修改登录时优惠卷发放时机
This commit is contained in:
parent
0bb46d2706
commit
fc165bd067
@ -163,6 +163,7 @@ class OrderProduct extends Model
|
||||
"OrderProductItem:product_item_id,order_product_id,product_id,product_name,amount,manufacturer,product_cover_img,product_spec",
|
||||
])
|
||||
->where($params)
|
||||
->orderBy("created_at",'desc')
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
|
||||
@ -104,15 +104,6 @@ class LoginService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
$client_user_id = $user_patient['patient_id'];
|
||||
|
||||
// 发放用户优惠卷
|
||||
$CouponService = new CouponService();
|
||||
|
||||
$res = $CouponService->DistributeCoupon(1,$user->user_id,$user_patient['patient_id']);
|
||||
if (!$res){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
} elseif ($user['user_type'] == 2) {
|
||||
// 新增医生表
|
||||
$user_doctor = UserDoctorModel::addUserDoctor($data);
|
||||
@ -128,6 +119,17 @@ class LoginService extends BaseService
|
||||
$account = new Account();
|
||||
// 创建单个账号
|
||||
$account->createAccount($user->user_id,$user->user_name,addAliyunOssWebsite($avatar));
|
||||
|
||||
if ($user['user_type'] == 1){
|
||||
// 发放用户优惠卷
|
||||
$CouponService = new CouponService();
|
||||
|
||||
$res = $CouponService->DistributeCoupon(1,$user->user_id,$user_patient['patient_id']);
|
||||
if (!$res){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 已注册用户
|
||||
// 重复注册不同端
|
||||
@ -318,15 +320,6 @@ class LoginService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
$client_user_id = $user_patient['patient_id'];
|
||||
|
||||
// 发放用户优惠卷
|
||||
$CouponService = new CouponService();
|
||||
|
||||
$res = $CouponService->DistributeCoupon(1,$user->user_id,$user_patient['patient_id']);
|
||||
if (!$res){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
} elseif ($user['user_type'] == 2) {
|
||||
// 新增医生表
|
||||
$user_doctor = UserDoctorModel::addUserDoctor($data);
|
||||
@ -347,6 +340,17 @@ class LoginService extends BaseService
|
||||
$account = new Account();
|
||||
// 创建单个账号
|
||||
$account->createAccount($user->user_id,$user->user_name,addAliyunOssWebsite($avatar));
|
||||
|
||||
if ($user['user_type'] == 1){
|
||||
// 发放用户优惠卷
|
||||
$CouponService = new CouponService();
|
||||
|
||||
$res = $CouponService->DistributeCoupon(1,$user->user_id,$user_patient['patient_id']);
|
||||
if (!$res){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 已注册用户
|
||||
if ($user_type != $user['user_type']) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user