new Expression('concat(m.run_date," ",m.prod_start_station_time)'), 'prod_end_station_time'=>new Expression('concat(m.run_date," ",m.prod_end_station_time)'), 'm.prod_start_station_res_id', 'm.prod_start_station_res_name', 'm.prod_end_station_res_id', 'm.prod_end_station_res_name', 'm.prod_start_station_area_id', 'm.prod_start_station_area_name', 'm.prod_end_station_area_id', 'm.prod_end_station_area_name', 'start_longitude'=>'(select property from base_resource_property where res_id=m.prod_start_station_res_id and type_id=212 and cancel_flag=0 limit 1)', 'start_latitude'=>'(select property from base_resource_property where res_id=m.prod_start_station_res_id and type_id=213 and cancel_flag=0 limit 1)', ]; $res1 = (new Query())->select($select) ->from('order_main as m') ->where(['and', ['=', 'm.customer_mobile', $cus_phone], ['=', 'm.agent_level', 1], ['>=', 'm.run_date', $start_date], ['<=', 'm.run_date', $end_date],['>', 'm.parent_order_id', 0],['=', 'm.order_prod_type', 82],['=', 'm.cancel_flag', 0],['in', 'm.order_status', [146,147]] ]) ->groupBy("m.parent_order_id") ->all(); if( !$res1 ) { return false; } return $res1; } }