Blogger Information
Blog 175
fans 1
comment 0
visits 384658
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Yii CDbCriteria案例
dxp2tq的博客
Original
977 people have browsed it

$criteria = new CDbCriteria();  

$criteria->select = 'table_name,model_id,sum(amount) total';  

$criteria->group = 'table_name,model_id';  

$criteria->addCondition("$nIdcId=4");//也可以$criteria->condition = "$nIdcId=4";  

$aResult = accessory_info::model()->findAll($criteria);  

  

  

$c = new CDbCriteria();  

$c->select = 't.id, t.created_at, t.outsource_id, t.user_id, t.operate, t.content';  

$c->join = 'LEFT JOIN outsource ON outsource.id=t.outsource_id';  

$c->condition = 'outsource.idc_id IN(' . implode(',', $idc_ids)  . ')';  

  

if($last_log_id) {  

    $c->condition .= " AND t.id > $last_log_id";  

}  

  

$c->limit = 20;  

$c->order = 't.id DESC';  

  

$logs = OutsourceProcessLog::model()->findAll($c);  


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post