Explorar o código

商品下线优化

wufeng %!s(int64=2) %!d(string=hai) anos
pai
achega
ec5f75228a
Modificáronse 1 ficheiros con 22 adicións e 0 borrados
  1. 22 0
      app/admin/controller/Goodup.php

+ 22 - 0
app/admin/controller/Goodup.php

@@ -1393,6 +1393,13 @@ class Goodup extends Base
 //        if($exam_status===""){
 //        if($exam_status===""){
 //            return error_show(1004,"参数exam_status不能为空");
 //            return error_show(1004,"参数exam_status不能为空");
 //        }
 //        }
+
+        //下线
+        if ($exam_status == 8) {
+            $offline_reason = $exam_status = isset($this->post['offline_reason']) && $this->post['offline_reason'] !== "" ? trim($this->post['offline_reason']) : "";
+            if ($offline_reason == '') return error_show(1005, '商品下线时下线原因必填');
+            $offline_remark = $exam_status = isset($this->post['offline_remark']) && $this->post['offline_remark'] !== "" ? trim($this->post['offline_remark']) : "";
+        }
         if($exam_status==3){
         if($exam_status==3){
             $online_time= isset($this->post['online_time'])&&$this->post['online_time']!==""?$this->post['online_time']:"";
             $online_time= isset($this->post['online_time'])&&$this->post['online_time']!==""?$this->post['online_time']:"";
             if($online_time===""){
             if($online_time===""){
@@ -1465,6 +1472,21 @@ class Goodup extends Base
                         "order_status" => $exam_status,"before_status"=>$bifore
                         "order_status" => $exam_status,"before_status"=>$bifore
                     ]);
                     ]);
 
 
+
+                    //如果是商品下线的话,记入商品下线记录表
+                    if ($exam_status == 8) {
+                        Db::name("good_offline_log")->insert([
+                            'spuCode' => $platform['spuCode'],
+                            'skuCodes' => $skuCode,
+                            'good_name' => Db::name("good_basic")->where('spuCode', $platform['spuCode'])->value('good_name', ''),
+                            'offline_reason' => $offline_reason,
+                            'offline_remark' => $offline_remark,
+                            'createrid' => $createrid,
+                            'creater' => $creater,
+                            'addtime' => date('Y-m-d H:i:s'),
+                        ]);
+                    }
+
                     Db::commit();
                     Db::commit();
                     return app_show(0,"审核成功");
                     return app_show(0,"审核成功");
                 }else{
                 }else{