Commit d1c93db5 by 杨树贤

添加更多的助力信息

parent 959dd79b
......@@ -48,10 +48,12 @@ class AssistsController extends Controller
$userExchangeService = new UserExchangeService();
$userExchange = array_get($userExchangeService->getUserExchange(['id' => $exchangeId]), 'data');
$result['data']['amount'] = array_get($userExchange, 'amount', '0');
$user = $this->service->getUserInfo($userId);
$temp = array_get($userExchange,'user_id');
$user = $this->service->getUserInfo($temp);
$result['data']['user_info'] = [
'avatar' => array_get($user, 'avatar'),
'company_name' => array_get($user, 'company_name', ''),
'user_id' => array_get($user, 'user_id', ''),
];
$needAssistCount = 2;
$result['data']['need_assist_count'] = $needAssistCount - count($list);
......@@ -74,6 +76,10 @@ class AssistsController extends Controller
$result = $this->service->addAssist($map);
if ($result['errcode'] === self::SUCCESS) {
return $this->Export(0, 'ok');
} elseif ($result['errcode'] === 109008) {
return $this->Export(self::CAN_NOT_ASSIST_MYSELF);
} elseif ($result['errcode'] === 109009) {
return $this->Export(self::CAN_NOT_ASSIST);
} else {
return $this->Export(self::ASSIST_FAIL);
}
......
......@@ -19,8 +19,14 @@ class Controller extends BaseController
const INVALID_CODE = 109006;
//已经兑换过红包码,不能再兑换
const EXCHANGED_CODE = 109007;
//自己不能助力自己
const CAN_NOT_ASSIST_MYSELF = 109008;
//不能助力了(助力人数已满或者用户已经助力过)
const CAN_NOT_ASSIST = 109009;
const EXCHANGED_TODAY = 109100;
//这个是服务那边返回的错误码,代表已经超出了每日每人可领取的对应项的数额(比如每人每天只能签到一次)
const INTEGRAL_LIMIT = 509000;
......
......@@ -15,6 +15,8 @@ return [
109005 => '用户无法兑换,用户未认证',
109006 => '红包码无效',
109007 => '已经兑换过红包码,不能再兑换',
109008 => '自己不能助力自己',
109009 => '助力人数已满或者您已经助力过',
109100 => '今天已经兑换过了,请明天再来吧',
109101 => '兑换名额被抢光了',
......
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