model = model('app\index\model\wanlshop\ShopConfig'); $this->view->assign("typeList", $this->model->getTypeList()); } /** * 查看 */ public function index($type = '') { $row = $this->model->get(['shop_id' => $this->shop->id]); if(!$row){ $this->model->shop_id = $this->shop->id; $this->model->save(); } if ($this->request->isPost()) { $params = $this->request->post("row/a"); $result = false; $result = $row->save($params,['id' => 1]); if ($result !== false) { $this->success(); } else { $this->error(__('No rows were inserted')); } } $this->view->assign('type', $type); $this->view->assign('row', $row); return $this->view->fetch(); } }