post()->goCheck('add'); $result = (new FreightLogic())->add($params); if (true !== $result) { return $this->fail($result); } return $this->success('添加成功',[],1,1); } /** * @notes 查看运费模版列表 * @return \think\response\Json * @author ljj * @date 2021/7/30 4:56 下午 */ public function lists() { return $this->dataLists(new FreightLists()); } /** * @notes 编辑运费模版 * @return \think\response\Json * @author ljj * @date 2021/7/30 6:06 下午 */ public function edit() { $params = (new FreightValidate())->post()->goCheck('edit'); $result = (new FreightLogic())->edit($params); if (true !== $result) { return $this->fail($result); } return $this->success('修改成功',[],1,1); } /** * @notes 查看运费模版详情 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author ljj * @date 2021/7/30 6:52 下午 */ public function detail() { $params = (new FreightValidate())->goCheck('detail'); $result = (new FreightLogic())->detail($params); return $this->success('获取成功',$result); } /** * @notes 删除运费模版 * @return \think\response\Json * @author ljj * @date 2021/7/30 7:00 下午 */ public function del() { $params = (new FreightValidate())->post()->goCheck('del'); (new FreightLogic())->del($params); return $this->success('删除成功',[],1,1); } }