Commit b2a92b91 by duwenjun

Merge branch 'feature/wenjun/20260514_yunxin_account' into 'master'

芯链账号修复

See merge request !4
parents 89bdf0ae 3481ae8c
......@@ -10,3 +10,4 @@ Homestead.json
/vendor/_laravel_ide
/storage/framework/views
/storage
CLAUDE.md
\ No newline at end of file
......@@ -86,25 +86,24 @@ class SupplierApplyService
'audit_uid' => request()->user->userId,
]);
$apply = SupplierApplyModel::where('id', $applyId)->first()->toArray();
$isNewAccount = false; // 标记是否为新创建的账号
if ($result ) {
if ($status == SupplierApplyModel::STATUS_PASS) {
$existAccount = SupplierAccountModel::where('supplier_code', $apply['supplier_code'])->exists();
//如果没有芯链账号,那么就要新增芯链账号
$existAccount = SupplierAccountModel::where('supplier_code', $apply['supplier_code'])->first();
if ($existAccount) {
SupplierAccountModel::where('supplier_code', $apply['supplier_code'])->update([
// 账号已存在,只更新联系信息,不修改密码(避免覆盖用户已修改的密码)
$existAccount->update([
'mobile' => $apply['mobile'],
'email' => $apply['email'],
'contacts_name' => $apply['contact_name'],
'password_raw' => 123456,
'password' => Hash::make(123456),
'create_time' => time(),
'update_time' => time(),
'a_type' => 1,
'a_status' => 1,
'create_uid' => 1000,
'source' => 2,
]);
}else{
//如果是通过并且已经存在,那么就要替换掉对应供应商的账号和密码
} else {
// 如果没有芯链账号,则新增芯链账号
$isNewAccount = true;
SupplierAccountModel::insert([
'supplier_id' => $apply['supplier_id'],
'supplier_code' => $apply['supplier_code'],
......@@ -112,17 +111,21 @@ class SupplierApplyService
'update_time' => time(),
'email' => $apply['email'],
'contacts_name' => $apply['contact_name'],
'password_raw' => 123456,
'password' => Hash::make(123456),
'password_raw' => '123456',
'password' => Hash::make('123456'),
'source' => 2,
]);
}
}
//无论是否通过,都要发短信通知
if ($status == SupplierApplyModel::STATUS_REJECT) {
$message = "${apply['contact_name']} 先生/女生您好,您的“芯链入驻申请”已收到,审核结果为:不通过,原因为:${auditReason},如对审核结果有疑问,可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com";
$message = "{$apply['contact_name']} 先生/女生您好,您的芯链入驻申请已收到,审核结果为:不通过,原因为:{$auditReason},如对审核结果有疑问,可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com";
} else {
$message = "${apply['contact_name']} 先生/女生您好,您的“芯链入驻申请”已收到,审核结果为:通过,芯链登录网址:http://xinlian.ichunt.com,您的芯链手机号:${apply['mobile']},初始密码:123456,请在登录芯链后修改密码,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com;";
if ($isNewAccount) {
$message = "{$apply['contact_name']} 先生/女生您好,您的芯链入驻申请已收到,审核结果为:通过,芯链登录网址:http://xinlian.ichunt.com,您的芯链手机号:{$apply['mobile']},初始密码:123456,请在登录芯链后修改密码,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com";
} else {
$message = "{$apply['contact_name']} 先生/女生您好,您的芯链入驻申请已收到,审核结果为:通过,芯链登录网址:http://xinlian.ichunt.com,您的芯链手机号:{$apply['mobile']},请使用原密码登录,如忘记密码请联系猎芯渠道经理,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com";
}
}
$data = [];
$data['data']['title'] = $message;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment