|
|
@@ -11,6 +11,7 @@ use bizHd\purchase\classes\PurchaseClass;
|
|
|
use bizHd\saas\services\RegionService;
|
|
|
use common\components\dict;
|
|
|
use common\components\dirUtil;
|
|
|
+use common\components\stringUtil;
|
|
|
use common\components\util;
|
|
|
use common\components\wxUtil;
|
|
|
use Yii;
|
|
|
@@ -55,7 +56,6 @@ class ShopController extends BaseController
|
|
|
$data = Yii::$app->request->post();
|
|
|
$data['sjId'] = $this->sjId;
|
|
|
$data['shopId'] = $this->shopId;
|
|
|
- $data['adminId'] = $this->adminId;
|
|
|
if (isset($data['shopName']) == false || empty($data['shopName'])) {
|
|
|
util::fail('请填写门店名称');
|
|
|
}
|
|
|
@@ -67,7 +67,17 @@ class ShopController extends BaseController
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
- //零售添加门店
|
|
|
+
|
|
|
+ $mobile = $data['mobile'] ?? 0;
|
|
|
+ if (stringUtil::isMobile($mobile) == false) {
|
|
|
+ util::fail('请填写正确手机号');
|
|
|
+ }
|
|
|
+ $adminInfo = ['name' => $mobile, 'mobile' => $mobile];
|
|
|
+ $fromApp = dict::getDict('userSourceGetId', 'app', 'id');
|
|
|
+ $admin = AdminClass::replaceAdmin($adminInfo, $fromApp);
|
|
|
+ $adminId = $admin['id'] ?? 0;
|
|
|
+ $data['adminId'] = $adminId;
|
|
|
+
|
|
|
\bizHd\shop\classes\ShopClass::addMainShop($data, $this->shop, $this->sj);
|
|
|
$transaction->commit();
|
|
|
util::complete();
|