diff --git a/app/controller/middle/Merchant.php b/app/controller/middle/Merchant.php index 0e8c665f..65915b29 100644 --- a/app/controller/middle/Merchant.php +++ b/app/controller/middle/Merchant.php @@ -29,6 +29,25 @@ class Merchant extends BaseController return app('json')->success($select); } + public function get_street(){ + $area_code = $this->request->param('area_code', ''); + $select=Db::name('geo_street')->where('area_code',$area_code)->field('street_id id,street_code code,street_name name')->select(); + $arr=$select?$select->toArray():[]; + foreach ($arr as $k=>$item){ + $first_char = mb_str_split($item['name']); + if($first_char[0]){ + $pinyin=new Pinyin(); + $string=$first_char[0]; + $pinyin = $pinyin->abbr($string); + $arr[$k]['pinyin']=$pinyin; + }else{ + $arr[$k]['pinyin']=''; + } + + } + return app('json')->success($arr); + } + public function count() { $where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);