正在显示
1 个修改的文件
包含
4 行增加
和
6 行删除
@@ -145,8 +145,8 @@ class User extends Api | @@ -145,8 +145,8 @@ class User extends Api | ||
145 | $total_money = bcadd($total_money,$v['money'],2); | 145 | $total_money = bcadd($total_money,$v['money'],2); |
146 | } | 146 | } |
147 | } | 147 | } |
148 | - $store = \app\api\model\Store::where('user_id',$this->auth->id)->order('id','DESC')->value('status'); | ||
149 | - if($store == 3) { | 148 | + $store = \app\api\model\Store::where('user_id',$this->auth->id)->order('id','DESC')->find(); |
149 | + if($store && $store['status'] == 3) { | ||
150 | $where_house = [ | 150 | $where_house = [ |
151 | 'user_id' => $this->auth->id, | 151 | 'user_id' => $this->auth->id, |
152 | 'store_id' => $store['id'], | 152 | 'store_id' => $store['id'], |
@@ -154,12 +154,11 @@ class User extends Api | @@ -154,12 +154,11 @@ class User extends Api | ||
154 | // 'end_time' => ['>',time()] | 154 | // 'end_time' => ['>',time()] |
155 | ]; | 155 | ]; |
156 | $store_house = Db::name('store_house')->where($where_house)->count(); | 156 | $store_house = Db::name('store_house')->where($where_house)->count(); |
157 | - $this->success('成功', $where_house); | ||
158 | if(!$store_house) { | 157 | if(!$store_house) { |
159 | $store_house = 2; | 158 | $store_house = 2; |
160 | } | 159 | } |
161 | } else { | 160 | } else { |
162 | - $store_house = $store ? $store : 0; | 161 | + $store_house = $store ? $store['status'] : 0; |
163 | } | 162 | } |
164 | $data = [ | 163 | $data = [ |
165 | // 当前小区信息 | 164 | // 当前小区信息 |
@@ -173,8 +172,7 @@ class User extends Api | @@ -173,8 +172,7 @@ class User extends Api | ||
173 | ->where('is_read_user',2) | 172 | ->where('is_read_user',2) |
174 | ->count(), | 173 | ->count(), |
175 | // 是否入驻店铺 | 174 | // 是否入驻店铺 |
176 | - 'is_store' => $store_house, | ||
177 | - 'sql' => Db::name('store_house')->getLastSql() | 175 | + 'is_store' => $store_house |
178 | ]; | 176 | ]; |
179 | $user = $user->visible([ | 177 | $user = $user->visible([ |
180 | 'id', | 178 | 'id', |
-
请 注册 或 登录 后发表评论