|
@@ -889,18 +889,15 @@ class ProductController extends BaseController
|
|
|
public function actionAdd()
|
|
public function actionAdd()
|
|
|
{
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
$post = Yii::$app->request->post();
|
|
|
-
|
|
|
|
|
$shop = $this->shop;
|
|
$shop = $this->shop;
|
|
|
$default = $shop->default ?? 0;
|
|
$default = $shop->default ?? 0;
|
|
|
if ($default == 0) {
|
|
if ($default == 0) {
|
|
|
util::fail('请在默认门店添加花材,分店只能修改花材');
|
|
util::fail('请在默认门店添加花材,分店只能修改花材');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$shopAdmin = $this->shopAdmin;
|
|
$shopAdmin = $this->shopAdmin;
|
|
|
if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
util::fail('管理员才能添加花材');
|
|
util::fail('管理员才能添加花材');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$post['sjId'] = $this->sjId;
|
|
$post['sjId'] = $this->sjId;
|
|
|
$post['adminId'] = $this->adminId;
|
|
$post['adminId'] = $this->adminId;
|
|
|
$post['mainId'] = $this->mainId;
|
|
$post['mainId'] = $this->mainId;
|
|
@@ -909,8 +906,6 @@ class ProductController extends BaseController
|
|
|
if ($addPrice > $price) {
|
|
if ($addPrice > $price) {
|
|
|
util::fail('加价不能大于售价');
|
|
util::fail('加价不能大于售价');
|
|
|
}
|
|
}
|
|
|
- $cost = bcsub($price, $addPrice, 2);
|
|
|
|
|
- $post['cost'] = $cost;
|
|
|
|
|
$post['staffName'] = $shopAdmin->name ?? '';
|
|
$post['staffName'] = $shopAdmin->name ?? '';
|
|
|
ProductClass::addProduct($post, $this->shop);
|
|
ProductClass::addProduct($post, $this->shop);
|
|
|
util::complete('添加成功');
|
|
util::complete('添加成功');
|