| xqd
@@ -794,7 +794,7 @@ class ApiController extends Controller
|
|
|
$list = [];
|
|
|
if ($role == 1) {
|
|
|
$ids = DocterOrganization::where(['organization_id' => $org_id])->pluck('docter_id')->toArray();
|
|
|
- $docters = Docter::whereIn('id', $ids)->distinct('id')->get(['id', 'name'])->toArray();
|
|
|
+ $docters = Docter::whereIn('id', $ids)->distinct('id')->orderBy('id')->get(['id', 'name'])->toArray();
|
|
|
if (!empty($docters)) {
|
|
|
//机构默认取第一个医生id
|
|
|
$docter_id = $docters[0]['id'];
|
| xqd
@@ -806,7 +806,7 @@ class ApiController extends Controller
|
|
|
|
|
|
} else if ($role == 2) {
|
|
|
$ids = DocterOrganization::where(['docter_id' => $user->docter_id])->distinct('docter_id')->pluck('organization_id')->toArray();
|
|
|
- $docters = Organization::whereIn('id', $ids)->get(['id', 'name']);
|
|
|
+ $docters = Organization::whereIn('id', $ids)->orderBy('id')->get(['id', 'name']);
|
|
|
foreach ($docters as $val) {
|
|
|
$list[] = ['value' => $val->id, 'label' => $val->name];
|
|
|
}
|