diff --git a/backstage/application/api/controllers/api/Dishes.php b/backstage/application/api/controllers/api/Dishes.php index 17eea0b..14d47f9 100644 --- a/backstage/application/api/controllers/api/Dishes.php +++ b/backstage/application/api/controllers/api/Dishes.php @@ -832,6 +832,8 @@ class Dishes extends REST_Controller // $month = date('n', $date); // $day = date('j', $date); // $date_text = $month . '月' . $day . '日' . '(周' . cnWeek($date) . ')'; + + // 遍历每个dc_date foreach ($date_dish_list as $book_k => $book_v) { $date_id = $book_v['id']; @@ -846,7 +848,7 @@ class Dishes extends REST_Controller $dishes = $this->sort_dishes($dishes, '' , $dining_hall_id, $date_id, 0); $explode = explode(')', $book_v['jcname']); - $meal_list[$explode[1]]['cs'] = $dishes; +// $meal_list[$explode[1]]['cs'] = $dishes; // $date_dish_list[$book_k]['jcname'] = str_replace($date_text, '', $book_v['jcname']); $dishes_type_num = 0; @@ -856,15 +858,20 @@ class Dishes extends REST_Controller $dishes_type_num += $cItem['num']; } } - $cart_arr[$book_v['dc_date']] += $dishes_type_num; +// $cart_arr[$book_v['dc_date']] += $dishes_type_num; // } - if(!empty($meal_list)){ - $jcmeal[$book_v['dc_date']] = array( - 'cart_num' => $cart_arr[$book_v['dc_date']], - 'meal_list' => $meal_list, - 'active' => $book_v['dc_date'] == $date_get ? 1 : 0 - ); - } +// if(!empty($meal_list)){ + + $jcmeal[$book_v['dc_date']]['cart_num'] += $dishes_type_num; + $jcmeal[$book_v['dc_date']]['active'] = $book_v['dc_date'] == $date_get ? 1 : 0; + $jcmeal[$book_v['dc_date']]['meal_list'][$explode[1]] = $dishes; + +// $jcmeal[$book_v['dc_date']] = array( +// 'cart_num' => $cart_arr[$book_v['dc_date']], +// 'active' => $book_v['dc_date'] == $date_get ? 1 : 0 +// ); +// $jcmeal[$book_v['dc_date']]['meal_list'][$explode[1]][] = $dishes; +// } } $data['date'] = $date_get; @@ -872,7 +879,6 @@ class Dishes extends REST_Controller ksort($jcmeal); $data['jcdata'] = array( 'jcplace' => $dining_hall_info, - 'jcdate' => $date_key, 'jcmeal' => $jcmeal ); diff --git a/m/js/main.js b/m/js/main.js index 05aa419..2480296 100644 --- a/m/js/main.js +++ b/m/js/main.js @@ -2406,8 +2406,8 @@ $(function () { $.each(meal_list, function (d, date) { var look_li = ''; var cs_li = ''; - if (date['cs'].length > 0) { - $.each(date['cs'], function (i, cs) { + if (date.length > 0) { + $.each(date, function (i, cs) { if (cs.book_type != '2') { var addClass =