Browse Source

药方模型

pull/1/head
pengda 8 months ago
parent
commit
678f3e0e61
  1. 6
      model/mFormula.php

6
model/mFormula.php

@ -56,6 +56,8 @@ class mFormula extends mBase {
$formula_arr = $this->getFormulaHerbData($formula_ids);
foreach ($data as &$da) {
//格式化日期
$da['create_time'] = date('Y-m-d', strtotime($da['create_time']));
if (isset($formula_arr[$da['id']])) {
$da['formula'] = $formula_arr[$da['id']];
}
@ -85,6 +87,10 @@ class mFormula extends mBase {
foreach ($condition as $key => $val) {
if ($key == 'name') {
$where .= " and {$key} like '%{$val}%'";
} elseif ($key == 'uid' && is_array($val)) {
$val = implode(',', $val);
$where .= " and {$key} in ({$val})";
} else {
$where .= " and {$key}={$val}";
}

Loading…
Cancel
Save