area model update for get city first char
This commit is contained in:
@@ -39,16 +39,18 @@ class Area_model extends HD_Model
|
||||
public function city($province_id = '',$type = 0)
|
||||
{
|
||||
$result = array();
|
||||
$list = $this->select(array('province_id' => $province_id), null, null, null, 'distinct(city_id), city_name');
|
||||
$list = $this->select(array('province_id' => $province_id), null, null, null, 'distinct(city_id), city_name, firstchar');
|
||||
$type == 0 && $result[] = array('name'=>'城市','id'=>'');
|
||||
if($list)
|
||||
{
|
||||
foreach ($list as $v)
|
||||
{
|
||||
$result[$v['city_id']] = array(
|
||||
$item = array(
|
||||
'id' => $v['city_id'],
|
||||
'name' => $v['city_name'],
|
||||
);
|
||||
2 == $type && $item['firstchar'] = $v['firstchar'];
|
||||
$result[$v['city_id']] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user