| | |
| | | namespace app\common\model\plus\vip; |
| | | |
| | | use app\common\model\BaseModel; |
| | | use app\common\model\order\OrderProduct; |
| | | use app\common\model\plus\vip\GradeLog as GradeLogModel; |
| | | use app\common\enum\user\grade\ChangeTypeEnum; |
| | | |
| | |
| | | 'freeze_money' => $model['freeze_money'] + $money, |
| | | ]); |
| | | } |
| | | |
| | | |
| | | public function getViewpointMoneyQualification($user_id,$setting) |
| | | { |
| | | $userNum=$this->where('referee_id','=',$user_id)->count(); |
| | | $consumption=(new OrderProduct()) |
| | | ->alias('order_product') |
| | | ->where('order_product.user_id','=',$user_id) |
| | | ->join('order','order_product.order_id=order.order_id') |
| | | ->where('order.order_status','=',30) |
| | | ->where('order_product.create_time','>=',strtotime(date('Y-m-01 00:00:00'))) |
| | | ->where('order_product.create_time','<',strtotime('+1 month',strtotime(date('Y-m-01 00:00:00')))) |
| | | ->where('order_product.is_repurchase','=',1)->sum('order_product.total_pay_price'); |
| | | if($userNum>=$setting['viewpoint_buy_count']&&$consumption>=$setting['repurchase_consumption']){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |