|
@@ -807,22 +807,22 @@ class Sale extends Base
|
|
|
$process=[];
|
|
|
if($status == 1){
|
|
|
//库存品,推给库管和库管-张凯旋
|
|
|
-// if($etid['is_stock']==1){
|
|
|
-// $roleid = config('app.wsm_cgder_role');
|
|
|
-// $uids = Db::name('user_role')
|
|
|
-// ->where('is_del', 0)
|
|
|
-// ->whereIn('roleid', $roleid)
|
|
|
-// ->column('uid');
|
|
|
-// $process=[
|
|
|
-// "order_type" => 'CKD',
|
|
|
-// "order_code" => $outCode,//出库单号
|
|
|
-// "order_id" => $ou,
|
|
|
-// "order_status" => $status,
|
|
|
-// "before_status" => 0,
|
|
|
-//// 'holder_id'=>$out['apply_id'],
|
|
|
-// 'handle_user_list' => implode(',', $uids)
|
|
|
-// ];
|
|
|
-// }else{
|
|
|
+ if($etid['is_stock']==1){
|
|
|
+ $roleid = config('app.wsm_cgder_role');
|
|
|
+ $uids = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $process=[
|
|
|
+ "order_type" => 'CKD',
|
|
|
+ "order_code" => $outCode,//出库单号
|
|
|
+ "order_id" => $ou,
|
|
|
+ "order_status" => $status,
|
|
|
+ "before_status" => 0,
|
|
|
+// 'holder_id'=>$out['apply_id'],
|
|
|
+ 'handle_user_list' => implode(',', $uids)
|
|
|
+ ];
|
|
|
+ }else{
|
|
|
//推给供应商负责人
|
|
|
$supplier = Db::name('supplier')
|
|
|
->field('person,personid')
|
|
@@ -838,7 +838,7 @@ class Sale extends Base
|
|
|
'wait_name'=>$supplier['person'],
|
|
|
'holder_id'=>$supplier['personid'],
|
|
|
];
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(empty($process)) $process=[
|
|
@@ -2920,15 +2920,15 @@ class Sale extends Base
|
|
|
//库存品——>推到库管,非库存品——>推送供应商负责人
|
|
|
$order=[];
|
|
|
if($data['status'] == 1){
|
|
|
-// if($der['is_stock'] == 1){
|
|
|
-// //库存品,推给库管和库管-张凯旋
|
|
|
-// $roleid = config('app.wsm_cgder_role');
|
|
|
-// $uids = Db::name('user_role')
|
|
|
-// ->where('is_del', 0)
|
|
|
-// ->whereIn('roleid', $roleid)
|
|
|
-// ->column('uid');
|
|
|
-// $order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'handle_user_list' => implode(',', $uids)];
|
|
|
-// }else{
|
|
|
+ if($der['is_stock'] == 1){
|
|
|
+ //库存品,推给库管和库管-张凯旋
|
|
|
+ $roleid = config('app.wsm_cgder_role');
|
|
|
+ $uids = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'handle_user_list' => implode(',', $uids)];
|
|
|
+ }else{
|
|
|
//推给供应商负责人
|
|
|
$supplier = Db::name('supplier')
|
|
|
->alias('a')
|
|
@@ -2938,7 +2938,7 @@ class Sale extends Base
|
|
|
->where('c.orderCode', $orderCode)
|
|
|
->findOrEmpty();
|
|
|
$order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id'], 'wait_id' => $supplier['personid'] ?? 0, 'wait_name' => $supplier['person'] ?? ''];
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
if(empty($order)) $order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id']];
|
|
|
|
|
@@ -3011,7 +3011,7 @@ class Sale extends Base
|
|
|
$order = [];
|
|
|
if ($status == 1) {
|
|
|
//推给供应商负责人
|
|
|
-// if ($dr['is_stock'] == 0) {
|
|
|
+ if ($dr['is_stock'] == 0) {
|
|
|
$supplier = Db::name('supplier')
|
|
|
->alias('a')
|
|
|
->field('a.id,a.person,a.personid')
|
|
@@ -3020,14 +3020,14 @@ class Sale extends Base
|
|
|
->where('c.orderCode', $codeinfo['orderCode'])
|
|
|
->findOrEmpty();
|
|
|
$order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $codeinfo['id'], "order_status" => $codeinfo['status'], "before_status" => 0, 'holder_id' => $codeinfo['apply_id'], 'wait_id' => $supplier['personid'] ?? 0, 'wait_name' => $supplier['person'] ?? ''];
|
|
|
-// } else{
|
|
|
-// $roleid = config('app.wsm_cgder_role');
|
|
|
-// $uids = Db::name('user_role')
|
|
|
-// ->where('is_del', 0)
|
|
|
-// ->whereIn('roleid', $roleid)
|
|
|
-// ->column('uid');
|
|
|
-// $order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $codeinfo['id'], "order_status" => $codeinfo['status'], "before_status" => 0, 'handle_user_list' => implode(',', $uids)];
|
|
|
-// }
|
|
|
+ } else{
|
|
|
+ $roleid = config('app.wsm_cgder_role');
|
|
|
+ $uids = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $codeinfo['id'], "order_status" => $codeinfo['status'], "before_status" => 0, 'handle_user_list' => implode(',', $uids)];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (empty($order)) $order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $codeinfo['id'], "order_status" => $codeinfo['status'], "before_status" => 0, 'holder_id' => $codeinfo['apply_id']];
|
|
@@ -3813,22 +3813,22 @@ class Sale extends Base
|
|
|
//是否库存品,待办数据推送到的人有区别,
|
|
|
$process = [];
|
|
|
if ($data['status'] == 1) {
|
|
|
-// if ($der['is_stock'] == 1) {
|
|
|
-// //库存品,推给库管和库管-张凯旋
|
|
|
-// $roleid = config('app.wsm_cgder_role');
|
|
|
-// $uids = Db::name('user_role')
|
|
|
-// ->where('is_del', 0)
|
|
|
-// ->whereIn('roleid', $roleid)
|
|
|
-// ->column('uid');
|
|
|
-// $process = ["order_type" => 'CKD', "order_code" => $data['outCode'], "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id'], 'handle_user_list' => implode(',', $uids)];
|
|
|
-// } else{
|
|
|
+ if ($der['is_stock'] == 1) {
|
|
|
+ //库存品,推给库管和库管-张凯旋
|
|
|
+ $roleid = config('app.wsm_cgder_role');
|
|
|
+ $uids = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $process = ["order_type" => 'CKD', "order_code" => $data['outCode'], "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id'], 'handle_user_list' => implode(',', $uids)];
|
|
|
+ } else{
|
|
|
//推给供应商负责人
|
|
|
$supplier = Db::name('supplier')
|
|
|
->field('person,personid')
|
|
|
->where('code', $cgd['supplierNo'])
|
|
|
->findOrEmpty();
|
|
|
$process = ["order_type" => 'CKD', "order_code" => $data['outCode'], "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id'], 'wait_id' => $supplier['personid'], 'wait_name' => $supplier['person'],];
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
if (empty($process)) $process = ["order_type" => 'CKD', "order_code" => $data['outCode'], "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id']];
|
|
|
|