|
@@ -227,9 +227,17 @@ class Orderback extends Base
|
|
|
$up=Db::name("order_back")->save($info);
|
|
|
if($up){
|
|
|
$stn = ["order_code"=>$info['thNo'],"status"=>$str,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$stn,"CKTHD",$info['status'],$info);
|
|
|
- $process=["order_code"=>$info['thNo'],"order_id"=>$info['id'],"order_status"=>$info['status'],'order_type'=>"CKTHD","before_status"=>$str];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ActionLog::logAdd(['id' => $this->uid, 'nickname' => $this->uname],$stn,"CKTHD",$info['status'],$info);
|
|
|
+
|
|
|
+ if($info['status'] == 2) $roleid = [10, 31, 41];//特殊处理,写入到10采购负责人、31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+ else $roleid = [31,41];//特殊处理,写入到31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+
|
|
|
+ $handle_user_list = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $process = ["order_code" => $info['thNo'], "order_id" => $info['id'], "order_status" => $info['status'], 'order_type' => "CKTHD", "before_status" => $str, 'handle_user_list' => implode(',', $handle_user_list)];
|
|
|
+ ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], $process);
|
|
|
if(empty($errorlist)){
|
|
|
Db::commit();
|
|
|
return app_show(0,'更新成功');
|
|
@@ -280,9 +288,16 @@ class Orderback extends Base
|
|
|
$up=Db::name("order_back")->save($info);
|
|
|
if($up){
|
|
|
$stn = ["order_code"=>$thNo,"status"=>$temp,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$stn,"CKTHD",$info['status'],$stn);
|
|
|
- $process=["order_code"=>$info['thNo'],"order_id"=>$info['id'],"order_status"=>3,"order_type"=>"CKTHD","before_status"=>$temp];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ActionLog::logAdd(['id' => $this->uid, 'nickname' => $this->uname], $stn, "CKTHD", $info['status'], $stn);
|
|
|
+
|
|
|
+ //特殊处理,写入到31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+ $handle_user_list = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', [31, 41])
|
|
|
+ ->column('uid');
|
|
|
+ $process = ["order_code" => $info['thNo'], "order_id" => $info['id'], "order_status" => 3, "order_type" => "CKTHD", "before_status" => $temp, 'handle_user_list' => implode(',', $handle_user_list)];
|
|
|
+ ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], $process);
|
|
|
+
|
|
|
if(empty($errorlist)){
|
|
|
$up =Db::name("order_backinfo")->where(["thNo"=>$thNo,"is_del"=>0])->save(["status"=>1,
|
|
|
"updatetime"=>date("Y-m-d H:i:s")]);
|
|
@@ -373,9 +388,22 @@ class Orderback extends Base
|
|
|
$up=Db::name("order_back")->save($info);
|
|
|
if($up){
|
|
|
$stn = ["order_code"=>$thNo,"status"=>$var,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$stn,"CKTHD",$info['status'],$this->post);
|
|
|
- $process=["order_code"=>$info['thNo'],"order_id"=>$info['id'],"order_status"=>$status,"order_type"=>"CKTHD","before_status"=>$var];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$stn,"CKTHD",$info['status'],$this->post);
|
|
|
+
|
|
|
+ if (in_array($status, [2, 3])) {
|
|
|
+
|
|
|
+ if ($status == 2) $roleid = [10, 31, 41];//特殊处理,写入到10采购负责人、31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+ else $roleid = [31, 41];//特殊处理,写入到、31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+
|
|
|
+ $handle_user_list = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $process = ["order_code" => $info['thNo'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "CKTHD", "before_status" => $var, 'handle_user_list' => implode(',', $handle_user_list)];
|
|
|
+
|
|
|
+ } else $process = ["order_code" => $info['thNo'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "CKTHD", "before_status" => $var];
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], $process);
|
|
|
Db::commit();
|
|
|
return app_show(0,'更新成功');
|
|
|
}
|
|
@@ -424,8 +452,7 @@ class Orderback extends Base
|
|
|
Db::rollback();
|
|
|
return error_show(1004,"未找到售后单数据");
|
|
|
}
|
|
|
- $sabebn =Db::name("sale_info")->where([["orderCode",'=',$info['orderCode']],["num",">",0]])->select()
|
|
|
- ->toArray();
|
|
|
+ $sabebn =Db::name("sale_info")->where([["orderCode",'=',$info['orderCode']],["num",">",0]])->select()->toArray();
|
|
|
if($param['can_sell_num']!=0&& $param['can_sell_wsm']!=''){
|
|
|
if($sale['is_stock']==1){ //库存品退回原仓库 备库单释放数量 采购单
|
|
|
$param['can_sell_wsm'] = $out['wsm_code'];
|
|
@@ -738,9 +765,21 @@ class Orderback extends Base
|
|
|
}
|
|
|
|
|
|
$stn = ["order_code" => $param['thNo'], "status" => $info['status'], "action_remark" => '', "action_type" => "edit"];
|
|
|
- ActionLog::logAdd($this->post['token'], $stn, "CKTHD", $param['status'], $stn);
|
|
|
- $process = ["order_code" => $param['thNo'], "order_id" => $info['id'], "order_status" => $param['status'], "order_type" =>"CKTHD","before_status"=>$info['status']];
|
|
|
- ProcessOrder::AddProcess($this->post['token'], $process);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], $stn, "CKTHD", $param['status'], $stn);
|
|
|
+
|
|
|
+ if (in_array($param['status'], [2, 3])) {
|
|
|
+ if ($param['status'] == 2) $roleid = [10, 31, 41];//特殊处理,写入到10采购负责人、31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+ else $roleid = [31, 41];//特殊处理,写入到、31库管人员、41库管-张凯旋这三个角色下的所有人
|
|
|
+
|
|
|
+ $handle_user_list = Db::name('user_role')
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->whereIn('roleid', $roleid)
|
|
|
+ ->column('uid');
|
|
|
+ $process = ["order_code" => $param['thNo'], "order_id" => $info['id'], "order_status" => $param['status'], "order_type" => "CKTHD", "before_status" => $info['status'], 'handle_user_list' => implode(',', $handle_user_list)];
|
|
|
+
|
|
|
+ } else $process = ["order_code" => $param['thNo'], "order_id" => $info['id'], "order_status" => $param['status'], "order_type" => "CKTHD", "before_status" => $info['status']];
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], $process);
|
|
|
|
|
|
Db::commit();
|
|
|
return app_show(0, '操作成功');
|