|
@@ -52,12 +52,12 @@ class Office extends Api
|
|
|
|
|
|
$mp = [];
|
|
|
|
|
|
- if (isset($area_id) || !empty($area_id)) $mp['p_id'] = $area_id;
|
|
|
+ if (isset($area_id) && !empty($area_id)) $mp['p_id'] = $area_id;
|
|
|
|
|
|
- if (isset($num) || !empty($num)) $mp['num'] = $num;
|
|
|
-
|
|
|
- if (isset($money) || !empty($money)) $mp['money'] = ['like',',','%'.$money.'%'];
|
|
|
+ if (isset($num) && !empty($num)) $mp['num'] = $num;
|
|
|
|
|
|
+ if (isset($money) && !empty($money)) $mp['money'] = array('like', '%' . $money . '%');
|
|
|
+// dump($mp);die;
|
|
|
$user = $this->auth->getUser();
|
|
|
|
|
|
if ($user && $user['p_id'] !=0) $mp['p_id'] = $user['p_id'];
|
|
@@ -74,7 +74,7 @@ class Office extends Api
|
|
|
|
|
|
$officeModel = new OfficeModel();
|
|
|
|
|
|
- $field = 'id,image,title,money,wuye,mianji,address';
|
|
|
+ $field = 'id,image,title,money,wuye,mianji,address,num';
|
|
|
|
|
|
$data = $officeModel->where($mp)->limit($pages)->field($field)->order('sort desc')->select();
|
|
|
|