作者 郭文星

'3123'

... ... @@ -11,6 +11,7 @@ use think\Exception;
*/
class Client extends Api
{
protected $noNeedLogin = [''];
protected $noNeedRight = ['*'];
protected $postParam;
protected $store_id;
... ...
... ... @@ -163,8 +163,8 @@ class Wechat extends Api
if(empty(request()->param('code'))){
return $this->error('非法操作');
}
try{
$app = WehcatModule::getInstance()->initWechat();
$oauth = $app->oauth;
... ... @@ -200,7 +200,7 @@ class Wechat extends Api
if($user_id !=0){
$data['token'] = $this->auth->getToken();
$data['user_info'] = $user;
$data['user_info'] =$this->auth->getUserinfo();
$this->success('完成',$data);
}else{
$this->error('code处理失败');
... ... @@ -221,7 +221,7 @@ class Wechat extends Api
return $this->error('请求错误');
}
$my_user_id = $this->auth->id;
if(empty($my_user_id)){return $this->error('用户信息错误');}
if(empty($param['store_id'])){return $this->error('门店信息错误');}
//记录门店浏览统计
... ... @@ -263,7 +263,7 @@ class Wechat extends Api
$data['user_id'] = $user_id;
$data['createtime'] = time();
Db::name('verification_store_user_record')->insert($data);
}
}
/*
... ... @@ -354,7 +354,7 @@ class Wechat extends Api
* 4. 上级的上级 是普通人,则直接获得某个门店的所有礼品券
* A -> B -> C 下单
* $order_info 支付成功后的订单信息
*/
*/
public function sales_distribution($order_info){
$w['id'] = $order_info['user_id'];
... ... @@ -367,7 +367,7 @@ class Wechat extends Api
$w1['id'] = $myInfo['pid'];
$myInfoP = Db::name('user')->where($w1)->find();
$this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']);
}
}
... ... @@ -443,14 +443,14 @@ class Wechat extends Api
$verification_order = Db::name('verification_order')->where(['id'=>$order_id])->find();
$app = WehcatModule::getInstance()->initWechatPay();
$result = $app->redpack->sendNormal([
'mch_billno' => '168532907259455',
'send_name' => '测试红包',
're_openid' => 'o5OQw6PPEGaHqIjAir7gqeDV5MzQ',
'total_num' => 1, //固定为1,可不传
'total_amount' => 100, //单位为分,不小于100
'wishing' => '祝福语',
'act_name' => '测试活动',
'remark' => '测试备注',
]);
... ...