正在显示
1 个修改的文件
包含
16 行增加
和
3 行删除
| @@ -374,11 +374,20 @@ class Wechat extends Api | @@ -374,11 +374,20 @@ class Wechat extends Api | ||
| 374 | //是否与上级 | 374 | //是否与上级 |
| 375 | if(!empty($myInfo['pid'])){ | 375 | if(!empty($myInfo['pid'])){ |
| 376 | //上级 | 376 | //上级 |
| 377 | + try{ | ||
| 377 | $this->getParent($myInfo['pid'],$order_info['verification_store_id'],$order_info['id']); | 378 | $this->getParent($myInfo['pid'],$order_info['verification_store_id'],$order_info['id']); |
| 379 | + }catch(\Exception $e){ | ||
| 380 | + Common::put_file_log('上级-分销异常',json_encode($e->getMessage()), 'sales_distribution', __CLASS__ . __FUNCTION__ . __LINE__); | ||
| 381 | + } | ||
| 378 | //上级的上级 | 382 | //上级的上级 |
| 383 | + try{ | ||
| 379 | $w1['id'] = $myInfo['pid']; | 384 | $w1['id'] = $myInfo['pid']; |
| 380 | $myInfoP = Db::name('user')->where($w1)->find(); | 385 | $myInfoP = Db::name('user')->where($w1)->find(); |
| 381 | $this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']); | 386 | $this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']); |
| 387 | + }catch(\Exception $e){ | ||
| 388 | + Common::put_file_log('上级的上级-分销异常',json_encode($e->getMessage()), 'sales_distribution', __CLASS__ . __FUNCTION__ . __LINE__); | ||
| 389 | + } | ||
| 390 | + | ||
| 382 | 391 | ||
| 383 | } | 392 | } |
| 384 | } | 393 | } |
| @@ -387,12 +396,13 @@ class Wechat extends Api | @@ -387,12 +396,13 @@ class Wechat extends Api | ||
| 387 | private function getParent($pid,$verification_store_id,$order_id){ | 396 | private function getParent($pid,$verification_store_id,$order_id){ |
| 388 | //上级身份 | 397 | //上级身份 |
| 389 | $time = time(); | 398 | $time = time(); |
| 399 | + $w1 = []; | ||
| 390 | $w1['user_id'] = $pid; | 400 | $w1['user_id'] = $pid; |
| 391 | $w1['verification_store_id'] = $verification_store_id; | 401 | $w1['verification_store_id'] = $verification_store_id; |
| 392 | $role = Db::name('verification_staff')->where($w1)->find(); | 402 | $role = Db::name('verification_staff')->where($w1)->find(); |
| 393 | if(in_array($role['type'],['1','3'])){ | 403 | if(in_array($role['type'],['1','3'])){ |
| 394 | //属于代理 企业付款到佣金 | 404 | //属于代理 企业付款到佣金 |
| 395 | - $this->grant_commission($pid,$order_id); | 405 | + //$this->grant_commission($pid,$order_id); |
| 396 | }else{ | 406 | }else{ |
| 397 | //属于普通用户 发送代金券 | 407 | //属于普通用户 发送代金券 |
| 398 | $this->send_voucher($pid,$verification_store_id,$order_id,$time); | 408 | $this->send_voucher($pid,$verification_store_id,$order_id,$time); |
| @@ -401,6 +411,7 @@ class Wechat extends Api | @@ -401,6 +411,7 @@ class Wechat extends Api | ||
| 401 | 411 | ||
| 402 | //发放代金券 | 412 | //发放代金券 |
| 403 | public function send_voucher($pid,$verification_store_id,$order_id,$time){ | 413 | public function send_voucher($pid,$verification_store_id,$order_id,$time){ |
| 414 | + $w1 = []; | ||
| 404 | $w1['verification_store_id'] = $verification_store_id; | 415 | $w1['verification_store_id'] = $verification_store_id; |
| 405 | $w1['closetime'] = ['<',$time]; | 416 | $w1['closetime'] = ['<',$time]; |
| 406 | $coupon = Db::name('verification_coupon')->where($w1)->select(); | 417 | $coupon = Db::name('verification_coupon')->where($w1)->select(); |
| @@ -425,7 +436,8 @@ class Wechat extends Api | @@ -425,7 +436,8 @@ class Wechat extends Api | ||
| 425 | } | 436 | } |
| 426 | } | 437 | } |
| 427 | } | 438 | } |
| 428 | - // 发放佣金 | 439 | + |
| 440 | + // 发放佣金 企业付款到零钱 | ||
| 429 | public function grant_commission($pid=0,$order_id=0){ | 441 | public function grant_commission($pid=0,$order_id=0){ |
| 430 | try{ | 442 | try{ |
| 431 | $verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find(); | 443 | $verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find(); |
| @@ -439,7 +451,8 @@ class Wechat extends Api | @@ -439,7 +451,8 @@ class Wechat extends Api | ||
| 439 | 'desc' => '理赔', // 企业付款操作说明信息。必填 | 451 | 'desc' => '理赔', // 企业付款操作说明信息。必填 |
| 440 | ]); | 452 | ]); |
| 441 | if($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS'){ | 453 | if($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS'){ |
| 442 | - //记录佣金表 | 454 | + //记录佣金表 后台没有配置 |
| 455 | + | ||
| 443 | }else{ | 456 | }else{ |
| 444 | Common::put_file_log('失败-佣金发放',json_encode($result), 'grant_commission', __CLASS__ . __FUNCTION__ . __LINE__); | 457 | Common::put_file_log('失败-佣金发放',json_encode($result), 'grant_commission', __CLASS__ . __FUNCTION__ . __LINE__); |
| 445 | } | 458 | } |
-
请 注册 或 登录 后发表评论