如何编写以下代码:
- run: bundle install && bundle clean
采用if(!empty($event))
$msg = " and LogEvent='".$event."'";
else $msg ="";
if(!empty($user))
$k = " and UserName='".$user."'";
else $k ="";
$sql="select UserName,CONVERT_TZ(EventTime,'+00:00','+5:30') as EventTime,EventName,CarrierName,TrunkGroupName,A.Description as Description
from
Nextone_cdr_config.UserLogs A,
Nextone_cdr_config.Carriers C,
Nextone_cdr_config.TrunkGroups T,
Nextone_cdr_config.UserEvent B
where
CarrierId=A.FK_CarrierId and
TrunkGroupId=FK_TrunkGroupId and
B.Id=LogEvent ".$msg.$k. " and
date(EventTime)>='".$date."'
and Date(EventTime)<='".$date1."';
";
格式,无论将查询放置在何处,模型的名称(在cakephp2中应为表名)应该是什么?