wugg 7 months ago
parent
commit
233fe3c881
1 changed files with 8 additions and 42 deletions
  1. 8 42
      app/admin/controller/Consult.php

+ 8 - 42
app/admin/controller/Consult.php

@@ -2230,12 +2230,6 @@ class Consult extends Base
         $companyNo = trim($this->post['companyNo'] ?? '');
         if ($companyNo !== "") $where[] = ["b.companyNo", 'like', '%' . $companyNo . '%'];
 
-//        $role=$this->checkRole();
-//        if(!empty($role['write'])){
-//            $where[]=["bo.createrid","in",$role['write']];
-//        }
-//        $role = $this->checkDataShare();
-//        if (!empty($role[DataGroupModel::$type_全部])) $where[] = ['bo.createrid', 'in', $role[DataGroupModel::$type_全部]];
         $role = $this->checkDataShare();
         $hand = resign_hand_user($this->uid, 0);
         if (!empty($role[DataGroupModel::$type_全部])) {
@@ -2288,51 +2282,23 @@ class Consult extends Base
         $data = [];
         foreach ($list as $value) {
             $value['companyName'] = $names['data'][$value['companyNo']] ?? '';
-//           $bidinfos =   Db::name("consult_bids")->where([["bidNo","=",$value['bidsNo']],["is_del","=",0]])->find();
-            $bidinfos = $bidinfos_list[$value['bidsNo']];
+            $bidinfos = $bidinfos_list[$value['bidsNo']]??[];
             $value['spuCode'] = isset($bidinfos['spuCode']) ? $bidinfos['spuCode'] : "";
             $value['good_name'] = isset($bidinfos['good_name']) ? $bidinfos['good_name'] : "";
             $value['good_img'] = isset($bidinfos['good_img']) ? $bidinfos['good_img'] : "";
             $value['brand_id'] = isset($bidinfos['brand_id']) ? $bidinfos['brand_id'] : "";
-            if ($bidinfos['brand_id'] != 0) {
-                $value['brand_id'] = $bidinfos['brand_id'];
-//                $brand=Db::name("brand")->where(["id"=>$bidinfos['brand_id']])->find();
-                $value["brand_name"] = $brand[$value['brand_id']] ?? '';//isset($brand['brand_name'])?$brand['brand_name']:"";
-            } else {
-                $value["brand_name"] = "";
-                $value["brand_id"] = "";
-            }
-//            $catinfo = Db::name("cat")->where(["id"=>$bidinfos['cat_id']])->find();
+            $value['brand_id'] = $bidinfos['brand_id']??0;
+            $value['brand_name'] = $brand[$value['brand_id']] ?? '';
             $value['can'] = isset($bidinfos['cat_id']) && $bidinfos['cat_id'] != 0 ? made($bidinfos['cat_id']) : [];
-//            $unit =Db::name("unit")->where(["id"=>$bidinfos['unit_id']])->find();
-            $value['unit'] = $unit[$bidinfos['unit_id']] ?? '';//isset($unit['unit'])?$unit['unit']:'';
-//            $bidinfoe = Db::name("consult_info")->where(["infoNo"=>$value["infoNo"]])->find();
-//            $budget = $cat[$bidinfos['cat_id']] ?? 0;//isset($catinfo['order_rate']) ? $catinfo['order_rate']:0;
 
-            $budget = get_budget($bidinfos['cat_id'],$value['companyNo']??'',$value['platform_code']??0);
+            $value['unit'] = $unit[$bidinfos['unit_id']??0] ?? '';//isset($unit['unit'])?$unit['unit']:'';
+
+            $budget = get_budget($bidinfos['cat_id']??0,$value['companyNo']??'',$value['platform_code']??0);
             if($budget===false) $this->error('未找到业务公司有关的平台分类毛利信息');
             $value['budget'] = $budget;
-            $god = [
-                "metal_id" => $bidinfos['metal_id'],
-                "weight" => $bidinfos["good_weight"],
-                "demo_fee" => $bidinfos["demo_fee"],
-                "delivery_fee" => $bidinfos["delivery_fee"],
-                "open_fee" => $bidinfos["open_fee"],
-                "packing_fee" => $bidinfos["pakge_fee"],
-                "mark_fee" => $bidinfos["mark_fee"],
-                "nake_fee" => $bidinfos["nake_fee"],
-                "cert_fee" => $bidinfos["cert_fee"],
-                "cost_fee" => $bidinfos["cost_fee"],
-                "num" => $value["num"],
-            ];
-//            if($bidinfos['is_gold_price']==1){
-//                $price = GoldPrice($god, $budget/100);
-//            }else{
-//                $price = GoodPrice($god, $budget/100);
-//            }
             $value['metal_name'] = isset($bidinfos['metal_id']) && $bidinfos['metal_id'] != 0 ? $this->noble[$bidinfos['metal_id']] : "";
-            $value['sale_price'] = round($bidinfos['origin_price'], 2);
-            $value['cost_before_price'] = round($bidinfos['origin_cost_fee'], 2);
+            $value['sale_price'] = round($bidinfos['origin_price']??0, 2);
+            $value['cost_before_price'] = round($bidinfos['origin_cost_fee']??0, 2);
 
             $value['specinfo'] = isset($bidinfos['specinfo']) && $bidinfos['specinfo'] != "" ? json_decode($bidinfos['specinfo'], true) : [];
             $value['company_name'] = $item[$value['createrid']] ?? '';