|
|
|
@ -135,7 +135,7 @@ class OrderFinance_model extends CI_Model {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 子订单中人数最多的预定 */
|
|
|
|
|
public function get_max_cold_person_num($coli_sn=0)
|
|
|
|
|
public function get_max_cold_person_num($coli_sn=0, $cold_str='')
|
|
|
|
|
{
|
|
|
|
|
$sql = "SELECT
|
|
|
|
|
ISNULL(MAX(COLD_PersonNum+COLD_ChildNum+ISNULL(COLD_BabyNum,0)), 0) person_num
|
|
|
|
@ -143,12 +143,13 @@ class OrderFinance_model extends CI_Model {
|
|
|
|
|
,ISNULL(MAX(COLD_ChildNum+ISNULL(COLD_BabyNum,0)), 0) child_num
|
|
|
|
|
from BIZ_ConfirmLineDetail
|
|
|
|
|
where COLD_COLI_SN=$coli_sn ";
|
|
|
|
|
$sql .= $cold_str==='' ? " " : " and COLD_SN in ($cold_str) ";
|
|
|
|
|
$ret = $this->HT->query($sql)->row();
|
|
|
|
|
return $ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 订单人数 */
|
|
|
|
|
public function get_order_person_num($coli_sn=0)
|
|
|
|
|
public function get_order_person_num($coli_sn=0, $cold_str='')
|
|
|
|
|
{
|
|
|
|
|
$ret = new stdClass();
|
|
|
|
|
// 从订单客人名单列表中取
|
|
|
|
@ -162,8 +163,10 @@ class OrderFinance_model extends CI_Model {
|
|
|
|
|
$ret->person_num = $query->num_rows();
|
|
|
|
|
$guest_type_cnt = array_count_values(array_map(function($ele) { return $ele->BPE_GuestType; }, $query->result()));
|
|
|
|
|
// 从子订单的人数中取最大值
|
|
|
|
|
$max_person = $this->get_max_cold_person_num($coli_sn);
|
|
|
|
|
if ($ret->person_num === 0 || $ret->person_num < $max_person->person_num) {
|
|
|
|
|
$max_person = $this->get_max_cold_person_num($coli_sn, $cold_str);
|
|
|
|
|
if ($ret->person_num === 0 || $ret->person_num < $max_person->person_num
|
|
|
|
|
|| $cold_str!==''
|
|
|
|
|
) {
|
|
|
|
|
// 没有客人名单时, 客人名单小于子订单人数(如新港接送)时
|
|
|
|
|
// 使用子订单结果
|
|
|
|
|
$ret->person_num = $max_person->person_num;
|
|
|
|
|