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