model = new ShopListModel(); $this->assign('customerList', Customer::where('status',Customer::STATUS_NORMAL)->column('name','id')); $this->assign('platformList', config("app.platform_list")); $this->assign('userList', User::where('status',Customer::STATUS_NORMAL)->column('nickname','id')); $this->relationField=['customer','staff']; } #[Route('GET,POST','add')] public function add() { if($this->request->isPost()){ } return $this->_add(); } #[Route('GET,POST','edit')] public function edit() { $ids = $this->request->get('ids'); $row = $this->model->find($ids); //...可以对row进行一些前置的操作 if($this->request->isPost()){ //通过postParams属性可以增加或者覆盖前端row/a传过来的参数 //$this->postParams['属性名']='属性的值'; } //注意这里传入已经修改过的$row return $this->_edit($row); } //删除 #[Route("GET","del")] public function del() { return "删除"; } //导入 #[Route("GET","import")] public function import() { return "导入"; } }