Commit f58b69a3 authored by ZhuChunYang's avatar ZhuChunYang

update

parent 05c46c1e
......@@ -10,6 +10,7 @@ namespace api\controllers;
use api\base\BaseController;
use common\business\ApplicationBusiness;
use common\models\psources\CoinApplicateRank;
use Yii;
......@@ -82,6 +83,12 @@ class ApplicationController extends BaseController
*/
public function actionRankList()
{
$request = Yii::$app->request;
$type = $request->post('type',1);
if($id){
return CoinApplicateRank::appList($type);
}else{
return ['code' => 1,'data' => [],'msg' => 'id不能为空'];
}
}
}
\ No newline at end of file
......@@ -42,5 +42,14 @@ class CoinApplicateRank extends BaseActiveRecord
return self::find()->where(['relate_id' => $relate_id,'type' => $type])->one();
}
public static function getAppList($type)
{
$applicate_rank_model = self::find();
$data = $applicate_rank_model->JoinWith(['application'], false)
->select('relate_id as id,sort,name,icon'.self::tableName().".type")
->orderBy(self::tableName().'.sort asc')->where([self::tableName().'.type' => $type])->asArray()->all();
return $data;
}
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ class LotteryController extends Controller
if($last_header['height'] >= $start_height + $lottery_config['period_total_step']){ //超过起始高度40个区块可以开奖
$lottery_result = LotteryBusiness::lottery();
if($lottery_result['code'] == 0){ //如果开奖操作成功
echo date('Y-m-d H:i:s').': '.'开奖成功: '.PHP_EOL;
}else{
echo date('Y-m-d H:i:s').': '.'开奖异常: '.$lottery_result['msg'].PHP_EOL;
}
......
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