|
@@ -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']];
|
|
@@ -3959,6 +3961,9 @@ class Sale extends Base
|
|
|
if ($outinfo == false) {
|
|
|
return error_show(1004, "发货数据未找到");
|
|
|
}
|
|
|
+ if($outinfo['status']!=1){
|
|
|
+ return error_show(1004, "发货状态有误");
|
|
|
+ }
|
|
|
$einfo = Db::name('sale')->where(['orderCode' => $outinfo['orderCode'], 'is_del' => 0])->find();
|
|
|
if (empty($einfo)) {
|
|
|
return error_show(1002, "未找到销售订单数据");
|
|
@@ -3990,7 +3995,7 @@ class Sale extends Base
|
|
|
}
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
- $up = Db::name("order_out")->save($outinfo);
|
|
|
+ $up = Db::name("order_out")->where(["outCode"=>$outCode,"status"=>1,"is_del"=>0])->update($outinfo);
|
|
|
|
|
|
$user_info = GetUserInfo($this->post['token']);
|
|
|
$uid = isset($user_info['data']['id']) ? $user_info['data']['id'] : 0;
|