在tb_meal_type 增加allow_date_multi 自定义控制是否可以多订餐
Change-Id: Ib6a4acda3d6a056b022699a7853840ff33d717a3
This commit is contained in:
parent
5b786a5b53
commit
6c03627c63
|
@ -112,9 +112,31 @@ class Common
|
||||||
// $order = $this->_CI->Order_model->get_order_by_uid_date_id($user->id, $dishes_info->date_id);
|
// $order = $this->_CI->Order_model->get_order_by_uid_date_id($user->id, $dishes_info->date_id);
|
||||||
|
|
||||||
if ($dishes_info->type == DISHES_TYPE_COMMON) {
|
if ($dishes_info->type == DISHES_TYPE_COMMON) {
|
||||||
|
// 判断是否适合多次订餐
|
||||||
|
// 获取当前tb_meal_type的信息
|
||||||
|
$meal_type_info = $this->_CI->Common_model->get_meal_type_by_id($dishes_info->dc_type);
|
||||||
|
$allow_date_multi_arr = json_decode($meal_type_info->allow_date_multi, true);
|
||||||
|
|
||||||
|
// 允许的user_type
|
||||||
|
$allow_user_type_list = explode(",", $allow_date_multi_arr['user_type_list']);
|
||||||
|
|
||||||
|
// 允许的user_id
|
||||||
|
$allow_user_id_list = explode(",", $allow_date_multi_arr['user_id_list']);
|
||||||
|
|
||||||
|
if(in_array($user->type_id, $allow_user_type_list)){
|
||||||
|
$allow_date_multi_type_id = 1;
|
||||||
|
}else{
|
||||||
|
$allow_date_multi_type_id = 0;
|
||||||
|
}
|
||||||
|
if(!empty($allow_user_id_list)){
|
||||||
|
if(in_array($user->id, $allow_user_id_list)){
|
||||||
|
$allow_date_multi_user_id = 1;
|
||||||
|
}else{
|
||||||
|
$allow_date_multi_user_id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($allow_date_multi_user_id == 0 && $allow_date_multi_user_id == 0){
|
||||||
/*
|
/*
|
||||||
个性化 对于company_id = 58 韶关小岛 订餐规则 早午晚餐时间段,员工仅可以订餐+付款码在内,同一个时间段仅可一次
|
个性化 对于company_id = 58 韶关小岛 订餐规则 早午晚餐时间段,员工仅可以订餐+付款码在内,同一个时间段仅可一次
|
||||||
早餐 6:00 - 9:00
|
早餐 6:00 - 9:00
|
||||||
|
@ -132,7 +154,7 @@ class Common
|
||||||
$this->_CI->Cart_model->clear_dishes($c->id);
|
$this->_CI->Cart_model->clear_dishes($c->id);
|
||||||
$error[CART_ERROR_HAS_ORDER][] = $c;
|
$error[CART_ERROR_HAS_ORDER][] = $c;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue