From ee367f5a76f51b22d2de79390a3e5446d6fc870d Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 1 Apr 2025 18:19:15 +0800 Subject: [PATCH] record --- .../admin/controller/orders/Dispatchrecord.php | 13 ++++++++----- .../admin/view/orders/dispatchrecord/add.html | 4 ++-- public/assets/js/backend/orders/dispatch2.js | 4 +--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/application/admin/controller/orders/Dispatchrecord.php b/application/admin/controller/orders/Dispatchrecord.php index 39f47ed..160d998 100644 --- a/application/admin/controller/orders/Dispatchrecord.php +++ b/application/admin/controller/orders/Dispatchrecord.php @@ -2,6 +2,7 @@ namespace app\admin\controller\orders; +use app\admin\model\OrderDispatch; use app\common\controller\Backend; use think\Db; use think\Exception; @@ -45,16 +46,18 @@ class Dispatchrecord extends Backend * @return string * @throws \think\Exception */ - public function add() + public function add($ids=null) { if (false === $this->request->isPost()) { - $dispatch_id = $this->request->get('dispatch_id'); + $dispatch = OrderDispatch::get($ids); + if(empty($dispatch)){ + $this->error('没有关联派单'); + } + $list = $this->model->where('dispatch_id',$ids)->order('id','desc')->select(); - $list = $this->model->where('dispatch_id',$dispatch_id)->order('id','desc')->select(); - - $this->assign('dispatch_id',$dispatch_id); + $this->assign('dispatch',$dispatch); $this->assign('records',$list); diff --git a/application/admin/view/orders/dispatchrecord/add.html b/application/admin/view/orders/dispatchrecord/add.html index 87e509c..4c284e7 100644 --- a/application/admin/view/orders/dispatchrecord/add.html +++ b/application/admin/view/orders/dispatchrecord/add.html @@ -4,9 +4,9 @@ {notempty name='records'}