|
@@ -238,15 +238,18 @@ class Purchin extends Base
|
|
|
ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$sto,"RKD",$status,$this->post);
|
|
|
|
|
|
if($cgdinfo['status']==1 || $cgdinfo['status']==2){
|
|
|
- $orderinfo = Db::name('sale')
|
|
|
- ->alias('a')
|
|
|
- ->field('a.id,a.orderCode,a.is_stock,a.order_type,a.cgderid')
|
|
|
- ->leftJoin('order_num b','b.orderCode=a.orderCode')
|
|
|
- ->where([
|
|
|
- 'a.is_del'=>0,
|
|
|
- 'b.cgdNo'=>$cgdinfo['cgdNo'],
|
|
|
- ])->findOrEmpty();
|
|
|
- if($orderinfo['is_stock']==1){
|
|
|
+// $orderinfo = Db::name('sale')
|
|
|
+// ->alias('a')
|
|
|
+// ->field('a.id,a.orderCode,a.is_stock,a.order_type,a.cgderid')
|
|
|
+// ->leftJoin('order_num b','b.orderCode=a.orderCode')
|
|
|
+// ->where([
|
|
|
+// 'a.is_del'=>0,
|
|
|
+// 'b.cgdNo'=>$cgdinfo['cgdNo'],
|
|
|
+// ])->findOrEmpty();
|
|
|
+ $is_stock = Db::name('good_basic')
|
|
|
+ ->where(['is_del'=>0,'spuCode'=>$cgdinfo['spuCode']])
|
|
|
+ ->value('is_stock');
|
|
|
+ if($is_stock==1){
|
|
|
//库存品,推给31库管人员、41库管-张凯旋
|
|
|
$uid = Db::name('user_role')
|
|
|
->where([
|
|
@@ -255,7 +258,16 @@ class Purchin extends Base
|
|
|
['status', '=', 1]
|
|
|
])->column('uid');
|
|
|
$process=["order_code"=>$wsm_in_code,"order_id"=>$win,"order_status"=>$status,"order_type"=>'RKD',"before_status"=>$status,'holder_id' => $orin['apply_id'],'handle_user_list'=>implode(',', $uid)];
|
|
|
- }elseif ($orderinfo['is_stock']==0 || $orderinfo['order_type']==3) $process=["order_code"=>$wsm_in_code,"order_id"=>$win,"order_status"=>$status,"order_type"=>'RKD',"before_status"=>$status,'holder_id' => $orin['apply_id'],'handle_user_list'=>$orderinfo['cgderid']];//非库存品和采返商品,推给供应商负责人
|
|
|
+ }elseif ($is_stock==0 || $cgdinfo['order_type']==3) {
|
|
|
+
|
|
|
+ //非库存品和采返商品,推给供应商负责人
|
|
|
+ $supplier = Db::name('supplier')
|
|
|
+ ->where('is_del',0)
|
|
|
+ ->where('code',$cgdinfo['supplierNo'])
|
|
|
+ ->field('personid')
|
|
|
+ ->findOrEmpty();
|
|
|
+ $process=["order_code"=>$wsm_in_code,"order_id"=>$win,"order_status"=>$status,"order_type"=>'RKD',"before_status"=>$status,'holder_id' => $orin['apply_id'],'handle_user_list'=>$supplier['personid']];
|
|
|
+ }
|
|
|
}else $process=["order_code"=>$wsm_in_code,"order_id"=>$win,"order_status"=>$status,"order_type"=>'RKD',"before_status"=>$status,'holder_id' => $orin['apply_id']];
|
|
|
|
|
|
ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|