|
|
@@ -294,20 +294,7 @@ class ItemController extends BaseController
|
|
|
|
|
|
public function actionAdd()
|
|
|
{
|
|
|
- $post = Yii::$app->request->post();
|
|
|
- $post['adminId'] = $this->adminId;
|
|
|
- $post['sjId'] = $this->sjId;
|
|
|
-
|
|
|
- $connection = Yii::$app->db;//事务处理
|
|
|
- $transaction = $connection->beginTransaction();
|
|
|
- try {
|
|
|
- ItemService::addGhsItem($post);
|
|
|
- $transaction->commit();
|
|
|
- util::complete('添加成功');
|
|
|
- } catch (Exception $e) {
|
|
|
- $transaction->rollBack();
|
|
|
- util::fail('添加失败');
|
|
|
- }
|
|
|
+ util::fail('开发中');
|
|
|
}
|
|
|
|
|
|
//批量添加花材
|
|
|
@@ -336,11 +323,6 @@ class ItemController extends BaseController
|
|
|
if (!empty($has)) {
|
|
|
util::fail("有花材已经添加过了");
|
|
|
}
|
|
|
-
|
|
|
- $shopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*');
|
|
|
- if (count($shopList) > 1) {
|
|
|
- util::fail('您已有多家门店,暂不支持批量添加花材');
|
|
|
- }
|
|
|
$shopId = $this->shopId;
|
|
|
$mainId = $this->mainId;
|
|
|
$connection = Yii::$app->db;
|
|
|
@@ -351,7 +333,8 @@ class ItemController extends BaseController
|
|
|
$v['sjId'] = $sjId;
|
|
|
$v['shopId'] = $shopId;
|
|
|
$v['mainId'] = $mainId;
|
|
|
- ItemService::addGhsItem($v);
|
|
|
+ $v['staffName'] = $shopAdmin->name ?? '';
|
|
|
+ ProductClass::addProduct($v, $this->shop);
|
|
|
}
|
|
|
$transaction->commit();
|
|
|
util::complete('添加成功');
|