Просмотр исходного кода

feat(product): 更新产品价格更新命令支持更多商品ID

- 扩展PRODUCT_IDS数组,新增商品ID 57507, 57506, 33246, 33240
- 优化数据库操作语句中的空格格式
- 删除未使用的注释代码块
- 统一代码格式化和间距调整
shichen месяцев назад: 4
Родитель
Сommit
05e8534c68
1 измененных файлов с 4 добавлено и 6 удалено
  1. 4 6
      app/command/ProductPriceUpdate.php

+ 4 - 6
app/command/ProductPriceUpdate.php

@@ -13,7 +13,7 @@ class ProductPriceUpdate extends Command
13 13
     // 变更数量
14 14
     const NUMBER = 5;
15 15
 
16
-    const PRODUCT_IDS = [31053, 32171];
16
+    const PRODUCT_IDS = [31053, 32171, 57507, 57506, 33246, 33240];
17 17
 
18 18
     const MER_ID = 3447;
19 19
 
@@ -62,10 +62,9 @@ class ProductPriceUpdate extends Command
62 62
             // ];
63 63
 
64 64
 
65
-
66 65
             $update = [
67 66
                 'image' => $product['image'],
68
-                'slider_image' => explode(',',$product['slider_image']),
67
+                'slider_image' => explode(',', $product['slider_image']),
69 68
                 'store_name' => $product['store_name'],
70 69
                 'store_info' => $product['store_info'],
71 70
                 'keyword' => $product['keyword'],
@@ -95,12 +94,11 @@ class ProductPriceUpdate extends Command
95 94
                 'status' => $product['status']
96 95
             ];
97 96
 
98
-            $repository->update($product['product_id'],$update,self::MER_ID);
99
-            Db::name('product_share')->where('product_id',$product['product_id'])->where('share_channel',1)->update(['url'=>'']);
97
+            $repository->update($product['product_id'], $update, self::MER_ID);
98
+            Db::name('product_share')->where('product_id', $product['product_id'])->where('share_channel', 1)->update(['url' => '']);
100 99
         }
101 100
 
102 101
 
103
-
104 102
         // // 获取当前数据
105 103
         // $productData = Db::name('store_product')->where(['product_id' => self::PRODUCT_IDS])->field('product_id,price')->select()->toArray();
106 104
         // $attrData = Db::name('store_product_attr_value')->where(['product_id' => self::PRODUCT_IDS])->field('product_id,price')->select()->toArray();