Commit 8576cb84 authored by hujun's avatar hujun

invitee_id

parent cc79393d
...@@ -30,12 +30,12 @@ class CouponService{ ...@@ -30,12 +30,12 @@ class CouponService{
* 发券 * 发券
* *
* @param int $user_id * @param int $user_id
* @param int $referrer_id * @param int $invitee_id
* @param int $type * @param int $type
* @return mixed * @return mixed
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function sendCoupon(int $user_id, int $referrer_id,int $type) { public function sendCoupon(int $user_id, int $invitee_id,int $type) {
$result['status'] = 'successful'; $result['status'] = 'successful';
$result['msg'] = '发券成功'; $result['msg'] = '发券成功';
$result['data'] = []; $result['data'] = [];
...@@ -58,7 +58,7 @@ class CouponService{ ...@@ -58,7 +58,7 @@ class CouponService{
return $result; return $result;
} }
$activity_data = $this->checkUserCoupon($user_id, $type, $referrer_id); $activity_data = $this->checkUserCoupon($user_id, $type, $invitee_id);
if (empty($activity_data)) { if (empty($activity_data)) {
$result['status'] = 'fail'; $result['status'] = 'fail';
$result['msg'] = '没有可参加的活动'; $result['msg'] = '没有可参加的活动';
...@@ -66,8 +66,8 @@ class CouponService{ ...@@ -66,8 +66,8 @@ class CouponService{
} }
$save_data = []; $save_data = [];
$save_data['user_id'] = $user_id; $save_data['user_id'] = $user_id;
if ($referrer_id) { if ($invitee_id) {
$save_data['referrer_id'] = $referrer_id; $save_data['invitee_id'] = $invitee_id;
} }
$save_data['status'] = 0; $save_data['status'] = 0;
$save_data['create_time'] = date('Y-m-d H:i:s'); $save_data['create_time'] = date('Y-m-d H:i:s');
...@@ -129,7 +129,7 @@ class CouponService{ ...@@ -129,7 +129,7 @@ class CouponService{
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function checkUserCoupon(int $user_id, int $type, $referrer_id) public function checkUserCoupon(int $user_id, int $type, $invitee_id)
{ {
$return_activity = []; $return_activity = [];
$time = time(); $time = time();
...@@ -144,7 +144,7 @@ class CouponService{ ...@@ -144,7 +144,7 @@ class CouponService{
} }
if ($type == 0) { if ($type == 0) {
$count_where['referrer_id'] = $referrer_id; $count_where['invitee_id'] = $invitee_id;
$num = $this->m_coupon->getCount($count_where); $num = $this->m_coupon->getCount($count_where);
if ($num > 0) { if ($num > 0) {
continue; continue;
......
...@@ -125,11 +125,11 @@ class RegisterService ...@@ -125,11 +125,11 @@ class RegisterService
$coupon_service = new CouponService(); $coupon_service = new CouponService();
if (!empty($first_login_time)) { if (!empty($first_login_time)) {
$coupon_service->sendCoupon((int)$id, $user_info[0]['referrer_id'], 0); $coupon_service->sendCoupon((int)$id, 0, 0);
} }
if (!empty($registration_time) && $referrer_source == 10 && $referrer_id) { if (!empty($registration_time) && $referrer_source == 10 && $referrer_id) {
$coupon_service->sendCoupon((int)$referrer_id, 0, 2); $coupon_service->sendCoupon((int)$referrer_id, $id, 2);
} }
$jwt = new JwtUntils(); $jwt = new JwtUntils();
......
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 to comment