You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
720 B
35 lines
720 B
<?php |
|
/** |
|
* Created by IntelliJ IDEA. |
|
* User: luwei |
|
* Date: 2017/9/8 |
|
* Time: 11:15 |
|
*/ |
|
|
|
namespace app\modules\api\models; |
|
|
|
use app\models\DistrictArr; |
|
|
|
class WechatDistrictForm extends ApiModel |
|
{ |
|
public $national_code; |
|
|
|
public $province_name; |
|
public $city_name; |
|
public $county_name; |
|
|
|
public function rules() |
|
{ |
|
return [ |
|
[['national_code', 'province_name', 'city_name', 'county_name',], 'safe',], |
|
]; |
|
} |
|
|
|
public function search() |
|
{ |
|
if (!$this->validate()) |
|
return $this->errorResponse; |
|
return DistrictArr::getWechatDistrict($this->province_name, $this->city_name, $this->county_name); |
|
} |
|
|
|
}
|
|
|