From 5a18492649abfc4e0833dfed68d5a163eb316439 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 4 Dec 2023 15:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=AD=E5=8F=B0=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=95=86=E5=9F=8E=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/middle/Merchant.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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']);