$criteria=new CDbCriteria;
$criteria->addCondition("id=:id", "and");
$criteria->params[':id']=$_POST['book_id'];
$criteria->order = "remove_time desc";
$comments = BooksComments::model()->findAllByAttributes(
array('book_id'=>$_REQUEST["bkid"]),
$criteria
);
$readhistory = BooksHistory::model()->findAllByAttributes(
array('book_id'=>$_REQUEST["bkid"]),
new CDbCriteria(array("order"=>"borrow_time desc"))
);
$bookwaiting = BooksWaiting::model()->findAllByAttributes(
array('book_id'=>$book_id, 'status'=>array(0,1)),
new CDbCriteria(array("order"=>"id "))// ,"limit"=>"20", "offset"=>"0" // limit 0,20
);
修改:
BooksWaiting::model()->updateAll(
array("status"=>"4", "cancel_time"=>getCurTime()),
"book_id=:book_id and user_id=:user_id",
array(":book_id"=>$_REQUEST['book_id'], ":user_id"=>RoleUtil::getUser()->nsn_id)
);
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。