Commit 0c93b8c7 authored by shajiaiming's avatar shajiaiming

修复已知问题

parent 74b9c2a8
......@@ -90,7 +90,7 @@ class TickerController extends BaseController
$symbol = $request->post('symbol', '');
$platform = $request->post('platform', '');
$device_code = $request->post('device_code', '');
$platform_id = $request->post('platform_id', '');
$platform_id = $request->post('platform_id', 0);
if (empty($symbol) || empty($platform) || empty($device_code) || empty($platform_id)) {
$msg = '参数错误';
......@@ -115,7 +115,7 @@ class TickerController extends BaseController
if ($request->isGet) {
$device_code = $request->get('device_code', '');
$platform_id = $request->get('platform_id', '');
$platform_id = $request->get('platform_id', 0);
$page = Yii::$app->request->get('page', 1);
if (false == $device_code || false == $platform_id) {
$msg = '参数错误';
......@@ -123,7 +123,7 @@ class TickerController extends BaseController
}
$temp = [];
$query = CoinOptional::find()->select('symbol, platform')
->where(['device_code' => $device_code, 'platform_id' => $platform_id])
->where(['device_code' => $device_code, 'platform_id' => (int)$platform_id])
->orderBy('update_time desc');
$data = $query->offset(($page - 1) * 50)->limit(50)->asArray()->all();
if (false == $data) {
......@@ -215,12 +215,12 @@ class TickerController extends BaseController
$symbol = $request->post('symbol', '');
$platform = $request->post('platform', '');
$device_code = $request->post('device_code', '');
$platform_id = $request->post('platform_id', '');
$platform_id = $request->post('platform_id', 0);
if (empty($symbol) || empty($device_code) || empty($platform) || empty($platform_id)) {
$msg = '请求参数错误!';
goto doEnd;
}
$model = CoinOptional::find()->where(['symbol' => $symbol, 'platform' => $platform, 'device_code' => $device_code, 'platform_id' => $platform_id])->one();
$model = CoinOptional::find()->where(['symbol' => $symbol, 'platform' => $platform, 'device_code' => $device_code, 'platform_id' => (int)$platform_id])->one();
if (empty($model)) {
$msg = '数据不存在!';
goto doEnd;
......
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 to comment