From b0bb19777114558c73b0555974bb351b08fdc62b Mon Sep 17 00:00:00 2001 From: 15090180611 <215509543@qq.com> Date: Thu, 7 Nov 2024 18:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E7=94=A8=E6=88=B7=E7=94=9F?= =?UTF-8?q?=E6=88=90=EF=BC=8C=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=A0=B8=E9=94=80=E6=9D=83=E9=99=90=EF=BC=8C?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E8=AF=A6=E6=83=85=EF=BC=8C=E6=95=99=E5=B8=88?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/dyqc/ManystoreShop.php | 71 ++++ .../controller/school/classes/VirtualUser.php | 8 +- .../school/classes/hourorder/Order.php | 4 +- .../admin/lang/zh-cn/dyqc/manystore_shop.php | 34 ++ .../zh-cn/school/classes/hourorder/order.php | 2 + .../school/classes/hourorder/order_log.php | 2 + .../zh-cn/school/classes/virtual_user.php | 6 + .../admin/model/dyqc/ManystoreShop.php | 104 ++++++ .../admin/model/school/classes/Teacher.php | 15 +- .../model/school/classes/VirtualUser.php | 28 +- .../model/school/classes/hourorder/Order.php | 4 +- .../school/classes/hourorder/OrderLog.php | 2 +- .../admin/validate/dyqc/ManystoreShop.php | 27 ++ .../admin/view/dyqc/manystore_shop/add.html | 165 ++++++++ .../admin/view/dyqc/manystore_shop/edit.html | 165 ++++++++ .../admin/view/dyqc/manystore_shop/index.html | 46 +++ .../view/school/classes/classes_lib/add.html | 40 +- .../view/school/classes/classes_lib/edit.html | 42 ++- .../view/school/classes/classes_spec/add.html | 2 +- .../school/classes/classes_spec/edit.html | 2 +- .../view/school/classes/teacher/add.html | 4 +- .../view/school/classes/teacher/edit.html | 4 +- .../view/school/classes/verification/add.html | 6 +- .../school/classes/verification/edit.html | 6 +- .../view/school/classes/virtual_user/add.html | 2 +- .../school/classes/virtual_user/edit.html | 2 +- application/api/controller/Common.php | 32 +- application/api/controller/User.php | 5 + application/api/controller/school/Base.php | 25 ++ application/api/controller/school/Classes.php | 119 ++++++ application/api/controller/school/Order.php | 57 +++ application/api/controller/school/Shop.php | 60 +++ application/api/controller/school/Teacher.php | 57 +++ .../api/controller/school/worker/Base.php | 25 ++ application/common/library/Virtual.php | 66 ++++ application/common/model/User.php | 33 +- .../common/model/dyqc/ManystoreShop.php | 178 +++++++++ .../common/model/school/classes/Cate.php | 59 +++ .../model/school/classes/ClassesLib.php | 353 ++++++++++++++++++ .../model/school/classes/ClassesSpec.php | 87 +++++ .../common/model/school/classes/Collect.php | 60 +++ .../common/model/school/classes/Label.php | 59 +++ .../common/model/school/classes/Lib.php | 12 + .../common/model/school/classes/Order.php | 12 + .../common/model/school/classes/Teacher.php | 95 +++++ .../model/school/classes/Verification.php | 65 ++++ .../model/school/classes/VirtualHead.php | 53 +++ .../model/school/classes/VirtualUser.php | 60 +++ .../model/school/classes/hour/Order.php | 12 + .../model/school/classes/hourorder/Order.php | 140 +++++++ .../school/classes/hourorder/OrderLog.php | 53 +++ .../common/model/school/classes/lib/Spec.php | 12 + .../model/school/classes/order/Detail.php | 12 + .../model/school/classes/order/Order.php | 189 ++++++++++ .../school/classes/order/OrderDetail.php | 99 +++++ .../model/school/classes/order/OrderLog.php | 95 +++++ .../controller/school/classes/VirtualUser.php | 3 +- .../zh-cn/school/classes/hourorder/order.php | 1 + .../school/classes/hourorder/order_log.php | 1 + .../zh-cn/school/classes/virtual_user.php | 6 + application/manystore/model/Admin.php | 12 + .../model/SchoolClassesHourOrder.php | 12 + .../manystore/model/SchoolClassesLib.php | 12 + .../manystore/model/SchoolClassesLibSpec.php | 12 + .../manystore/model/SchoolClassesOrder.php | 12 + .../model/SchoolClassesOrderDetail.php | 12 + application/manystore/model/User.php | 12 + .../model/school/classes/VirtualUser.php | 28 +- .../model/school/classes/hourorder/Order.php | 2 +- .../school/classes/hourorder/OrderLog.php | 2 +- .../view/school/classes/virtual_user/add.html | 24 ++ .../school/classes/virtual_user/edit.html | 24 ++ .../backend/school/classes/hourorder/order.js | 4 +- .../school/classes/hourorder/order_log.js | 2 +- .../js/backend/school/classes/virtual_user.js | 5 +- .../school/classes/hourorder/order.js | 2 +- .../school/classes/hourorder/order_log.js | 2 +- .../manystore/school/classes/virtual_user.js | 4 +- 78 files changed, 3113 insertions(+), 58 deletions(-) create mode 100644 application/admin/controller/dyqc/ManystoreShop.php create mode 100644 application/admin/lang/zh-cn/dyqc/manystore_shop.php create mode 100644 application/admin/model/dyqc/ManystoreShop.php create mode 100644 application/admin/validate/dyqc/ManystoreShop.php create mode 100644 application/admin/view/dyqc/manystore_shop/add.html create mode 100644 application/admin/view/dyqc/manystore_shop/edit.html create mode 100644 application/admin/view/dyqc/manystore_shop/index.html create mode 100644 application/api/controller/school/Base.php create mode 100644 application/api/controller/school/Classes.php create mode 100644 application/api/controller/school/Order.php create mode 100644 application/api/controller/school/Shop.php create mode 100644 application/api/controller/school/Teacher.php create mode 100644 application/api/controller/school/worker/Base.php create mode 100644 application/common/library/Virtual.php create mode 100644 application/common/model/dyqc/ManystoreShop.php create mode 100644 application/common/model/school/classes/Cate.php create mode 100644 application/common/model/school/classes/ClassesLib.php create mode 100644 application/common/model/school/classes/ClassesSpec.php create mode 100644 application/common/model/school/classes/Collect.php create mode 100644 application/common/model/school/classes/Label.php create mode 100644 application/common/model/school/classes/Lib.php create mode 100644 application/common/model/school/classes/Order.php create mode 100644 application/common/model/school/classes/Teacher.php create mode 100644 application/common/model/school/classes/Verification.php create mode 100644 application/common/model/school/classes/VirtualHead.php create mode 100644 application/common/model/school/classes/VirtualUser.php create mode 100644 application/common/model/school/classes/hour/Order.php create mode 100644 application/common/model/school/classes/hourorder/Order.php create mode 100644 application/common/model/school/classes/hourorder/OrderLog.php create mode 100644 application/common/model/school/classes/lib/Spec.php create mode 100644 application/common/model/school/classes/order/Detail.php create mode 100644 application/common/model/school/classes/order/Order.php create mode 100644 application/common/model/school/classes/order/OrderDetail.php create mode 100644 application/common/model/school/classes/order/OrderLog.php create mode 100644 application/manystore/model/Admin.php create mode 100644 application/manystore/model/SchoolClassesHourOrder.php create mode 100644 application/manystore/model/SchoolClassesLib.php create mode 100644 application/manystore/model/SchoolClassesLibSpec.php create mode 100644 application/manystore/model/SchoolClassesOrder.php create mode 100644 application/manystore/model/SchoolClassesOrderDetail.php create mode 100644 application/manystore/model/User.php diff --git a/application/admin/controller/dyqc/ManystoreShop.php b/application/admin/controller/dyqc/ManystoreShop.php new file mode 100644 index 0000000..0795b38 --- /dev/null +++ b/application/admin/controller/dyqc/ManystoreShop.php @@ -0,0 +1,71 @@ +model = new \app\admin\model\dyqc\ManystoreShop; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['admin']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('admin')->visible(['nickname']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/controller/school/classes/VirtualUser.php b/application/admin/controller/school/classes/VirtualUser.php index e99bd8f..a35ccc2 100644 --- a/application/admin/controller/school/classes/VirtualUser.php +++ b/application/admin/controller/school/classes/VirtualUser.php @@ -22,7 +22,8 @@ class VirtualUser extends Backend { parent::_initialize(); $this->model = new \app\admin\model\school\classes\VirtualUser; - + $this->view->assign("jointypeList", $this->model->getJointypeList()); + $this->view->assign("havetypeList", $this->model->getHavetypeList()); } @@ -57,8 +58,9 @@ class VirtualUser extends Backend ->paginate($limit); foreach ($list as $row) { - - $row->getRelation('lib')->visible(['title','headimage']); +// $row->visible(['id','classes_lib_id']); +// $row->visible(['lib']); + $row->getRelation('lib')->visible(['title','headimage']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/classes/hourorder/Order.php b/application/admin/controller/school/classes/hourorder/Order.php index b705ab9..2b6f4a2 100644 --- a/application/admin/controller/school/classes/hourorder/Order.php +++ b/application/admin/controller/school/classes/hourorder/Order.php @@ -51,14 +51,14 @@ class Order extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['order','spec','user','detail','lib']) + ->with(['classesorder','spec','user','detail','lib']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('order')->visible(['order_no']); + $row->getRelation('classesorder')->visible(['order_no']); $row->getRelation('spec')->visible(['name']); $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); $row->getRelation('detail')->visible(['title','headimage']); diff --git a/application/admin/lang/zh-cn/dyqc/manystore_shop.php b/application/admin/lang/zh-cn/dyqc/manystore_shop.php new file mode 100644 index 0000000..35d9aba --- /dev/null +++ b/application/admin/lang/zh-cn/dyqc/manystore_shop.php @@ -0,0 +1,34 @@ + 'ID', + 'Name' => '店铺名称', + 'Logo' => '品牌LOGO', + 'Image' => '封面图', + 'Images' => '店铺环境照片', + 'Address_city' => '城市选择', + 'Province' => '省编号', + 'City' => '市编号', + 'District' => '县区编号', + 'Address' => '店铺地址', + 'Address_detail' => '店铺详细地址', + 'Longitude' => '经度', + 'Latitude' => '纬度', + 'Yyzzdm' => '营业执照', + 'Yyzz_images' => '营业执照照片', + 'Tel' => '服务电话', + 'Content' => '店铺详情', + 'Status' => '审核状态', + 'Status 0' => '待审核', + 'Set status to 0'=> '设为待审核', + 'Status 1' => '审核通过', + 'Set status to 1'=> '设为审核通过', + 'Status 2' => '审核失败', + 'Set status to 2'=> '设为审核失败', + 'Reason' => '审核不通过原因', + 'Auth_time' => '审核时间', + 'Admin_id' => '审核管理员id', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'Admin.nickname' => '昵称' +]; diff --git a/application/admin/lang/zh-cn/school/classes/hourorder/order.php b/application/admin/lang/zh-cn/school/classes/hourorder/order.php index d005421..3432102 100644 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order.php +++ b/application/admin/lang/zh-cn/school/classes/hourorder/order.php @@ -16,6 +16,8 @@ return [ 'Status' => '订单状态', 'Status -3' => '已取消', 'Set status to -3' => '设为已取消', + 'Status -1' => '已报名待审核', + 'Set status to -1' => '设为已报名待审核', 'Status 0' => '已预约', 'Set status to 0' => '设为已预约', 'Status 3' => '已完成', diff --git a/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php b/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php index 6ba3615..8ad69ca 100644 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php +++ b/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php @@ -5,6 +5,8 @@ return [ 'Status' => '订单状态', 'Status -3' => '已取消', 'Set status to -3' => '设为已取消', + 'Status -1' => '已报名待审核', + 'Set status to -1' => '设为已报名待审核', 'Status 0' => '已预约', 'Set status to 0' => '设为已预约', 'Status 3' => '已完成', diff --git a/application/admin/lang/zh-cn/school/classes/virtual_user.php b/application/admin/lang/zh-cn/school/classes/virtual_user.php index 1c87a80..8461481 100644 --- a/application/admin/lang/zh-cn/school/classes/virtual_user.php +++ b/application/admin/lang/zh-cn/school/classes/virtual_user.php @@ -5,6 +5,12 @@ return [ 'Head_image' => '头像', 'Classes_lib_id' => '课程id', 'Time' => '虚拟下单时间', + 'Jointype' => '参与中', + 'Jointype 1' => '是', + 'Jointype 0' => '否', + 'Havetype' => '已报名', + 'Havetype 1' => '是', + 'Havetype 0' => '否', 'Lib.title' => '标题', 'Lib.headimage' => '头图' ]; diff --git a/application/admin/model/dyqc/ManystoreShop.php b/application/admin/model/dyqc/ManystoreShop.php new file mode 100644 index 0000000..3213277 --- /dev/null +++ b/application/admin/model/dyqc/ManystoreShop.php @@ -0,0 +1,104 @@ + __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getAuthTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getCreateTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getUpdateTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + protected function setAuthTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setCreateTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setUpdateTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + public function admin() + { + return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/school/classes/Teacher.php b/application/admin/model/school/classes/Teacher.php index fe3d566..8873287 100644 --- a/application/admin/model/school/classes/Teacher.php +++ b/application/admin/model/school/classes/Teacher.php @@ -27,7 +27,20 @@ class Teacher extends Model protected $append = [ 'status_text' ]; - + + + public function getHeadImageAttr($value, $data) + { + if (!empty($value)) return cdnurl($value, true); + } + + public function getExpertImageAttr($value, $data) + { + if (!empty($value)) return cdnurl($value, true); + } + + + protected static function init() { diff --git a/application/admin/model/school/classes/VirtualUser.php b/application/admin/model/school/classes/VirtualUser.php index bc167f1..4b4d75f 100644 --- a/application/admin/model/school/classes/VirtualUser.php +++ b/application/admin/model/school/classes/VirtualUser.php @@ -25,12 +25,22 @@ class VirtualUser extends Model // 追加属性 protected $append = [ - 'time_text' + 'time_text', + 'jointype_text', + 'havetype_text' ]; + public function getJointypeList() + { + return ['1' => __('Jointype 1'), '0' => __('Jointype 0')]; + } + public function getHavetypeList() + { + return ['1' => __('Havetype 1'), '0' => __('Havetype 0')]; + } public function getTimeTextAttr($value, $data) @@ -39,6 +49,22 @@ class VirtualUser extends Model return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } + + public function getJointypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['jointype']) ? $data['jointype'] : ''); + $list = $this->getJointypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getHavetypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['havetype']) ? $data['havetype'] : ''); + $list = $this->getHavetypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + protected function setTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); diff --git a/application/admin/model/school/classes/hourorder/Order.php b/application/admin/model/school/classes/hourorder/Order.php index 8e5cbce..5fa1483 100644 --- a/application/admin/model/school/classes/hourorder/Order.php +++ b/application/admin/model/school/classes/hourorder/Order.php @@ -37,7 +37,7 @@ class Order extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')]; + return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; } @@ -109,7 +109,7 @@ class Order extends Model } - public function order() + public function classesorder() { return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); } diff --git a/application/admin/model/school/classes/hourorder/OrderLog.php b/application/admin/model/school/classes/hourorder/OrderLog.php index da7afa2..422394c 100644 --- a/application/admin/model/school/classes/hourorder/OrderLog.php +++ b/application/admin/model/school/classes/hourorder/OrderLog.php @@ -32,7 +32,7 @@ class OrderLog extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')]; + return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; } diff --git a/application/admin/validate/dyqc/ManystoreShop.php b/application/admin/validate/dyqc/ManystoreShop.php new file mode 100644 index 0000000..5f60c6b --- /dev/null +++ b/application/admin/validate/dyqc/ManystoreShop.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/dyqc/manystore_shop/add.html b/application/admin/view/dyqc/manystore_shop/add.html new file mode 100644 index 0000000..6fad076 --- /dev/null +++ b/application/admin/view/dyqc/manystore_shop/add.html @@ -0,0 +1,165 @@ +
diff --git a/application/admin/view/dyqc/manystore_shop/edit.html b/application/admin/view/dyqc/manystore_shop/edit.html new file mode 100644 index 0000000..9887622 --- /dev/null +++ b/application/admin/view/dyqc/manystore_shop/edit.html @@ -0,0 +1,165 @@ + diff --git a/application/admin/view/dyqc/manystore_shop/index.html b/application/admin/view/dyqc/manystore_shop/index.html new file mode 100644 index 0000000..68d5cdf --- /dev/null +++ b/application/admin/view/dyqc/manystore_shop/index.html @@ -0,0 +1,46 @@ +