wugg 2 years ago
parent
commit
379a581f34
1 changed files with 12 additions and 8 deletions
  1. 12 8
      app/admin/controller/Goodup.php

+ 12 - 8
app/admin/controller/Goodup.php

@@ -878,16 +878,20 @@ class Goodup extends Base
         Db::startTrans();
         try {
             if($data['status']==3 && $status==1){
-                $online = Db::name("good_platform")->where(["spuCode"=>$supcode,"is_online"=>0,"status"=>0, "is_del"=>0])->save(["is_online"=>0,"exam_status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
+                $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,"审核失败");
+                }
             }
 
-            if ($status == 1) {
-                //把同一个spuCode,且状态为1待完善成本,的记录更改状态为2待产品审核
-                Db::name('good')
-                    ->where(['is_del' => 0, 'status' => 1])
-                    ->whereIn('spuCode', $supcode)
-                    ->update(['status' => 2, 'updatetime' => date('Y-m-d H:i:s')]);
-            }
+//            if ($status == 1) {
+//                //把同一个spuCode,且状态为1待完善成本,的记录更改状态为2待产品审核
+//                Db::name('good')
+//                    ->where(['is_del' => 0, 'status' => 1])
+//                    ->whereIn('spuCode', $supcode)
+//                    ->update(['status' => 2, 'updatetime' => date('Y-m-d H:i:s')]);
+//            }
             $data['status']=$status;
             $data['updatetime']=date("Y-m-d H:i:s");
             $up= Db::name("good_basic")->save($data);