|
@@ -101,12 +101,12 @@ class After extends Base
|
|
|
if($token==''){
|
|
|
return error_show(105,"参数token不能为空");
|
|
|
}
|
|
|
- $user =GetUserInfo($token);
|
|
|
- if(empty($user)||$user['code']!=0){
|
|
|
- return error_show(102,"申请人数据不存在");
|
|
|
- }
|
|
|
- $rm= isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
- $ri= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+// $user =GetUserInfo($token);
|
|
|
+// if(empty($user)||$user['code']!=0){
|
|
|
+// return error_show(102,"申请人数据不存在");
|
|
|
+// }
|
|
|
+ $rm = $this->uid;//isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
+ $ri = $this->uname;//isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
$returnCode=makeNo("RS");
|
|
|
Db::startTrans();
|
|
|
try{
|
|
@@ -140,7 +140,7 @@ class After extends Base
|
|
|
];
|
|
|
$create = Db::name("order_return")->insert($in,true);
|
|
|
$orde = ["order_code"=>$returnCode,"status"=>$in['status'],"action_remark"=>'',"action_type"=>"create"];
|
|
|
- ActionLog::logAdd($this->post['token'],$orde,'SHD',1,$orde);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$orde,'SHD',1,$orde);
|
|
|
if($create>0){
|
|
|
|
|
|
//维护台账
|
|
@@ -153,7 +153,15 @@ class After extends Base
|
|
|
|
|
|
Db::execute("UPDATE `wsm_standing_book` SET `returnCode`=CONCAT(IFNULL(`returnCode`,''),',{$returnCode}'),`updatetime`='" . date('Y-m-d H:i:s') . "' WHERE FIND_IN_SET('{$outCode}',`outCode`)");
|
|
|
|
|
|
- $process = ["order_code" => $returnCode, "order_id" => $create, "order_status" => $in['status'], "order_type" => 'SHD', "before_status" => 1,'holder_id'=>$in['apply_id']];
|
|
|
+ //当状态为1(即待业务审核)时,要将待办数据推给销售主管,即角色为'客服负责人'的用户
|
|
|
+ $user = Db::name('user_role')
|
|
|
+ ->where([
|
|
|
+ ['is_del', '=', 0],
|
|
|
+ ['roleid', 'in', [12, 13, 17, 28]],//12客服负责人,13项目负责人,17平台负责人,28网络负责人
|
|
|
+ ['status', '=', 1],
|
|
|
+ ])->column('uid');
|
|
|
+
|
|
|
+ $process = ["order_code" => $returnCode, "order_id" => $create, "order_status" => $in['status'], "order_type" => 'SHD', "before_status" => 0, 'handle_user_list'=>implode($user)];
|
|
|
ProcessOrder::AddProcess($token,$process);
|
|
|
Db::commit();
|
|
|
return app_show(0,"售后申请单新建成功",["returnCode"=>$returnCode]);
|
|
@@ -396,9 +404,9 @@ class After extends Base
|
|
|
return error_show(1004,"发货单更新失败");
|
|
|
}
|
|
|
$order = ["order_code"=>$orde['outCode'],"status"=>$od_status,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$order,"CKD", $orde['status'],$this->post);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$order,"CKD", $orde['status'],$this->post);
|
|
|
$process=["order_code"=>$orde['outCode'],"order_id"=>$orde['id'],"order_status"=>$orde['status'],"order_type"=>"CKD","before_status"=>$od_status];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|
|
|
$sale['th_num'] += $info['error_num'];
|
|
|
$sale['th_fee'] += round($info['error_num']*$sale['sale_price'],2);
|
|
|
$sale['updatetime']=date("Y-m-d H:i:s");
|
|
@@ -429,13 +437,33 @@ class After extends Base
|
|
|
}
|
|
|
}
|
|
|
$order = ["order_code"=>$info['returnCode'],"status"=>$var,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$order,"SHD", $info['status'],$this->post);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$order,"SHD", $info['status'],$this->post);
|
|
|
|
|
|
- if (in_array($status, [2, 3])) $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['cgderid'], 'wait_name' => $info['cgder'],'holder_id'=>$info['cgderid']];
|
|
|
- elseif ($status == 4) $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['apply_id'], 'wait_name' => $info['apply_name'],'holder_id'=>$info['apply_id']];
|
|
|
- else $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var,'holder_id'=>$info['apply_id']];
|
|
|
+// switch ($status) {
|
|
|
+// //待采购审核
|
|
|
+// case 2:
|
|
|
+// $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['person_id'], 'wait_name' => $info['person'], 'holder_id' => $info['person_id']];
|
|
|
+// break;
|
|
|
+//
|
|
|
+// //待设置仓库
|
|
|
+// case 3:
|
|
|
+// $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['cgderid'], 'wait_name' => $info['cgder'], 'holder_id' => $info['cgderid']];
|
|
|
+// break;
|
|
|
+//
|
|
|
+// //待客户退货
|
|
|
+// case 4:
|
|
|
+// $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['apply_id'], 'wait_name' => $info['apply_name'], 'holder_id' => $info['apply_id']];
|
|
|
+// break;
|
|
|
+//
|
|
|
+// default:
|
|
|
+// $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'holder_id' => $info['apply_id']];
|
|
|
+// }
|
|
|
+// if (in_array($status, [2, 3])) $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['cgderid'], 'wait_name' => $info['cgder'],'holder_id'=>$info['cgderid']];
|
|
|
+// elseif ($status == 4) $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['apply_id'], 'wait_name' => $info['apply_name'],'holder_id'=>$info['apply_id']];
|
|
|
+// else $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var,'holder_id'=>$info['apply_id']];
|
|
|
+ $process = ["order_code" => $info['returnCode'], "order_id" => $info['id'], "order_status" => $status, "order_type" => "SHD", "before_status" => $var, 'wait_id' => $info['person_id'], 'wait_name' => $info['person'], 'holder_id' => $info['person_id']];
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|
|
|
Db::commit();
|
|
|
return app_show(0,"更新成功");
|
|
|
}else{
|
|
@@ -527,14 +555,14 @@ class After extends Base
|
|
|
if($up){
|
|
|
|
|
|
//修改状态,添加待办
|
|
|
- ActionLog::logAdd($this->post['token'], [
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_code" => $info['returnCode'],//销售单code
|
|
|
"status" => $old_info_status,//这里的status是之前的值
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "status"//新建create,编辑edit,更改状态status
|
|
|
], "SHD", $info['status'], $info);
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_type" => 'SHD',
|
|
|
"order_code" => $info['returnCode'],//销售单code
|
|
|
"order_id" => $info['id'],
|
|
@@ -655,9 +683,9 @@ class After extends Base
|
|
|
$in=Db::name("order_returninfo")->save($returninfo);
|
|
|
if($in){
|
|
|
$order = ["order_code"=>$info['returnCode'],"status"=>$var,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$order,"SHD",$info['status'],$this->post);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$order,"SHD",$info['status'],$this->post);
|
|
|
$process=["order_code"=>$info['returnCode'],"order_id"=>$info['id'],"order_status"=>$info['status'],"order_type"=>"SHD","before_status"=>$var,'holder_id'=>$info['apply_id']];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|
|
|
Db::commit();
|
|
|
return app_show(0,"更新成功");
|
|
|
}
|
|
@@ -729,9 +757,9 @@ class After extends Base
|
|
|
$up =Db::name("order_return")->save($info);
|
|
|
if($up){
|
|
|
$order = ["order_code"=>$info['orderCode'],"status"=>$str,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$order,"SHD",$info['status'],$this->post);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$order,"SHD",$info['status'],$this->post);
|
|
|
$process=["order_code"=>$info['returnCode'],"order_id"=>$info['id'],"order_status"=>$info['status'],"order_type"=>"SHD","before_status"=>$str,'holder_id'=>$info['apply_id']];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|
|
|
$in=Db::name("order_returninfo")->save($return_info);
|
|
|
if($in){
|
|
|
$data=[
|
|
@@ -772,9 +800,9 @@ class After extends Base
|
|
|
|
|
|
|
|
|
$order = ["order_code"=>$data['thNo'],"status"=>0,"action_remark"=>'',"action_type"=>"create"];
|
|
|
- ActionLog::logAdd($this->post['token'],$order,"CKTHD", 0,$data);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$order,"CKTHD", 0,$data);
|
|
|
$process=["order_code"=>$data['thNo'],"order_id"=>$back,"order_status"=>0,"order_type"=>"CKTHD","before_status"=>0];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|
|
|
Db::commit();
|
|
|
return app_show(0,"更新成功");
|
|
|
}
|
|
@@ -867,9 +895,9 @@ class After extends Base
|
|
|
$in=Db::name("order_returninfo")->save($returninfo);
|
|
|
if($in){
|
|
|
$order = ["order_code"=>$info['returnCode'],"status"=>$stat,"action_remark"=>'',"action_type"=>"edit"];
|
|
|
- ActionLog::logAdd($this->post['token'],$order,"SHD", $info['status'],$this->post);
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname],$order,"SHD", $info['status'],$this->post);
|
|
|
$process=["order_code"=>$info['returnCode'],"order_id"=>$info['id'],"order_status"=>$info['status'],"SHD","before_status"=>$stat,'holder_id'=>$info['apply_id']];
|
|
|
- ProcessOrder::AddProcess($this->post['token'],$process);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname],$process);
|
|
|
Db::commit();
|
|
|
return app_show(0,"更新成功");
|
|
|
}
|
|
@@ -1022,14 +1050,14 @@ class After extends Base
|
|
|
if($ro){
|
|
|
|
|
|
//修改状态,添加待办
|
|
|
- ActionLog::logAdd($this->post['token'], [
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_code" => $info['returnCode'],//销售单code
|
|
|
"status" => $old_info_status,//这里的status是之前的值
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "status"//新建create,编辑edit,更改状态status
|
|
|
], "SHD", $info['status'], $this->post);
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_type" => 'SHD',
|
|
|
"order_code" => $info['returnCode'],//销售单code
|
|
|
"order_id" => $info['id'],
|
|
@@ -1078,19 +1106,42 @@ class After extends Base
|
|
|
if($sav){
|
|
|
|
|
|
//修改状态,添加待办
|
|
|
- ActionLog::logAdd($this->post['token'], [
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_code" => $thdata['thNo'],//销售单code
|
|
|
"status" => $thdata['status'],//这里的status是之前的值
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
], "CKTHD", $thdata['status'], $thdata);
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'], [
|
|
|
- "order_type" => 'CKTHD',
|
|
|
- "order_code" => $thdata['thNo'],//销售单code
|
|
|
- "order_id" => $sav,
|
|
|
- "order_status" => $thdata['status'],"before_status"=>1
|
|
|
- ]);
|
|
|
+
|
|
|
+ //售后退货单,供应商不同意退货,退回到业务公司仓的时候,要把待办数据推给供应商负责人和库管人员
|
|
|
+ if($thdata['status']==1){
|
|
|
+
|
|
|
+ //31库管人员,41库管-张凯旋
|
|
|
+ $uids = Db::name('user_role')
|
|
|
+ ->where(['is_del' => 0, 'roleid' => [31, 41], 'status' => 1])
|
|
|
+ ->column('uid');
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
|
|
|
+ "order_type" => 'CKTHD',
|
|
|
+ "order_code" => $thdata['thNo'],//销售单code
|
|
|
+ "order_id" => $sav,
|
|
|
+ "order_status" => $thdata['status'],
|
|
|
+ "before_status" => 0,
|
|
|
+ 'handle_user_list' => implode(',', array_merge($uids,[$sale['cgderid']])),
|
|
|
+ ]);
|
|
|
+ }else{
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
+ "order_type" => 'CKTHD',
|
|
|
+ "order_code" => $thdata['thNo'],//销售单code
|
|
|
+ "order_id" => $sav,
|
|
|
+ "order_status" => $thdata['status'],
|
|
|
+ "before_status"=>0
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//维护台账记录
|
|
|
// Db::name('standing_book')
|
|
@@ -1287,7 +1338,7 @@ class After extends Base
|
|
|
|
|
|
//记录日志
|
|
|
ActionLog::logAdd($data['token'], ["order_code" => $data['returnCode'], "status" => $rs['status'], "action_remark" => '', "action_type" => "delete"], 'SHD', 8, $this->post);
|
|
|
- ProcessOrder::AddProcess($this->post['token'], ["order_code" => $data['returnCode'], "order_id" => $rs['id'], "order_status" => 8, "order_type" => 'SHD',"before_status"=>$rs['status'],'holder_id'=>$rs['apply_id']]);
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], ["order_code" => $data['returnCode'], "order_id" => $rs['id'], "order_status" => 8, "order_type" => 'SHD',"before_status"=>$rs['status'],'holder_id'=>$rs['apply_id']]);
|
|
|
|
|
|
//提交
|
|
|
Db::commit();
|
|
@@ -1557,14 +1608,14 @@ class After extends Base
|
|
|
];
|
|
|
|
|
|
//修改状态,添加待办
|
|
|
- ActionLog::logAdd($this->post['token'], [
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_code" => $orderCode,//销售单code
|
|
|
"status" => 0,//这里的status是之前的值
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
], "XSQRD", $data['status'], $data);
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_type" => 'XSQRD',
|
|
|
"order_code" => $orderCode,//销售单code
|
|
|
"order_id" => $datainfo,
|
|
@@ -1581,7 +1632,7 @@ class After extends Base
|
|
|
// return error_show(1002,"咨询单修改失败");
|
|
|
// }else{
|
|
|
// //修改状态,添加待办
|
|
|
-// ActionLog::logAdd($this->post['token'], [
|
|
|
+// ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
// "order_code" => $zx['infoNo'],//咨询单详情编号
|
|
|
// "status" => $old_zx_status,//这里的status是之前的值
|
|
|
// "action_remark" => '',//备注
|
|
@@ -1714,14 +1765,14 @@ class After extends Base
|
|
|
if ($ou == false) throw new Exception('发货地址添加创建失败');
|
|
|
else {
|
|
|
//修改状态,添加待办
|
|
|
- ActionLog::logAdd($this->post['token'], [
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_code" => $outCode,//出库单号
|
|
|
"status" => 0,//这里的status是之前的值
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
], "CKD", 0, $out);
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_type" => 'CKD',
|
|
|
"order_code" => $outCode,//出库单号
|
|
|
"order_id" => Db::name("order_out")->getLastInsID(),
|
|
@@ -1863,14 +1914,14 @@ class After extends Base
|
|
|
$up =Db::name("purchease_order")->insertGetId($cg);
|
|
|
if($up){
|
|
|
//修改状态,添加待办
|
|
|
- ActionLog::logAdd($this->post['token'], [
|
|
|
+ ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_code" => $cg['cgdNo'],//销售单code
|
|
|
"status" => 0,//这里的status是之前的值
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
], "CGD", $cg['status'], $cg);
|
|
|
|
|
|
- ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
"order_type" => 'CGD',
|
|
|
"order_code" => $cg['cgdNo'],//销售单code
|
|
|
"order_id" => $up,
|