wugg 2 anos atrás
pai
commit
143e60b306
1 arquivos alterados com 26 adições e 18 exclusões
  1. 26 18
      app/admin/controller/Consult.php

+ 26 - 18
app/admin/controller/Consult.php

@@ -1367,17 +1367,20 @@ class Consult extends Base
             ("zxNo");
             $where[] = ['zxNo','in',$zxlist];
         }
+        $is_own = isset($this->post['is_own']) ? intval($this->post['is_own']) : "0";
+        if($is_own==1){
+             $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+            if($token==""){
+                return error_show(101,'token不能为空');
+            }
+            $apply_id =GetUserInfo($token);
+            if(empty($apply_id)||$apply_id['code']!=0){
+                return error_show(1002,"申请人数据不存在");
+            }
+            $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+            $where[]=['createrid',"=",$rm];
+        }
 
-//        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
-//        if($token==""){
-//            return error_show(101,'token不能为空');
-//        }
-//        $apply_id =GetUserInfo($token);
-//        if(empty($apply_id)||$apply_id['code']!=0){
-//            return error_show(1002,"申请人数据不存在");
-//        }
-//        $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
-//        $where[]=['createrid',"=",$rm];
         $count = Db::name('consult_bids')->where($where)->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
@@ -1448,14 +1451,19 @@ class Consult extends Base
         if($token==''){
             return error_show(102,"参数token不能为空");
         }
-//        $user =GetUserInfo($token);
-//        if(empty($user)||$user['code']!=0){
-//            return error_show(105,"用户数据不存在");
-//        }
-
-//        $createrid= isset($user["data"]['id']) ?  $user["data"]['id'] : "";
-//        $creater= isset($user["data"]['nickname']) ?  $user["data"]['nickname'] : "";
-//        $where[] = ["createrid","=",$createrid];
+        $is_own = isset($this->post['is_own']) ? intval($this->post['is_own']) : "0";
+        if($is_own==1){
+            $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+            if($token==""){
+                return error_show(101,'token不能为空');
+            }
+            $apply_id =GetUserInfo($token);
+            if(empty($apply_id)||$apply_id['code']!=0){
+                return error_show(1002,"申请人数据不存在");
+            }
+            $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+            $where[]=['createrid',"=",$rm];
+        }
         $list =Db::name('consult_bids')->where($where)->select();
         $data=[];
         foreach ($list as $value){