|
@@ -1069,7 +1069,7 @@ class DoctorController extends AuthController
|
|
* Auth:Yuanhang-Liu
|
|
* Auth:Yuanhang-Liu
|
|
* Date:2020/10/17 13:21
|
|
* Date:2020/10/17 13:21
|
|
* @return \Illuminate\Http\JsonResponse
|
|
* @return \Illuminate\Http\JsonResponse
|
|
- */
|
|
|
|
|
|
+ */
|
|
public function userList()
|
|
public function userList()
|
|
{
|
|
{
|
|
$req = request()->post();
|
|
$req = request()->post();
|
|
@@ -1453,6 +1453,8 @@ class DoctorController extends AuthController
|
|
$finds = Patient::where('id', '=', $req['patient_id'])->first();
|
|
$finds = Patient::where('id', '=', $req['patient_id'])->first();
|
|
if ($finds) {
|
|
if ($finds) {
|
|
$finds = $finds->toArray();
|
|
$finds = $finds->toArray();
|
|
|
|
+ }else{
|
|
|
|
+ return out();
|
|
}
|
|
}
|
|
if ($finds['sex'] == 0) {
|
|
if ($finds['sex'] == 0) {
|
|
$finds['sex'] = '未知';
|
|
$finds['sex'] = '未知';
|
|
@@ -1488,12 +1490,24 @@ class DoctorController extends AuthController
|
|
$finds['relationship_type'] = '其他';
|
|
$finds['relationship_type'] = '其他';
|
|
}
|
|
}
|
|
$finds['age'] = numBirthday($finds['birthday']);
|
|
$finds['age'] = numBirthday($finds['birthday']);
|
|
|
|
+ $user_id = $user['id'];
|
|
// 患者单子
|
|
// 患者单子
|
|
- $patient_list = OrderPatient::with('order')->where('patient_id', '=', $req['patient_id'])->groupBy('id', 'order_id')->get();
|
|
|
|
|
|
+ $order_where = [];
|
|
|
|
+ $order_where['docter_id'] = $user_id;
|
|
|
|
+ $order_where['order_status'] = 4;
|
|
|
|
+ $patient_list = OrderPatient::with("order")
|
|
|
|
+ ->where('patient_id','=',$req['patient_id'])
|
|
|
|
+ ->whereHas('order',function ($query) use ($order_where){
|
|
|
|
+ return $query->where($order_where);
|
|
|
|
+ })
|
|
|
|
+ ->groupBy('id', 'order_id')->get();
|
|
$patient_arr = [];
|
|
$patient_arr = [];
|
|
if ($patient_list) {
|
|
if ($patient_list) {
|
|
$patient_list = $patient_list->toArray();
|
|
$patient_list = $patient_list->toArray();
|
|
foreach ($patient_list as $k => $v) {
|
|
foreach ($patient_list as $k => $v) {
|
|
|
|
+ if (!$v['order']){
|
|
|
|
+ unset($patient_list[$k]);
|
|
|
|
+ }
|
|
switch ($v['order']['product_type']) {
|
|
switch ($v['order']['product_type']) {
|
|
case 1:
|
|
case 1:
|
|
$patient_arr[$k]['product_type'] = '电话咨询';
|
|
$patient_arr[$k]['product_type'] = '电话咨询';
|