调整种养殖户入驻
This commit is contained in:
parent
1ddb5b2f02
commit
735db0e46d
@ -176,30 +176,29 @@ class MerchantIntentionRepository extends BaseRepository
|
||||
}
|
||||
Db::transaction(function () use ($config, $intention, $data, $create,$margin,$merData,$smsData,$autoCreate) {
|
||||
if ($data['status'] == 1) {
|
||||
if ($intention['type'] == 1) {
|
||||
if ($create) {
|
||||
$merchant = app()->make(MerchantRepository::class)->createMerchant($merData);
|
||||
$data['mer_id'] = $merchant->mer_id;
|
||||
$data['uid'] = $intention['uid'];
|
||||
$data['reg_admin_id'] = $autoCreate ? 0: $merchant['merchant_admin']['merchant_admin_id'];
|
||||
// 写入商户客服表
|
||||
$store_service_data['mer_id'] = $merchant->mer_id;
|
||||
$store_service_data['uid'] = $intention['uid'];
|
||||
$store_service_data['avatar'] = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/1b716202302251108516996.png';
|
||||
$store_service_data['nickname'] = $intention['mer_name'];
|
||||
$store_service_data['account'] = $intention['phone'];
|
||||
$store_service_data['pwd'] = password_hash('123456', PASSWORD_BCRYPT);;
|
||||
$store_service_data['status'] = 1;
|
||||
$store_service_data['is_open'] = 1;
|
||||
$store_service_data['notify'] = 1;
|
||||
$store_service_data['customer'] = 1;
|
||||
$store_service_data['is_verify'] = 1;
|
||||
$store_service_data['is_goods'] = 1;
|
||||
$store_service_data['phone'] = $intention['phone'];
|
||||
$store_service_data['create_time'] = date('Y-m-d H:i:s');
|
||||
Db::name('store_service')->insert($store_service_data);
|
||||
}
|
||||
} else {
|
||||
if ($create) {
|
||||
$merchant = app()->make(MerchantRepository::class)->createMerchant($merData);
|
||||
$data['mer_id'] = $merchant->mer_id;
|
||||
$data['uid'] = $intention['uid'];
|
||||
$data['reg_admin_id'] = $autoCreate ? 0: $merchant['merchant_admin']['merchant_admin_id'];
|
||||
// 写入商户客服表
|
||||
$store_service_data['mer_id'] = $merchant->mer_id;
|
||||
$store_service_data['uid'] = $intention['uid'];
|
||||
$store_service_data['avatar'] = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/1b716202302251108516996.png';
|
||||
$store_service_data['nickname'] = $intention['mer_name'];
|
||||
$store_service_data['account'] = $intention['phone'];
|
||||
$store_service_data['pwd'] = password_hash('123456', PASSWORD_BCRYPT);;
|
||||
$store_service_data['status'] = 1;
|
||||
$store_service_data['is_open'] = 1;
|
||||
$store_service_data['notify'] = 1;
|
||||
$store_service_data['customer'] = 1;
|
||||
$store_service_data['is_verify'] = 1;
|
||||
$store_service_data['is_goods'] = 1;
|
||||
$store_service_data['phone'] = $intention['phone'];
|
||||
$store_service_data['create_time'] = date('Y-m-d H:i:s');
|
||||
Db::name('store_service')->insert($store_service_data);
|
||||
}
|
||||
if ($intention['type'] == 2) {
|
||||
$merId = MerchantIntention::where('uid', $intention['uid'])->where('status', 1)->value('mer_id');
|
||||
if (!empty($merId)) {
|
||||
Merchant::where('mer_id', $merId)->update(['business_status' => 2]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user