yingzi 2 vuotta sitten
vanhempi
commit
357dc6d496
2 muutettua tiedostoa jossa 33 lisäystä ja 3 poistoa
  1. 1 2
      app/api/controller/User.php
  2. 32 1
      app/model/api/InfoAudit.php

+ 1 - 2
app/api/controller/User.php

@@ -183,10 +183,9 @@ class User extends BaseController
     public function getUserCardInfo(Request $request){
         $data = (new InfoAudit)
                 ->alias("u")
-                ->field("u.*,wt.title as user_work_type_title,s.title as service_time_type_title,w.title as user_work_type_title")
+                ->field("u.*,wt.title as user_work_type_title,s.title as service_time_type_title")
                 ->join("user_work_type wt","wt.id = u.user_work_type_id","left")
                 ->leftJoin("service_time_type s", "s.code = u.service_type")
-                ->leftJoin("user_work_type w", "w.id = u.user_work_type_id")
                 ->where("u.uid",$request->user["uid"])
                 ->where("u.status",1)
                 ->order("u.id","desc")

+ 32 - 1
app/model/api/InfoAudit.php

@@ -10,5 +10,36 @@ use think\Model;
  */
 class InfoAudit extends Model
 {
-    //
+    public function getList(){
+        
+    }
+    /**
+     * 
+     * @param type $id
+     * @param type $type
+     */
+    public function getItem($post){
+        if(empty($parms)){
+            return [];
+        }
+        $where=[];
+        if(isset($post["status"]) && in_array((string)$post["status"], ["0","1"])){
+            $where[]=["au.status","=",(int)$post["status"]];
+        }
+        if(!empty($post["id"])){
+            $where[]=["au.id","=",$post["id"]];
+        }
+        if(!empty($post["uid"])){
+            $where[]=["au.uid","=",$post["uid"]];
+        }
+        
+        $data = (new InfoAudit)
+                ->alias("au")
+                ->field("au.*,wt.title as user_work_type_title,s.title as service_time_type_title")
+                ->leftJoin("user_work_type wt"   , "wt.id = au.user_work_type_id")//职称
+                ->leftJoin("service_time_type s" , "s.code = au.service_type")//服务时长类型
+                ->where($where)
+                ->order("au.id","desc")
+                ->find();
+    }
 }