|
@@ -217,6 +217,7 @@ class Wechat extends Api |
|
@@ -217,6 +217,7 @@ class Wechat extends Api |
|
217
|
*/
|
217
|
*/
|
|
218
|
public function register_relation(){
|
218
|
public function register_relation(){
|
|
219
|
//参数
|
219
|
//参数
|
|
|
|
220
|
+ $time = time();
|
|
220
|
$param = request()->param();
|
221
|
$param = request()->param();
|
|
221
|
if(!request()->isPost()){
|
222
|
if(!request()->isPost()){
|
|
222
|
return $this->error('请求错误');
|
223
|
return $this->error('请求错误');
|
|
@@ -242,7 +243,7 @@ class Wechat extends Api |
|
@@ -242,7 +243,7 @@ class Wechat extends Api |
|
242
|
return $this->error('我是代理不记录');
|
243
|
return $this->error('我是代理不记录');
|
|
243
|
}
|
244
|
}
|
|
244
|
|
245
|
|
|
245
|
- Db::name('user')->where($w)->update(['pid'=>$param['share_id']]);
|
246
|
+ Db::name('user')->where($w)->update(['pid'=>$param['share_id'],'updatetime'=>$time]);
|
|
246
|
return $this->success('更新关系');
|
247
|
return $this->success('更新关系');
|
|
247
|
}else{
|
248
|
}else{
|
|
248
|
if($myInfo['pid'] == $param['share_id']){
|
249
|
if($myInfo['pid'] == $param['share_id']){
|
|
@@ -447,6 +448,8 @@ class Wechat extends Api |
|
@@ -447,6 +448,8 @@ class Wechat extends Api |
|
447
|
|
448
|
|
|
448
|
// 发放佣金 企业付款到零钱
|
449
|
// 发放佣金 企业付款到零钱
|
|
449
|
public function grant_commission($pid=0,$order_id=0){
|
450
|
public function grant_commission($pid=0,$order_id=0){
|
|
|
|
451
|
+ //测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_commission
|
|
|
|
452
|
+ $order_id = 14;
|
|
450
|
try{
|
453
|
try{
|
|
451
|
$send_result = 0;
|
454
|
$send_result = 0;
|
|
452
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
455
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
|
@@ -463,6 +466,8 @@ class Wechat extends Api |
|
@@ -463,6 +466,8 @@ class Wechat extends Api |
|
463
|
'amount' => 1, // 企业付款金额,单位为分
|
466
|
'amount' => 1, // 企业付款金额,单位为分
|
|
464
|
'desc' => '分销佣金', // 企业付款操作说明信息。必填
|
467
|
'desc' => '分销佣金', // 企业付款操作说明信息。必填
|
|
465
|
]);
|
468
|
]);
|
|
|
|
469
|
+ return json($result);
|
|
|
|
470
|
+ die;
|
|
466
|
if($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS'){
|
471
|
if($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS'){
|
|
467
|
//记录佣金表 后台没有配置
|
472
|
//记录佣金表 后台没有配置
|
|
468
|
$send_result = 1;
|
473
|
$send_result = 1;
|
|
@@ -484,6 +489,8 @@ class Wechat extends Api |
|
@@ -484,6 +489,8 @@ class Wechat extends Api |
|
484
|
// 发放红包
|
489
|
// 发放红包
|
|
485
|
public function grant_red_packets($pid=0,$order_id=0){
|
490
|
public function grant_red_packets($pid=0,$order_id=0){
|
|
486
|
try{
|
491
|
try{
|
|
|
|
492
|
+ //测试 https://coupon.xp.yn.cn/api/v1/wechat/grant_red_packets
|
|
|
|
493
|
+ $order_id = 14;
|
|
487
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
494
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
|
488
|
$app = WehcatModule::getInstance()->initWechatPay();
|
495
|
$app = WehcatModule::getInstance()->initWechatPay();
|
|
489
|
$result = $app->redpack->sendNormal([
|
496
|
$result = $app->redpack->sendNormal([
|