Files
CompanyProject/芳林公司项目/www.zhiyuanhelp.com/application/api/model/Province.php
2024-09-27 01:32:49 +08:00

37 lines
700 B
PHP

<?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;
}
}