wugg hace 7 meses
padre
commit
d303819ce9
Se han modificado 1 ficheros con 17 adiciones y 15 borrados
  1. 17 15
      app/admin/controller/Consult.php

+ 17 - 15
app/admin/controller/Consult.php

@@ -1955,13 +1955,15 @@ class Consult extends Base
         }
         $pgNo = isset($this->post['pgNo']) && $this->post['pgNo'] !== "" ? trim($this->post['pgNo']) : "";
         if ($pgNo !== "") {
-            $bidinfo = Db::name("consult_info")->where([["pgNo","=",$pgNo],["is_del","=",0]])->column("infoNo");
-            $where[] = ['infoNo','in',$bidinfo];
+            $where[] = ['pgNo','=',$pgNo];
         }
         $bargain_status = isset($this->post['bargain_status']) && $this->post['bargain_status'] !== "" ? intval($this->post['bargain_status']) : "";
         if ($bargain_status !== "") {
-            $bidinfo = Db::name("consult_info")->where([["bargain_status","=",$bargain_status],["is_del","=",0]])->column("infoNo");
-            $where[] = ['infoNo','in',$bidinfo];
+            $where[] = ['bargain_status','=',$bargain_status];
+        }
+        $infoStatus = isset($this->post['info_status']) && !empty($this->post['info_status'])? $this->post['info_status'] : [];
+        if (!empty($infoStatus)) {
+            $where[] = ['c.status','=',$infoStatus];
         }
         $projectNo = isset($this->post['projectNo']) && $this->post['projectNo'] !== "" ? trim($this->post['projectNo']) : "";
         if ($projectNo !== "") {
@@ -1990,13 +1992,19 @@ class Consult extends Base
         }
 
         $count = Db::name('consult_bids')->alias("a")
+        ->leftJoin('consult_info c','a.infoNo=c.infoNo')
         ->leftJoin("consult_order b","a.zxNo=b.zxNo")->where($where)->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
         $list =Db::name('consult_bids')->alias('a')
-        ->leftJoin('consult_order b','a.zxNo=b.zxNo')->where($where)
-        ->field("a.*,b.companyNo,b.companyName")->order("a.id desc")
-        ->page($page,$size)->select()->toArray();
+        ->leftJoin('consult_info c','a.infoNo=c.infoNo')
+        ->leftJoin('consult_order b','a.zxNo=b.zxNo')
+        ->where($where)
+        ->field("a.*,b.companyNo,b.companyName,platform_code,c.num info_num,c.bargain_status,c.status info_status")
+        ->order("a.id desc")
+        ->page($page,$size)
+        ->select()
+        ->toArray();
         $data=[];
         $user= \app\admin\common\User::getIns();
         $supplier_temp =$user->handle("getCodeAndName",["code"=>array_column($list,"supplierNo")]);
@@ -2013,9 +2021,7 @@ class Consult extends Base
                 $value["brand_name"]="";
                 $value["brand_id"]="";
             }
-            $bidinfo = Db::name("consult_info")->where(["infoNo"=>$value["infoNo"]])->find();
-            $zx = Db::name("consult_order")->where(["zxNo"=>$value["zxNo"]])->find();
-             $budget = get_budget($value['cat_id'],$zx['companyNo']??'',$zx['platform_code']??0);
+             $budget = get_budget($value['cat_id'],$value['companyNo']??'',$value['platform_code']??0);
                 $god=[
                     "metal_id"=>$value['metal_id'],
                     "weight"=>$value["good_weight"],
@@ -2027,7 +2033,7 @@ class Consult extends Base
                     "nake_fee"=>$value["nake_fee"],
                     "cert_fee"=>$value["cert_fee"],
                     "cost_fee"=>$value["sale_cost_fee"]!=$value['origin_cost_fee']? $value["sale_cost_fee"]: $value["cost_fee"],
-                    "num"=>$bidinfo["num"],
+                    "num"=>$value["info_num"],
                 ];
 
             $top_cat = made($value['cat_id']);
@@ -2042,10 +2048,6 @@ class Consult extends Base
             $value['cost_fee'] =$value['origin_cost_fee'];
             $value['specinfo'] = json_decode($value['specinfo'],true);
             $value['metal_name']=isset($value['metal_id'])&& $value['metal_id']!=0?$this->noble[$value['metal_id']]:"";
-            $value['bargain_status']=$bidinfo['bargain_status'];
-            $value['info_status']=$bidinfo['status']??"";
-
-
 
             //reject驳回原因,status==5表示驳回
             $value['reject']=[];