Commit 8682c4ac by 杨树贤

添加助力判断

parent bea54d4d
...@@ -51,6 +51,11 @@ class AssistsController extends Controller ...@@ -51,6 +51,11 @@ class AssistsController extends Controller
$assistUserId = $request->get('assist_user_id'); $assistUserId = $request->get('assist_user_id');
$exchange = $userExchange->getUserExchange($exchangeId); $exchange = $userExchange->getUserExchange($exchangeId);
$userId = array_get((array)$exchange, 'user_id'); $userId = array_get((array)$exchange, 'user_id');
$type = array_get((array)$exchange, 'type');
//如果类型是兑换话费,就不应该进入这个助力逻辑
if ($type == 1) {
return $this->Export(ErrorCode(16,1),'只有微信转账才能进行助力');
}
$data = [ $data = [
'user_id' => $userId, 'user_id' => $userId,
'assist_user_id' => $assistUserId, 'assist_user_id' => $assistUserId,
...@@ -70,6 +75,7 @@ class AssistsController extends Controller ...@@ -70,6 +75,7 @@ class AssistsController extends Controller
if ($result) { if ($result) {
//好友助力成功一次就要向用户添加一条站内信 //好友助力成功一次就要向用户添加一条站内信
$assist->sendNotice($data['user_id']); $assist->sendNotice($data['user_id']);
return $this->Export(0, 'ok'); return $this->Export(0, 'ok');
} else { } else {
return $this->Export(ErrorCode(20, 5), '新增好友助力记录失败'); return $this->Export(ErrorCode(20, 5), '新增好友助力记录失败');
......
3887 2310
\ No newline at end of file \ No newline at end of file
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