作者 chencheng
@@ -126,10 +126,10 @@ class Business extends Api @@ -126,10 +126,10 @@ class Business extends Api
126 $keyfield=$this->postParam['keyfield']; 126 $keyfield=$this->postParam['keyfield'];
127 $page = $this->request->post('page', 1); 127 $page = $this->request->post('page', 1);
128 $total = $this->request->post('total', 10); 128 $total = $this->request->post('total', 10);
129 - $where="a.verification_store_id=".$this->store_id; 129 + $where['a.verification_store_id'] =['=', $this->store_id];
130 if($keyfield){ 130 if($keyfield){
131 - $where.=" and (c.receive_no like %{$keyfield}% or e.mobile like %{$keyfield}%)";  
132 - 131 + $where['c.receive_no'] =['like', '%' . $keyfield . '%'];
  132 + $where['e.mobile'] = ['like', '%' . $keyfield . '%'];
133 } 133 }
134 $field = "a.id,a.createtime,b.name,d.name as coupon_name,c.type"; 134 $field = "a.id,a.createtime,b.name,d.name as coupon_name,c.type";
135 $cancel=Db::name('verification_cancel') 135 $cancel=Db::name('verification_cancel')
@@ -139,7 +139,8 @@ class Business extends Api @@ -139,7 +139,8 @@ class Business extends Api
139 ->join('verification_coupon d','c.verification_coupon_id=d.id') 139 ->join('verification_coupon d','c.verification_coupon_id=d.id')
140 ->join('user e','c.user_id=e.id') 140 ->join('user e','c.user_id=e.id')
141 ->where($where) 141 ->where($where)
142 - ->fetchSql()->select(); 142 + ->paginate($total, false, ['page' => $page])
  143 + ->toArray();
143 $this->success('查询成功',$cancel); 144 $this->success('查询成功',$cancel);
144 145
145 } 146 }
@@ -159,6 +160,8 @@ class Business extends Api @@ -159,6 +160,8 @@ class Business extends Api
159 * 6、订单查询 160 * 6、订单查询
160 */ 161 */
161 public function selectorder(){ 162 public function selectorder(){
  163 + $keyfield=$this->postParam['keyfield'];
  164 +
162 $page = $this->request->post('page', 1); 165 $page = $this->request->post('page', 1);
163 $total = $this->request->post('total', 10); 166 $total = $this->request->post('total', 10);
164 $where["a.verification_store_id"] = ["=", $this->store_id]; 167 $where["a.verification_store_id"] = ["=", $this->store_id];
@@ -11,7 +11,7 @@ use think\Exception; @@ -11,7 +11,7 @@ use think\Exception;
11 */ 11 */
12 class Client extends Api 12 class Client extends Api
13 { 13 {
14 - protected $noNeedLogin = ['*']; 14 + protected $noNeedLogin = [''];
15 protected $noNeedRight = ['*']; 15 protected $noNeedRight = ['*'];
16 protected $postParam; 16 protected $postParam;
17 protected $store_id; 17 protected $store_id;
@@ -38,8 +38,8 @@ class Client extends Api @@ -38,8 +38,8 @@ class Client extends Api
38 } 38 }
39 $this->store = $store; 39 $this->store = $store;
40 if (empty($this->auth->id)) { 40 if (empty($this->auth->id)) {
  41 + $this->error("非法操作,用户信息为空");
41 42
42 - return;  
43 } 43 }
44 44
45 } 45 }
@@ -47,7 +47,7 @@ class Client extends Api @@ -47,7 +47,7 @@ class Client extends Api
47 * 1、获取活动 47 * 1、获取活动
48 */ 48 */
49 public function getactivity(){ 49 public function getactivity(){
50 - 50 + $this->success('123',$this->auth->id);
51 //根据门店查询活动 51 //根据门店查询活动
52 $time=time(); 52 $time=time();
53 $where["closetime"] = [">", $time]; 53 $where["closetime"] = [">", $time];
@@ -201,7 +201,7 @@ class Wechat extends Api @@ -201,7 +201,7 @@ class Wechat extends Api
201 if($user_id !=0){ 201 if($user_id !=0){
202 202
203 $data['token'] = $this->auth->getToken(); 203 $data['token'] = $this->auth->getToken();
204 - $data['user_info'] = $user; 204 + $data['user_info'] =$this->auth->getUserinfo();
205 $this->success('完成',$data); 205 $this->success('完成',$data);
206 }else{ 206 }else{
207 $this->error('code处理失败'); 207 $this->error('code处理失败');