增加tb_meal_type的备注notes,再购物车展示

Change-Id: I967e6a9bb3d2095ad07d9ff82515929618d98226
This commit is contained in:
vguanyiwgd 2024-04-02 17:29:04 +08:00
parent 63a19d6451
commit 93153b6d02
2 changed files with 11 additions and 1 deletions

View File

@ -1137,10 +1137,13 @@ class Dishes extends REST_Controller
$month = date('n', $date);
$day = date('j', $date);
$date_text = $month . '月' . $day . '日' . '(周' . cnWeek($date) . ')';
$dc_type_info = $this->Common_model->get_meal_type_by_id($cd->dc_type);
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['date_name'] = $date_text;
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['data'][$cd->dc_type]['type'] = $cd->type;
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['data'][$cd->dc_type]['date_id'] = $cd->date_id;
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['data'][$cd->dc_type]['meal_name'] = $this->Common_model->get_meal_type_by_id($cd->dc_type)->name;
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['data'][$cd->dc_type]['meal_name'] = $dc_type_info->name;
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['data'][$cd->dc_type]['notes'] = $dc_type_info->notes;
$dishes = $this->Dishes_model->get_dishes_by_dishes_id($cd->dish_id);
$cd->dish_name = $dishes->dish_name;
$result[$cd->dining_hall_id]['data'][$cd->dc_date]['data'][$cd->dc_type]['data'][] = $cd;

View File

@ -8753,6 +8753,13 @@ $(function () {
meal.rise_info.rise_tip +
'</p></div></div></li>';
}
if(meal.notes){
var notes = JSON.parse(meal.notes);
cartHtml +=
'<li><div class="row no-gutter"><div class="col-100"><p class="ma-0 tips text-red">备注:' +
notes.text +
'</p></div></div></li>';
}
cartHtml += '</ul>';
});
});