Commit 46f50add by 杨树贤

去掉兑换接口的type字段

parent 6b8be7da
......@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
use App\Http\Transformers\UserExchangeTransformer;
use App\Services\UserExchangeService;
use Carbon\Carbon;
use Common\Model\RedisModel;
use Illuminate\Http\Request;
/**
......@@ -55,16 +57,43 @@ class UserExchangesController extends Controller
{
$exchangeId = $request->get('exchange_id');
//先写死用于测试
// $exchangeId = 1;
$exchangeId = 1;
$userId = $request->user->user_id;
$type = $request->get('type');
$result = $service->addUserExchange([
if (empty($exchangeId) || empty($type)) {
return $this->Export(self::INVALID_PARAMETER);
}
$data = [
'user_id' => $userId,
'exchange_id' => $exchangeId,
]);
];
//如果类型是微信转账,则前提是要两个好友助力完成才能成功
//添加兑换记录并且提现
$result = $service->addUserExchangeAndQuota($data);
//这里直接使用服务返回的错误码,对应的错误码在language.php
return $this->Export($result['errcode']);
}
/**
* 好友助力接口
* @param Request $request
*/
public function assist(Request $request)
{
$userId = $request->user->user_id;
}
/**
* 兑换详情接口
*/
public function info(Request $request)
{
$userId = $request->user->user_id;
$type = $request->get('type');
//根据不同类型找到不同的提现信息
}
}
\ 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