|
@@ -585,10 +585,14 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
|
|
|
// return Result::success($data);
|
|
|
$pid = $data['pid'] ?? 0;
|
|
|
- $result = District::where('pid', $pid)->where('status', 1)->orderBy('code')->get();
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("未查询到此地区", 0);
|
|
|
- } else {
|
|
|
+ $result = District::leftJoin('district as district2','district.pid','=','district2.id')
|
|
|
+ ->where('district.pid',$pid)
|
|
|
+ ->where('district.status',1)
|
|
|
+ ->select('district.*','district2.name as pid_name')
|
|
|
+ ->orderBy('district.code')->get();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("未查询到此地区",0);
|
|
|
+ }else{
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
}
|