作者 chencheng

kq-0621-18

... ... @@ -240,6 +240,9 @@ class Wechat extends Api
$my_user_id = $this->auth->id;
if(empty($my_user_id)){return $this->error('用户信息错误');}
if(empty($param['store_id'])){return $this->error('门店信息错误');}
if($my_user_id == $param['share_id']){
return $this->error('自行点击不记录');
}
//记录门店浏览统计
$this->store_record($param['store_id'],$my_user_id);
... ... @@ -472,16 +475,23 @@ class Wechat extends Api
$w1['user_id'] = $pid;
// $w1['verification_store_id'] = $verification_store_id;
$role = Db::name('verification_staff')->where($w1)->find();
if(in_array($role['type'],['1','3','0'])){
if(!empty($role) && in_array($role['type'],['1','3','0'])){
//属于代理 发送红包
$this->grant_red_packets($pid,$order_id);
}else{
//属于普通用户 则领取礼品券
//$this->send_gift_certificate($pid,$verification_coupon_ids,$order_id,$time);
//卡券发放规则
$this->send_gift_certificate_url($pid,$verification_coupon_ids,$order_id,$time);
$this->send_gift_certificate_url($pid,$order_id,$time);
}
}
/**
*
* truncate `cv_user`;
truncate `cv_user_token`;
truncate cv_verification_order;
truncate cv_verification_receive;
*/
//发放 对应活动的礼品券
public function send_gift_certificate_url($pid,$order_id,$time){
... ...