shish 3 ani în urmă
părinte
comite
56a695f726
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      app-hd/controllers/ProductController.php

+ 4 - 0
app-hd/controllers/ProductController.php

@@ -72,10 +72,14 @@ class ProductController extends BaseController
         $post['mainId'] = $this->mainId;
 
         $price = $post['price'] ?? 0;
+        if ($price <= 0) {
+            util::fail('请填写价格');
+        }
         $addPrice = $post['addPrice'] ?? 0;
         if ($addPrice > $price) {
             util::fail('加价不能大于售价');
         }
+        $post['skPrice'] = $price;
         $cost = bcsub($price, $addPrice, 2);
         $post['cost'] = $cost;
         ItemClass::addItem($post, $this->shop);