first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Administrator
|
||||
* Date: 2020/4/15
|
||||
* Time: 9:20
|
||||
*/
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProScoreRank extends Model
|
||||
{
|
||||
protected $table = 'yzy_weici';
|
||||
|
||||
/*
|
||||
* 根据省份,文理科,分数查询用户排名
|
||||
* @param $data['province'] int 省份code
|
||||
* @param $data['subType'] int 文理科或其他0
|
||||
* @param $data['score'] int 分数
|
||||
* return @array
|
||||
* */
|
||||
public static function getProRankByScore($data){
|
||||
//调用配置里面的年份
|
||||
$year = config('setsub.year');
|
||||
|
||||
$result = self::field('lowestRank,minScore')->where([['yzy_province','=',$data['province']],
|
||||
['wenli','=',$data['subType']],['year','=',$year],['minScore','<=',$data['score']],['maxScore','>=',$data['score']]])->cache(3600)->find();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user