$type, 'status' => \E_BASE_STATUS::Normal ]; if (isset($params['category_id']) && $params['category_id'] > 0) $where['category_id'] = $params['category_id']; if (isset($params['hot']) && $params['hot']) $where['hot'] = 1; if (isset($params['store_id']) && $params['store_id'] > 0) $where['store_id'] = $params['store_id']; if (isset($params["sift"]) && $params['sift']) $where['sift'] = 1; if (!isset($params["is_add_clock"]) || $params["is_add_clock"] != 1) { $where['is_add_clock'] = 0; } $q = ["id", "<>", "276"]; if ($user) { $exist = RedisClient::of()->get("scan:qr:codes:" . $user["id"]); if ($exist) { $q = ["id", ">", "0"]; } } return $this->where($where) ->where($q[0], $q[1], $q[2]) ->order('sort', 'desc') ->order('real_price', 'ASC') ->page($page) ->paginate($size); } public function fetchServicesV2($type, $params, $page = 1, $size = 10, $user = null) { $where = [ 'type' => $type, 'status' => \E_BASE_STATUS::Normal, 'p_code' => $params['p_code'] ]; if (isset($params['category_id']) && $params['category_id'] > 0) $where['category_id'] = $params['category_id']; if (isset($params['hot']) && $params['hot']) $where['hot'] = 1; if (isset($params['store_id']) && $params['store_id'] > 0) $where['store_id'] = $params['store_id']; if (isset($params["sift"]) && $params['sift']) $where['sift'] = 1; if (!isset($params["is_add_clock"]) || $params["is_add_clock"] != 1) { $where['is_add_clock'] = 0; } return $this->where($where) ->order('sort', 'desc') ->order('real_price', 'ASC') ->page($page) ->paginate($size); } }