|
|
@@ -61,13 +61,13 @@ class ShopController extends BaseController
|
|
|
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
- try{
|
|
|
+ try {
|
|
|
$shop = ShopClass::addShop($data);
|
|
|
$shopId = $shop['id'];
|
|
|
//门店product 同步数据 linqh 2021.4.18
|
|
|
- $product = ProductClass::getAllProduct($this->sjId,$this->shopId,"name,cover,classId,itemId,rank,price,priceLabel,cost,addPrice,stockWarning,weight,alias,py,ratio,bigUnit,smallUnit,bigUnitId,smallUnitId,inTurn");
|
|
|
+ $product = ProductClass::getAllProduct($this->sjId, $this->shopId, "name,cover,classId,itemId,rank,price,priceLabel,cost,addPrice,stockWarning,weight,alias,py,ratio,bigUnit,smallUnit,bigUnitId,smallUnitId,inTurn");
|
|
|
$productData = [];
|
|
|
- foreach ($product as $v){
|
|
|
+ foreach ($product as $v) {
|
|
|
$tmp = $v;
|
|
|
$tmp['merchantId'] = $this->sjId;
|
|
|
$tmp['shopId'] = $shopId;
|
|
|
@@ -77,7 +77,7 @@ class ShopController extends BaseController
|
|
|
ProductClass::batchAdd($productData);
|
|
|
$transaction->commit();
|
|
|
util::complete();
|
|
|
- }catch (\Exception $exception){
|
|
|
+ } catch (\Exception $exception) {
|
|
|
$transaction->rollBack();
|
|
|
util::fail();
|
|
|
}
|
|
|
@@ -213,4 +213,15 @@ class ShopController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
+ //获取门店详情 ssh 2021.4.23
|
|
|
+ public function actionDetail()
|
|
|
+ {
|
|
|
+ $shopId = Yii::$app->request->get('shopId');
|
|
|
+ if (empty($shopId)) {
|
|
|
+ $shopId = $this->shopId;
|
|
|
+ }
|
|
|
+ $shop = ShopClass::getShopInfo($shopId);
|
|
|
+ util::success(['info' => $shop]);
|
|
|
+ }
|
|
|
+
|
|
|
}
|