56,679
社区成员
发帖
与我相关
我的任务
分享
foreach ($sqlstaff as $key => &$value) {
$sqlservice="select ifnull(waiter,'total') as total,sum(if(table_id='$value[table_id]',count,0)) AS '$value[table_id]',SUM(count) AS count from newboll_tablelog where company='172' group by waiter with rollup";
$servicedata=$model->query($sqlservice);
$serviceDate[$key]=$servicedata;
}
动态查询 没有写游标