Commit 8f086b6f by 杨树贤

修复邀请无法添加红包的bug

parent d37619f6
...@@ -9,6 +9,10 @@ class Controller extends BaseController ...@@ -9,6 +9,10 @@ class Controller extends BaseController
{ {
const SUCCESS = 0; const SUCCESS = 0;
//请求参数错误
const INVALID_PARAMETER = 109000;
//这个是服务那边返回的错误码,代表已经超出了每日每人可领取的对应项的数额(比如每人每天只能签到一次) //这个是服务那边返回的错误码,代表已经超出了每日每人可领取的对应项的数额(比如每人每天只能签到一次)
const INTEGRAL_LIMIT = 509000; const INTEGRAL_LIMIT = 509000;
...@@ -25,6 +29,9 @@ class Controller extends BaseController ...@@ -25,6 +29,9 @@ class Controller extends BaseController
//添加好友邀请失败 //添加好友邀请失败
const INVITE_FAIL = 509004; const INVITE_FAIL = 509004;
//分享失败
const SHARE_FAIL = 509004;
public function Export($Errcode = 0, $ErrMsg = '', $dataArr = []) public function Export($Errcode = 0, $ErrMsg = '', $dataArr = [])
{ {
......
...@@ -34,9 +34,13 @@ class InvitesController extends Controller ...@@ -34,9 +34,13 @@ class InvitesController extends Controller
{ {
$userId = $request->user->user_id; $userId = $request->user->user_id;
$invitedUserId = $request->get('invited_user_id'); $invitedUserId = $request->get('invited_user_id');
if (!$invitedUserId) {
return $this->Export(self::INVALID_PARAMETER);
}
$map = [ $map = [
'user_id' => $userId, 'user_id' => $userId,
'invited_user_id' => $invitedUserId, 'invited_user_id' => $invitedUserId,
'integral_id' => self::INTEGRAL_TYPE_INVITE,
]; ];
$result = $this->service->addInvite($map); $result = $this->service->addInvite($map);
if ($result['errcode'] === self::SUCCESS) { if ($result['errcode'] === self::SUCCESS) {
......
...@@ -18,7 +18,7 @@ class InviteService ...@@ -18,7 +18,7 @@ class InviteService
public function addInvite($map = []) public function addInvite($map = [])
{ {
$url = config('website.BaseUrl') . '/integral_bills/add'; $url = config('website.BaseUrl') . '/invites/add';
$result = reportCurl($url, $map, true); $result = reportCurl($url, $map, true);
$result = json_decode($result, true); $result = json_decode($result, true);
......
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 sign in to comment