Jelajahi Sumber

修改比例

shish 5 tahun lalu
induk
melakukan
e55e20cf83
1 mengubah file dengan 5 tambahan dan 3 penghapusan
  1. 5 3
      console/controllers/ProductController.php

+ 5 - 3
console/controllers/ProductController.php

@@ -58,12 +58,14 @@ class ProductController extends Controller
             $ptItemId = $product->itemId ?? 0;
             $weight = $product->weight ?? 0;
             $addPrice = $product->addPrice ?? 0;
+            $ratio = $product->ratio ?? 20;
             $p = ProductClass::getByCondition(['shopId' => 214, 'itemId' => $ptItemId], true);
             if (!empty($p)) {
-                $p->addPrice = $addPrice;
-                $p->weight = $weight;
+                //$p->addPrice = $addPrice;
+                //$p->weight = $weight;
+                $p->ratio = $ratio;
                 $p->save();
-                echo "productId {$p->id} 加价改成了:{$addPrice} 重量改成了:{$weight} \n";
+                echo "productId {$p->id} 加价改成了:{$addPrice} 重量改成了:{$weight} 比例修改为 {$ratio} \n";
             }
         }
     }