|
|
@@ -431,25 +431,21 @@ class User extends BaseModel
|
|
|
{
|
|
|
$post["pageSize"] = $post["pageSize"] > 20 ? 20 : (int)$post["pageSize"];
|
|
|
$post["page"] = $post["page"] <= 0 ? 1 : (int)$post["page"];
|
|
|
+
|
|
|
// 构建基础条件
|
|
|
- $where = [["work_type_id", ">", 0], ["status", "=", 1]];
|
|
|
+ $where = [["u.work_type_id", ">", 0], ["u.status", "=", 1]];
|
|
|
if (!empty($post['work_type_id'])) {
|
|
|
- $where[] = ["work_type_id", "=", $post['work_type_id']];
|
|
|
+ $where[] = ["u.work_type_id", "=", $post['work_type_id']];
|
|
|
+ }
|
|
|
+ if ($post['servicePrice'] > 0) {
|
|
|
+ $where[] = ["a.service_min_price", "<=", $post['servicePrice']];
|
|
|
+ }
|
|
|
+ if (!empty($post['timetype'])) {
|
|
|
+ $where[] = ["a.service_type", "=", $post['timetype']];
|
|
|
+ }
|
|
|
+ if ($post['is_china'] != '') {
|
|
|
+ $where[] = ["a.is_china", '=', $post['is_china']];
|
|
|
}
|
|
|
-// // 构建基础条件
|
|
|
-// $where = [["u.work_type_id", ">", 0], ["u.status", "=", 1]];
|
|
|
-// if (!empty($post['work_type_id'])) {
|
|
|
-// $where[] = ["u.work_type_id", "=", $post['work_type_id']];
|
|
|
-// }
|
|
|
-// if ($post['servicePrice'] > 0) {
|
|
|
-// $where[] = ["a.service_min_price", "<=", $post['servicePrice']];
|
|
|
-// }
|
|
|
-// if (!empty($post['timetype'])) {
|
|
|
-// $where[] = ["a.service_type", "=", $post['timetype']];
|
|
|
-// }
|
|
|
-// if ($post['is_china'] != '') {
|
|
|
-// $where[] = ["a.is_china", '=', $post['is_china']];
|
|
|
-// }
|
|
|
|
|
|
// 城市查询条件
|
|
|
$serviceAreaWhere = null;
|
|
|
@@ -475,8 +471,8 @@ class User extends BaseModel
|
|
|
|
|
|
// 构建查询(不设置 field,用默认查所有,减少解析开销)
|
|
|
$query = $this
|
|
|
-// ->alias("u")
|
|
|
-// ->leftJoin("info_audit a", "u.uid=a.uid and a.status = 1 and a.is_show = 1")
|
|
|
+ ->alias("u")
|
|
|
+ ->leftJoin("info_audit a", "u.uid=a.uid and a.status = 1 and a.is_show = 1")
|
|
|
// ->leftJoin("user_show_template ut", "ut.uid = u.uid and ut.is_default = 1")
|
|
|
->where($where);
|
|
|
if ($serviceAreaWhere) {
|
|
|
@@ -490,7 +486,7 @@ class User extends BaseModel
|
|
|
$data = [];
|
|
|
if ($totalCount > 0) {
|
|
|
$offset = ($post["page"] - 1) * $post["pageSize"];
|
|
|
- $result = $query->order("uid", "desc")
|
|
|
+ $result = $query->order("u.uid", "desc")
|
|
|
->limit($offset, $post["pageSize"])
|
|
|
->select();
|
|
|
if (!empty($result)) {
|