...
|
...
|
@@ -28,10 +28,10 @@ class Client extends Api |
|
|
$this->auth->id ;//测试用
|
|
|
$postParam = $this->request->param();
|
|
|
$this->postParam = $postParam;
|
|
|
if (empty($postParam['code'])) {
|
|
|
$this->error("门店code异常");
|
|
|
if (empty($postParam['store_id'])) {
|
|
|
$this->error("门店store_id异常");
|
|
|
}
|
|
|
$this->store_id = $postParam['code'];
|
|
|
$this->store_id = $postParam['store_id'];
|
|
|
$store = Db::name("verification_store")->where("id", $this->store_id)->find();
|
|
|
if (empty($store)) {
|
|
|
$this->error("门店不存在,请退出登录后重试!");
|
...
|
...
|
@@ -231,13 +231,12 @@ class Client extends Api |
|
|
|
|
|
|
|
|
/*
|
|
|
7.生成二维码 及 规则
|
|
|
二维码 没有则创新 /index.php/api/v1/index/synthesis?store_id=1&activity_id=2
|
|
|
7.生成二维码 及 规则 https://coupon.xp.yn.cn?store_id=1&activity_id=3
|
|
|
二维码 没有则创新
|
|
|
参数 用户id 门店id 活动id
|
|
|
code activiy_id
|
|
|
store_id activiy_id
|
|
|
请求需要加 header token
|
|
|
|
|
|
有前端自行合成分销图片
|
|
|
由前端自行合成分销图片
|
|
|
*/
|
|
|
public function synthesis(){
|
|
|
//参数
|
...
|
...
|
@@ -246,10 +245,10 @@ class Client extends Api |
|
|
$user_id=2;
|
|
|
//验证
|
|
|
if(empty($user_id)){return $this->error('用户信息错误');}
|
|
|
if(empty($param['code'])){return $this->error('请确认门店');}
|
|
|
if(empty($param['store_id'])){return $this->error('请确认门店');}
|
|
|
if(empty($param['activity_id'])){return $this->error('请确认活动');}
|
|
|
$w['user_id'] = $user_id;
|
|
|
$w['code'] = $param['code'];
|
|
|
$w['store_id'] = $param['store_id'];
|
|
|
$w['activity_id'] = $param['activity_id'];
|
|
|
$r = Db::name('verification_user_synthesis')->where($w)->find();
|
|
|
//有 则 返回 无 则新增
|
...
|
...
|
@@ -263,7 +262,13 @@ class Client extends Api |
|
|
}else{
|
|
|
$res = $r['url'];
|
|
|
}
|
|
|
return $this->success('',$res);
|
|
|
//获取 当前活动当前门店的背景图
|
|
|
$st_a['verification_store_id'] = $param['store_id'];
|
|
|
$st_a['id'] = $param['activity_id'];
|
|
|
$storeActivity = Db::name('verification_activity')->where($st_a)->find();
|
|
|
$data['ercode_url'] = $res;//二维码地址
|
|
|
$data['bg_url'] = !empty($storeActivity['poster'])?request()->domain().$storeActivity['poster']:'';//背景图
|
|
|
return $this->success('',$data);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|