|
@@ -28,10 +28,10 @@ class Client extends Api |
|
@@ -28,10 +28,10 @@ class Client extends Api |
28
|
$this->auth->id ;//测试用
|
28
|
$this->auth->id ;//测试用
|
29
|
$postParam = $this->request->param();
|
29
|
$postParam = $this->request->param();
|
30
|
$this->postParam = $postParam;
|
30
|
$this->postParam = $postParam;
|
31
|
- if (empty($postParam['code'])) {
|
|
|
32
|
- $this->error("门店code异常");
|
31
|
+ if (empty($postParam['store_id'])) {
|
|
|
32
|
+ $this->error("门店store_id异常");
|
33
|
}
|
33
|
}
|
34
|
- $this->store_id = $postParam['code'];
|
34
|
+ $this->store_id = $postParam['store_id'];
|
35
|
$store = Db::name("verification_store")->where("id", $this->store_id)->find();
|
35
|
$store = Db::name("verification_store")->where("id", $this->store_id)->find();
|
36
|
if (empty($store)) {
|
36
|
if (empty($store)) {
|
37
|
$this->error("门店不存在,请退出登录后重试!");
|
37
|
$this->error("门店不存在,请退出登录后重试!");
|
|
@@ -231,13 +231,12 @@ class Client extends Api |
|
@@ -231,13 +231,12 @@ class Client extends Api |
231
|
|
231
|
|
232
|
|
232
|
|
233
|
/*
|
233
|
/*
|
234
|
- 7.生成二维码 及 规则
|
|
|
235
|
- 二维码 没有则创新 /index.php/api/v1/index/synthesis?store_id=1&activity_id=2
|
234
|
+ 7.生成二维码 及 规则 https://coupon.xp.yn.cn?store_id=1&activity_id=3
|
|
|
235
|
+ 二维码 没有则创新
|
236
|
参数 用户id 门店id 活动id
|
236
|
参数 用户id 门店id 活动id
|
237
|
- code activiy_id
|
237
|
+ store_id activiy_id
|
238
|
请求需要加 header token
|
238
|
请求需要加 header token
|
239
|
-
|
|
|
240
|
- 有前端自行合成分销图片
|
239
|
+ 由前端自行合成分销图片
|
241
|
*/
|
240
|
*/
|
242
|
public function synthesis(){
|
241
|
public function synthesis(){
|
243
|
//参数
|
242
|
//参数
|
|
@@ -246,10 +245,10 @@ class Client extends Api |
|
@@ -246,10 +245,10 @@ class Client extends Api |
246
|
$user_id=2;
|
245
|
$user_id=2;
|
247
|
//验证
|
246
|
//验证
|
248
|
if(empty($user_id)){return $this->error('用户信息错误');}
|
247
|
if(empty($user_id)){return $this->error('用户信息错误');}
|
249
|
- if(empty($param['code'])){return $this->error('请确认门店');}
|
248
|
+ if(empty($param['store_id'])){return $this->error('请确认门店');}
|
250
|
if(empty($param['activity_id'])){return $this->error('请确认活动');}
|
249
|
if(empty($param['activity_id'])){return $this->error('请确认活动');}
|
251
|
$w['user_id'] = $user_id;
|
250
|
$w['user_id'] = $user_id;
|
252
|
- $w['code'] = $param['code'];
|
251
|
+ $w['store_id'] = $param['store_id'];
|
253
|
$w['activity_id'] = $param['activity_id'];
|
252
|
$w['activity_id'] = $param['activity_id'];
|
254
|
$r = Db::name('verification_user_synthesis')->where($w)->find();
|
253
|
$r = Db::name('verification_user_synthesis')->where($w)->find();
|
255
|
//有 则 返回 无 则新增
|
254
|
//有 则 返回 无 则新增
|
|
@@ -263,7 +262,13 @@ class Client extends Api |
|
@@ -263,7 +262,13 @@ class Client extends Api |
263
|
}else{
|
262
|
}else{
|
264
|
$res = $r['url'];
|
263
|
$res = $r['url'];
|
265
|
}
|
264
|
}
|
266
|
- return $this->success('',$res);
|
265
|
+ //获取 当前活动当前门店的背景图
|
|
|
266
|
+ $st_a['verification_store_id'] = $param['store_id'];
|
|
|
267
|
+ $st_a['id'] = $param['activity_id'];
|
|
|
268
|
+ $storeActivity = Db::name('verification_activity')->where($st_a)->find();
|
|
|
269
|
+ $data['ercode_url'] = $res;//二维码地址
|
|
|
270
|
+ $data['bg_url'] = !empty($storeActivity['poster'])?request()->domain().$storeActivity['poster']:'';//背景图
|
|
|
271
|
+ return $this->success('',$data);
|
267
|
}
|
272
|
}
|
268
|
|
273
|
|
269
|
} |
274
|
} |