Kaynağa Gözat

商品上下架问题修复

xialei 1 yıl önce
ebeveyn
işleme
84b12f72bd

+ 7 - 1
app/common/repositories/store/product/ProductRepository.php

@@ -2043,7 +2043,13 @@ class ProductRepository extends BaseRepository
2043
     // 供应链商品上下架
2043
     // 供应链商品上下架
2044
     public function changeStatus($ids, $is_show)
2044
     public function changeStatus($ids, $is_show)
2045
     {
2045
     {
2046
-        $data = ['is_show' => $is_show, 'is_status' => 1];
2046
+    
2047
+        if ($is_show == 1) {
2048
+            $data = ['is_show' => $is_show, 'is_status' => 0];
2049
+        } else {
2050
+            $data = ['is_show' => $is_show, 'is_status' => 1];
2051
+        }
2052
+
2047
         $this->dao->updates($ids, $data);
2053
         $this->dao->updates($ids, $data);
2048
 
2054
 
2049
         foreach ($ids as $id) {
2055
         foreach ($ids as $id) {