|
|
@@ -84,7 +84,7 @@ class ApplyService extends BaseService
|
|
|
}
|
|
|
|
|
|
//新增或修改申请开店 shish 2021.2.27
|
|
|
- public static function replaceRetail($data, $import = false)
|
|
|
+ public static function replaceRetail($data)
|
|
|
{
|
|
|
$mobile = $data['mobile'] ?? 0;
|
|
|
if (empty($mobile)) {
|
|
|
@@ -108,40 +108,31 @@ class ApplyService extends BaseService
|
|
|
}
|
|
|
$licenseNo = $data['licenseNo'] ?? '';
|
|
|
$mobile = $data['mobile'] ?? '';
|
|
|
-
|
|
|
+ if (empty($licenseNo)) {
|
|
|
+ util::fail('请填写营业执照编号');
|
|
|
+ }
|
|
|
+ //查询客户提交的证件
|
|
|
+ $has = ApplyClass::getByCondition(['licenseNo' => $licenseNo]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('营业执照已经使用过了');
|
|
|
+ }
|
|
|
+ $has = ApplyClass::getByCondition(['mobile' => $mobile]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('手机号已经使用过了');
|
|
|
+ }
|
|
|
+ $adminId = $data['adminId'];
|
|
|
+ if (empty($adminId)) {
|
|
|
+ util::fail('帐号有问题');
|
|
|
+ }
|
|
|
+ $has = ApplyClass::getByCondition(['adminId' => $adminId]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('您的微信已经申请过了');
|
|
|
+ }
|
|
|
$from = $data['from'] ?? 0;
|
|
|
if (in_array($from, [ApplyClass::FROM_GHS, ApplyClass::FROM_RETAIL]) == false) {
|
|
|
util::fail('请填写来源');
|
|
|
}
|
|
|
- if ($import == false) {
|
|
|
- //查询客户提交的证件
|
|
|
- $has = ApplyClass::getByCondition(['licenseNo' => $licenseNo]);
|
|
|
- if (!empty($has)) {
|
|
|
- util::fail('您已申请');
|
|
|
- }
|
|
|
- $has = ApplyClass::getByCondition(['mobile' => $mobile]);
|
|
|
- if (!empty($has)) {
|
|
|
- $currentSjId = $has['sjId'] ?? 0;
|
|
|
- $currentCustom = CustomClass::getByCondition(['customSjId' => $currentSjId]);
|
|
|
- if (!empty($currentCustom)) {
|
|
|
- $data['customId'] = $currentCustom['id'] ?? 0;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- //导入纯彩花艺已有客户判断
|
|
|
- $has = ApplyClass::getByCondition(['mobile' => $mobile]);
|
|
|
- if (!empty($has)) {
|
|
|
- noticeUtil::push("客户 $mobile 已经申请", '15280215347');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- $customId = $data['customId'] ?? 0;
|
|
|
- if (!empty($customId)) {
|
|
|
- //纯彩花艺客户已经开店但没有提供营业执照,需要重新走申请流程
|
|
|
- return ApplyClass::updateRetail($data);
|
|
|
- } else {
|
|
|
- return ApplyClass::addRetail($data);
|
|
|
- }
|
|
|
+ return ApplyClass::addRetail($data);
|
|
|
}
|
|
|
|
|
|
//供货商申请开店 shish 2021.01.28
|