123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace app\admin\controller\wechat;
- use app\common\controller\Backend;
- use app\admin\model\WechatResponse;
- class LaveMonth extends Backend
- {
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = model('LaveMonth');
- }
- public function index()
- {
-
- $this->request->filter(['strip_tags', 'trim']);
- if ($this->request->isAjax()) {
-
- if ($this->request->request('keyField')) {
- $data = $this->selectpage()->getData();
- return $data;
- }
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-
- $where1 = is_sys_admin();
- $list = $this->model
- ->where($where)->where($where1)
- ->order($sort, $order)
- ->paginate($limit);
- foreach ($list as $k => $v) {
- }
- $result = array("total" => $list->total(), "rows" => $list->items());
- return json($result);
- }
- return $this->view->fetch();
- }
-
- public function edit($ids = null)
- {
- $row = $this->model->get(['id' => $ids]);
- if (!$row) {
- $this->error(__('No Results were found'));
- }
- if ($this->request->isPost()) {
- $params = $this->request->post("row/a");
- if ($params) {
- $row->save($params);
- $this->success();
- }
- $this->error();
- }
- $this->view->assign("row", $row);
- return $this->view->fetch();
- }
- }
|