瀏覽代碼

Merge branch 'master-new' into master-new-dev-wf

wufeng 2 年之前
父節點
當前提交
b60bf77a26

+ 8 - 0
app/admin/controller/Brand.php

@@ -20,6 +20,10 @@ class Brand extends Base
         if($brand_name==""){
             return error_show(1002,"参数brand_name不能为空");
         }
+
+        $brandisT=Db::name("brand")->where(["brand_name"=>$brand_name,"is_del"=>0])->findOrEmpty();
+        if(!empty($brandisT))return error_show(1002,"品牌名称已存在");
+
         $logo_url= isset($this->post['logo_url'])  && $this->post['logo_url'] !=="" ? trim($this->post['logo_url']):"";
 //        if($logo_url==""){
 //            return error_show(1002,"参数logo_url不能为空");
@@ -32,6 +36,7 @@ class Brand extends Base
         if(empty($user)||$user['code']!=0){
             return error_show(102,"创建人数据不存在");
         }
+
         $createrid= isset($user["data"]['id']) ?  $user["data"]['id'] : "";
         $creater= isset($user["data"]['nickname']) ?  $user["data"]['nickname'] : "";
         $status = isset($this->post['status']) &&$this->post['status'] !==""? intval($this->post['status']):"1";
@@ -130,6 +135,9 @@ class Brand extends Base
         if($brand_name==""){
             return error_show(1002,"参数brand_name不能为空");
         }
+        $brandisT=Db::name("brand")->where(["brand_name"=>$brand_name,"is_del"=>0])->where("id","<>",$id)
+        ->findOrEmpty();
+        if(!empty($brandisT))return error_show(1002,"品牌名称已存在");
         $logo_url= isset($this->post['logo_url'])  && $this->post['logo_url'] !=="" ? trim($this->post['logo_url']):"";
 //        $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
 //        if($token==''){

+ 2 - 1
app/admin/controller/Cat.php

@@ -23,7 +23,7 @@ class Cat extends Base
 
         if ($param['cat_name'] !== '') $where[] = ['cat_name', 'like', '%' . $param['cat_name'] . '%'];
 
-        $data = Db::name('cat')->where($where)->cursor();
+        $data = Db::name('cat')->where($where)->order("id desc")->cursor();
         $vmp = [];
         foreach ($data as $sts) {
             $vmp[] = stro($sts);
@@ -149,6 +149,7 @@ class Cat extends Base
             ->alias('c')
             ->where($where)
             ->page($param['page'], $param['size'])
+            ->order("id desc")
             ->select()
             ->toArray();
         $var = [];

+ 52 - 11
app/admin/controller/Consult.php

@@ -99,6 +99,11 @@ class Consult extends Base
         $all_createrid = array_column($list,'createrid');
         $item = get_company_name_by_uid($all_createrid);
 
+		 $userCommon = new \app\admin\common\User();
+		 $tmp = $userCommon->handle('getCodeAndName', ['code' =>array_column($list,"khNo")]);
+        $kh = $tmp['data']??[];
+
+
         $brand = Db::name("brand")
             ->where(['id'=>array_column($list,'brand_id')])
             ->column('brand_name','id');
@@ -106,6 +111,7 @@ class Consult extends Base
         $userCommon = new \app\admin\common\User();
         $names = $userCommon->handle('getCodeAndName', ['code' => array_column($list, 'khNo')]);
 
+
         $data=[];
         foreach ($list as $value){
             $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
@@ -113,9 +119,15 @@ class Consult extends Base
 //            $brand = Db::name("brand")->where(['id'=>$value['brand_id']])->find();
             $value['brand_name']= $brand[$value['brand_id']]??'';//isset($brand['brand_name']) && $brand['brand_name']!='' ? $brand['brand_name']:"";
             $value['khname']="";
-            if ($value['khNo'] !== "") {
+
+            if($value['khNo']!==""){
 //                $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
-                $value['khname'] = $names['data'][$value['khNo']] ?? '';//isset($kh['companyName'])?$kh['companyName']:"";
+                $value['khname']=$kh[$value['khNo']]??"";
+
+//            if ($value['khNo'] !== "") {
+////                $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
+//                $value['khname'] = $names['data'][$value['khNo']] ?? '';//isset($kh['companyName'])?$kh['companyName']:"";
+
             }
             $value['metal_name']=isset($value['metal_id'])&& $value['metal_id']!=0?$this->noble[$value['metal_id']]:"";
             $value['company_name'] = $item[$value['createrid']]??'';
@@ -371,15 +383,24 @@ class Consult extends Base
         $zxinfo['unit_name']="";
         $zxinfo['metal_name']=isset($zxinfo['metal_id'])&& $zxinfo['metal_id']!=0?$this->noble[$zxinfo['metal_id']]:"";
         $zxinfo['specinfo']=json_decode($zxinfo['specinfo'],true);
+//<<<<<<< HEAD
+//		$zxinfo['khname']= '';
+//		$kccode=[];
+//        if($zxorder['khNo']!==""){
+////            $kh=Db::name("customer_info")->where(['companyNo'=>$zxorder['khNo']])->find();
+////            $zxinfo['khname']= isset($kh['companyName'])?$kh['companyName']:"";
+//=======
 
         $userCommon = new \app\admin\common\User();
         $tmp = $userCommon->handle('getCodeAndName', ['code' => [$zxorder['companyNo'],$zxorder['khNo']]]);
 
-        if($zxorder['khNo']!==""){
+//        if($zxorder['khNo']!==""){
 //            $kh=Db::name("customer_info")->where(['companyNo'=>$zxorder['khNo']])->find();
-            $zxinfo['khname']= $tmp['data'][$zxorder['khNo']]??'';//isset($kh['companyName'])?$kh['companyName']:"";
-            $zxinfo['khNo']= $zxorder['khNo'];
-        }
+//            $zxinfo['khname']= $tmp['data'][$zxorder['khNo']]??'';//isset($kh['companyName'])?$kh['companyName']:"";
+//>>>>>>> master-new
+//            $zxinfo['khNo']= $zxorder['khNo'];
+//            $kccode[]=$zxorder['khNo'];
+//        }
         if($zxinfo['unit']!==""){
             $unit=Db::name("unit")->where(['id'=>$zxinfo['unit']])->find();
             $zxinfo['unit_name']= isset($unit['unit'])?$unit['unit']:"";
@@ -388,11 +409,22 @@ class Consult extends Base
             $unit=Db::name("brand")->where(['id'=>$zxinfo['brand_id']])->find();
             $zxinfo['brand']= isset($unit['brand_name'])?$unit['brand_name']:"";
         }
-        if($zxorder['companyNo']!==""){
+//        $zxinfo['company']= '';
+//        if($zxorder['companyNo']!==""){
 //            $kh=Db::name("business")->where(['companyNo'=>$zxorder['companyNo']])->find();
 //            $zxinfo['company']= isset($kh['company'])?$kh['company']:"";
+//<<<<<<< HEAD
+//            $kccode[]=$zxorder['companyNo'];
+//        }
+//        if(!empty($kccode)){
+//            $userCommon = new \app\admin\common\User();
+//            $tmp = $userCommon->handle('getCodeAndName', ['code' =>$kccode]);
+////=======
+////>>>>>>> master-new
             $zxinfo['company'] = $tmp['data'][$zxorder['companyNo']] ?? '';
-        }
+            $zxinfo['khname'] = $tmp['data'][$zxorder['khNo']] ?? '';
+//        }
+
         if($zxorder['is_project']==1 && $zxorder['projectNo']!==""){
             $project = Db::name("project")->where(["projectNo"=>$zxorder['projectNo'],"is_del"=>0])->find();
             $zxinfo['project_name']=isset($project['project_name'])?$project['project_name']:"";
@@ -854,9 +886,12 @@ class Consult extends Base
 //            ->field('id,person,personid')
 //            ->where('code',$supplierNo)
 //            ->findOrEmpty();
-	    $user= new \app\admin\common\User();
-        $supplier =$user->handle("sInfo",["code"=>$supplierNo]);
-
+	    $userCommon= new \app\admin\common\User();
+        $supplier_temp =$userCommon->handle("hqInfo",["code"=>$supplierNo]);
+        if($supplier_temp['code']!=0 || empty($supplier_temp['data']) ) return error_show(1004,"供应商信息未找到");
+		$supplierArr=$supplier_temp['data']??[];
+		$supplier=$supplierArr['child']??[];
+		if($supplierArr['relation_code']==$zx['companyNo']) return error_show(1004,"业务公司与供应商信息一致");
         $data=[
             "bidNo"=>$bidNo,
             "infoNo"=>$infoNo,
@@ -1183,6 +1218,12 @@ class Consult extends Base
                     $mark_fee + $cert_fee + $nake_fee) / (1 - $budget);
             $total_fee = $demo_fee/$zxinfo['num']+$delivery_fee+$open_fee/$zxinfo['num'] + $cost_fee * $noble_weight + $pakge_fee + $mark_fee+$cert_fee +$nake_fee;
         }
+        $userCommon= new \app\admin\common\User();
+        $supplier_temp =$userCommon->handle("hqInfo",["code"=>$supplierNo]);
+        if($supplier_temp['code']!=0 || empty($supplier_temp['data']) ) return error_show(1004,"供应商信息未找到");
+		$supplierArr=$supplier_temp['data']??[];
+		$supplier=$supplierArr['child']??[];
+		if($supplierArr['relation_code']==$zx['companyNo']) return error_show(1004,"业务公司与供应商信息一致");
         Db::startTrans();
         try{
             $data=[

+ 1 - 1
app/admin/controller/Customer.php

@@ -97,7 +97,7 @@ class Customer extends Base
             ->alias('co')
             ->where($condition)
             ->order("co.addtime",'desc')
-            ->column("co.id,co.pid,co.name,co.level,co.depart_link,co.creater,co.addtime,co.status");
+            ->column("co.id,co.pid,co.name,co.level,co.depart_link,co.creater,co.createrid,co.addtime,co.status");
 
         $all_createrid = array_column($list,'createrid');
         $all_item = get_company_name_by_uid($all_createrid);

+ 11 - 6
app/admin/controller/Exclusive.php

@@ -61,14 +61,14 @@ class Exclusive extends Base
         if($name==""){
             return error_show(1004,"参数name不能为空");
         }
-        $rename = Db::name('exclusive')->where(['is_del' => 0, 'name' => $name])->find();
-        if (!empty($rename)) {
-            return error_show(1002, "专属类型名称已存在");
-        }
         $pid =isset($this->post['pid'])&&$this->post['pid']!=="" ? intval($this->post['pid']):0;
-        if($pid==""){
+        if($pid===""){
             return error_show(1002,"父级id不能为空");
         }
+        $rename = Db::name('exclusive')->where(["pid"=>$pid,'is_del' => 0, 'name' => $name])->find();
+        if (!empty($rename)) {
+            return error_show(1002, "专属类型名称已存在");
+        }
         $level=1;
         $search = $name;
         if($pid!==0){
@@ -328,8 +328,13 @@ class Exclusive extends Base
             return error_show(1004,"参数name不能为空");
         }
         $pid =isset($this->post['pid'])&&$this->post['pid']!=="" ? intval($this->post['pid']):0;
-        if($pid==""){
+        if($pid===""){
             return error_show(1004,"参数pid不能为空");
+        }
+         $rename = Db::name('exclusive')->where(["pid"=>$pid,'is_del' => 0, 'name' => $name])->where("id","<>",$id)
+         ->findOrEmpty();
+        if (!empty($rename)) {
+            return error_show(1002, "专属类型名称已存在");
         }
         $level=1;
         $search = $name;

+ 10 - 8
app/admin/controller/Good.php

@@ -65,10 +65,10 @@ class Good extends Base
         if($supplierNo!==""){
             $where[]=['a.supplierNo',"like","%$supplierNo%"];
         }
-         $supplier_name = isset($this->post['supplier_name']) && $this->post['supplier_name'] !=="" ? trim($this->post['supplier_name']):"";
-        if($supplier_name!==""){
-            $where[]=['s.name',"like","%$supplier_name%"];
-        }
+//         $supplier_name = isset($this->post['supplier_name']) && $this->post['supplier_name'] !=="" ? trim($this->post['supplier_name']):"";
+//        if($supplier_name!==""){
+//            $where[]=['s.name',"like","%$supplier_name%"];
+//        }
         $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] !=="" ? trim($this->post['companyNo']) :"";
         if($companyNo!==""){
             $where[]=['a.companyNo',"like","%$companyNo%"];
@@ -131,7 +131,7 @@ class Good extends Base
         $count = Db::name('good')
             ->alias("a")
             ->leftJoin("good_platform b","a.spuCode=b.spuCode")
-            ->leftJoin("supplier s","a.supplierNo=s.code")
+//            ->leftJoin("supplier s","a.supplierNo=s.code")
             ->leftJoin("depart_user u", "u.uid=b.createrid AND u.is_del=0")
             ->leftJoin("platform p","p.id=b.platform_code")
             ->where('p.platform_type',0)//只筛选非对接平台的商品
@@ -141,10 +141,10 @@ class Good extends Base
         $page = $page >= $total ? $total : $page;
         $list = Db::name('good')
             ->alias("a")
-            ->field("b.skuCode,b.platform_code,b.plat_code,b.id as good_id,a.cat_id,a.good_name,a.good_img,a.good_info_img,a.good_thumb_img,b.createrid,a.is_exclusive,a.brand_id,a.supplierNo,a.good_unit,a.noble_metal,a.companyNo,a.spuCode,a.good_type,b.creater,b.addtime,b.updatetime,b.exam_status,a.createrid purchase_id,a.creater purchase,a.is_stock,s.name as supplier_name")
+            ->field("b.skuCode,b.platform_code,b.plat_code,b.id as good_id,a.cat_id,a.good_name,a.good_img,a.good_info_img,a.good_thumb_img,b.createrid,a.is_exclusive,a.brand_id,a.supplierNo,a.good_unit,a.noble_metal,a.companyNo,a.spuCode,a.good_type,b.creater,b.addtime,b.updatetime,b.exam_status,a.createrid purchase_id,a.creater purchase,a.is_stock")
             //成本表里的创建人,也是线上商品的采购人,为了防止混淆,给creater取个别名
             ->leftJoin("good_platform b","a.spuCode=b.spuCode")
-            ->leftJoin("supplier s","a.supplierNo=s.code")
+//            ->leftJoin("supplier s","a.supplierNo=s.code")
 //            ->leftJoin("good_basic gb","gb.spuCode=a.spuCode")
             ->leftJoin("platform p","p.id=b.platform_code")
             ->where('p.platform_type',0)//只筛选非对接平台的商品
@@ -166,7 +166,8 @@ class Good extends Base
             ->column('unit','id');
 
         $userCommon = new \app\admin\common\User();
-        $names = $userCommon->handle('getCodeAndName',['code'=>array_column($list,'companyNo')]);
+        $names = $userCommon->handle('getCodeAndName',['code'=>array_merge(array_column($list,'companyNo'),
+        array_column($list,'supplierNo'))]);
 
         $data=[];
         foreach ($list as $value){
@@ -182,6 +183,7 @@ class Good extends Base
             $value['unit'] =$unit[$value['good_unit']]??'';//isset($unit['unit'])?$unit['unit']:"";
 //            $company = Db::name("business")->where(["companyNo"=>$value['companyNo']])->find();
             $value['company'] = $names['data'][$value['companyNo']]??'';//isset($company['company'])?$company['company']:"";
+            $value['supplierName'] = $names['data'][$value['supplierNo']]??'';//isset($company['company'])//?$company['company']:"";
             $value['stock_total'] = Db::name("good_stock")->where(['spuCode'=>$value['spuCode'],"is_del"=>0])->sum("usable_stock");
             $value['status']=$value['exam_status'];
             $value['exclusive']=makeExcluse($value['is_exclusive']);

+ 18 - 6
app/admin/controller/Goodup.php

@@ -291,9 +291,10 @@ class Goodup extends Base
             return error_show(1004,"参数supplierNo不能为空");
         }
         $userCommon= new \app\admin\common\User();
-        $supplier_temp =$userCommon->handle("sInfo",["code"=>$supplierNo]);
+        $supplier_temp =$userCommon->handle("hqInfo",["code"=>$supplierNo]);
         if($supplier_temp['code']!=0 || empty($supplier_temp['data']) ) return error_show(1004,"供应商信息未找到");
-		$supplier=$supplier_temp['data']??[];
+		$supplierArr=$supplier_temp['data']??[];
+		$supplier=$supplierArr['child']??[];
 //        $supplier =Db::name("supplier")->where(["code"=>$supplierNo])->findOrEmpty();
 //        if(empty($supplier)) return error_show(1004,"供应商信息未找到");
         $good_size = isset($this->post['good_size'])&&$this->post['good_size']!=""? trim($this->post['good_size']):"";
@@ -304,6 +305,9 @@ class Goodup extends Base
         if($company_id==''){
             return error_show(1004,"参数company_id不能为空");
         }
+        if($supplierArr['relation_code']==$company_id){
+        	 return error_show(1004,"业务公司与供应商属于同一家公司");
+        }
         $is_auth = isset($this->post['is_auth'])&&$this->post['is_auth']!==""? intval($this->post['is_auth']):"";
         if($is_auth===''){
             return error_show(1004,"参数is_auth不能为空");
@@ -661,9 +665,10 @@ class Goodup extends Base
             return error_show(1004,"参数supplierNo不能为空");
         }
         $userCommon= new \app\admin\common\User();
-        $supplier_temp =$userCommon->handle("sInfo",["code"=>$supplierNo]);
+		$supplier_temp =$userCommon->handle("hqInfo",["code"=>$supplierNo]);
         if($supplier_temp['code']!=0 || empty($supplier_temp['data']) ) return error_show(1004,"供应商信息未找到");
-		$supplier=$supplier_temp['data']??[];
+		$supplierArr=$supplier_temp['data']??[];
+		$supplier=$supplierArr['child']??[];
         $good_size = isset($this->post['good_size'])&&$this->post['good_size']!=""? trim($this->post['good_size']) :"";
         if($good_size==''){
             return error_show(1004,"参数good_size不能为空");
@@ -672,6 +677,9 @@ class Goodup extends Base
         if($company_id==''){
             return error_show(1004,"参数company_id不能为空");
         }
+        if($supplierArr['relation_code']==$company_id){
+        	 return error_show(1004,"业务公司与供应商属于同一家公司");
+        }
         $is_auth = isset($this->post['is_auth'])&&$this->post['is_auth']!==""? intval($this->post['is_auth']):"";
         if($is_auth===''){
             return error_show(1004,"参数is_auth不能为空");
@@ -2100,9 +2108,10 @@ class Goodup extends Base
             return error_show(1004,"参数supplierNo不能为空");
         }
         $userCommon= new \app\admin\common\User();
-        $supplier_temp =$userCommon->handle("sInfo",["code"=>$supplierNo]);
+        $supplier_temp =$userCommon->handle("hqInfo",["code"=>$supplierNo]);
         if($supplier_temp['code']!=0 || empty($supplier_temp['data']) ) return error_show(1004,"供应商信息未找到");
-		$supplier=$supplier_temp['data']??[];
+		$supplierArr=$supplier_temp['data']??[];
+		$supplier=$supplierArr['child']??[];
         $good_size = isset($this->post['good_size'])&&$this->post['good_size']!=""? trim($this->post['good_size']) :"";
         if($good_size==''){
             return error_show(1004,"参数good_size不能为空");
@@ -2111,6 +2120,9 @@ class Goodup extends Base
         if($company_id==''){
             return error_show(1004,"参数companyNo不能为空");
         }
+        if($supplierArr['relation_code']==$company_id){
+        	 return error_show(1004,"业务公司与供应商属于同一家公司");
+        }
         $is_auth = isset($this->post['is_auth'])&&$this->post['is_auth']!==""? intval($this->post['is_auth']):"";
         if($is_auth===''){
             return error_show(1004,"参数is_auth不能为空");

+ 21 - 20
app/admin/controller/Keepbrand.php

@@ -15,9 +15,9 @@ class Keepbrand extends Base
     }
     public function create(){
         $brand_book = isset($this->post['brand_book']) && $this->post['brand_book'] !=="" ? trim($this->post['brand_book']):"";
-        if($brand_book==""){
-            return error_show(1003,"参数brand_book不能为空");
-        }
+//        if($brand_book==""){
+//            return error_show(1003,"参数brand_book不能为空");
+//        }
         $gyscode = isset($this->post['gyscode']) && $this->post['gyscode'] !=="" ? trim($this->post['gyscode']):"";
         if($gyscode==""){
             return error_show(1003,"参数gyscode不能为空");
@@ -26,7 +26,7 @@ class Keepbrand extends Base
         if($brand_id==""){
             return error_show(1003,"参数brand_id不能为空");
         }
-        $rename = Db::name('brand_book')->where(['brand_id' => $brand_id,'is_del' => 0])->find();
+        $rename = Db::name('brand_book')->where(['brand_id' => $brand_id,"gyscode"=>$gyscode,'is_del' => 0])->find();
         if (!empty($rename)) {
             return error_show(1002, "品牌名称已存在");
         }
@@ -61,14 +61,15 @@ class Keepbrand extends Base
                 "updatetime"=>date("Y-m-d H:i:s")
             ];
         if($long===1){
-            $starttime = isset($this->post['starttime']) && $this->post['starttime'] !=="" ?$this->post['starttime']:"";
-            if($starttime==""){
-                return error_show(1005,'参数starttime不能为空');
-            }
-            $endtime= isset($this->post['endtime']) && $this->post['endtime'] !=="" ?$this->post['endtime']:"";
-            if($endtime==""){
-                return error_show(1005,'修改时间不能为空');
-            }
+            $starttime = isset($this->post['starttime']) && $this->post['starttime'] !==""
+            ?$this->post['starttime']:null;
+//            if($starttime==""){
+//                return error_show(1005,'参数starttime不能为空');
+//            }
+            $endtime= isset($this->post['endtime']) && $this->post['endtime'] !=="" ?$this->post['endtime']:null;
+//            if($endtime==""){
+//                return error_show(1005,'修改时间不能为空');
+//            }
             $data['starttime']=$starttime;
             $data['endtime']=$endtime;
         }
@@ -210,14 +211,14 @@ class Keepbrand extends Base
             "updatetime"=>date("Y-m-d H:i:s")
         ];
         if($long===1){
-            $starttime = isset($this->post['starttime']) && $this->post['starttime'] !=="" ?$this->post['starttime']:"";
-            if($starttime==""){
-                return error_show(1005,'参数starttime不能为空');
-            }
-            $endtime= isset($this->post['endtime']) && $this->post['endtime'] !=="" ?$this->post['endtime']:"";
-            if($endtime==""){
-                return error_show(1005,'修改时间不能为空');
-            }
+            $starttime = isset($this->post['starttime']) && $this->post['starttime'] !=="" ?$this->post['starttime']:null;
+//            if($starttime==""){
+//                return error_show(1005,'参数starttime不能为空');
+//            }
+            $endtime= isset($this->post['endtime']) && $this->post['endtime'] !=="" ?$this->post['endtime']:null;
+//            if($endtime==""){
+//                return error_show(1005,'修改时间不能为空');
+//            }
             $data['starttime']=$starttime;
             $data['endtime']=$endtime;
         }

+ 10 - 5
app/admin/controller/Role.php

@@ -33,12 +33,12 @@ class Role extends Base
         isset($post['role_name']) && $post['role_name'] !== "" ? $condition[] = ['a.role_name', "like", "%" . $post['role_name'] . "%"] : "";
         isset($post['relaComNo']) && $post['relaComNo'] !== "" ? $condition[] = ["a.companyNo", "=", $post['relaComNo']] : "";
         isset($post['companyNo']) && $post['companyNo'] !== "" ? $condition[] = ["a.companyNo", "=", $post['companyNo']] : "";
-        isset($post['companyName']) && $post['companyName'] !== "" ? $condition[] = ["b.name", "like", "%{$post['companyName']}%"] : "";
+//        isset($post['companyName']) && $post['companyName'] !== "" ? $condition[] = ["b.name", "like", "%{$post['companyName']}%"] : "";
         isset($post['level']) && $post['level'] !== "" ? $condition[] = ["a.role_level", "=", $post['level']] : "";
 
         $count = Db::name("role")
             ->alias("a")
-            ->leftJoin("supplier_info b", "a.companyNo=b.code")
+//            ->leftJoin("supplier_info b", "a.companyNo=b.code")
             ->where($condition)
             ->count('a.id');
         $page = isset($post['page']) ? intval($post['page']) : 1;
@@ -46,15 +46,20 @@ class Role extends Base
         $page >= ceil($count / $size) ? $page = (int)ceil($count / $size) : "";
         $list = Db::name("role")
             ->alias("a")
-            ->leftJoin("supplier_info b", "a.companyNo=b.code")
+//            ->leftJoin("supplier_info b", "a.companyNo=b.code")
             ->leftJoin("role_action t", "a.id=t.role_id")
-            ->field("a.*,b.name as companyName,t.action_conllect as action,t.action_data")
+            ->field("a.*,t.action_conllect as action,t.action_data")
             ->order("a.addtime desc")
             ->where($condition)
             ->page($page, $size)
             ->select()
             ->toArray();
-
+        $userComon=new \app\admin\common\User();
+        $supplier =$userComon->handle("getCodeAndName",["code"=>array_column($list,"companyNo")]);
+        $supplierArr=$supplier['data']??[];
+        foreach ($list as &$value){
+        	$value['companyName'] = $supplierArr[$value['companyNo']]??"";
+        }
         return app_show(0, "获取成功", ["list" => $list, "count" => $count]);
     }
 

+ 9 - 0
app/admin/controller/Sale.php

@@ -1683,6 +1683,15 @@ class Sale extends Base
             if ($sa == false) {
                 return false;
             }
+
+
+            $goodinfo['status'] = 5;
+            $goodinfo['updatetime'] = date("Y-m-d H:i:s");
+            $saa = Db::name("consult_info")->where(["infoNo"=>$goodinfo['infoNo']])->update(["status"=>5,
+            "updatetime"=>date("Y-m-d H:i:s")]);
+            if ($saa == false) {
+                return false;
+            }
             //修改状态,添加待办
             ActionLog::logAdd($this->post['token'], [
                 "order_code" => $goodinfo['bidNo'],//项目编码

+ 13 - 33
app/common.php

@@ -1,7 +1,7 @@
 <?php
 // 应用公共文件
 
-use think\facade\Config;
+use app\admin\common\User as CommonUser;use think\facade\Config;
 use think\facade\Db;
 use think\facade\Filesystem;
 use think\helper\Str;
@@ -115,7 +115,7 @@ function VerifyTokens($token){
 //    ];
 //    $response=curl_request($url,$data);
 
-    $userCommon = new \app\admin\common\User();
+    $userCommon = new CommonUser();
     $rs = $userCommon->VerifyTokens(['token'=>$token]);
 
     return json_decode($rs,true);
@@ -128,13 +128,8 @@ function VerifyTokens($token){
  * @return mixed
  */
 function GetUserlist($token,$condition){
-    $host = Config::get("app");
-
-    $url = $host["api_host"]."/Api/getuserlist";
-    $condition['token']=$token;
-    $response=curl_request($url,$condition);
-
-    return json_decode($response,true);
+    $userCommon = new CommonUser();
+    return json_decode($userCommon->GetUserlist($condition), true);
 }
 
 /**
@@ -143,23 +138,13 @@ function GetUserlist($token,$condition){
  * @return mixed
  */
 function GetAccountall($token, $condition){
-    $host = Config::get("app");
-
-    $url = $host["api_host"]."/Api/userall";
-    $condition['token']=$token;
-    $response=curl_request($url,$condition);
-
-    return json_decode($response,true);
+    $userCommon = new CommonUser();
+    return json_decode($userCommon->GetAccountall($condition), true);
 }
 
-function GetList($token,$condition){
-    $host = Config::get("app");
-
-    $url = $host["api_host"]."/Api/userlist";
-    $condition['token']=$token;
-    $response=curl_request($url,$condition);
-
-    return json_decode($response,true);
+function GetList($condition){
+    $userCommon = new CommonUser();
+    return json_decode($userCommon->GetUserlist($condition), true);
 }
 
 /**
@@ -168,18 +153,13 @@ function GetList($token,$condition){
  * @return mixed
  */
 function GetInfoById($token,$condition){
-    $host = Config::get("app");
-    $url = $host["api_host"]."/Api/userinfobyid";
-    $condition['token']=$token;
-    $response=curl_request($url,$condition);
-    return json_decode($response,true);
+    $userCommon = new CommonUser();
+    return json_decode($userCommon->GetUserInfo($condition), true);
 }
 
 function GetInfoNoToken($condition){
-    $host = Config::get("app");
-    $url = $host["api_host"]."/Api/uinfo";
-    $response=curl_request($url,$condition);
-    return json_decode($response,true);
+    $userCommon = new CommonUser();
+    return json_decode($userCommon->GetUserInfo($condition), true);
 }
 
 function makeNo($str){