public function actionDeleteAllHistoryOfRemind() { try { $request = Yii::app()->request; $remind_id = StringHelper::filterString($request->getQuery('remin_id')); $result = HistoryRemind::model()->deleteAllHistoryOfARemind($remind_id); if ($result) { ResponseHelper::JsonReturnSuccess('', 'Success'); } else { ResponseHelper::JsonReturnError('', 'Error !'); } } catch (Exception $ex) { var_dump($ex->getMessage()); } }
public function deleteAllHistoryOfARemind($remind_id) { $model = HistoryRemind::model()->findAllByAttributes(array('remind_id' => $remind_id)); $flag = TRUE; foreach ($model as $item) { if (!$item->delete) { $flag = FALSE; } } return $flag; }