Browse Source

药方相关接口数据优化

pull/1/head
pengda 9 months ago
parent
commit
bfa8b1e9d9
  1. 7
      model/mCase.php

7
model/mCase.php

@ -225,7 +225,7 @@ class mCase extends mBase {
} }
$case_ids = array(); $case_ids = array();
foreach ($case as &$item){ foreach ($case as &$item) {
$item['original'] = json_decode($item['original'], true); $item['original'] = json_decode($item['original'], true);
$case_ids[] = $item['id']; $case_ids[] = $item['id'];
} }
@ -246,8 +246,8 @@ class mCase extends mBase {
} }
$case_herb = array(); $case_herb = array();
foreach ($case_herbs as $item){ foreach ($case_herbs as $v) {
$case_herb[$item['case_id']][] = $item; $case_herb[$v['case_id']][] = $v;
} }
return array('case' => $case, 'case_herb' => $case_herb, 'herb' => array_column($herb, null, 'id')); return array('case' => $case, 'case_herb' => $case_herb, 'herb' => array_column($herb, null, 'id'));
@ -270,6 +270,7 @@ class mCase extends mBase {
$this->setError('查询不到此药方'); $this->setError('查询不到此药方');
return false; return false;
} }
$case['original'] = json_decode($case['original'], true);
//药方药材信息 //药方药材信息
$case_herb = $this->getCaseHerbByCaseId($case['id']); $case_herb = $this->getCaseHerbByCaseId($case['id']);

Loading…
Cancel
Save