model = new \app\model\Order(); } // 无需登录的接口,*表示全部 public $noNeedLogin = ['notify','test','notifySettle','notifyHupijiao']; public function hupijiaopay(){ global $_GPC; $post = $this->request->post(); $isCommission = $this->request->post('is_commission',0); $returnUrl = $this->request->post('return_url',''); $callbackUrl = $this->request->post('callback_url',''); $platform = $this->request->header('platform'); // 获得订单信息 if ($isCommission ==1) { $notify = IS_R==1?request()->domain() . SURL . '/api.pay/notifySettleHupijiao':request()->domain() . SURL . '/index.php/api.pay/notifySettleHupijiao'; $pay_price = \app\model\commission\Settle::where(['order_number'=>$post['order_number']])->value('pay_price'); } else { $notify = IS_R==1?request()->domain() . SURL . '/api.pay/notifyHupijiao':request()->domain() . SURL . '/index.php/api.pay/notifyHupijiao'; $pay_price = \app\model\Order::where(['order_number'=>$post['order_number']])->value('pay_price'); } if(!$pay_price){ return $this->error('获取订单数据失败'); } $data =[ 'version' => 1.1, 'trade_order_id'=>$post['order_number'], 'total_fee'=>$pay_price, 'title'=>'充值', 'time'=>time(), 'notify_url'=>$notify, 'return_url' => $returnUrl, 'callback_url'=>$callbackUrl, 'type'=>'WAP', 'wap_name'=>'支付' ]; $res = HupijiaopayServiceFacade::pay($data); return $this->success('获取结果', $res); } public function prepay(){ global $_GPC; $post = $this->request->post(); $platform = $this->request->post('platform'); $isCommission = $this->request->post('is_commission',0); // 获得订单信息 if ($isCommission ==1) { $notify = IS_R==1?request()->domain() . SURL . '/api.pay/notifySettle':request()->domain() . SURL . '/index.php/api.pay/notifySettle'; $pay_price = \app\model\commission\Settle::where(['order_number'=>$post['order_number']])->value('pay_price'); } else { $notify = IS_R==1?request()->domain() . SURL . '/api.pay/notify':request()->domain() . SURL . '/index.php/api.pay/notify'; $pay_price = \app\model\Order::where(['order_number'=>$post['order_number']])->value('pay_price'); } if(!$pay_price){ return $this->error('获取订单数据失败'); } // print_r(request()->domain() . SURL . '/index.php/api.pay/notify'); $app = PayServiceFacade::option($platform=='wxOfficialAccount'?'wechat':'miniapp'); $loginUserInfo = UserServiceFacade::getUserInfo(); // print_r($loginUserInfo); $result = $app->order->unify([ 'body' => '充值', 'out_trade_no' => $post['order_number'], 'total_fee' => $pay_price * 100, 'notify_url' => $notify, // 支付结果通知网址,如果不设置则会使用配置里的默认地址 'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型 'openid' => $platform=='wxOfficialAccount'?$loginUserInfo['openid_wechat']:$loginUserInfo['openid_miniapp'], ]); $jssdk = $app->jssdk; if($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS'){ $config = $jssdk->bridgeConfig($result['prepay_id'], false); return $this->success('获取结果', $config); } return $this->error('获取失败,'.json_encode($result,320)); } public function hupijiao() { global $_GPC; } public function notify(){ global $_GPC; // $app = PayServiceFacade::option(); $notifiedData = file_get_contents('php://input'); $xmlObj = simplexml_load_string($notifiedData, 'SimpleXMLElement', LIBXML_NOCDATA); $xmlObj = json_decode(json_encode($xmlObj), true); // 库里查 $order = $this->model->where('order_number','=',$xmlObj['out_trade_no'])->find(); // 如果订单不存在 或者 订单已经支付过了 if(!$order || $order['paid'] == 1){ return true; //已经处理 或该笔订单库里已经支付,微信你请勿再通知 } if ($xmlObj['return_code'] === 'SUCCESS') { // return_code 表示通信状态,不代表支付状态 // 用户是否支付成功 if ($xmlObj['result_code'] === 'SUCCESS') { // 用户支付成功 $_GPC['uniacid'] = $order['uniacid']; $updateRes = $this->model->where('order_number', '=', $xmlObj['out_trade_no'])->update(['paid'=>1, 'pay_time' => time()]); $memberInfo = \app\model\Member::find($order['link_id']); $this->setMember($order,$memberInfo); // 分销 $this->setCommission($order,$memberInfo); // $title = '下单支付成功通知'; // $content = '您的订单已支付,订单编号'.$xmlObj['out_trade_no'].',价格:¥'.$order['pay_price']; // $jobQueueName ='wike_oddjob'; // $queueData =[ // 'uid' => $order['uid'], // 'title'=>$title, // 'content'=>$content, // 'order_number'=>$xmlObj['out_trade_no'], // 'pay_price'=>$order['pay_price'], // 'status'=>'已支付', // 'remark'=>'订单价格:'.$order['pay_price'], // 'uniacid' => $order['uniacid'] // ]; // MessageSystemServiceFacade::Unified($order['uid'],$title,$content); // $conf = ConfServiceFacade::groupGet('system.notification'); // if($conf['subscribe_status'] == 1){ // Queue::later(3, 'app\jobs\SubscribeMessageJob@pay_suc', $queueData, $jobQueueName); // } // Queue::later(86400, 'app\jobs\SubscribeMessageJob@recommend', $queueData, $jobQueueName); // Queue::later(432000, 'app\jobs\SubscribeMessageJob@new_video', $queueData, $jobQueueName); if (!$updateRes) return false; } elseif ($xmlObj['result_code'] === 'FAIL') { // 用户支付失败 return false; } } else { return false; } return true; // file_put_contents(__DIR__ . '/ds.json', json_encode($xmlObj)); } public function notifySettle(){ global $_GPC; $modelSettle = new \app\model\commission\Settle(); $modelTeam =new \app\model\commission\Team(); $modelIncome =new \app\model\commission\Income(); $modelUser =new \app\model\commission\User(); // $app = PayServiceFacade::option(); $notifiedData = file_get_contents('php://input'); $xmlObj = simplexml_load_string($notifiedData, 'SimpleXMLElement', LIBXML_NOCDATA); $xmlObj = json_decode(json_encode($xmlObj), true); // 库里查 $order = $modelSettle->where('order_number','=',$xmlObj['out_trade_no'])->find(); // file_put_contents(__DIR__ . '/ds.json', json_encode($order)); // 如果订单不存在 或者 订单已经支付过了 if(!$order || $order['paid'] == 1){ return true; //已经处理 或该笔订单库里已经支付,微信你请勿再通知 } if ($xmlObj['return_code'] === 'SUCCESS') { // return_code 表示通信状态,不代表支付状态 // 用户是否支付成功 if ($xmlObj['result_code'] === 'SUCCESS') { // 用户支付成功 $_GPC['uniacid'] = $order['uniacid']; $updateRes =$modelSettle->where('order_number', '=', $xmlObj['out_trade_no'])->update(['paid'=>1, 'pay_time' => time()]); $updateRes2 = $modelUser->save(['paid' => 1,'uniacid'=>$order['uniacid'],'status'=>1,'paid'=>1,'uid'=>$order['uid'],'real_name'=>$order['real_name'],'telnum'=>$order['telnum'] ]); // 分销 $teamUserInfo = $modelTeam::where('uid','=',$order['uid'])->find(); $conf = ConfServiceFacade::groupGet('system.commission'); if(!empty($conf['is_commission']) && $conf['is_commission']==1 ){ if($conf['first'] > 0){ $firstLevel = $order['pay_price'] * ($conf['first'])/100; } if($conf['second'] > 0){ $secondLevel = $order['pay_price'] * ($conf['second'])/100; } if($conf['third'] > 0){ $thirdLevel = $order['pay_price'] * ($conf['third'])/100; } if(!empty($teamUserInfo['pid'])){ // 奖励给pid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['pid'])->find(); if(!empty($higherUserInfo) && $higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $firstLevel; $modelUser::where('uid','=',$teamUserInfo['pid'])->update(['money'=>$banlance]); // $a = $modelIncome->save(['money'=>$firstLevel,'uid'=>$teamUserInfo['pid'],'mark'=>'您的一级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$firstLevel,'uniacid'=>$_GPC['uniacid']]); $a = $modelIncome->create([ 'money' => $firstLevel, 'oid' => $order['id'], 'uid' => $teamUserInfo['pid'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的一级下线支付订单金额:¥'.$order['pay_price'].'入驻分销商。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$firstLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } if(!empty($teamUserInfo['gid'])){ // 奖励给gid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['gid'])->find(); if(!empty($higherUserInfo) && $higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $secondLevel; $modelUser::where('uid','=',$teamUserInfo['gid'])->update(['money'=>$banlance]); // $b = $modelIncome->save(['money'=>$secondLevel,'uid'=>$teamUserInfo['gid'],'mark'=>'您的二级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['second'].'%返佣,¥'.$secondLevel,'uniacid'=>$_GPC['uniacid']]); $b = $modelIncome->create([ 'money' => $secondLevel, 'uid' => $teamUserInfo['gid'], 'oid' => $order['id'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的二级下线支付订单金额:¥'.$order['pay_price'].'入驻分销商。您获得的佣金是:'.$conf['second'].'%返佣,¥'.$secondLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } if(!empty($teamUserInfo['gfid'])){ // 奖励给gfid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['gfid'])->find(); if(!empty($higherUserInfo) && $higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $thirdLevel; $modelUser::where('uid','=',$teamUserInfo['gfid'])->update(['money'=>$banlance]); // $c = $modelIncome->save(['money'=>$thirdLevel,'uid'=>$teamUserInfo['gfid'],'mark'=>'您的三级下线支付订单金额:'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['third'].'%返佣,¥'.$secondLevel,'uniacid'=>$_GPC['uniacid']]); $c = $modelIncome->create([ 'money' => $thirdLevel, 'uid' => $teamUserInfo['gfid'], 'oid' => $order['id'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的三级下线支付订单金额:¥'.$order['pay_price'].'入驻分销商。您获得的佣金是:'.$conf['third'].'%返佣,¥'.$thirdLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } } if (!$updateRes) return false; } elseif ($xmlObj['result_code'] === 'FAIL') { // 用户支付失败 return false; } } else { return false; } return true; // file_put_contents(__DIR__ . '/ds.json', json_encode($xmlObj)); } public function notifyHupijiao() { global $_GPC; $post = $this->request->post(); // file_put_contents(__DIR__ . '/notifyHupijiao.json', json_encode($post)); // 库里查 $order = $this->model->where('order_number','=',$post['trade_order_id'])->find(); // file_put_contents(__DIR__ . '/ds.json', json_encode($order)); // 如果订单不存在 或者 订单已经支付过了 if(!$order || $order['paid'] == 1){ return true; //已经处理 或该笔订单库里已经支付,微信你请勿再通知 } if($post['status'] === 'OD'){ $_GPC['uniacid'] = $order['uniacid']; $updateRes = $this->model->where('order_number', '=', $post['trade_order_id'])->update(['paid'=>1, 'pay_time' => time(),'pay_channel'=>'hupijiao']); $memberInfo = \app\model\Member::find($order['link_id']); $this->setMember($order,$memberInfo); // 分销 $this->setCommission($order,$memberInfo); } return 'success'; } public function setMember($order,$memberInfo) { global $_GPC; if(!empty($memberInfo) && !empty($memberInfo['type'])){ if($memberInfo['type']==2){ $modelVipinfo =new \app\model\Vipinfo(); $title = '充值时长'; $userInfo = \app\model\User::find($order['uid']); if($memberInfo['day'] === 9999){ $title = $title.'(永久)'; $updateRes2 = \app\model\User::where('id', '=', $order['uid'])->update(['vip_time' => 9999]); }else{ $title = $title.'('.$memberInfo['day'].'天)'; if($userInfo['vip_time'] < time()){ $balance = strtotime("+".$memberInfo['day']."days"); }else{ // file_put_contents(__DIR__ . '/d.json', $memberInfo['day']*24*60*60); $balance = $userInfo['vip_time'] + $memberInfo['day']*24*60*60; } $updateRes2 = \app\model\User::where('id', '=', $order['uid'])->update(['vip_time' => $balance]); } BillServiceFacade::record(1,$memberInfo['coin'],'pay_member',$title,$order['uid'],$order['uniacid']); // 写入余量 $vipinfo = $modelVipinfo->where('uid',$order['uid'])->find(); if(empty($vipinfo)){ $save =[ 'uid'=>$order['uid'], 'gpt35_times'=>$memberInfo['gpt35_times']?$memberInfo['gpt35_times']:0, 'gpt4_times'=>$memberInfo['gpt4_times']?$memberInfo['gpt4_times']:0, 'sd_times'=>$memberInfo['sd_times']?$memberInfo['sd_times']:0, 'mj_times'=>$memberInfo['mj_times']?$memberInfo['mj_times']:0, 'order_number'=>$order['order_number'], 'member_id'=>$memberInfo['id'], 'uniacid'=>$_GPC['uniacid'] ]; $res = $modelVipinfo->save($save); file_put_contents(__DIR__ . '/vipinfo.json', json_encode($res)); }else{ $updata =[ // 'gpt35_times'=>$memberInfo['gpt35_times']?$memberInfo['gpt35_times']:0, // 'gpt4_times'=>$memberInfo['gpt4_times']?$memberInfo['gpt4_times']:0, // 'sd_times'=>$memberInfo['sd_times']?$memberInfo['sd_times']:0, // 'mj_times'=>$memberInfo['mj_times']?$memberInfo['mj_times']:0, 'order_number'=>$order['order_number'], 'member_id'=>$memberInfo['id'], 'uniacid'=>$_GPC['uniacid'] ]; if($memberInfo['gpt35_times'] == -1){ $updata['gpt35_times'] = -1; }else{ if($userInfo['vip_time'] <= time()){ // 过期 $updata['gpt35_times'] = $memberInfo['gpt35_times']; }else{ if($vipinfo['gpt35_times']==-1){ $updata['gpt35_times'] = -1; }else{ $updata['gpt35_times'] = $vipinfo['gpt35_times'] + $memberInfo['gpt35_times']; } } } if($memberInfo['gpt4_times'] == -1){ $updata['gpt4_times'] = -1; }else{ if($userInfo['vip_time'] <= time()){ $updata['gpt4_times'] = $memberInfo['gpt4_times']; }else{ if($vipinfo['gpt4_times']==-1){ $updata['gpt4_times'] = -1; }else{ $updata['gpt4_times'] = $vipinfo['gpt4_times'] + $memberInfo['gpt4_times']; } } } if($memberInfo['sd_times'] == -1){ $updata['sd_times'] = -1; }else{ if($userInfo['vip_time'] <= time()){ $updata['sd_times'] = $memberInfo['sd_times']; }else{ if($vipinfo['sd_times']==-1){ $updata['sd_times'] = -1; }else{ $updata['sd_times'] = $vipinfo['sd_times'] + $memberInfo['sd_times']; } } } if($memberInfo['mj_times'] == -1){ $updata['mj_times'] = -1; }else{ if($userInfo['vip_time'] <= time()){ $updata['mj_times'] = $memberInfo['mj_times']; }else{ if($vipinfo['mj_times']==-1){ $updata['mj_times'] = -1; }else{ $updata['mj_times'] = $vipinfo['mj_times'] + $memberInfo['mj_times']; } } } $modelVipinfo->where('uid',$order['uid']) ->update($updata); } }else{ $updateRes2 = \app\model\User::where('id', '=', $order['uid'])->inc('coin',$memberInfo['coin'])->update(); BillServiceFacade::record(1,$memberInfo['coin'],'pay_member','充值次数',$order['uid'],$order['uniacid']); } } } public function setCommission($order,$memberInfo) { global $_GPC; $modelTeam =new \app\model\commission\Team(); $modelIncome =new \app\model\commission\Income(); $modelUser =new \app\model\commission\User(); $teamUserInfo = $modelTeam::where('uid','=',$order['uid'])->find(); $conf = ConfServiceFacade::groupGet('system.commission'); // 获得购买者是否是分销商 $buyUserInfo= $modelUser::where('uid','=',$order['uid'])->find(); if(!empty($conf['is_commission']) && $conf['is_commission']==1 ){ if($conf['first'] > 0){ $firstLevel = $order['pay_price'] * ($conf['first'])/100; } if($conf['second'] > 0){ $secondLevel = $order['pay_price'] * ($conf['second'])/100; } if($conf['third'] > 0){ $thirdLevel = $order['pay_price'] * ($conf['third'])/100; } if(!empty($conf['is_self_buy']) && $conf['is_self_buy'] == 1 && !empty($buyUserInfo) && $buyUserInfo['status'] == 1){ // 开启自购 $higherUserInfo = $modelUser::where('uid','=',$order['uid'])->find(); $banlance = $higherUserInfo['money'] + $firstLevel; $modelUser::where('uid','=',$order['uid'])->update(['money'=>$banlance]); // $a = $modelIncome->save(['money'=>$firstLevel,'uid'=>$teamUserInfo['pid'],'mark'=>'您的一级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$firstLevel,'uniacid'=>$_GPC['uniacid']]); $a = $modelIncome->create([ 'money' => $firstLevel, 'oid' => $order['id'], 'uid' => $order['uid'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '自购返佣:您支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$firstLevel, 'uniacid'=>$_GPC['uniacid'], ]); if(!empty($teamUserInfo['pid'])){ // 奖励给pid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['pid'])->find(); // if($higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $secondLevel; $modelUser::where('uid','=',$teamUserInfo['pid'])->update(['money'=>$banlance]); // $a = $modelIncome->save(['money'=>$secondLevel,'uid'=>$teamUserInfo['pid'],'mark'=>'您的一级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$secondLevel,'uniacid'=>$_GPC['uniacid']]); $a = $modelIncome->create([ 'money' => $secondLevel, 'oid' => $order['id'], 'uid' => $teamUserInfo['pid'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的一级下线分销商内购,支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['second'].'%返佣,¥'.$secondLevel, 'uniacid'=>$_GPC['uniacid'], ]); // } } if(!empty($teamUserInfo['gid'])){ // 奖励给gid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['gid'])->find(); if($higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $thirdLevel; $modelUser::where('uid','=',$teamUserInfo['gid'])->update(['money'=>$banlance]); // $b = $modelIncome->save(['money'=>$thirdLevel,'uid'=>$teamUserInfo['gid'],'mark'=>'您的二级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['second'].'%返佣,¥'.$thirdLevel,'uniacid'=>$_GPC['uniacid']]); $b = $modelIncome->create([ 'money' => $thirdLevel, 'uid' => $teamUserInfo['gid'], 'oid' => $order['id'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的二级下线分销商内购,支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['third'].'%返佣,¥'.$thirdLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } } else { if(!empty($teamUserInfo['pid'])){ // 奖励给pid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['pid'])->find(); if(!empty($higherUserInfo) && $higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $firstLevel; $modelUser::where('uid','=',$teamUserInfo['pid'])->update(['money'=>$banlance]); // $a = $modelIncome->save(['money'=>$firstLevel,'uid'=>$teamUserInfo['pid'],'mark'=>'您的一级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$firstLevel,'uniacid'=>$_GPC['uniacid']]); $a = $modelIncome->create([ 'money' => $firstLevel, 'oid' => $order['id'], 'uid' => $teamUserInfo['pid'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的一级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['first'].'%返佣,¥'.$firstLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } if(!empty($teamUserInfo['gid'])){ // 奖励给gid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['gid'])->find(); if(!empty($higherUserInfo) && $higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $secondLevel; $modelUser::where('uid','=',$teamUserInfo['gid'])->update(['money'=>$banlance]); // $b = $modelIncome->save(['money'=>$secondLevel,'uid'=>$teamUserInfo['gid'],'mark'=>'您的二级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['second'].'%返佣,¥'.$secondLevel,'uniacid'=>$_GPC['uniacid']]); $b = $modelIncome->create([ 'money' => $secondLevel, 'uid' => $teamUserInfo['gid'], 'oid' => $order['id'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的二级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['second'].'%返佣,¥'.$secondLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } if(!empty($teamUserInfo['gfid'])){ // 奖励给gfid // 计算一级分销返佣 $higherUserInfo = $modelUser::where('uid','=',$teamUserInfo['gfid'])->find(); if(!empty($higherUserInfo) && $higherUserInfo['status'] == 1){ $banlance = $higherUserInfo['money'] + $thirdLevel; $modelUser::where('uid','=',$teamUserInfo['gfid'])->update(['money'=>$banlance]); // $c = $modelIncome->save(['money'=>$thirdLevel,'uid'=>$teamUserInfo['gfid'],'mark'=>'您的三级下线支付订单金额:'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['third'].'%返佣,¥'.$secondLevel,'uniacid'=>$_GPC['uniacid']]); $c = $modelIncome->create([ 'money' => $thirdLevel, 'uid' => $teamUserInfo['gfid'], 'oid' => $order['id'], 'buy_uid' => $order['uid'], 'buy_price'=>$order['pay_price'], 'mark' => '您的三级下线支付订单金额:¥'.$order['pay_price'].'购买了'.$memberInfo['title'].'套餐。您获得的佣金是:'.$conf['third'].'%返佣,¥'.$thirdLevel, 'uniacid'=>$_GPC['uniacid'], ]); } } } } } }