Commit 4df53760 by 杨树贤

修复bug

parent f5cd65cc
...@@ -56,7 +56,7 @@ class ExchangeSettingsController extends Controller ...@@ -56,7 +56,7 @@ class ExchangeSettingsController extends Controller
$exchangeSettings['can_exchange'] = $canExchangeStatus; $exchangeSettings['can_exchange'] = $canExchangeStatus;
//获取微信兑换状况 //获取微信兑换状况
$info = $this->service->getWeixinExchangeInfo(98); $info = $this->service->getWeixinExchangeInfo($userId);
$exchangeSettings['weixin_exchange_info'] = $info; $exchangeSettings['weixin_exchange_info'] = $info;
return $this->Export(0, 'ok', $exchangeSettings); return $this->Export(0, 'ok', $exchangeSettings);
......
...@@ -69,7 +69,7 @@ class UserExchangesController extends Controller ...@@ -69,7 +69,7 @@ class UserExchangesController extends Controller
return $this->Export(self::EXCHANGED_TODAY); return $this->Export(self::EXCHANGED_TODAY);
} }
if (empty($exchangeId) || empty($type)) { if (empty($exchangeId)) {
return $this->Export(self::INVALID_PARAMETER); return $this->Export(self::INVALID_PARAMETER);
} }
$data = [ $data = [
......
...@@ -26,17 +26,15 @@ class ExchangeSettingService ...@@ -26,17 +26,15 @@ class ExchangeSettingService
$userExchange = array_get($userExchangeService->getUserExchange($map), 'data', []); $userExchange = array_get($userExchangeService->getUserExchange($map), 'data', []);
//如果最后一条记录是未审核就代表这个需要好友助力 //如果最后一条记录是未审核就代表这个需要好友助力
$info = []; $info = [];
$info['exchanging'] = 1; $info['exchanging'] = $info['assist_count'] = 0;
if (is_array($userExchange)) { if (is_array($userExchange)) {
//如果审核状态为未审核,就代表需要好友助力,也就是说正在兑换 //如果审核状态为未审核,就代表需要好友助力,也就是说正在兑换
if ($userExchange['status'] == 0) { if ($userExchange['status'] == 0) {
$info['assist_count'] = $userExchange['assist_count']; $info['assist_count'] = $userExchange['assist_count'];
} else { $info['exchanging'] = 1;
//否则直接返回没有正在兑换
$info['exchanging'] = $info['assist_count'] = 0;
} }
//否则直接返回没有正在兑换
} }
return $info; return $info;
} }
} }
\ 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