repository = $repository; } public function get_area(){ $city_code = $this->request->param('city_code', ''); $select = Db::name('geo_area')->where('city_code',$city_code)->field('area_id id,area_code code,area_name name')->select(); 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']); return app('json')->success($this->repository->count($where)); } public function lst() { [$page, $limit] = $this->getPage(); $where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']); $data = $this->repository->lst($where, $page, $limit); $data['lists'] = $data['list']; unset($data['list']); return app('json')->success($data); } }