|
@@ -163,8 +163,8 @@ class Wechat extends Api |
|
@@ -163,8 +163,8 @@ class Wechat extends Api |
163
|
if(empty(request()->param('code'))){
|
163
|
if(empty(request()->param('code'))){
|
164
|
return $this->error('非法操作');
|
164
|
return $this->error('非法操作');
|
165
|
}
|
165
|
}
|
166
|
-
|
|
|
167
|
-
|
166
|
+
|
|
|
167
|
+
|
168
|
try{
|
168
|
try{
|
169
|
$app = WehcatModule::getInstance()->initWechat();
|
169
|
$app = WehcatModule::getInstance()->initWechat();
|
170
|
$oauth = $app->oauth;
|
170
|
$oauth = $app->oauth;
|
|
@@ -201,7 +201,7 @@ class Wechat extends Api |
|
@@ -201,7 +201,7 @@ class Wechat extends Api |
201
|
if($user_id !=0){
|
201
|
if($user_id !=0){
|
202
|
|
202
|
|
203
|
$data['token'] = $this->auth->getToken();
|
203
|
$data['token'] = $this->auth->getToken();
|
204
|
- $data['user_info'] = $user;
|
204
|
+ $data['user_info'] =$this->auth->getUserinfo();
|
205
|
$this->success('完成',$data);
|
205
|
$this->success('完成',$data);
|
206
|
}else{
|
206
|
}else{
|
207
|
$this->error('code处理失败');
|
207
|
$this->error('code处理失败');
|
|
@@ -222,7 +222,7 @@ class Wechat extends Api |
|
@@ -222,7 +222,7 @@ class Wechat extends Api |
222
|
return $this->error('请求错误');
|
222
|
return $this->error('请求错误');
|
223
|
}
|
223
|
}
|
224
|
$my_user_id = $this->auth->id;
|
224
|
$my_user_id = $this->auth->id;
|
225
|
-
|
225
|
+
|
226
|
if(empty($my_user_id)){return $this->error('用户信息错误');}
|
226
|
if(empty($my_user_id)){return $this->error('用户信息错误');}
|
227
|
if(empty($param['store_id'])){return $this->error('门店信息错误');}
|
227
|
if(empty($param['store_id'])){return $this->error('门店信息错误');}
|
228
|
//记录门店浏览统计
|
228
|
//记录门店浏览统计
|
|
@@ -264,7 +264,7 @@ class Wechat extends Api |
|
@@ -264,7 +264,7 @@ class Wechat extends Api |
264
|
$data['user_id'] = $user_id;
|
264
|
$data['user_id'] = $user_id;
|
265
|
$data['createtime'] = time();
|
265
|
$data['createtime'] = time();
|
266
|
Db::name('verification_store_user_record')->insert($data);
|
266
|
Db::name('verification_store_user_record')->insert($data);
|
267
|
- }
|
267
|
+ }
|
268
|
|
268
|
|
269
|
|
269
|
|
270
|
/*
|
270
|
/*
|
|
@@ -355,7 +355,7 @@ class Wechat extends Api |
|
@@ -355,7 +355,7 @@ class Wechat extends Api |
355
|
* 4. 上级的上级 是普通人,则直接获得某个门店的所有礼品券
|
355
|
* 4. 上级的上级 是普通人,则直接获得某个门店的所有礼品券
|
356
|
* A -> B -> C 下单
|
356
|
* A -> B -> C 下单
|
357
|
* $order_info 支付成功后的订单信息
|
357
|
* $order_info 支付成功后的订单信息
|
358
|
- */
|
358
|
+ */
|
359
|
|
359
|
|
360
|
public function sales_distribution($order_info){
|
360
|
public function sales_distribution($order_info){
|
361
|
$w['id'] = $order_info['user_id'];
|
361
|
$w['id'] = $order_info['user_id'];
|
|
@@ -368,7 +368,7 @@ class Wechat extends Api |
|
@@ -368,7 +368,7 @@ class Wechat extends Api |
368
|
$w1['id'] = $myInfo['pid'];
|
368
|
$w1['id'] = $myInfo['pid'];
|
369
|
$myInfoP = Db::name('user')->where($w1)->find();
|
369
|
$myInfoP = Db::name('user')->where($w1)->find();
|
370
|
$this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']);
|
370
|
$this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']);
|
371
|
-
|
371
|
+
|
372
|
}
|
372
|
}
|
373
|
}
|
373
|
}
|
374
|
|
374
|
|
|
@@ -444,14 +444,14 @@ class Wechat extends Api |
|
@@ -444,14 +444,14 @@ class Wechat extends Api |
444
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
444
|
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
|
445
|
$app = WehcatModule::getInstance()->initWechatPay();
|
445
|
$app = WehcatModule::getInstance()->initWechatPay();
|
446
|
$result = $app->redpack->sendNormal([
|
446
|
$result = $app->redpack->sendNormal([
|
447
|
-
|
447
|
+
|
448
|
'mch_billno' => '168532907259455',
|
448
|
'mch_billno' => '168532907259455',
|
449
|
'send_name' => '测试红包',
|
449
|
'send_name' => '测试红包',
|
450
|
're_openid' => 'o5OQw6PPEGaHqIjAir7gqeDV5MzQ',
|
450
|
're_openid' => 'o5OQw6PPEGaHqIjAir7gqeDV5MzQ',
|
451
|
'total_num' => 1, //固定为1,可不传
|
451
|
'total_num' => 1, //固定为1,可不传
|
452
|
'total_amount' => 100, //单位为分,不小于100
|
452
|
'total_amount' => 100, //单位为分,不小于100
|
453
|
'wishing' => '祝福语',
|
453
|
'wishing' => '祝福语',
|
454
|
-
|
454
|
+
|
455
|
'act_name' => '测试活动',
|
455
|
'act_name' => '测试活动',
|
456
|
'remark' => '测试备注',
|
456
|
'remark' => '测试备注',
|
457
|
]);
|
457
|
]);
|