|
@@ -978,6 +978,14 @@ class Purchin extends Base
|
|
|
Db::rollback();
|
|
|
return error_show(1002,"未找到采购单数据");
|
|
|
}
|
|
|
+ //库存品,推给31库管人员、41库管-张凯旋
|
|
|
+ $uid = Db::name('user_role')
|
|
|
+ ->where([
|
|
|
+ ['is_del', '=', 0],
|
|
|
+ ['roleid', 'in', [31, 41]],
|
|
|
+ ['status', '=', 1]
|
|
|
+ ])->column('uid');
|
|
|
+ $handle_user_list=implode(",",$uid);
|
|
|
if($info['status']==4){
|
|
|
$order = ["order_code"=>$info['cgdNo'],"status"=>$cgdinfo['status'],"action_remark"=>'',"action_type"=>"edit"];
|
|
|
$cgdinfo['wsend_num']-=$info['send_num'];
|
|
@@ -994,27 +1002,14 @@ class Purchin extends Base
|
|
|
|
|
|
$holder_id = Db::name('supplier')->where(['code' => $cgdinfo['supplierNo'], 'is_del' => 0])->value('personid', 0);
|
|
|
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();
|
|
|
$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([
|
|
|
- ['is_del', '=', 0],
|
|
|
- ['roleid', 'in', [31, 41]],
|
|
|
- ['status', '=', 1]
|
|
|
- ])->column('uid');
|
|
|
+
|
|
|
if(!in_array($this->uid,$uid)) throw new Exception('库存品订单只能由库管人员操作');
|
|
|
- $handle_user_list=implode(",",$uid);
|
|
|
+
|
|
|
// $process=["order_code"=>$info['cgdNo'],"order_id"=>$cgdinfo['id'],"order_status"=>$cgdinfo['status'],"order_type"=>'CGD',"before_status"=>$order['status'],'holder_id'=>Db::name('supplier')->where(['code' => $cgdinfo['supplierNo'], 'is_del' => 0])->value('personid', 0),'handle_user_list'=>implode(',', $uid)];
|
|
|
}else{
|
|
|
// $holder_id = Db::name('supplier')->where(['code' => $cgdinfo['supplierNo'], 'is_del' => 0])->value('personid', 0);
|