wugg vor 2 Jahren
Ursprung
Commit
186af1082b
3 geänderte Dateien mit 20 neuen und 3 gelöschten Zeilen
  1. 15 2
      app/admin/controller/After.php
  2. 2 0
      app/admin/controller/Base.php
  3. 3 1
      app/admin/controller/Sale.php

+ 15 - 2
app/admin/controller/After.php

@@ -45,7 +45,19 @@ class After extends Base
 	        if($wsm==false){
 	            return error_show(1005,"未找到仓库数据");
 	        }
+//	        $cgder =$wsm['contactor_name'] ??'';
+//	        $cgderid =$wsm['contactor'] ??0;
 		}
+//		else{
+//			$roleArr=\think\facade\Config::get("app");
+//			$kuguan = Db::name("user_role")->where(["roleid"=>$roleArr['wsm_cgder_role'],"is_del"=>0])->column("uid");
+//			if(empty($kuguan)){
+//				 return error_show(1005,"未找到仓库管理员数据");
+//			}
+//			$userinfo = Db::name("dapart_user")
+//			$cgder =$wsm['contactor_name'] ??'';
+//	        $cgderid =$wsm['contactor'] ??0;
+//		}
 
         if ($oder['order_type'] == 3) {
             $goon = Db::name("good_zixun")->where(["spuCode" => $oder['good_code'], "is_del" => 0])->find();
@@ -213,8 +225,9 @@ class After extends Base
         $role=$this->checkRole();
         $condition='';
         if(!empty($role['write']) && $this->uid!=""){
-            // $where[]=["a.apply_id","in",$role['write']];
-            $condition .="a.cgderid = {$this->uid} or a.apply_id in (".implode(',',$role['write']).") or a.person_id={$this->uid}";
+        	$cgdArr =\think\facade\Config::get("app");
+        	$cgdids =implode(",",$cgdArr);
+            $condition .="a.cgderid = {$this->uid} or a.apply_id in (".implode(',',$role['write']).") or a.person_id={$this->uid} or (order_type=1 and {$this->roleid} in ($cgdids))";
         }
         $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
         if ($company_name !== "") $where[] = ["a.apply_id", 'in', get_company_item_user_by_name($company_name)];

+ 2 - 0
app/admin/controller/Base.php

@@ -12,6 +12,7 @@ class Base extends \app\BaseController
     public  $post=[];
     public  $uid='';
     public  $uname='';
+    public  $roleid='';
     public function __construct(App $app)
     {
         parent::__construct($app);
@@ -44,6 +45,7 @@ class Base extends \app\BaseController
             return [];
         }
         $action=[];
+        $this->roleid=$uid['roleid'];
         $role =Db::name("role_action")->where(["role_id"=>$uid['roleid'],"status"=>1])->find();
         $action['action_conllect']=isset($role['action_conllect'])? $role['action_conllect']:'';
         $action['write'][]=$this->uid;

+ 3 - 1
app/admin/controller/Sale.php

@@ -3301,7 +3301,9 @@ class Sale extends Base
         $condition = '';
         if (!empty($role['write']) && $this->uid != "") {
             // $where[]=["a.apply_id","in",$role['write']];
-            $condition .= " (b.is_stock=1 and n.contactor = {$this->uid}) or (b.is_stock=0 and wpo.cgder_id = {$this->uid}) or a.apply_id in (" . implode(',',
+            $cgdArr =\think\facade\Config::get("app");
+        	$cgdids =implode(",",$cgdArr);
+            $condition .= " (b.is_stock=1 and {$this->roleid} in ($cgdids)) or (b.is_stock=0 and wpo.cgder_id = {$this->uid}) or a.apply_id in (" . implode(',',
                     $role['write']) . ")";
         }
 //        if(!empty($role['platform']) ){