正在显示
1 个修改的文件
包含
6 行增加
和
15 行删除
@@ -482,39 +482,30 @@ class Attestation extends Api | @@ -482,39 +482,30 @@ class Attestation extends Api | ||
482 | } | 482 | } |
483 | $where['status'] = ['eq',1]; | 483 | $where['status'] = ['eq',1]; |
484 | $data = Db::name('government') | 484 | $data = Db::name('government') |
485 | + ->field('id,company_name') | ||
485 | ->where($where) | 486 | ->where($where) |
486 | ->select(); | 487 | ->select(); |
487 | if(empty($data)){ | 488 | if(empty($data)){ |
488 | $city = Db::name('government') | 489 | $city = Db::name('government') |
490 | + ->field('id,company_name') | ||
489 | ->where('province','Like',"$param[province]%") | 491 | ->where('province','Like',"$param[province]%") |
490 | ->where('city',$param['city']) | 492 | ->where('city',$param['city']) |
491 | ->select(); | 493 | ->select(); |
492 | if(empty($city)){ | 494 | if(empty($city)){ |
493 | $province = Db::name('government') | 495 | $province = Db::name('government') |
496 | + ->field('id,company_name') | ||
494 | ->where('province','Like',"$param[province]%") | 497 | ->where('province','Like',"$param[province]%") |
495 | ->select(); | 498 | ->select(); |
496 | if(empty($province)){ | 499 | if(empty($province)){ |
497 | $this->success('暂无机构'); | 500 | $this->success('暂无机构'); |
498 | }else{ | 501 | }else{ |
499 | - foreach ($province as $v){ | ||
500 | - $res['id'] = $v['id']; | ||
501 | - $res['institution'] = $v['company_name']; | ||
502 | - } | ||
503 | - $this->success('success',$res); | 502 | + $this->success('success',$province); |
504 | } | 503 | } |
505 | }else{ | 504 | }else{ |
506 | - foreach ($city as $v){ | ||
507 | - $res['id'] = $v['id']; | ||
508 | - $res['institution'] = $v['company_name']; | ||
509 | - } | ||
510 | - $this->success('success',$res); | 505 | + $this->success('success',$city); |
511 | } | 506 | } |
512 | }else{ | 507 | }else{ |
513 | - foreach ($data as $v){ | ||
514 | - $res['id'] = $v['id']; | ||
515 | - $res['institution'] = $v['company_name']; | ||
516 | - } | ||
517 | - $this->success('success',$res); | 508 | + $this->success('success',$data); |
518 | } | 509 | } |
519 | } | 510 | } |
520 | 511 |
-
请 注册 或 登录 后发表评论