$criteria = new CDbCriteria;
$criteria->join = "JOIN hm_live_catalog on t.catalog_id=hm_live_catalog.id";
$criteria->addColumnCondition(array('hm_live_catalog.os' => 1));
$criteria->addColumnCondition(array('t.status' => 1));
$criteria->addColumnCondition(array('t.com_id' => $this->com_id));
$criteria->addInCondition('catalog_id', $arrCatalogId);
$total = Content::model()->count($criteria);
$content = Content::model()->findAll($criteria);
$attr = array('username' => $params['username'], 'email' => $params['email']);
$member = Member::model()->findByAttributes($attr);
p($member->username) ;
添加:
$tag_model = new Tag('add');
$tag_model->tag = $tag;
$tag_model->save();
$id = $tag_model ->id;
删除:
$criteria = new CDbCriteria();
$criteria->addColumnCondition(array('content_id' => $contentid));
$deleteR = ContentTag::model()->deleteAll($criteria);