...
|
...
|
@@ -23,7 +23,7 @@ class Client extends Api |
|
|
$this->postParam = $postParam;
|
|
|
|
|
|
$res=$this->request->header();
|
|
|
print_r($res);
|
|
|
|
|
|
parent::_initialize();
|
|
|
$this->auth->id ;//测试用
|
|
|
$postParam = $this->request->param();
|
...
|
...
|
@@ -38,7 +38,7 @@ class Client extends Api |
|
|
}
|
|
|
$this->store = $store;
|
|
|
if (empty($this->auth->id)) {
|
|
|
print_r([$this->auth->id]);
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -229,4 +229,40 @@ class Client extends Api |
|
|
$this->success("查询成功",$receive);
|
|
|
}
|
|
|
|
|
|
|
|
|
/*
|
|
|
7.生成二维码 及 规则
|
|
|
二维码 没有则创新 /index.php/api/v1/index/synthesis?store_id=1&activity_id=2
|
|
|
参数 用户id 门店id 活动id
|
|
|
code activiy_id
|
|
|
请求需要加 header token
|
|
|
|
|
|
有前端自行合成分销图片
|
|
|
*/
|
|
|
public function synthesis(){
|
|
|
//参数
|
|
|
$param = request()->param();
|
|
|
$user_id = $this->auth->id;
|
|
|
$user_id=2;
|
|
|
//验证
|
|
|
if(empty($user_id)){return $this->error('用户信息错误');}
|
|
|
if(empty($param['code'])){return $this->error('请确认门店');}
|
|
|
if(empty($param['activity_id'])){return $this->error('请确认活动');}
|
|
|
$w['user_id'] = $user_id;
|
|
|
$w['code'] = $param['code'];
|
|
|
$w['activity_id'] = $param['activity_id'];
|
|
|
$r = Db::name('user_synthesis')->where($w)->find();
|
|
|
//有 则 返回 无 则新增
|
|
|
if(empty($r)){
|
|
|
$url = (new \app\api\controller\v1\Base())->url_h5.'?'.http_build_query($param);
|
|
|
$res = (new \app\api\controller\v1\Index())->build($url);
|
|
|
$w['create_at'] = time();
|
|
|
$w['url'] = $res;
|
|
|
Db::name('user_synthesis')->insert($w);
|
|
|
}else{
|
|
|
$res = $r['url'];
|
|
|
}
|
|
|
return $this->success('',request()->domain() . $res);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|