12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\common\api;
- use app\common\model\LivingAllowance as LaModel;
- use app\common\state\LivingAllowanceState as LaState;
- /**
- * Description of LivingAllowanceApi
- *
- * @author sgq
- */
- class LivingAllowanceApi {
- public static function getList($where = []) {
- return LaModel::where($where)->select()->toArray();
- }
- public static function getInfoById($id) {
- return LaModel::findOrEmpty($id)->toArray();
- }
- public static function getApplyCountByIdCard($idCard) {
- $where = [];
- $where[] = ["idCard", "=", $idCard];
- $where[] = ["checkState", "<>", LaState::LA_NOTPASS];
- $list = LaModel::where($where)->distinct(true)->field("substr(year,1,4)")->select();
- return count($list);
- }
- }
|