Browse Source

线上商品筛选未上线条件优化

wufeng 2 years ago
parent
commit
5660847049
1 changed files with 15 additions and 8 deletions
  1. 15 8
      app/admin/controller/Goodup.php

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

@@ -103,14 +103,21 @@ class Goodup extends Base
         }
         $isonline = isset($this->post['isonline']) && $this->post['isonline']!=="" ? $this->post['isonline']:"";
         if($isonline!==""){
-            if($isonline==1){
-                $condit[] =['b.exam_status',"=",6];
-            }else{
-                $condit[] =['b.exam_status',"<>",6];
-            }
-          $sta =Db::name("good_basic")->alias("a")->leftJoin("good_platform b","a.spuCode=b.spuCode")->where($condit)
-              ->group("a.spuCode")->column('a.spuCode');
-            $where[]=["spuCode","in",$sta];
+            $condit[] =['b.exam_status',"=",6];
+//            if($isonline==1){
+//                $condit[] =['b.exam_status',"=",6];
+//            }else{
+//                $condit[] =['b.exam_status',"<>",6];
+//            }
+          $sta =Db::name("good_basic")
+              ->alias("a")
+              ->leftJoin("good_platform b","a.spuCode=b.spuCode")
+              ->where($condit)
+              ->group("a.spuCode")
+              ->column('a.spuCode');
+
+            if($isonline==1) $where[]=["spuCode","in",$sta];
+            else  $where[]=["spuCode","not in",$sta];
         }
         $token = isset($this->post['token']) ? trim($this->post['token']) : "";
         if($token==""){