public function actionDelete() { $companyId = Helper::getCompanyId(Yii::app()->request->getParam('companyId')); $ids = Yii::app()->request->getPost('lid'); Until::isUpdateValid($ids, $companyId, $this); //0,表示企业任何时候都在云端更新。 if (!empty($ids)) { foreach ($ids as $id) { $model = Retreat::model()->find('lid=:id and dpid=:companyId', array(':id' => $id, ':companyId' => $companyId)); if ($model) { $model->saveAttributes(array('delete_flag' => 1, 'update_at' => date('Y-m-d H:i:s', time()))); } } $this->redirect(array('retreat/index', 'companyId' => $companyId)); } else { Yii::app()->user->setFlash('error', yii::t('app', '请选择要删除的项目')); $this->redirect(array('retreat/index', 'companyId' => $companyId)); } }
public function actionRetreatTip() { $id = Yii::app()->request->getParam('id', 0); $companyId = Yii::app()->request->getParam('companyId'); $retreat = Retreat::model()->find(' lid=:id and dpid=:dpid', array(':id' => $id, ':dpid' => $companyId)); echo json_encode(array('cp' => $retreat->tip)); }