|
|
@@ -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);
|