|
@@ -3509,22 +3509,24 @@ class Sale extends Base
|
|
|
|
|
|
|
|
|
$hand = resign_hand_user($this->uid,0);
|
|
|
+ $uidarr =implode(",",$hand);
|
|
|
//库管只能看到库存品订单,供应商负责人只能看到非库存品订单
|
|
|
if(!in_array($this->roleid,[1,33])){
|
|
|
//库管看到所有的库存品发货申请单
|
|
|
- if(in_array($this->roleid,config('app.wsm_cgder_role'))) $where[]=["b.is_stock","=",1];
|
|
|
+ if(in_array($this->roleid,config('app.wsm_cgder_role'))) $condition .= " b.is_stock=1";
|
|
|
else{
|
|
|
$role = $this->checkDataShare();
|
|
|
- $uidarr =implode(",",$hand);
|
|
|
if (!empty($role[DataGroupModel::$type_全部])) {
|
|
|
$arr= array_unique(array_merge($hand,$role[DataGroupModel::$type_全部]));
|
|
|
+ if($condition!='') $condition.="or ";
|
|
|
$condition .= " a.apply_id in (" . implode(',',$arr) . ")";
|
|
|
}
|
|
|
-
|
|
|
- $personid=Db::name('supplier')->field('id')->where(['is_del'=>0,'personid'=> $hand])->findOrEmpty();
|
|
|
- if($personid)$condition.=" or (b.is_stock=0 and sip.personid in ($uidarr))";//供应商负责人能看到非库存品的单子
|
|
|
-// else $condition.="a.apply_id = {$this->uid}";//其他只能看到自己创建的单子
|
|
|
}
|
|
|
+ $personid=Db::name('supplier')->field('id')->where(['is_del'=>0,'personid'=> $hand])->findOrEmpty();
|
|
|
+ if($personid){
|
|
|
+ if($condition!='') $condition.="or ";
|
|
|
+ $condition.="(b.is_stock=0 and sip.personid in ($uidarr))";
|
|
|
+ }
|
|
|
}
|
|
|
// if(!empty($role['platform']) ){
|
|
|
// $where[]=["b.platform_id","in",$role['platform']];
|