first commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Administrator
|
||||
* Date: 2020/4/13
|
||||
* Time: 19:36
|
||||
*/
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Province extends Model
|
||||
{
|
||||
protected $table = 'yzy_province';
|
||||
|
||||
/*
|
||||
* 获取区域
|
||||
* return array
|
||||
* */
|
||||
public static function getAreaInfo($type = 1){
|
||||
$res = self::field('id,code,title,real_code')->order('firsts ASC')->cache(3600)->select()->toArray();
|
||||
|
||||
if($type == 2) {
|
||||
foreach ($res as $key => $val) {
|
||||
if ($val['title'] == "西藏") {
|
||||
unset($res[$key]);
|
||||
}
|
||||
}
|
||||
$res = array_values($res);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user