...
|
...
|
@@ -242,7 +242,7 @@ class Wechat extends Api |
|
|
if(in_array($role['type'],['1','3'])){
|
|
|
return $this->error('我是代理不记录');
|
|
|
}
|
|
|
|
|
|
|
|
|
Db::name('user')->where($w)->update(['pid'=>$param['share_id'],'updatetime'=>$time]);
|
|
|
return $this->success('更新关系');
|
|
|
}else{
|
...
|
...
|
@@ -292,7 +292,7 @@ class Wechat extends Api |
|
|
return $this->error('预下单信息错误');
|
|
|
}
|
|
|
$my_user_id = $this->auth->id;
|
|
|
|
|
|
|
|
|
if(empty($my_user_id)){return $this->error('用户信息错误');}
|
|
|
$o_w["order_no"] = $order_no;
|
|
|
$order_info = Db::name('verification_order')->where($o_w)->find();
|
...
|
...
|
@@ -334,7 +334,7 @@ class Wechat extends Api |
|
|
public function notify(){
|
|
|
$app = WehcatModule::getInstance()->initWechatPay();
|
|
|
$xml = file_get_contents("php://input");
|
|
|
|
|
|
|
|
|
$xmljson= json_encode(simplexml_load_string($xml, 'SimplexmlElement', LIBXML_NOCDATA ));//将对象转换个JSON
|
|
|
$message = json_decode($xmljson,true);
|
|
|
// 使用通知里的 "微信支付订单号" 或者 "商户订单号" 去自己的数据库找到订单
|
...
|
...
|
@@ -353,11 +353,11 @@ class Wechat extends Api |
|
|
$this->sales_distribution($order_info);
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
|
|
|
}
|
|
|
// 返回状态
|
|
|
$this->returnCode(true, 'OK');
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
$xml = file_get_contents("php://input");
|
...
|
...
|
@@ -380,7 +380,7 @@ class Wechat extends Api |
|
|
'return_code' => $returnCode ? 'SUCCESS' : 'FAIL',
|
|
|
'return_msg' => $msg ?: 'OK',
|
|
|
];
|
|
|
|
|
|
|
|
|
die($this->toXml($return));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -451,7 +451,7 @@ class Wechat extends Api |
|
|
|
|
|
//支付后,根据用户角色 处理对应的事情
|
|
|
private function getParent($pid,$verification_coupon_ids,$order_id){
|
|
|
|
|
|
|
|
|
//上级身份
|
|
|
$time = time();
|
|
|
$w1 = [];
|
...
|
...
|
@@ -479,10 +479,10 @@ class Wechat extends Api |
|
|
$save['verification_coupon_id'] = $store['verification_coupon_id'];
|
|
|
$save['verification_store_id'] = $store['id'];
|
|
|
$save['user_id'] = $pid;
|
|
|
|
|
|
|
|
|
$save['type'] = 0;//使用情况
|
|
|
$save['closetime'] = $coupon['closetime'];
|
|
|
$save['receive_no'] = $time.uniqid();
|
|
|
$save['receive_no'] = rand(100000,999999).uniqid();
|
|
|
$res = (new \app\api\controller\v1\Index())->build($save['receive_no']);
|
|
|
$save['qr_code'] = $res;//二维码
|
|
|
$save['createtime'] = $time;
|
...
|
...
|
@@ -519,7 +519,7 @@ class Wechat extends Api |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 发放红包 单位 分 最低100分,
|
...
|
...
|
@@ -547,7 +547,7 @@ class Wechat extends Api |
|
|
'act_name' => '佣金分享红包到账',
|
|
|
'remark' => '感谢您的参与',
|
|
|
]);
|
|
|
|
|
|
|
|
|
if($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS'){
|
|
|
//记录佣金表 verification_brokerage_record
|
|
|
$send_result = 1;
|
...
|
...
|
@@ -556,7 +556,7 @@ class Wechat extends Api |
|
|
$this->brokerage_record($verification_store,$user_info,$send_result,$verification_order,$mch_billno);
|
|
|
}catch(\Exception $e){
|
|
|
Db::name('wechat_pay_recode')->insert(['json'=>json_encode($result),'time'=>time(),'action'=>'grant_red_packets']);
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -584,10 +584,10 @@ class Wechat extends Api |
|
|
}catch(\Exception $e){
|
|
|
Db::name('wechat_pay_recode')->insert(['json'=>$e->getMessage(),'time'=>time()]);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|