$customSjId]); if (empty($currentApply)) { util::fail('此客户没有申请开店记录,请排查'); } $currentApplyId = $currentApply['id'] ?? 0; $licenseNo = $currentApply['licenseNo'] ?? ''; if (!empty($licenseNo)) { util::fail('您已经申请过了'); } $applyMobile = $currentApply['mobile'] ?? ''; $mobile = $data['mobile'] ?? ''; if ($mobile != $applyMobile) { noticeUtil::push("二次申请开店使用的手机号不一样 customId:{$customId}", '15280215347'); util::fail('手机号错误,请联系管理员', '15280215347'); } $data['status'] = ApplyClass::STATUS_CHECKING; ApplyClass::updateById($currentApplyId, $data); $licenseNo = $data['licenseNo'] ?? ''; $mobile = $data['mobile'] ?? ''; $extData = [ 'licenseNo' => $licenseNo, 'mobile' => $mobile, ]; ApplyExtendClass::updateByCondition(['applyId' => $currentApplyId], $extData); return true; } //新增申请开店 ssh 2021.2.27 public static function addRetail($data) { $city = $data['city'] ?? ''; $dist = $data['dist'] ?? ''; $floor = $data['floor'] ?? ''; $address = $data['address'] ?? ''; $data['fullAddress'] = $city . $dist . $address . $floor; $data['style'] = SjClass::STYLE_RETAIL; $respond = self::addApply($data); //供货商添加客户的不需要通知 if (isset($data['replace']) && $data['replace'] == 0) { $mobile = $data['mobile']; $text = "零售商 {$mobile} 已提交资料,"; if (isset($data['introSjName']) && !empty($data['introSjName'])) { $text .= "介绍人:{$data['introSjName']},"; } $text .= "请及时跟进"; noticeUtil::push($text, '15280215347'); } return $respond; } //新增申请开店 ssh 2021.2.27 public static function addGhs($data) { $dist = $data['dist'] ?? ''; $floor = $data['floor'] ?? ''; $address = $data['address'] ?? ''; $city = $data['city'] ?? ''; $data['fullAddress'] = $city . $dist . $address . $floor; $data['style'] = SjClass::STYLE_SUPPLIER; $respond = self::addApply($data); if (isset($data['replace']) && $data['replace'] == 0) { $mobile = $data['mobile']; $text = "供货商 {$mobile} 已提交资料,"; if (isset($data['introSjName']) && !empty($data['introSjName'])) { $text .= "介绍人:{$data['introSjName']},"; } $text .= "请及时跟进"; noticeUtil::push($text, '15280215347'); } return $respond; } //新增申请开店 ssh 2021.2.27 public static function addKmGhs($data) { $dist = $data['dist'] ?? ''; $floor = $data['floor'] ?? ''; $address = $data['address'] ?? ''; $city = $data['city'] ?? ''; $data['fullAddress'] = $city . $dist . $address . $floor; $data['style'] = dict::getDict('ptStyle', 'kmGhs'); $respond = self::addApply($data); if (isset($data['replace']) && $data['replace'] == 0) { $mobile = $data['mobile']; $text = "供货商 {$mobile} 已提交资料,"; if (isset($data['introSjName']) && !empty($data['introSjName'])) { $text .= "介绍人:{$data['introSjName']},"; } $text .= "请及时跟进"; noticeUtil::push($text, '15280215347'); } return $respond; } //添加申请 ssh 2020.2.10 public static function addApply($data) { //邀请人数+1 $introSjId = isset($data['introSjId']) ? $data['introSjId'] : ''; if (!empty($introSjId)) { $agent = AgentAssetClass::getByCondition(['sjId' => $introSjId], true); if (empty($agent)) { $agent = AgentAssetClass::add(['sjId' => $introSjId], true); } $agent->inviteNum += 1; $agent->save(); } $name = $data['name'] ?? 0; $num = stringUtil::getWordNum($name); if ($num > 19) { util::fail('标题不能超过19个字'); } $apply = self::add($data); $id = $apply['id']; $data['applyId'] = $id; ApplyExtendClass::add($data); return $apply; } }