Exemplo n.º 1
0
 public function updateNotice()
 {
     $moduleName = \common\populac\components\Module::getModuleName(get_class($this->owner));
     if ($module = Module::findOne(['name' => $moduleName])) {
         $module->notice = call_user_func($this->callback);
         $module->update();
     }
 }
Exemplo n.º 2
0
 public function actionDelete($id)
 {
     if ($model = Module::findOne($id)) {
         $model->delete();
     } else {
         $this->error = 'Not found';
     }
     return $this->formatResponse('模块已删除!');
 }
Exemplo n.º 3
0
 public function actionViewall()
 {
     Guestbook::updateAll(['new' => 0]);
     $module = \common\populac\models\Module::findOne(['name' => 'guestbook']);
     $module->notice = 0;
     $module->save();
     $this->flash('success', Yii::t('easyii/guestbook', 'Guestbook updated'));
     return $this->back();
 }