添加绑定邀请码

This commit is contained in:
luofei 2024-03-02 15:57:33 +08:00
parent 829a250047
commit c769fbbd37
3 changed files with 14 additions and 0 deletions

View File

@ -1649,4 +1649,10 @@ class UserRepository extends BaseRepository
{ {
return app()->make(UserInfoRepository::class)->getSearch(['is_used' => 1])->order(['sort', 'create_time' => 'ASC'])->select()->toArray(); return app()->make(UserInfoRepository::class)->getSearch(['is_used' => 1])->order(['sort', 'create_time' => 'ASC'])->select()->toArray();
} }
public function bindPromotionCode($promotionCode, $uid)
{
return $this->dao->update($uid, ['promotion_code' => $promotionCode, 'promoter_time' => date('Y-m-d H:i:s')]);
}
} }

View File

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

View File

@ -115,6 +115,7 @@ Route::group('api/', function () {
Route::post('change/phone', 'User/changePhone'); Route::post('change/phone', 'User/changePhone');
Route::post('change/info', 'User/updateBaseInfo'); Route::post('change/info', 'User/updateBaseInfo');
Route::post('change/password', 'User/changePassword'); Route::post('change/password', 'User/changePassword');
Route::post('change/bind_promotion_code', 'User/bindPromotionCode');
//收藏 //收藏
Route::get('/relation/product/lst', 'UserRelation/productList'); Route::get('/relation/product/lst', 'UserRelation/productList');
Route::get('/relation/merchant/lst', 'UserRelation/merchantList'); Route::get('/relation/merchant/lst', 'UserRelation/merchantList');