diff --git a/app/common/repositories/marketing/AgentApplyRepository.php b/app/common/repositories/marketing/AgentApplyRepository.php index 92a1385..49c3c47 100644 --- a/app/common/repositories/marketing/AgentApplyRepository.php +++ b/app/common/repositories/marketing/AgentApplyRepository.php @@ -237,12 +237,16 @@ class AgentApplyRepository extends BaseRepository{ $agentId = Agent::insertGetId($insertInfo); // 判断:如果是餐厅 生成商户信息 if((int)$insertInfo['agent_type'] == 7){ - $password = substr($applyInfo['contact_phone'],-6); + $password = substr($applyInfo['contact_phone'],-6); $config = systemConfig(['broadcast_room_type', 'broadcast_goods_type']); + // 商户账号 默认随机生成 + $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + $merAccount = substr(str_shuffle($characters), 0, 11); + $merchant = app()->make(MerchantRepository::class)->createMerchant([ 'mer_name' => $applyInfo['mer_name'], 'mer_phone' => $applyInfo['contact_phone'], - 'mer_account' => $applyInfo['contact_phone'], + 'mer_account' => $merAccount, 'category_id' => $applyInfo['mer_class_id'], 'type_id' => $applyInfo['mer_type_id'], 'real_name' => $applyInfo['contact_name'],