123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace app\admin\controller\about;
- use app\common\controller\Backend;
- class AboutLangs extends Backend
- {
-
-
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\about\AboutLangs;
- $this->view->assign("langlistList", $this->model->getLanglistList());
- }
- public function import()
- {
- parent::import();
- }
-
-
- public function add()
- {
- if ($this->request->isPost()) {
- $params = $this->request->post("row/a");
- if ($this->model->where('about_id', $params['about_id'])->where('langlist', $params['langlist'])->find()) {
- $this->error(__('Same Language Data'));
- }
- }
- return parent::add();
- }
-
- public function edit($ids = null)
- {
- if ($this->request->isPost()) {
- $params = $this->request->post("row/a");
- if ($this->model->where('id', '<>', $ids)->where('about_id', $params['about_id'])->where('langlist', $params['langlist'])->find()) {
- $this->error(__('Same Language Data'));
- }
- }
- return parent::edit($ids);
- }
- }
|