add 用户绑定邀请码

This commit is contained in:
chenbo 2024-01-12 15:11:45 +08:00
parent 1014b70b74
commit d84f5d4413
3 changed files with 13 additions and 0 deletions

View File

@ -1472,4 +1472,9 @@ class UserRepository extends BaseRepository
}
});
}
public function bindPromotionCode($promotionCode, $uid)
{
return $this->dao->update($uid, ['promotion_code' => $promotionCode, 'promoter_time' => date('Y-m-d H:i:s')]);
}
}

View File

@ -528,4 +528,11 @@ class User extends BaseController
return app('json')->success('修改成功');
}
public function bindPromotionCode()
{
$promotionCode = $this->request->param('promotion_code');
$this->repository->bindPromotionCode($promotionCode, $this->request->uid());
return app('json')->success('修改成功');
}
}

View File

@ -171,6 +171,7 @@ Route::group('api/', function () {
Route::post('change/phone', 'User/changePhone');
Route::post('change/info', 'User/updateBaseInfo');
Route::post('change/password', 'User/changePassword');
Route::post('change/bind_promotion_code', 'User/bindPromotionCode'); // 绑定新供销邀请码
//收藏
Route::get('/relation/product/lst', 'UserRelation/productList');
Route::get('/relation/merchant/lst', 'UserRelation/merchantList');