Commit 7707b03d authored by ZhuChunYang's avatar ZhuChunYang

添加时时彩查询接口

parent 33866811
...@@ -10,7 +10,7 @@ table1.render({ ...@@ -10,7 +10,7 @@ table1.render({
cols: [[ cols: [[
{field: 'id', title: '应用id'}, {field: 'id', title: '应用id'},
{field: 'name', title: '应用名称'}, {field: 'name', title: '应用名称'},
{field: 'sort', title: '排序'}, {field: 'sort', title: '排序',edit: 'text'},
{title: '操作', templet: '#operTpl'}, {title: '操作', templet: '#operTpl'},
]] ]]
}); });
...@@ -21,7 +21,7 @@ table2.render({ ...@@ -21,7 +21,7 @@ table2.render({
cols: [[ cols: [[
{field: 'id', title: '应用id'}, {field: 'id', title: '应用id'},
{field: 'name', title: '应用名称'}, {field: 'name', title: '应用名称'},
{field: 'sort', title: '排序'}, {field: 'sort', title: '排序',edit: 'text'},
{title: '操作', templet: '#operTpl'}, {title: '操作', templet: '#operTpl'},
]] ]]
}); });
...@@ -98,3 +98,17 @@ function after_close_add(reflush = true) { ...@@ -98,3 +98,17 @@ function after_close_add(reflush = true) {
$('select[name="applicate_id"]').val(0); $('select[name="applicate_id"]').val(0);
form.render(); form.render();
} }
//监听单元格编辑
table.on('edit(table1)', function(obj){
var value = obj.value; //得到修改后的值
var data = obj.data; //得到所在行所有键值
$.get('/admin/applicate-rank/set-sort', {id:data.id,type:data.type,sort:value}, function(rev) {
layer.msg(rev.msg);
if (0 == rev.code) {
table.reload('table1',{});
}else{
}
});
});
...@@ -52,4 +52,13 @@ class CoinLottery extends BaseActiveRecord ...@@ -52,4 +52,13 @@ class CoinLottery extends BaseActiveRecord
$coin_lottery->save(); $coin_lottery->save();
} }
/**
* @return array|null|\yii\db\ActiveRecord
* 获取最新记录
*/
public static function getLastRecord()
{
return self::find()->orderBy(['id' => SORT_DESC])->asArray()->one();
}
} }
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 2018/11/5
* Time: 10:15
*/
namespace h5\controllers;
use common\models\psources\CoinApplicateRank;
use common\models\psources\CoinLottery;
use h5\base\ResponseBuild;
use Yii;
use common\models\psources\Coin;
use h5\base\BaseController;
/**
* Class CoinController
* 时时彩控制器
*
* @package h5\controllers
*/
class LotteryController extends BaseController
{
public function actionLotteryInfo()
{
$lottery_config = Yii::$app->params['lottery'];
$period_num = $lottery_config['period_num'];
$response_ = new ResponseBuild();
$data = CoinLottery::getLastRecord();
$data['end_round'] = $period_num - $data['stage'] + $data['round'];
$response_->build(ResponseBuild::STATUS_SUCCEED, '', $data);
return $response_;
}
}
\ 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 to comment