update
Change-Id: I1fb94a18b1fb480770da7ba133f21408fb3f540f
This commit is contained in:
parent
3e222fc84e
commit
88f78c9db1
|
@ -750,25 +750,25 @@ class Dishes extends REST_Controller
|
||||||
// 最左侧菜单
|
// 最左侧菜单
|
||||||
$extra_menus = '';
|
$extra_menus = '';
|
||||||
// 左侧的列表2
|
// 左侧的列表2
|
||||||
$meal_list2 = array();
|
// $meal_list2 = array();
|
||||||
// 左侧的列表
|
// 左侧的列表
|
||||||
$date_list = array();
|
// $date_list = array();
|
||||||
|
|
||||||
$date_get = $this->input->get('date');
|
$date_get = $this->input->get('date');
|
||||||
// 当前展示的日期
|
// 当前展示的日期
|
||||||
$currentDateInfo = '';
|
// $currentDateInfo = '';
|
||||||
foreach($list as $item) {
|
// foreach($list as $item) {
|
||||||
// if(!empty($date_get)){
|
//// if(!empty($date_get)){
|
||||||
// if($date_get == $item['dc_date']){
|
//// if($date_get == $item['dc_date']){
|
||||||
// $currentDateInfo = $item['dc_date'];
|
//// $currentDateInfo = $item['dc_date'];
|
||||||
// }
|
//// }
|
||||||
// }else{
|
//// }else{
|
||||||
// $currentDateInfo = $list[0]['dc_date'];
|
//// $currentDateInfo = $list[0]['dc_date'];
|
||||||
// }
|
//// }
|
||||||
$date_list[$item['dc_date']][] = $item;
|
// $date_list[$item['dc_date']][] = $item;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$date_key = array_keys($date_list);
|
// $date_key = array_keys($date_list);
|
||||||
// 就是cp的id, 改为日期(当前日期)
|
// 就是cp的id, 改为日期(当前日期)
|
||||||
// if(empty($date_get)){
|
// if(empty($date_get)){
|
||||||
// $date_get = $date_key ? $date_key[0] : '';
|
// $date_get = $date_key ? $date_key[0] : '';
|
||||||
|
@ -793,27 +793,27 @@ class Dishes extends REST_Controller
|
||||||
//print_r($userCartList);exit;
|
//print_r($userCartList);exit;
|
||||||
|
|
||||||
// 遍历左侧日期cp
|
// 遍历左侧日期cp
|
||||||
foreach ($date_list as $dc_date => $dateInfo) {
|
// foreach ($date_list as $dc_date => $dateInfo) {
|
||||||
if (!empty($date_get) && $date_get != $dc_date) {
|
// if (!empty($date_get) && $date_get != $dc_date) {
|
||||||
|
//
|
||||||
foreach ($dateInfo as $dateInfo_k => $dateInfo_v) {
|
// foreach ($dateInfo as $dateInfo_k => $dateInfo_v) {
|
||||||
$date_id = $dateInfo_v['id'];
|
// $date_id = $dateInfo_v['id'];
|
||||||
$dishes_type_num = 0;
|
// $dishes_type_num = 0;
|
||||||
foreach ($userCartList as $cItem) {
|
// foreach ($userCartList as $cItem) {
|
||||||
if ($cItem['dining_hall_id'] == $dining_hall_id && $cItem['date_id'] == $date_id) {
|
// if ($cItem['dining_hall_id'] == $dining_hall_id && $cItem['date_id'] == $date_id) {
|
||||||
$dishes_type_num += $cItem['num'];
|
// $dishes_type_num += $cItem['num'];
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
$cart_arr[$dateInfo_v['dc_date']] += $dishes_type_num;
|
// $cart_arr[$dateInfo_v['dc_date']] += $dishes_type_num;
|
||||||
}
|
// }
|
||||||
$jcmeal[$dc_date] = array(
|
// $jcmeal[$dc_date] = array(
|
||||||
'cart_num' => $cart_arr[$dc_date],
|
// 'cart_num' => $cart_arr[$dc_date],
|
||||||
'meal_list' => array(),
|
// 'meal_list' => array(),
|
||||||
'active' => 0
|
// 'active' => 0
|
||||||
);
|
// );
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
$dining_hall_ids = array_column($dining_halls, 'id');
|
$dining_hall_ids = array_column($dining_halls, 'id');
|
||||||
$key = array_search($dining_hall_id, $dining_hall_ids);
|
$key = array_search($dining_hall_id, $dining_hall_ids);
|
||||||
|
@ -835,8 +835,6 @@ class Dishes extends REST_Controller
|
||||||
foreach ($date_dish_list as $book_k => $book_v) {
|
foreach ($date_dish_list as $book_k => $book_v) {
|
||||||
$date_id = $book_v['id'];
|
$date_id = $book_v['id'];
|
||||||
|
|
||||||
// if($book_v['dc_date'] == $dc_date){
|
|
||||||
// 获取当天
|
|
||||||
$dishes = $this->Dishes_model->get_dishes_by_type_id($date_id, '', $dining_hall_id, $this->user->type_id);
|
$dishes = $this->Dishes_model->get_dishes_by_type_id($date_id, '', $dining_hall_id, $this->user->type_id);
|
||||||
if(!empty($dishes) && empty($date_get)){
|
if(!empty($dishes) && empty($date_get)){
|
||||||
$date_get = $book_v['dc_date'];
|
$date_get = $book_v['dc_date'];
|
||||||
|
|
Loading…
Reference in New Issue