diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 6a1ac58e..7687eefa 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -198,7 +198,12 @@ class Index extends Api // 控制显示本地生活 public function setHome() { - $local = Db::name("local_store")->where("user_id", $this->user_id)->where("is_delete", 0)->select()->toArray(); + $local = Db::name("local_store") + ->where([ + 'user_id' => $this->user_id, + 'store_state' => 1, + 'is_delete' => 0, + ])->count(); $list = MenuDecorate::where(['decorate_type' => 3, 'del' => 0, 'is_show' => 1]) ->field('name,image,link_type,link_address') ->order('sort desc') @@ -206,7 +211,7 @@ class Index extends Api ->toArray(); $company = array(); - if (!empty($local)) { + if ($local > 0) { $company[] = array( "image" => 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/all_service.png', "name" => '企业服务',