|
@@ -25,30 +25,30 @@ class InfoAudit extends Model
|
|
|
$post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"];
|
|
$post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"];
|
|
|
$where=[];
|
|
$where=[];
|
|
|
if(is_numeric($post['status'])) {
|
|
if(is_numeric($post['status'])) {
|
|
|
- $where[]=["t.status","=",(int)$post['status']];
|
|
|
|
|
|
|
+ $where[]=["au.status","=",(int)$post['status']];
|
|
|
}
|
|
}
|
|
|
if(is_numeric($post['uid']) && $post['uid']>0) {
|
|
if(is_numeric($post['uid']) && $post['uid']>0) {
|
|
|
- $where[]=["t.uid","=",(int)$post['uid']];
|
|
|
|
|
|
|
+ $where[]=["au.uid","=",(int)$post['uid']];
|
|
|
}else if(is_mobile($post['user_mobile'])){
|
|
}else if(is_mobile($post['user_mobile'])){
|
|
|
$udata = (new UserModel)->where("mobile",$post['user_mobile'])->find();
|
|
$udata = (new UserModel)->where("mobile",$post['user_mobile'])->find();
|
|
|
if(!empty($udata)){
|
|
if(!empty($udata)){
|
|
|
- $where[]=["t.uid","=",(int)$udata['uid']];
|
|
|
|
|
|
|
+ $where[]=["au.uid","=",(int)$udata['uid']];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(is_mobile($post['mobile'])) {
|
|
if(is_mobile($post['mobile'])) {
|
|
|
- $where[]=["t.mobile","=",$post['mobile']];
|
|
|
|
|
|
|
+ $where[]=["au.mobile","=",$post['mobile']];
|
|
|
}
|
|
}
|
|
|
$startTime = "";
|
|
$startTime = "";
|
|
|
$endTime = "";
|
|
$endTime = "";
|
|
|
if(!empty($post['time'][0]) && !empty($post['time'][1])) {
|
|
if(!empty($post['time'][0]) && !empty($post['time'][1])) {
|
|
|
$startTime = strtotime($post['time'][0]);
|
|
$startTime = strtotime($post['time'][0]);
|
|
|
$endTime = strtotime($post['time'][1]);
|
|
$endTime = strtotime($post['time'][1]);
|
|
|
- $where[]=["t.time","between","{$startTime},{$endTime}"];
|
|
|
|
|
|
|
+ $where[]=["au.time","between","{$startTime},{$endTime}"];
|
|
|
}
|
|
}
|
|
|
if(!empty($post['keyword'])){
|
|
if(!empty($post['keyword'])){
|
|
|
- $where[]=["t.name","=",$post['keyword']];
|
|
|
|
|
|
|
+ $where[]=["au.name","=",$post['keyword']];
|
|
|
}
|
|
}
|
|
|
- $pageCount = (new InfoAudit)->alias("au")->where($where)->count();
|
|
|
|
|
|
|
+ $pageCount = $this->alias("au")->where($where)->count();
|
|
|
$data = null;
|
|
$data = null;
|
|
|
if($pageCount>0){
|
|
if($pageCount>0){
|
|
|
$userField = $is_admin==1 ? ",u.mobile as user_mobile,u.nickname as user_nickname,u.avatar as user_avatar,a.name as admin_name" : "";
|
|
$userField = $is_admin==1 ? ",u.mobile as user_mobile,u.nickname as user_nickname,u.avatar as user_avatar,a.name as admin_name" : "";
|
|
@@ -103,7 +103,7 @@ class InfoAudit extends Model
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
|
$where=[];
|
|
$where=[];
|
|
|
- if(isset($post["status"]) && in_array((string)$post["status"], ["0","1"])){
|
|
|
|
|
|
|
+ if(isset($post["status"]) && in_array((string)$post["status"], ["0","1","-1"])){
|
|
|
$where[]=["au.status","=",(int)$post["status"]];
|
|
$where[]=["au.status","=",(int)$post["status"]];
|
|
|
}
|
|
}
|
|
|
if(!empty($post["id"])){
|
|
if(!empty($post["id"])){
|
|
@@ -114,7 +114,7 @@ class InfoAudit extends Model
|
|
|
}
|
|
}
|
|
|
//后台
|
|
//后台
|
|
|
$userField = $is_admin==1 ? ",u.mobile as user_mobile,u.nickname as user_nickname,u.avatar as user_avatar,a.name as admin_name" : "";
|
|
$userField = $is_admin==1 ? ",u.mobile as user_mobile,u.nickname as user_nickname,u.avatar as user_avatar,a.name as admin_name" : "";
|
|
|
- $data = (new InfoAudit)
|
|
|
|
|
|
|
+ $data = $this
|
|
|
->alias("au")
|
|
->alias("au")
|
|
|
->field("au.*,wt.title as user_work_type_title,s.title as service_time_type_title{$userField}")
|
|
->field("au.*,wt.title as user_work_type_title,s.title as service_time_type_title{$userField}")
|
|
|
->leftJoin("user u" ,"u.uid = au.uid")//用户信息
|
|
->leftJoin("user u" ,"u.uid = au.uid")//用户信息
|