|
@@ -481,6 +481,21 @@ class Goodup extends Base
|
|
|
return app_show(1004,"商品规格值创建失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$spucode,//咨询单详情编号
|
|
|
+ "status" => 0,//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB", 0,$data);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" => $spucode,//咨询单详情编号
|
|
|
+ "order_id" => Db::name("good_basic")->getLastInsID(),
|
|
|
+ "order_status" =>0
|
|
|
+ ]);
|
|
|
Db::commit();
|
|
|
return app_show(0,"创建成功",["spuCode"=>$spucode]);
|
|
|
|
|
@@ -719,6 +734,20 @@ class Goodup extends Base
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$supcode,//咨询单详情编号
|
|
|
+ "status" => $data['status'],//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB",$temp['status'] ,$data);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" => $supcode,//咨询单详情编号
|
|
|
+ "order_id" => $data['id'],
|
|
|
+ "order_status" =>$temp['status']
|
|
|
+ ]);
|
|
|
Db::commit();
|
|
|
return app_show(0,"更新成功");
|
|
|
}else{
|
|
@@ -794,6 +823,20 @@ class Goodup extends Base
|
|
|
$jsp = json_encode($datas,JSON_UNESCAPED_UNICODE);
|
|
|
if($up){
|
|
|
ChangeLog::logAdd(3,$datas['spuCode'],$jsp,$json,$this->post['token'],$this->post);
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$supcode,//咨询单详情编号
|
|
|
+ "status" => $datas['status'],//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB",$data['status'] ,$data);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" => $supcode,//咨询单详情编号
|
|
|
+ "order_id" => $datas['id'],
|
|
|
+ "order_status" =>$data['status']
|
|
|
+ ]);
|
|
|
$online = Db::name("good_platform")->where(["spuCode"=>$supcode,"is_del"=>0])->find();
|
|
|
if($online){
|
|
|
$onup = Db::name("good_platform")->where(["spuCode"=>$supcode,"is_del"=>0])->save
|
|
@@ -802,6 +845,20 @@ class Goodup extends Base
|
|
|
Db::rollback();
|
|
|
return app_show(1004,"商品规成本修改失败");
|
|
|
}
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$online['skuCode'],//咨询单详情编号
|
|
|
+ "status" => $online['exam_status'],//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPSX",2,["exam_status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPSX',
|
|
|
+ "order_code" => $online['skuCode'],//咨询单详情编号
|
|
|
+ "order_id" => $online['id'],
|
|
|
+ "order_status" =>2
|
|
|
+ ]);
|
|
|
}
|
|
|
if($good_ladder!=="" && !empty($good_ladder)){
|
|
|
|
|
@@ -886,10 +943,27 @@ class Goodup extends Base
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
if($data['status']==3 && $status==1){
|
|
|
- $online = Db::name("good_platform")->where(["spuCode"=>$supcode,"is_del"=>0])->save(["exam_status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
|
|
|
- if($online!=false){
|
|
|
- Db::rollback();
|
|
|
- return error_show(1004,"审核失败");
|
|
|
+ $online = Db::name("good_platform")->where(["spuCode"=>$supcode,"is_del"=>0])->find();
|
|
|
+ if($online) {
|
|
|
+ $onl= Db::name("good_platform")->where(["spuCode" => $supcode, "is_del" => 0])->save(["exam_status" => 2, "updatetime" => date("Y-m-d H:i:s")]);
|
|
|
+ if ($onl != false) {
|
|
|
+ Db::rollback();
|
|
|
+ return error_show(1004, "审核失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$online['skuCode'],//咨询单详情编号
|
|
|
+ "status" => $online['exam_status'],//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPSX", 2, ["exam_status" => 2, "updatetime" => date("Y-m-d H:i:s")]);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPSX',
|
|
|
+ "order_code" =>$online['skuCode'],//咨询单详情编号
|
|
|
+ "order_id" => $online['id'],
|
|
|
+ "order_status" => 2
|
|
|
+ ]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -904,6 +978,20 @@ class Goodup extends Base
|
|
|
$data['updatetime']=date("Y-m-d H:i:s");
|
|
|
$up= Db::name("good_basic")->save($data);
|
|
|
if($up){
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$supcode,//咨询单详情编号
|
|
|
+ "status" => $status,//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB",$data['status'] ,$data);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" => $supcode,//咨询单详情编号
|
|
|
+ "order_id" => $data['id'],
|
|
|
+ "order_status" =>$data['status']
|
|
|
+ ]);
|
|
|
$data=[
|
|
|
"code"=>$supcode,
|
|
|
"exam_status"=>$status,
|
|
@@ -1009,6 +1097,7 @@ class Goodup extends Base
|
|
|
}
|
|
|
$up= Db::name("good_basic")->where(["spuCode"=>$supcode,"is_del"=>0])->save(["is_del"=>1]);
|
|
|
if($up){
|
|
|
+ ProcessOrder::workdel(["order_type"=>"CGD","order_code"=>$supcode]);
|
|
|
return app_show(0,"更新成功");
|
|
|
}else{
|
|
|
return error_show(1005,"更新失败");
|
|
@@ -1050,111 +1139,156 @@ class Goodup extends Base
|
|
|
$data=[];
|
|
|
$isonline=[];
|
|
|
$i=0;
|
|
|
- foreach ($spuCode as $value){
|
|
|
- $count = Db::name("good_nake")->where(["spuCode"=>$value,"is_del"=>0])->count();
|
|
|
- $ist =Db::name("good_platform")->where(["spuCode"=>$value,"platform_code"=>$platform,"is_del"=>0])->find();
|
|
|
- if($ist){
|
|
|
- $god=Db::name("good_basic")->where(["spuCode"=>$value,"is_del"=>0])->find();
|
|
|
- if($god){
|
|
|
- $tp=[];
|
|
|
- $tp['spuCode']=$value;
|
|
|
- $tp['good_name']=$god['good_name'];
|
|
|
- $tp['good_img']=$god['good_thumb_img'];
|
|
|
- $tp['exam_status']=$ist['exam_status'];
|
|
|
- $spec = Db::name("good_spec")->where(["spuCode"=>$value,"is_del"=>0])->select()->toArray();
|
|
|
- $speclist=[];
|
|
|
- if(!empty($spec)){
|
|
|
- foreach ($spec as $val){
|
|
|
- $temp=[];
|
|
|
- $temp['id']=$val['id'];
|
|
|
- $temp['spuCode']=$val['spuCode'];
|
|
|
- $temp['spec_id']=$val['spec_id'];
|
|
|
- $temp['spec_value_id']=$val['spec_value_id'];
|
|
|
- $temp['is_del']=$val['is_del'];
|
|
|
- $sp = Db::name("specs")->where(["id"=>$val['spec_id']])->find();
|
|
|
- $temp['spec_name']=isset($sp["spec_name"]) ? $sp["spec_name"]:"";
|
|
|
- $spv = Db::name("spec_value")->where(["id"=>$val['spec_value_id']])->find();
|
|
|
- $temp['spec_value']=isset($spv["spec_value"]) ? $spv["spec_value"]:"";
|
|
|
- $speclist[]=$temp;
|
|
|
+ Db::startTrans();
|
|
|
+ try{
|
|
|
+ foreach ($datas as $value){
|
|
|
+ $count = Db::name("good_nake")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->count();
|
|
|
+ $ist =Db::name("good_platform")->where(["spuCode"=>$value['spuCode'],"platform_code"=>$platform,"is_del"=>0])->find();
|
|
|
+ if($ist){
|
|
|
+ $god=Db::name("good_basic")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->find();
|
|
|
+ if($god){
|
|
|
+ $tp=[];
|
|
|
+ $tp['spuCode']=$value['spuCode'];
|
|
|
+ $tp['good_name']=$god['good_name'];
|
|
|
+ $tp['good_img']=$god['good_thumb_img'];
|
|
|
+ $tp['exam_status']=$ist['exam_status'];
|
|
|
+ $spec = Db::name("good_spec")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->select()->toArray();
|
|
|
+ $speclist=[];
|
|
|
+ if(!empty($spec)){
|
|
|
+ foreach ($spec as $val){
|
|
|
+ $temp=[];
|
|
|
+ $temp['id']=$val['id'];
|
|
|
+ $temp['spuCode']=$val['spuCode'];
|
|
|
+ $temp['spec_id']=$val['spec_id'];
|
|
|
+ $temp['spec_value_id']=$val['spec_value_id'];
|
|
|
+ $temp['is_del']=$val['is_del'];
|
|
|
+ $sp = Db::name("specs")->where(["id"=>$val['spec_id']])->find();
|
|
|
+ $temp['spec_name']=isset($sp["spec_name"]) ? $sp["spec_name"]:"";
|
|
|
+ $spv = Db::name("spec_value")->where(["id"=>$val['spec_value_id']])->find();
|
|
|
+ $temp['spec_value']=isset($spv["spec_value"]) ? $spv["spec_value"]:"";
|
|
|
+ $speclist[]=$temp;
|
|
|
+ }
|
|
|
}
|
|
|
+ $tp["speclist"]=empty($speclist)?[]:$speclist;
|
|
|
+ $isonline[]=$tp;
|
|
|
}
|
|
|
- $tp["speclist"]=empty($speclist)?[]:$speclist;
|
|
|
- $isonline[]=$tp;
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+ if(!empty($isonline)){
|
|
|
+ return app_show(1009,"存在已上线产品",$isonline);
|
|
|
+ }
|
|
|
+ //改变编码规则,将原来的skuCode后两位换成序列号
|
|
|
+ //str_pad字符串填充
|
|
|
+ $skuCode = makeNo("SN");
|
|
|
+ $skuCode = substr($skuCode, 0, -2) . str_pad($i, 2, '0', STR_PAD_LEFT);
|
|
|
+ $tmp=[
|
|
|
+ "spuCode"=>$value['spuCode'],
|
|
|
+ "skuCode"=>$skuCode,
|
|
|
+ "platform_code"=>$platform,
|
|
|
+ "online_reason"=>$online_reason,
|
|
|
+ "online_remark"=>$online_remark,
|
|
|
+ "exam_status"=>$count>0 ?2:1,
|
|
|
+ "is_online"=>0,
|
|
|
+ "status"=>1,
|
|
|
+ "is_del"=>0,
|
|
|
+ "creater"=>$creater,
|
|
|
+ "createrid"=>$createrid,
|
|
|
+ "addtime"=>date("Y-m-d H:i:s"),
|
|
|
+ "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ $i++;
|
|
|
+ //修改状态,添加待办
|
|
|
+ $create =Db::name("good_platform")->insert($tmp,true);
|
|
|
+ if($create>0){
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$skuCode,//咨询单详情编号
|
|
|
+ "status" => $tmp['exam_status'],//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPSX",$tmp['exam_status'],$tmp);
|
|
|
|
|
|
- //改变编码规则,将原来的skuCode后两位换成序列号
|
|
|
- //str_pad字符串填充
|
|
|
- $skuCode = makeNo("SN");
|
|
|
- $skuCode = substr($skuCode, 0, -2) . str_pad($i, 2, '0', STR_PAD_LEFT);
|
|
|
- $data[]=[
|
|
|
- "spuCode"=>$value,
|
|
|
- "skuCode"=>$skuCode,
|
|
|
- "platform_code"=>$platform,
|
|
|
- "online_reason"=>$online_reason,
|
|
|
- "online_remark"=>$online_remark,
|
|
|
- "exam_status"=>$count>0 ?2:1,
|
|
|
- "is_online"=>0,
|
|
|
- "status"=>1,
|
|
|
- "is_del"=>0,
|
|
|
- "creater"=>$creater,
|
|
|
- "createrid"=>$createrid,
|
|
|
- "addtime"=>date("Y-m-d H:i:s"),
|
|
|
- "updatetime"=>date("Y-m-d H:i:s")
|
|
|
- ];
|
|
|
- $i++;
|
|
|
- }
|
|
|
- if(!empty($isonline)){
|
|
|
- return app_show(1009,"存在已上线产品",$isonline);
|
|
|
- }
|
|
|
- Db::startTrans();
|
|
|
- $create =Db::name("good_platform")->insertAll($data);
|
|
|
- if($create){
|
|
|
- foreach ($datas as $value){
|
|
|
- $iso = Db::name("good")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->find();
|
|
|
- if($iso==false){
|
|
|
- unset($value['id']);
|
|
|
- $value['creater']=$creater;
|
|
|
- $value['createrid']=$createrid;
|
|
|
- $value['addtime']=date("Y-m-d H:i:s");
|
|
|
- $value['updatetime']=date("Y-m-d H:i:s");
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" =>$skuCode,//咨询单详情编号
|
|
|
+ "order_id" => $create,
|
|
|
+ "order_status" =>$tmp['exam_status']
|
|
|
+ ]);
|
|
|
+ $iso = Db::name("good")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->find();
|
|
|
+ if($iso==false){
|
|
|
+ unset($value['id']);
|
|
|
+ $value['creater']=$creater;
|
|
|
+ $value['createrid']=$createrid;
|
|
|
+ $value['addtime']=date("Y-m-d H:i:s");
|
|
|
+ $value['updatetime']=date("Y-m-d H:i:s");
|
|
|
+ }else{
|
|
|
+ $value['id']=$iso['id'];
|
|
|
+ $value['creater']=$creater;
|
|
|
+ $value['createrid']=$createrid;
|
|
|
+ $value['updatetime']=date("Y-m-d H:i:s");
|
|
|
+ }
|
|
|
+ $up =Db::name("good")->save($value);
|
|
|
+ if(!$up){
|
|
|
+ Db::rollback();
|
|
|
+ return error_show(1004,"提交失败");
|
|
|
+ }
|
|
|
}else{
|
|
|
- $value['id']=$iso['id'];
|
|
|
- $value['creater']=$creater;
|
|
|
- $value['createrid']=$createrid;
|
|
|
- $value['updatetime']=date("Y-m-d H:i:s");
|
|
|
- }
|
|
|
- $up =Db::name("good")->save($value);
|
|
|
- if(!$up){
|
|
|
Db::rollback();
|
|
|
return error_show(1004,"提交失败");
|
|
|
}
|
|
|
-
|
|
|
- //添加审核记录
|
|
|
- //修改状态,添加待办
|
|
|
- $skuCodes = array_column($data, 'skuCode', 'spuCode');
|
|
|
-
|
|
|
- ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_code" => $skuCodes[$value['spuCode']],//编号
|
|
|
- "status" => 2,//待产品审核
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX", $value['status'], $value);
|
|
|
-
|
|
|
- ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_type" => 'SPSX',
|
|
|
- "order_code" => $skuCodes[$value['spuCode']],//咨询单详情编号
|
|
|
- "order_id" => isset($value['id']) ? $value['id'] : 0,
|
|
|
- "order_status" => 2,//待产品审核
|
|
|
- ]);
|
|
|
}
|
|
|
+
|
|
|
+// if($create){
|
|
|
+// foreach ($datas as $value){
|
|
|
+// $iso = Db::name("good")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->find();
|
|
|
+// if($iso==false){
|
|
|
+// unset($value['id']);
|
|
|
+// $value['creater']=$creater;
|
|
|
+// $value['createrid']=$createrid;
|
|
|
+// $value['addtime']=date("Y-m-d H:i:s");
|
|
|
+// $value['updatetime']=date("Y-m-d H:i:s");
|
|
|
+// }else{
|
|
|
+// $value['id']=$iso['id'];
|
|
|
+// $value['creater']=$creater;
|
|
|
+// $value['createrid']=$createrid;
|
|
|
+// $value['updatetime']=date("Y-m-d H:i:s");
|
|
|
+// }
|
|
|
+// $up =Db::name("good")->save($value);
|
|
|
+// if(!$up){
|
|
|
+// Db::rollback();
|
|
|
+// return error_show(1004,"提交失败");
|
|
|
+// }
|
|
|
+//
|
|
|
+// //添加审核记录
|
|
|
+// //修改状态,添加待办
|
|
|
+// $skuCodes = array_column($data, 'skuCode', 'spuCode');
|
|
|
+//
|
|
|
+// ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
+// "order_code" => $skuCodes[$value['spuCode']],//编号
|
|
|
+// "status" => 2,//待产品审核
|
|
|
+// "action_remark" => '',//备注
|
|
|
+// "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
+// ], "SPSX", $value['status'], $value);
|
|
|
+//
|
|
|
+// ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
+// "order_type" => 'SPSX',
|
|
|
+// "order_code" => $skuCodes[$value['spuCode']],//咨询单详情编号
|
|
|
+// "order_id" => isset($value['id']) ? $value['id'] : 0,
|
|
|
+// "order_status" => 2,//待产品审核
|
|
|
+// ]);
|
|
|
+// }
|
|
|
+// Db::commit();
|
|
|
+// return app_show(0,"提交成功");
|
|
|
+// }else{
|
|
|
+// Db::rollback();
|
|
|
+// return error_show(1004,"提交失败");
|
|
|
+// }
|
|
|
Db::commit();
|
|
|
return app_show(0,"提交成功");
|
|
|
- }else{
|
|
|
+ }catch (\Exception $e){
|
|
|
Db::rollback();
|
|
|
- return error_show(1004,"提交失败");
|
|
|
+ return error_show(1004,$e->getMessage()."|".$e->getLine());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//审核
|
|
@@ -1192,6 +1326,7 @@ class Goodup extends Base
|
|
|
|
|
|
}
|
|
|
$exam_remark = isset($this->post['exam_remark'])&&$this->post['exam_remark']!==""?trim($this->post['exam_remark']):"";
|
|
|
+ $bifore=$platform['exam_status'];
|
|
|
$platform['exam_status']=$exam_status;
|
|
|
$platform['updatetime']=date("Y-m-d H:i:s");
|
|
|
$token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
|
|
@@ -1222,7 +1357,7 @@ class Goodup extends Base
|
|
|
|
|
|
ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
"order_code" => $skuCode,//编号
|
|
|
- "status" => $exam_status,
|
|
|
+ "status" => $bifore,
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "status"//新建create,编辑edit,更改状态status
|
|
|
], "SPSX", $exam_status, $platform);
|
|
@@ -1283,6 +1418,7 @@ class Goodup extends Base
|
|
|
}
|
|
|
$createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
$creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+ $bifore=$platform['exam_status'];
|
|
|
$platform['exam_status']=4;
|
|
|
$platform['updatetime']=date("Y-m-d H:i:s");
|
|
|
Db::startTrans();
|
|
@@ -1309,6 +1445,19 @@ class Goodup extends Base
|
|
|
}
|
|
|
$up = Db::name("good_platform")->save($platform);
|
|
|
if($up){
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
+ "status" =>$bifore,//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPSX", $platform['exam_status'],$platform);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPSX',
|
|
|
+ "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
+ "order_id" => $platform['id'],
|
|
|
+ "order_status" => $platform['exam_status']
|
|
|
+ ]);
|
|
|
$proof=[
|
|
|
'spuCode'=>$platform['spuCode'],
|
|
|
'proof_type'=>$proof_type,
|
|
@@ -1335,22 +1484,6 @@ class Goodup extends Base
|
|
|
];
|
|
|
$inr=Db::name("good_exam")->insert($data);
|
|
|
if($inr){
|
|
|
-
|
|
|
- //修改状态,添加待办
|
|
|
- ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_code" => $skuCode,
|
|
|
- "status" => 4,//待财务审核定价
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "status"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX", 4, $value);
|
|
|
-
|
|
|
- ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_type" => 'SPSX',
|
|
|
- "order_code" => $skuCode,
|
|
|
- "order_id" => $platform['id'],
|
|
|
- "order_status" => 4,//待财务审核定价
|
|
|
- ]);
|
|
|
-
|
|
|
Db::commit();
|
|
|
return app_show(0,"审核成功");
|
|
|
}else{
|
|
@@ -1399,6 +1532,7 @@ class Goodup extends Base
|
|
|
return error_show(1004,"商品状态有误");
|
|
|
}
|
|
|
$nake =Db::name("good_nake")->where(["spuCode"=>$platform['spuCode'],"is_del"=>0])->select()->toArray();
|
|
|
+ $bifore=$platform['exam_status'];
|
|
|
$platform['exam_status'] = empty($nake)?1:2;
|
|
|
$platform['updatetime'] = date("Y-m-d H:i:s");
|
|
|
$token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
|
|
@@ -1415,6 +1549,18 @@ class Goodup extends Base
|
|
|
try {
|
|
|
$save =Db::name("good_platform")->save($platform);
|
|
|
if($save){
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
+ "status" =>$bifore,//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPSX", $platform['exam_status'],$platform);
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPSX',
|
|
|
+ "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
+ "order_id" => $platform['id'],
|
|
|
+ "order_status" => $platform['exam_status']
|
|
|
+ ]);
|
|
|
$data=[
|
|
|
"code"=>$platform['skuCode'],
|
|
|
"type"=>2,
|
|
@@ -1506,6 +1652,20 @@ class Goodup extends Base
|
|
|
$data['updatetime']=date("Y-m-d H:i:s");
|
|
|
$cre = Db::name("good_basic")->insert($data);
|
|
|
if($cre){
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$newCode,//咨询单详情编号
|
|
|
+ "status" => 0,//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB", 7,$data);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" =>$newCode,//咨询单详情编号
|
|
|
+ "order_id" => Db::name("good_basic")->getLastInsID(),
|
|
|
+ "order_status" =>7
|
|
|
+ ]);
|
|
|
if(!empty($ladd)){
|
|
|
$na = Db::name("good_nake")->insertAll($ladd);
|
|
|
if($na==0){
|
|
@@ -1780,6 +1940,20 @@ class Goodup extends Base
|
|
|
$dat = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
|
if($up){
|
|
|
ChangeLog::logAdd(3,$data['spuCode'],$dat,$json,$this->post['token'],$this->post);
|
|
|
+ //修改状态,添加待办
|
|
|
+ ActionLog::logAdd($this->post['token'], [
|
|
|
+ "order_code" =>$supcode,//咨询单详情编号
|
|
|
+ "status" => $data['status'],//这里的status是之前的值
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB", 0,$temp);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess($this->post['token'], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" =>$supcode,//咨询单详情编号
|
|
|
+ "order_id" => $data['id'],
|
|
|
+ "order_status" =>0
|
|
|
+ ]);
|
|
|
if($speclist!=="" && !empty($speclist)){
|
|
|
foreach ($speclist as $value){
|
|
|
$lemp=[];
|
|
@@ -2188,24 +2362,36 @@ class Goodup extends Base
|
|
|
if (!empty($good_spec_insert_data)) Db::name('good_spec')->insertAll($good_spec_insert_data);
|
|
|
|
|
|
if ($create) {
|
|
|
- foreach ($good_zixun_list as $value) {
|
|
|
+ foreach ($good_basic_insert_data as $value) {
|
|
|
|
|
|
- //添加审核记录
|
|
|
- //修改状态,添加待办
|
|
|
- $skuCodes = array_column($data, 'skuCode', 'spuCode');
|
|
|
+ ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
+ "order_code" =>$value['spuCode'],//
|
|
|
+ "status" => 8,//待产品审核
|
|
|
+ "action_remark" => '',//备注
|
|
|
+ "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
+ ], "SPCB", $value['status'], $value);
|
|
|
+
|
|
|
+ ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
+ "order_type" => 'SPCB',
|
|
|
+ "order_code" =>$value['spuCode'],//
|
|
|
+ "order_id" => isset($value['id']) ? $value['id'] : 0,
|
|
|
+ "order_status" => 8,//待产品审核
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ foreach ($data as $value) {
|
|
|
|
|
|
ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_code" => $skuCodes[$value['spuCode']],//
|
|
|
- "status" => 2,//待产品审核
|
|
|
+ "order_code" =>$value['skuCode'],//
|
|
|
+ "status" => 0,//待产品审核
|
|
|
"action_remark" => '',//备注
|
|
|
"action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX", $value['status'], $value);
|
|
|
+ ], "SPSX", $value['exam_status'], $value);
|
|
|
|
|
|
ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
"order_type" => 'SPSX',
|
|
|
- "order_code" => $skuCodes[$value['spuCode']],//
|
|
|
+ "order_code" =>$value['skuCode'],//
|
|
|
"order_id" => isset($value['id']) ? $value['id'] : 0,
|
|
|
- "order_status" => 2,//待产品审核
|
|
|
+ "order_status" =>$value['exam_status'],//待产品审核
|
|
|
]);
|
|
|
}
|
|
|
Db::commit();
|