|
@@ -20,6 +20,7 @@ class GhsController extends BaseController
|
|
|
public function actionAdd()
|
|
public function actionAdd()
|
|
|
{
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
$post = Yii::$app->request->post();
|
|
|
|
|
+ $location = $post['location'] ?? '';
|
|
|
$name = $post['name'] ?? '';
|
|
$name = $post['name'] ?? '';
|
|
|
if (empty($name)) {
|
|
if (empty($name)) {
|
|
|
util::fail('名称不能为空');
|
|
util::fail('名称不能为空');
|
|
@@ -92,6 +93,13 @@ class GhsController extends BaseController
|
|
|
|
|
|
|
|
$ghs = \biz\ghs\classes\GhsClass::build($currentShopId, $shopId, 1);
|
|
$ghs = \biz\ghs\classes\GhsClass::build($currentShopId, $shopId, 1);
|
|
|
$ghs['avatar'] = imgUtil::groupImg($ghs['avatar']);
|
|
$ghs['avatar'] = imgUtil::groupImg($ghs['avatar']);
|
|
|
|
|
+
|
|
|
|
|
+ if (is_numeric($location)) {
|
|
|
|
|
+ //本地批发商的标记
|
|
|
|
|
+ $ghsId = $ghs['id'] ?? 0;
|
|
|
|
|
+ \biz\ghs\classes\GhsClass::updateById($ghsId, ['location' => $location]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$transaction->commit();
|
|
$transaction->commit();
|
|
|
util::success($ghs);
|
|
util::success($ghs);
|
|
|
} catch (\Exception $exception) {
|
|
} catch (\Exception $exception) {
|