|
@@ -1049,7 +1049,7 @@ class Goodup extends Base
|
|
|
$json = json_encode($timp,JSON_UNESCAPED_UNICODE);
|
|
|
$jsp = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
|
if($up){
|
|
|
- ChangeLog::logAdd(3,$data['spuCode'],$jsp,$json,$this->post['token'],$this->post);
|
|
|
+ ChangeLog::logAdd(3,$data['spuCode'],$jsp,$json,['id' => $this->uid, 'nickname' => $this->uname]);
|
|
|
if($speclist!=="" && !empty($speclist)){
|
|
|
foreach ($speclist as $value){
|
|
|
$lemp=[];
|
|
@@ -1162,23 +1162,23 @@ class Goodup extends Base
|
|
|
$json = json_encode($temp,JSON_UNESCAPED_UNICODE);
|
|
|
$jsp = json_encode($datas,JSON_UNESCAPED_UNICODE);
|
|
|
if($up){
|
|
|
- ChangeLog::logAdd(3,$datas['spuCode'],$jsp,$json,$this->post['token'],$this->post);
|
|
|
+ ChangeLog::logAdd(3,$datas['spuCode'],$jsp,$json,['id' => $this->uid, 'nickname' => $this->uname]);
|
|
|
//修改状态,添加待办
|
|
|
- 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'],
|
|
|
- "before_status"=>$datas['status'],
|
|
|
- 'holder_id'=>$datas['createrid'],
|
|
|
- ]);
|
|
|
+// 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'],
|
|
|
+// "before_status"=>$datas['status'],
|
|
|
+// 'holder_id'=>$datas['createrid'],
|
|
|
+// ]);
|
|
|
// $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
|
|
@@ -1282,12 +1282,9 @@ class Goodup extends Base
|
|
|
if($token==''){
|
|
|
return error_show(105,"参数token不能为空");
|
|
|
}
|
|
|
- $user =GetUserInfo($token);
|
|
|
- if(empty($user)||$user['code']!=0){
|
|
|
- return error_show(1002,"用户数据不存在");
|
|
|
- }
|
|
|
- $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
- $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+
|
|
|
+ $createrid=$this->uid;
|
|
|
+ $creater= $this->uname;
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
if($data['status']==3 && $status==1){
|
|
@@ -1455,7 +1452,6 @@ class Goodup extends Base
|
|
|
//删除商品成本
|
|
|
public function delall()
|
|
|
{
|
|
|
-// $supcode = isset($this->post['codes'])&&!empty($this->post['codes'])? $this->post['codes']:"";
|
|
|
$supcode = $this->request->post('codes', '', 'trim');
|
|
|
if ($supcode == "") {
|
|
|
return error_show(1004, "参数codes不能为空");
|
|
@@ -1630,25 +1626,9 @@ class Goodup extends Base
|
|
|
//修改状态,添加待办
|
|
|
$create =Db::name("good_platform")->insert($tmp,true);
|
|
|
if($create>0){
|
|
|
- ActionLog::logAdd(['id'=>$createrid,'nickname'=>$creater], [
|
|
|
- "order_code" =>$skuCode,//咨询单详情编号
|
|
|
- "status" => $tmp['exam_status'],//这里的status是之前的值
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "create"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX",$tmp['exam_status'],$tmp);
|
|
|
-
|
|
|
- ProcessOrder::AddProcess(['id'=>$createrid,'nickname'=>$creater], [
|
|
|
- "order_type" => 'SPSX',
|
|
|
- "order_code" =>$skuCode,//咨询单详情编号
|
|
|
- "order_id" => $create,
|
|
|
- "order_status" =>$tmp['exam_status'],
|
|
|
- "before_status"=>$tmp['exam_status'],
|
|
|
- 'holder_id' => $tmp['createrid'],
|
|
|
- ]);
|
|
|
$iso = Db::name("good")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->find();
|
|
|
if($iso==false){
|
|
|
unset($value['id']);
|
|
|
-
|
|
|
$value['addtime']=date("Y-m-d H:i:s");
|
|
|
$value['updatetime']=date("Y-m-d H:i:s");
|
|
|
}else{
|
|
@@ -1665,52 +1645,6 @@ class Goodup extends Base
|
|
|
return error_show(1004,"提交失败");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// 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,"提交成功");
|
|
|
}catch (\Exception $e){
|
|
@@ -1722,110 +1656,79 @@ class Goodup extends Base
|
|
|
|
|
|
//审核
|
|
|
public function online_exam(){
|
|
|
- $skuCode = isset($this->post['skuCode'])&&$this->post['skuCode']!==""?trim($this->post['skuCode']):"";
|
|
|
- if($skuCode===""){
|
|
|
- return error_show(1004,"参数skuCode不能为空");
|
|
|
- }
|
|
|
- $platform = Db::name("good_platform")->where(["skuCode"=>$skuCode,"is_del"=>0])->find();
|
|
|
+ $post =$this->request->only([
|
|
|
+ "skuCode"=>"", //商品成本编号
|
|
|
+ "exam_status"=>"", //审核状态 1 提交待完善成本 2待审核 3上线完成 4 审核驳回 5 下线完成
|
|
|
+ "offline_reason"=>"", //下线原因
|
|
|
+ "offline_remark"=>"", //下线备注
|
|
|
+ "plat_code"=>"", //平台订单号
|
|
|
+ 'exam_remark'=>"", //审核备注
|
|
|
+ 'good_ladder'=>[], //售价阶梯
|
|
|
+ 'proof_type'=>"", // 售价凭证类型
|
|
|
+ 'proof_url'=>"", // 售价凭证
|
|
|
+ ],"post","trim");
|
|
|
+ $valide = Validate::rule([
|
|
|
+ "shuCode|商品编号"=>"require|max:255",
|
|
|
+ "exam_status|审核状态"=>"require|number|in:0,1,2,3,4,5",
|
|
|
+ "offline_reason|线下原因"=>"requireIf:exam_status,5|max:255",
|
|
|
+ "offline_remark|下线备注"=>"requireIf:exam_status,5|max:255",
|
|
|
+ "plat_code|平台商品编码"=>"requireIf:exam_status,3|max:255",
|
|
|
+ 'exam_remark|审核备注'=>"max:255",
|
|
|
+ 'good_ladder|售价阶梯'=>"requireIf:exam_status,3|array",
|
|
|
+ 'proof_type|售价凭证类型'=>"requireIf:exam_status,3|number|gt:0",
|
|
|
+ 'proof_url|售价凭证'=>"requireIf:exam_status,3|url",
|
|
|
+ ]);
|
|
|
+ if($valide->check($post)==false) return error_show(1004,$valide->getError());
|
|
|
+
|
|
|
+ $platform = Db::name("good_platform")->where(["skuCode"=>$post['skuCode'],"is_del"=>0])->find();
|
|
|
if($platform==false){
|
|
|
return error_show(1004,"未找到数据");
|
|
|
}
|
|
|
- $exam_status=isset($this->post['exam_status'])&&$this->post['exam_status']!==""?intval($this->post['exam_status']):"";
|
|
|
-// if($exam_status===""){
|
|
|
-// return error_show(1004,"参数exam_status不能为空");
|
|
|
-// }
|
|
|
-
|
|
|
- //下线
|
|
|
- if ($exam_status == 8) {
|
|
|
- $offline_reason = isset($this->post['offline_reason']) && $this->post['offline_reason'] !== "" ? trim($this->post['offline_reason']) : "";
|
|
|
- if ($offline_reason == '') return error_show(1005, '商品下线时下线原因必填');
|
|
|
- $offline_remark = isset($this->post['offline_remark']) && $this->post['offline_remark'] !== "" ? trim($this->post['offline_remark']) : "";
|
|
|
- }
|
|
|
- if($exam_status==3){
|
|
|
- $online_time= isset($this->post['online_time'])&&$this->post['online_time']!==""?$this->post['online_time']:"";
|
|
|
- if($online_time===""){
|
|
|
- return error_show(1004,"参数online_time不能为空");
|
|
|
- }
|
|
|
- $platform['online_time']=$online_time;
|
|
|
- }
|
|
|
- if($exam_status==6){
|
|
|
+ if($post['exam_status']==3){
|
|
|
|
|
|
- $good_code= isset($this->post['plat_code'])&&$this->post['plat_code']!==""?trim($this->post['plat_code']):"";
|
|
|
- if($good_code===""){
|
|
|
- return error_show(1004,"参数plat_code不能为空");
|
|
|
- }
|
|
|
-// $issale=Db::name("sale")->where(["skuCode"=>$platform['skuCode'],"status"=>[0,1,2]])->find();
|
|
|
-// if($issale!=false &&$platform['plat_code']!=$good_code){
|
|
|
-// return error_show(1004,"商品已下单,平台商品编码不允许修改");
|
|
|
-// }
|
|
|
$is_exit = Db::name("good_platform")
|
|
|
- ->where(["plat_code" => $good_code, "platform_code" => $platform['platform_code'], "is_del" => 0, 'exam_status' => 6])//exam_status==6已上线
|
|
|
+ ->where(["plat_code" =>$post['plat_code'], "platform_code" => $platform['platform_code'], "is_del" =>0, 'exam_status' =>3])//exam_status==3已上线
|
|
|
->where("id", "<>", $platform['id'])
|
|
|
->find();
|
|
|
if($is_exit==false){
|
|
|
- $platform['plat_code']=$good_code;
|
|
|
+ $platform['plat_code']=$post['plat_code'];
|
|
|
}else{
|
|
|
- return error_show(1004,"平台商品编码 {$good_code} 已存在");
|
|
|
+ return error_show(1004,"平台商品编码 {$post['plat_code']} 已存在");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- $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['exam_status']=$post['exam_status'];
|
|
|
$platform['updatetime']=date("Y-m-d H:i:s");
|
|
|
- $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
|
|
|
- if($token==''){
|
|
|
- return error_show(105,"参数token不能为空");
|
|
|
- }
|
|
|
- $user =GetUserInfo($token);
|
|
|
- if(empty($user)||$user['code']!=0){
|
|
|
- return error_show(1002,"用户数据不存在");
|
|
|
- }
|
|
|
- $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
- $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+ $createrid= $this->uid;
|
|
|
+ $creater= $this->uname;
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
$up = Db::name("good_platform")->save($platform);
|
|
|
if($up){
|
|
|
$data=[
|
|
|
"code"=>$platform['skuCode'],
|
|
|
- "exam_status"=>$bifore,//$exam_status,
|
|
|
+ "exam_status"=>$post['exam_status'],//$exam_status,
|
|
|
"type"=>2,
|
|
|
"exam_id"=>$createrid,
|
|
|
"exam_name"=>$creater,
|
|
|
- "exam_remark"=>$exam_remark,
|
|
|
+ "exam_remark"=>$post['exam_remark'],
|
|
|
"addtime"=>date("Y-m-d H:i:s")
|
|
|
];
|
|
|
$inr=Db::name("good_exam")->insert($data);
|
|
|
if($inr){
|
|
|
|
|
|
//如果是商品下线的话,记入商品下线记录表
|
|
|
- if ($exam_status == 8) {
|
|
|
+ if ($post['exam_status'] == 5) {
|
|
|
$offline_id = Db::name("good_offline_log")->insertGetId([
|
|
|
'spuCode' => $platform['spuCode'],
|
|
|
- 'skuCodes' => $skuCode,
|
|
|
+ 'skuCodes' => $platform['skuCode'],
|
|
|
'good_name' => Db::name("good_basic")->where('spuCode', $platform['spuCode'])->value('good_name', ''),
|
|
|
- 'offline_reason' => $offline_reason,
|
|
|
- 'offline_remark' => $offline_remark,
|
|
|
+ 'offline_reason' => $post['offline_reason'],
|
|
|
+ 'offline_remark' => $post['offline_remark'],
|
|
|
'createrid' => $createrid,
|
|
|
'creater' => $creater,
|
|
|
'addtime' => date('Y-m-d H:i:s'),
|
|
|
]);
|
|
|
-
|
|
|
- ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_code" => $skuCode,//编号
|
|
|
- "status" => $bifore,
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "status"//新建create,编辑edit,更改状态status
|
|
|
- ], "GOL", $exam_status, $platform);
|
|
|
-
|
|
|
- ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_type" => 'GOL',
|
|
|
- "order_code" => $skuCode,//咨询单详情编号
|
|
|
- "order_id" => $offline_id,//商品下线记录的ID
|
|
|
- "order_status" => $exam_status, "before_status" => $bifore
|
|
|
- ]);
|
|
|
-
|
|
|
//根据权限查询应该接收商品下线通知的人员
|
|
|
$all_uid_name = Db::name('role_action')
|
|
|
->whereFindInSet('action_conllect','877')//数据写死的,要注意各个环境数据是否一致
|
|
@@ -1841,10 +1744,10 @@ class Goodup extends Base
|
|
|
$insert_order_msg_data=[];
|
|
|
foreach ($all_user as $itemitem) {
|
|
|
$insert_order_msg_data[] = [
|
|
|
- 'content' => '商品下线:' . $skuCode . '由' . $creater . '操作下线',
|
|
|
- 'orderCode' => $skuCode,
|
|
|
+ 'content' => '商品下线:' . $platform['spuCode'] . '由' . $creater . '操作下线',
|
|
|
+ 'orderCode' => $platform['skuCode'],
|
|
|
'order_type' => 'GOL',
|
|
|
- 'order_status' => 8,
|
|
|
+ 'order_status' => 5,
|
|
|
'order_id' => $offline_id,
|
|
|
'apply_id' => $createrid,
|
|
|
'apply_name' => $creater,
|
|
@@ -1859,48 +1762,38 @@ class Goodup extends Base
|
|
|
Db::name('order_msg')->insertAll($insert_order_msg_data);
|
|
|
|
|
|
}
|
|
|
- ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_code" => $skuCode,//编号
|
|
|
- "status" => $bifore,
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "status"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX", $exam_status, $platform);
|
|
|
-
|
|
|
- ProcessOrder::AddProcess(['id' => $createrid, 'nickname' => $creater], [
|
|
|
- "order_type" => 'SPSX',
|
|
|
- "order_code" => $skuCode,//咨询单详情编号
|
|
|
- "order_id" => $platform['id'],
|
|
|
- "order_status" => $exam_status,
|
|
|
- "before_status" => $bifore,
|
|
|
- 'holder_id' => $platform['createrid'],
|
|
|
- ]);
|
|
|
-
|
|
|
- //商品上线的话,将数据包塞入到队列中
|
|
|
- if ($exam_status == 6) {
|
|
|
- //将上线成功数据塞入到队列中
|
|
|
-
|
|
|
- $good_info = Db::name('good_basic')
|
|
|
- ->field('id,good_name,supplierNo')
|
|
|
- ->where(['is_del' => 0, 'spuCode' => $platform['spuCode']])
|
|
|
- ->findOrEmpty();
|
|
|
- if ($good_info) {
|
|
|
- $push_data = json_encode([
|
|
|
- 'supplierNo' => $good_info['supplierNo'],
|
|
|
- 'type' => 2,//1销售订单(采销的采购单),2上线结果
|
|
|
- 'data' => [
|
|
|
- 'spuCode' => $platform['spuCode'],
|
|
|
- 'skuCode' => $platform['skuCode'],
|
|
|
- 'good_name' => $good_info['good_name'],
|
|
|
- 'platform_id' => $platform['platform_code'],
|
|
|
- 'platform_name' => Db::name('platform')->where(['id' => $platform['platform_code']])->value('platform_name', ''),
|
|
|
- 'plat_code' => $platform['plat_code'],
|
|
|
- 'online_time' => $platform['online_time'],
|
|
|
- ],
|
|
|
- ], JSON_UNESCAPED_UNICODE);
|
|
|
-// Cache::store("redis")->handler()->lPush(Config::get('app.abutment_queue'), $push_data);
|
|
|
- }
|
|
|
+ if ($post['exam_status'] == 3) {
|
|
|
+ $proof=[
|
|
|
+ 'spuCode'=>$platform['spuCode'],
|
|
|
+ 'proof_type'=>$post['proof_type'],
|
|
|
+ 'proof_url'=>$post['proof_url'],
|
|
|
+ 'is_del'=>0,
|
|
|
+ "creater"=>$creater,
|
|
|
+ "createrid"=>$createrid,
|
|
|
+ "addtime"=>date("Y-m-d H:i:s"),
|
|
|
+ "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ $inproof = Db::name("good_proof")->insert($proof);
|
|
|
+ if($inproof==false)throw new \Exception("商品凭证新建失败");
|
|
|
+ if(empty($post['good_ladder']))throw new \Exception("商品阶梯价不能为空");
|
|
|
+ foreach ($post['good_ladder'] as $value){
|
|
|
+ $lemp=[];
|
|
|
+ $value["id"]?$lemp['id']=$value['id']:"";
|
|
|
+ $lemp['skuCode']=$platform['skuCode'];
|
|
|
+ $lemp['min_num'] = $value['min_num'];
|
|
|
+ $lemp['max_num'] = 0;
|
|
|
+ $lemp['sale_price'] = $value['sale_price'];
|
|
|
+ $lemp['market_price'] = $value['market_price'];
|
|
|
+ $lemp['market_platform'] = $value['market_platform'];
|
|
|
+ $lemp['cost_fee'] = $value['cost_fee'];
|
|
|
+ $lemp['is_del'] = isset($value['is_del'])?$value['is_del']:0;
|
|
|
+ $value["id"]??$lemp['addtime'] = date("Y-m-d H:i:s");
|
|
|
+ $lemp['updatetime'] =date("Y-m-d H:i:s");
|
|
|
+ $ladderUp = Db::name("good_ladder")->save($lemp);
|
|
|
+ if($ladderUp==false) throw new \Exception("商品起订价修改失败");
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
Db::commit();
|
|
|
return app_show(0,"审核成功");
|
|
|
}else{
|
|
@@ -1918,7 +1811,7 @@ class Goodup extends Base
|
|
|
|
|
|
}
|
|
|
|
|
|
- //财务定价
|
|
|
+ //财务定价 废弃
|
|
|
public function editladder(){
|
|
|
$skuCode = isset($this->post['skuCode'])&&$this->post['skuCode']!==""?trim($this->post['skuCode']):"";
|
|
|
if($skuCode===""){
|
|
@@ -1940,16 +1833,8 @@ class Goodup extends Base
|
|
|
if($proof_url===""){
|
|
|
return error_show(1004,"参数proof_url不能为空");
|
|
|
}
|
|
|
-// $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
|
|
|
-// if($token==''){
|
|
|
-// return error_show(105,"参数token不能为空");
|
|
|
-// }
|
|
|
$exam_remark = isset($this->post['exam_remark'])&& $this->post['exam_remark']!='' ? trim($this->post['exam_remark']):"";
|
|
|
|
|
|
-// $user =GetUserInfo($token);
|
|
|
-// if(empty($user)||$user['code']!=0){
|
|
|
-// return error_show(1002,"用户数据不存在");
|
|
|
-// }
|
|
|
$createrid= $this->uid;//isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
$creater= $this->uname;//isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
$bifore=$platform['exam_status'];
|
|
@@ -1979,21 +1864,21 @@ class Goodup extends Base
|
|
|
}
|
|
|
$up = Db::name("good_platform")->save($platform);
|
|
|
if($up){
|
|
|
- ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
- "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
- "status" =>$bifore,//这里的status是之前的值
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX", $platform['exam_status'],$platform);
|
|
|
-
|
|
|
- ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
- "order_type" => 'SPSX',
|
|
|
- "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
- "order_id" => $platform['id'],
|
|
|
- "order_status" => $platform['exam_status'],
|
|
|
- "before_status"=>$bifore,
|
|
|
- 'holder_id' => $platform['createrid'],
|
|
|
- ]);
|
|
|
+// ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
+// "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
+// "status" =>$bifore,//这里的status是之前的值
|
|
|
+// "action_remark" => '',//备注
|
|
|
+// "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
+// ], "SPSX", $platform['exam_status'],$platform);
|
|
|
+//
|
|
|
+// ProcessOrder::AddProcess(['id'=>$this->uid,'nickname'=>$this->uname], [
|
|
|
+// "order_type" => 'SPSX',
|
|
|
+// "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
+// "order_id" => $platform['id'],
|
|
|
+// "order_status" => $platform['exam_status'],
|
|
|
+// "before_status"=>$bifore,
|
|
|
+// 'holder_id' => $platform['createrid'],
|
|
|
+// ]);
|
|
|
$proof=[
|
|
|
'spuCode'=>$platform['spuCode'],
|
|
|
'proof_type'=>$proof_type,
|
|
@@ -2066,7 +1951,7 @@ class Goodup extends Base
|
|
|
return error_show(1004,"未找到数据");
|
|
|
}
|
|
|
|
|
|
- if($platform["exam_status"]!=7&&$platform["exam_status"]!=8){
|
|
|
+ if($platform["exam_status"]!=5){
|
|
|
return error_show(1004,"商品状态有误");
|
|
|
}
|
|
|
//判断平台商品编码是否重复
|
|
@@ -2081,38 +1966,16 @@ class Goodup extends Base
|
|
|
$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']):"";
|
|
|
- if($token==''){
|
|
|
- return error_show(105,"参数token不能为空");
|
|
|
- }
|
|
|
- $user =GetUserInfo($token);
|
|
|
- if(empty($user)||$user['code']!=0){
|
|
|
- return error_show(1002,"用户数据不存在");
|
|
|
- }
|
|
|
- $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
- $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+ $createrid= $this->uid;
|
|
|
+ $creater= $this->uame;
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
$save =Db::name("good_platform")->save($platform);
|
|
|
if($save){
|
|
|
- ActionLog::logAdd(['id'=>$createrid,'nickname'=>$creater], [
|
|
|
- "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
- "status" =>$bifore,//这里的status是之前的值
|
|
|
- "action_remark" => '',//备注
|
|
|
- "action_type" => "edit"//新建create,编辑edit,更改状态status
|
|
|
- ], "SPSX", $platform['exam_status'],$platform);
|
|
|
- ProcessOrder::AddProcess(['id'=>$createrid,'nickname'=>$creater], [
|
|
|
- "order_type" => 'SPSX',
|
|
|
- "order_code" =>$platform['skuCode'],//咨询单详情编号
|
|
|
- "order_id" => $platform['id'],
|
|
|
- "order_status" => $platform['exam_status'],
|
|
|
- "before_status"=>$bifore,
|
|
|
- 'holder_id' => $platform['createrid'],
|
|
|
- ]);
|
|
|
$data=[
|
|
|
"code"=>$platform['skuCode'],
|
|
|
"type"=>2,
|
|
|
- "exam_status"=>$bifore,//$platform['exam_status'] ,
|
|
|
+ "exam_status"=>$platform['exam_status'],//$platform['exam_status'] ,
|
|
|
"exam_id"=>$createrid,
|
|
|
"exam_name"=>$creater,
|
|
|
"exam_remark"=>'',
|
|
@@ -2161,10 +2024,6 @@ class Goodup extends Base
|
|
|
if($token==''){
|
|
|
return error_show(105,"参数token不能为空");
|
|
|
}
|
|
|
-// $user =GetUserInfo($token);
|
|
|
-// if(empty($user)||$user['code']!=0){
|
|
|
-// return error_show(102,"用户数据不存在");
|
|
|
-// }
|
|
|
$createrid= $this->uid;
|
|
|
$creater= $this->uname;
|
|
|
$nake = Db::name("good_nake")->where(["spuCode"=>$supcode,"is_del"=>0])->select()->toArray();
|
|
@@ -2410,13 +2269,8 @@ class Goodup extends Base
|
|
|
return error_show(1004,"参数delivery_day不能为空");
|
|
|
}
|
|
|
$lead_time = isset($this->post['lead_time'])&&$this->post['lead_time']!==""? intval($this->post['lead_time']) :"0";
|
|
|
-// if($lead_time===""){
|
|
|
-// return error_show(1004,"参数lead_time不能为空");
|
|
|
-// }
|
|
|
+
|
|
|
$sample_day = isset($this->post['sample_day'])&&$this->post['sample_day']!==""? intval($this->post['sample_day']):"0";
|
|
|
-// if($sample_day===""){
|
|
|
-// return error_show(1004,"参数sample_day不能为空");
|
|
|
-// }
|
|
|
$sample_fee = isset($this->post['sample_fee'])&&$this->post['sample_fee']!==""? floatval($this->post['sample_fee']):"0";
|
|
|
|
|
|
$good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? trim($this->post['good_img']):"";
|
|
@@ -2454,14 +2308,7 @@ class Goodup extends Base
|
|
|
if($is_stock==1 && $stock_moq ==0){
|
|
|
return error_show(1004,"库存品备库起订量不能为零");
|
|
|
}
|
|
|
-// $is_step = isset($this->post['is_step'])&&$this->post['is_step']!==""? intval($this->post['is_step']):"";
|
|
|
-// if($is_step===""){
|
|
|
-// return error_show(1004,"参数is_step不能为空");
|
|
|
-// }
|
|
|
$good_ladder = isset($this->post['good_ladder'])&&!empty($this->post['good_ladder'])? $this->post['good_ladder']:"";
|
|
|
-// if($is_step==1 && $good_ladder==""){
|
|
|
-// return error_show(1004,"启用阶梯,阶梯价不能为空");
|
|
|
-// }
|
|
|
$speclist = isset($this->post['speclist'])&&!empty($this->post['speclist'])? $this->post['speclist']:"";
|
|
|
|
|
|
$is_support_barter = isset($this->post['is_support_barter']) && $this->post['is_support_barter'] !== "" ? intval($this->post['is_support_barter']) : 1;
|
|
@@ -2536,23 +2383,23 @@ class Goodup extends Base
|
|
|
$json = json_encode($var,JSON_UNESCAPED_UNICODE);
|
|
|
$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,
|
|
|
- "before_status"=>0,
|
|
|
- 'holder_id'=>$data['createrid'],
|
|
|
- ]);
|
|
|
+ ChangeLog::logAdd(3,$data['spuCode'],$dat,$json,['id' => $this->uid, 'nickname' => $this->uname]);
|
|
|
+// //修改状态,添加待办
|
|
|
+// 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,
|
|
|
+// "before_status"=>0,
|
|
|
+// 'holder_id'=>$data['createrid'],
|
|
|
+// ]);
|
|
|
if($speclist!=="" && !empty($speclist)){
|
|
|
foreach ($speclist as $value){
|
|
|
$lemp=[];
|
|
@@ -2572,7 +2419,7 @@ class Goodup extends Base
|
|
|
}
|
|
|
if($good_ladder!=="" && !empty($good_ladder)){
|
|
|
|
|
|
- $user =GetUserInfo($this->post['token']);//获取用户信息,下面更新成本表的创建人
|
|
|
+// $user =GetUserInfo($this->post['token']);//获取用户信息,下面更新成本表的创建人
|
|
|
|
|
|
$top_cat_id = made($cat_id);//获取所有分类
|
|
|
$top_cat_id = isset($top_cat_id[0]['id']) ? $top_cat_id[0]['id'] : 0;//获取顶级分类id
|
|
@@ -2601,8 +2448,8 @@ class Goodup extends Base
|
|
|
}else{
|
|
|
$lemp['nake_total'] =$value['nake_fee']+$value['delivery_fee']+$value['cert_fee']+$value['mark_fee']+$value['package_fee']+$value['other_fee'];
|
|
|
}
|
|
|
- $lemp['creater_id'] = isset($user["data"]['id']) ? $user["data"]['id'] : 0;
|
|
|
- $lemp['creater'] = isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+ $lemp['creater_id'] = $this->uid;
|
|
|
+ $lemp['creater'] = $this->uname;
|
|
|
$lemp['is_del'] = isset($value['is_del'])?$value['is_del']:0;
|
|
|
isset($value["id"])&&$value["id"]!=''?"": $lemp['addtime'] = date("Y-m-d H:i:s");
|
|
|
$lemp['updatetime'] =date("Y-m-d H:i:s");
|
|
@@ -2638,10 +2485,6 @@ class Goodup extends Base
|
|
|
]);
|
|
|
if($val->check($param) == false) return json_show(1005,$val->getError());
|
|
|
|
|
|
-// $spuCode=isset($this->post['spuCode'])&&$this->post['spuCode']!=""? trim($this->post['spuCode']):"";
|
|
|
-// if($spuCode==""){
|
|
|
-// return error_show(1005,"参数spuCode不能为空");
|
|
|
-// }
|
|
|
$good =Db::name("good_basic")
|
|
|
->field('id,is_stock,cat_id,is_gold_price,noble_weight,cgd_gold_price')
|
|
|
->where(["spuCode"=>$param['spuCode'],"is_del"=>0])
|
|
@@ -3337,7 +3180,7 @@ class Goodup extends Base
|
|
|
$rs = Db::name('good_platform')
|
|
|
->field('id')
|
|
|
->where(['spuCode' => $spuCode, 'is_del' => 0])
|
|
|
- ->whereNotIn('exam_status', [0, 8])
|
|
|
+ ->whereNotIn('exam_status', [0, 5])
|
|
|
->find();
|
|
|
|
|
|
if (!empty($rs)) $is_allow_update = 0;
|
|
@@ -3375,5 +3218,22 @@ class Goodup extends Base
|
|
|
return app_show(0, '请求成功', ['list' => $list, 'count' => $count]);
|
|
|
}
|
|
|
|
|
|
+ //获取某个商品编号下的所有审核备注列表
|
|
|
+ public function changeLog()
|
|
|
+ {
|
|
|
+ $param = $this->request->filter('trim')->only(["code"=>"","type"=>""], 'post');
|
|
|
+
|
|
|
+ $val = Validate::rule(['code' => 'require|max:255', 'type' => 'require|number|in:1,2,3,4,5,6,7,8']);
|
|
|
+
|
|
|
+ if (!$val->check($param)) return error_show(1005, $val->getError());
|
|
|
+
|
|
|
+ $count = Db::name('change_log')
|
|
|
+ ->where([['code',"=", $param['code']],["type","=",$param['type']]])
|
|
|
+ ->order("id desc")
|
|
|
+ ->findOrEmpty();
|
|
|
+
|
|
|
+ return app_show(0, '请求成功', $count);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|