public function actionChecklsbooking() { $result = VcosMemberBooking::model()->count("is_read=:num", array(':num' => '0')); //$result = VcosLifeserviceBooking::model()->count("is_read=:num",array(':num'=>'0')); echo $result; }
public function actionChangestate() { $state = VcosMemberBooking::model()->findByPk($_POST['id']); $state->id = $_POST['id']; $state->status = $_POST['state']; $state->is_read = 1; if ($state->save() > 0) { echo '1'; } else { echo '0'; } }