From c3af2aef072d39dcd1f542d5281e19df16a560ec Mon Sep 17 00:00:00 2001 From: 15090180611 <215509543@qq.com> Date: Thu, 3 Apr 2025 17:58:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=89=88=E8=A1=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90model=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 40 +- .../Activity.php} | 30 +- .../admin/controller/school/activity/Cate.php | 38 + .../school/activity/order/Order.php} | 28 +- .../order/OrderCode.php} | 15 +- .../order/OrderDetail.php | 23 +- .../order/SettleLog.php} | 20 +- .../controller/school/classes/ClassesLib.php | 1140 ---------- .../controller/school/classes/ClassesSpec.php | 296 --- .../school/classes/hourorder/Order.php | 329 --- .../controller/school/classes/order/Order.php | 158 -- .../school/classes/order/ServiceOrder.php | 240 --- .../user/withdrawal/Userwithdrawal.php | 71 + .../user/withdrawal/UserwithdrawalLog.php} | 25 +- .../lang/zh-cn/school/activity/activity.php | 78 + .../admin/lang/zh-cn/school/activity/cate.php | 17 + .../zh-cn/school/activity/order/order.php | 76 + .../school/activity/order/order_code.php | 24 + .../school/activity/order/order_detail.php | 56 + .../school/activity/order/settle_log.php | 33 + .../lang/zh-cn/school/classes/classes_lib.php | 96 - .../zh-cn/school/classes/classes_spec.php | 23 - .../zh-cn/school/classes/hourorder/order.php | 54 - .../school/classes/hourorder/order_log.php | 17 - .../lang/zh-cn/school/classes/order/order.php | 85 - .../school/classes/order/order_detail.php | 64 - .../zh-cn/school/classes/order/order_log.php | 35 - .../school/classes/order/service_order.php | 69 - .../classes/order/service_order_log.php | 45 - .../zh-cn/user/withdrawal/userwithdrawal.php | 15 + .../user/withdrawal/userwithdrawal_log.php | 34 + .../ClassesLib.php => activity/Activity.php} | 217 +- .../admin/model/school/activity/Cate.php | 73 + .../admin/model/school/activity/Order.php | 12 + .../model/school/activity/order/Detail.php | 12 + .../{classes => activity}/order/Order.php | 89 +- .../model/school/activity/order/OrderCode.php | 70 + .../school/activity/order/OrderDetail.php | 181 ++ .../model/school/activity/order/SettleLog.php | 108 + .../model/school/classes/ClassesSpec.php | 88 - .../admin/model/school/classes/hour/Order.php | 12 - .../model/school/classes/hourorder/Order.php | 156 -- .../school/classes/hourorder/OrderLog.php | 53 - .../admin/model/school/classes/lib/Spec.php | 12 - .../model/school/classes/order/Detail.php | 12 - .../school/classes/order/OrderDetail.php | 99 - .../model/school/classes/order/OrderLog.php | 95 - .../school/classes/order/ServiceOrder.php | 206 -- .../school/classes/order/ServiceOrderLog.php | 106 - .../admin/model/user/withdrawal/Log.php | 12 + .../model/user/withdrawal/Userwithdrawal.php | 44 + .../user/withdrawal/UserwithdrawalLog.php | 105 + .../ClassesSpec.php => activity/Activity.php} | 4 +- .../order/OrderLog.php => activity/Cate.php} | 4 +- .../{classes => activity}/order/Order.php | 2 +- .../school/activity/order/OrderCode.php | 27 + .../order/OrderDetail.php | 2 +- .../school/activity/order/SettleLog.php | 27 + .../validate/school/classes/ClassesLib.php | 43 - .../school/classes/order/ServiceOrder.php | 27 - .../school/classes/order/ServiceOrderLog.php | 27 - .../withdrawal/Userwithdrawal.php} | 4 +- .../withdrawal/UserwithdrawalLog.php} | 4 +- .../view/school/activity/activity}/add.html | 293 +-- .../activity}/edit.html | 274 +-- .../activity}/index.html | 26 +- .../school/activity/activity}/recyclebin.html | 12 +- .../order_log => activity/cate}/add.html | 22 +- .../order_log => activity/cate}/edit.html | 20 +- .../view/school/activity/cate}/index.html | 20 +- .../order => activity/cate}/recyclebin.html | 12 +- .../order/order/add.html | 216 +- .../school/activity/order/order/edit.html} | 255 ++- .../order/order}/index.html | 14 +- .../activity/order/order}/recyclebin.html | 12 +- .../school/activity/order/order_code/add.html | 79 + .../activity/order/order_code/edit.html | 79 + .../activity/order/order_code/index.html | 46 + .../order/order_code}/recyclebin.html | 12 +- .../order/order_detail/add.html | 236 +- .../activity}/order/order_detail/edit.html | 215 +- .../activity/order/order_detail/index.html | 29 + .../order/order_detail}/recyclebin.html | 12 +- .../school/activity/order/settle_log/add.html | 87 + .../activity/order/settle_log/edit.html | 87 + .../activity/order/settle_log/index.html | 46 + .../order/settle_log}/recyclebin.html | 12 +- .../view/school/classes/classes_lib/add.html | 366 ---- .../school/classes/classes_lib/addnew.html | 445 ---- .../view/school/classes/classes_lib/copy.html | 463 ---- .../view/school/classes/classes_lib/edit.html | 463 ---- .../view/school/classes/classes_spec/add.html | 78 - .../school/classes/classes_spec/edit.html | 78 - .../school/classes/hourorder/order/add.html | 20 - .../school/classes/hourorder/order/edit.html | 23 - .../classes/hourorder/order/examine.html | 32 - .../school/classes/hourorder/order/index.html | 50 - .../classes/hourorder/order_log/index.html | 46 - .../classes/order/order/after_sales.html | 31 - .../view/school/classes/order/order/edit.html | 252 --- .../school/classes/order/order/index.html | 47 - .../classes/order/order_detail/index.html | 29 - .../order/order_detail/recyclebin.html | 25 - .../school/classes/order/order_log/add.html | 69 - .../school/classes/order/order_log/edit.html | 69 - .../school/classes/order/order_log/index.html | 46 - .../classes/order/service_order/add.html | 219 -- .../service_order/admin_confirmation.html | 61 - .../classes/order/service_order/edit.html | 219 -- .../classes/order/service_order/index.html | 52 - .../service_order/shop_confirmation.html | 61 - .../service_order/user_confirmation.html | 61 - .../classes/order/service_order_log/add.html | 105 - .../classes/order/service_order_log/edit.html | 105 - .../order/service_order_log/index.html | 46 - .../user/withdrawal/userwithdrawal/add.html | 33 + .../user/withdrawal/userwithdrawal/edit.html | 33 + .../user/withdrawal/userwithdrawal/index.html | 29 + .../userwithdrawal}/recyclebin.html | 12 +- .../withdrawal/userwithdrawal_log/add.html | 105 + .../withdrawal/userwithdrawal_log/edit.html | 105 + .../withdrawal/userwithdrawal_log/index.html | 46 + .../api/controller/school/HourOrder.php | 267 --- application/api/controller/school/Order.php | 245 --- .../api/controller/school/ServiceOrder.php | 270 --- .../api/controller/school/worker/Classes.php | 253 --- .../controller/school/worker/HourOrder.php | 354 --- .../api/controller/school/worker/Order.php | 155 -- .../controller/school/worker/ServiceOrder.php | 281 --- application/common/model/BaseModel.php | 322 +-- .../model/school/classes/ClassesLib.php | 1898 ----------------- .../model/school/classes/ClassesSpec.php | 246 --- .../common/model/school/classes/Order.php | 12 - .../model/school/classes/hour/Order.php | 12 - .../model/school/classes/hourorder/Order.php | 1547 -------------- .../school/classes/hourorder/OrderLog.php | 181 -- .../common/model/school/classes/lib/Spec.php | 12 - .../model/school/classes/order/Detail.php | 48 - .../model/school/classes/order/Order.php | 1374 ------------ .../school/classes/order/OrderDetail.php | 139 -- .../model/school/classes/order/OrderLog.php | 159 -- .../school/classes/order/ServiceOrder.php | 1552 -------------- .../school/classes/order/ServiceOrderLog.php | 275 --- .../controller/school/classes/ClassesLib.php | 707 ------ .../controller/school/classes/ClassesSpec.php | 311 --- .../school/classes/hourorder/Order.php | 324 --- .../controller/school/classes/order/Order.php | 166 -- .../school/classes/order/OrderDetail.php | 79 - .../school/classes/order/ServiceOrder.php | 235 -- .../school/classes/order/ServiceOrderLog.php | 80 - .../lang/zh-cn/school/classes/classes_lib.php | 95 - .../zh-cn/school/classes/classes_spec.php | 21 - .../zh-cn/school/classes/hourorder/order.php | 50 - .../school/classes/hourorder/order_log.php | 13 - .../lang/zh-cn/school/classes/order/order.php | 80 - .../school/classes/order/order_detail.php | 64 - .../zh-cn/school/classes/order/order_log.php | 30 - .../school/classes/order/service_order.php | 65 - .../classes/order/service_order_log.php | 42 - .../model/SchoolClassesHourOrder.php | 12 - .../manystore/model/SchoolClassesLib.php | 12 - .../manystore/model/SchoolClassesLibSpec.php | 12 - .../manystore/model/SchoolClassesOrder.php | 12 - .../model/SchoolClassesOrderDetail.php | 12 - .../model/school/classes/ClassesLib.php | 249 --- .../model/school/classes/ClassesSpec.php | 86 - .../model/school/classes/hourorder/Order.php | 154 -- .../school/classes/hourorder/OrderLog.php | 53 - .../model/school/classes/order/Order.php | 189 -- .../school/classes/order/OrderDetail.php | 99 - .../model/school/classes/order/OrderLog.php | 95 - .../school/classes/order/ServiceOrder.php | 205 -- .../school/classes/order/ServiceOrderLog.php | 106 - .../validate/school/classes/ClassesLib.php | 43 - .../validate/school/classes/ClassesSpec.php | 27 - .../school/classes/hourorder/Order.php | 27 - .../school/classes/hourorder/OrderLog.php | 27 - .../validate/school/classes/order/Order.php | 27 - .../school/classes/order/OrderDetail.php | 27 - .../school/classes/order/OrderLog.php | 27 - .../school/classes/order/ServiceOrder.php | 27 - .../school/classes/order/ServiceOrderLog.php | 27 - .../view/school/classes/classes_lib/add.html | 360 ---- .../school/classes/classes_lib/addnew.html | 437 ---- .../view/school/classes/classes_lib/copy.html | 447 ---- .../view/school/classes/classes_lib/edit.html | 447 ---- .../school/classes/classes_lib/index.html | 65 - .../view/school/classes/classes_spec/add.html | 82 - .../school/classes/classes_spec/edit.html | 79 - .../school/classes/hourorder/order/add.html | 19 - .../school/classes/hourorder/order/edit.html | 25 - .../classes/hourorder/order/examine.html | 32 - .../school/classes/hourorder/order/index.html | 50 - .../classes/hourorder/order/recyclebin.html | 25 - .../classes/hourorder/order_log/add.html | 34 - .../classes/hourorder/order_log/edit.html | 34 - .../classes/hourorder/order_log/index.html | 44 - .../classes/order/order/after_sales.html | 30 - .../view/school/classes/order/order/edit.html | 253 --- .../school/classes/order/order/index.html | 44 - .../classes/order/order/recyclebin.html | 25 - .../classes/order/order_detail/index.html | 34 - .../order/order_detail/recyclebin.html | 25 - .../school/classes/order/order_log/add.html | 70 - .../school/classes/order/order_log/edit.html | 70 - .../school/classes/order/order_log/index.html | 44 - .../classes/order/service_order/add.html | 214 -- .../service_order/admin_confirmation.html | 61 - .../classes/order/service_order/edit.html | 214 -- .../classes/order/service_order/index.html | 44 - .../order/service_order/recyclebin.html | 25 - .../service_order/shop_confirmation.html | 61 - .../service_order/user_confirmation.html | 61 - .../classes/order/service_order_log/add.html | 100 - .../classes/order/service_order_log/edit.html | 100 - .../order/service_order_log/index.html | 44 - .../js/backend/school/activity/activity.js | 158 ++ .../assets/js/backend/school/activity/cate.js | 117 + .../js/backend/school/activity/order/order.js | 150 ++ .../school/activity/order/order_code.js | 127 ++ .../school/activity/order/order_detail.js | 153 ++ .../school/activity/order/settle_log.js | 133 ++ .../backend/user/withdrawal/userwithdrawal.js | 121 ++ .../user/withdrawal/userwithdrawal_log.js | 70 + 224 files changed, 4199 insertions(+), 25295 deletions(-) rename application/admin/controller/school/{classes/order/ServiceOrderLog.php => activity/Activity.php} (62%) create mode 100644 application/admin/controller/school/activity/Cate.php rename application/{manystore/controller/school/classes/order/OrderLog.php => admin/controller/school/activity/order/Order.php} (70%) rename application/admin/controller/school/{classes/hourorder/OrderLog.php => activity/order/OrderCode.php} (80%) rename application/admin/controller/school/{classes => activity}/order/OrderDetail.php (68%) rename application/admin/controller/school/{classes/order/OrderLog.php => activity/order/SettleLog.php} (74%) delete mode 100644 application/admin/controller/school/classes/ClassesLib.php delete mode 100644 application/admin/controller/school/classes/ClassesSpec.php delete mode 100644 application/admin/controller/school/classes/hourorder/Order.php delete mode 100644 application/admin/controller/school/classes/order/Order.php delete mode 100644 application/admin/controller/school/classes/order/ServiceOrder.php create mode 100644 application/admin/controller/user/withdrawal/Userwithdrawal.php rename application/{manystore/controller/school/classes/hourorder/OrderLog.php => admin/controller/user/withdrawal/UserwithdrawalLog.php} (71%) create mode 100644 application/admin/lang/zh-cn/school/activity/activity.php create mode 100644 application/admin/lang/zh-cn/school/activity/cate.php create mode 100644 application/admin/lang/zh-cn/school/activity/order/order.php create mode 100644 application/admin/lang/zh-cn/school/activity/order/order_code.php create mode 100644 application/admin/lang/zh-cn/school/activity/order/order_detail.php create mode 100644 application/admin/lang/zh-cn/school/activity/order/settle_log.php delete mode 100644 application/admin/lang/zh-cn/school/classes/classes_lib.php delete mode 100644 application/admin/lang/zh-cn/school/classes/classes_spec.php delete mode 100644 application/admin/lang/zh-cn/school/classes/hourorder/order.php delete mode 100644 application/admin/lang/zh-cn/school/classes/hourorder/order_log.php delete mode 100644 application/admin/lang/zh-cn/school/classes/order/order.php delete mode 100644 application/admin/lang/zh-cn/school/classes/order/order_detail.php delete mode 100644 application/admin/lang/zh-cn/school/classes/order/order_log.php delete mode 100644 application/admin/lang/zh-cn/school/classes/order/service_order.php delete mode 100644 application/admin/lang/zh-cn/school/classes/order/service_order_log.php create mode 100644 application/admin/lang/zh-cn/user/withdrawal/userwithdrawal.php create mode 100644 application/admin/lang/zh-cn/user/withdrawal/userwithdrawal_log.php rename application/admin/model/school/{classes/ClassesLib.php => activity/Activity.php} (57%) create mode 100644 application/admin/model/school/activity/Cate.php create mode 100644 application/admin/model/school/activity/Order.php create mode 100644 application/admin/model/school/activity/order/Detail.php rename application/admin/model/school/{classes => activity}/order/Order.php (63%) create mode 100644 application/admin/model/school/activity/order/OrderCode.php create mode 100644 application/admin/model/school/activity/order/OrderDetail.php create mode 100644 application/admin/model/school/activity/order/SettleLog.php delete mode 100644 application/admin/model/school/classes/ClassesSpec.php delete mode 100644 application/admin/model/school/classes/hour/Order.php delete mode 100644 application/admin/model/school/classes/hourorder/Order.php delete mode 100644 application/admin/model/school/classes/hourorder/OrderLog.php delete mode 100644 application/admin/model/school/classes/lib/Spec.php delete mode 100644 application/admin/model/school/classes/order/Detail.php delete mode 100644 application/admin/model/school/classes/order/OrderDetail.php delete mode 100644 application/admin/model/school/classes/order/OrderLog.php delete mode 100644 application/admin/model/school/classes/order/ServiceOrder.php delete mode 100644 application/admin/model/school/classes/order/ServiceOrderLog.php create mode 100644 application/admin/model/user/withdrawal/Log.php create mode 100644 application/admin/model/user/withdrawal/Userwithdrawal.php create mode 100644 application/admin/model/user/withdrawal/UserwithdrawalLog.php rename application/admin/validate/school/{classes/ClassesSpec.php => activity/Activity.php} (78%) rename application/admin/validate/school/{classes/order/OrderLog.php => activity/Cate.php} (77%) rename application/admin/validate/school/{classes => activity}/order/Order.php (85%) create mode 100644 application/admin/validate/school/activity/order/OrderCode.php rename application/admin/validate/school/{classes => activity}/order/OrderDetail.php (86%) create mode 100644 application/admin/validate/school/activity/order/SettleLog.php delete mode 100644 application/admin/validate/school/classes/ClassesLib.php delete mode 100644 application/admin/validate/school/classes/order/ServiceOrder.php delete mode 100644 application/admin/validate/school/classes/order/ServiceOrderLog.php rename application/admin/validate/{school/classes/hourorder/Order.php => user/withdrawal/Userwithdrawal.php} (77%) rename application/admin/validate/{school/classes/hourorder/OrderLog.php => user/withdrawal/UserwithdrawalLog.php} (76%) rename application/{manystore/view/school/classes/order/order_detail => admin/view/school/activity/activity}/add.html (52%) rename application/admin/view/school/{classes/order/order_detail => activity/activity}/edit.html (53%) rename application/admin/view/school/{classes/classes_lib => activity/activity}/index.html (65%) rename application/{manystore/view/school/classes/classes_lib => admin/view/school/activity/activity}/recyclebin.html (51%) rename application/admin/view/school/{classes/hourorder/order_log => activity/cate}/add.html (52%) rename application/admin/view/school/{classes/hourorder/order_log => activity/cate}/edit.html (54%) rename application/{manystore/view/school/classes/classes_spec => admin/view/school/activity/cate}/index.html (64%) rename application/admin/view/school/{classes/order/order => activity/cate}/recyclebin.html (51%) rename application/admin/view/school/{classes => activity}/order/order/add.html (59%) rename application/{manystore/view/school/classes/order/order/add.html => admin/view/school/activity/order/order/edit.html} (51%) rename application/admin/view/school/{classes/classes_spec => activity/order/order}/index.html (81%) rename application/{manystore/view/school/classes/classes_spec => admin/view/school/activity/order/order}/recyclebin.html (63%) create mode 100644 application/admin/view/school/activity/order/order_code/add.html create mode 100644 application/admin/view/school/activity/order/order_code/edit.html create mode 100644 application/admin/view/school/activity/order/order_code/index.html rename application/admin/view/school/{classes/classes_lib => activity/order/order_code}/recyclebin.html (50%) rename application/admin/view/school/{classes => activity}/order/order_detail/add.html (55%) rename application/{manystore/view/school/classes => admin/view/school/activity}/order/order_detail/edit.html (53%) create mode 100644 application/admin/view/school/activity/order/order_detail/index.html rename application/admin/view/school/{classes/order/service_order => activity/order/order_detail}/recyclebin.html (57%) create mode 100644 application/admin/view/school/activity/order/settle_log/add.html create mode 100644 application/admin/view/school/activity/order/settle_log/edit.html create mode 100644 application/admin/view/school/activity/order/settle_log/index.html rename application/admin/view/school/{classes/classes_spec => activity/order/settle_log}/recyclebin.html (50%) delete mode 100644 application/admin/view/school/classes/classes_lib/add.html delete mode 100644 application/admin/view/school/classes/classes_lib/addnew.html delete mode 100644 application/admin/view/school/classes/classes_lib/copy.html delete mode 100644 application/admin/view/school/classes/classes_lib/edit.html delete mode 100644 application/admin/view/school/classes/classes_spec/add.html delete mode 100644 application/admin/view/school/classes/classes_spec/edit.html delete mode 100644 application/admin/view/school/classes/hourorder/order/add.html delete mode 100644 application/admin/view/school/classes/hourorder/order/edit.html delete mode 100644 application/admin/view/school/classes/hourorder/order/examine.html delete mode 100644 application/admin/view/school/classes/hourorder/order/index.html delete mode 100644 application/admin/view/school/classes/hourorder/order_log/index.html delete mode 100644 application/admin/view/school/classes/order/order/after_sales.html delete mode 100644 application/admin/view/school/classes/order/order/edit.html delete mode 100644 application/admin/view/school/classes/order/order/index.html delete mode 100644 application/admin/view/school/classes/order/order_detail/index.html delete mode 100644 application/admin/view/school/classes/order/order_detail/recyclebin.html delete mode 100644 application/admin/view/school/classes/order/order_log/add.html delete mode 100644 application/admin/view/school/classes/order/order_log/edit.html delete mode 100644 application/admin/view/school/classes/order/order_log/index.html delete mode 100644 application/admin/view/school/classes/order/service_order/add.html delete mode 100644 application/admin/view/school/classes/order/service_order/admin_confirmation.html delete mode 100644 application/admin/view/school/classes/order/service_order/edit.html delete mode 100644 application/admin/view/school/classes/order/service_order/index.html delete mode 100644 application/admin/view/school/classes/order/service_order/shop_confirmation.html delete mode 100644 application/admin/view/school/classes/order/service_order/user_confirmation.html delete mode 100644 application/admin/view/school/classes/order/service_order_log/add.html delete mode 100644 application/admin/view/school/classes/order/service_order_log/edit.html delete mode 100644 application/admin/view/school/classes/order/service_order_log/index.html create mode 100644 application/admin/view/user/withdrawal/userwithdrawal/add.html create mode 100644 application/admin/view/user/withdrawal/userwithdrawal/edit.html create mode 100644 application/admin/view/user/withdrawal/userwithdrawal/index.html rename application/admin/view/{school/classes/hourorder/order => user/withdrawal/userwithdrawal}/recyclebin.html (57%) create mode 100644 application/admin/view/user/withdrawal/userwithdrawal_log/add.html create mode 100644 application/admin/view/user/withdrawal/userwithdrawal_log/edit.html create mode 100644 application/admin/view/user/withdrawal/userwithdrawal_log/index.html delete mode 100644 application/api/controller/school/HourOrder.php delete mode 100644 application/api/controller/school/Order.php delete mode 100644 application/api/controller/school/ServiceOrder.php delete mode 100644 application/api/controller/school/worker/Classes.php delete mode 100644 application/api/controller/school/worker/HourOrder.php delete mode 100644 application/api/controller/school/worker/Order.php delete mode 100644 application/api/controller/school/worker/ServiceOrder.php delete mode 100644 application/common/model/school/classes/ClassesLib.php delete mode 100644 application/common/model/school/classes/ClassesSpec.php delete mode 100644 application/common/model/school/classes/Order.php delete mode 100644 application/common/model/school/classes/hour/Order.php delete mode 100644 application/common/model/school/classes/hourorder/Order.php delete mode 100644 application/common/model/school/classes/hourorder/OrderLog.php delete mode 100644 application/common/model/school/classes/lib/Spec.php delete mode 100644 application/common/model/school/classes/order/Detail.php delete mode 100644 application/common/model/school/classes/order/Order.php delete mode 100644 application/common/model/school/classes/order/OrderDetail.php delete mode 100644 application/common/model/school/classes/order/OrderLog.php delete mode 100644 application/common/model/school/classes/order/ServiceOrder.php delete mode 100644 application/common/model/school/classes/order/ServiceOrderLog.php delete mode 100644 application/manystore/controller/school/classes/ClassesLib.php delete mode 100644 application/manystore/controller/school/classes/ClassesSpec.php delete mode 100644 application/manystore/controller/school/classes/hourorder/Order.php delete mode 100644 application/manystore/controller/school/classes/order/Order.php delete mode 100644 application/manystore/controller/school/classes/order/OrderDetail.php delete mode 100644 application/manystore/controller/school/classes/order/ServiceOrder.php delete mode 100644 application/manystore/controller/school/classes/order/ServiceOrderLog.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/classes_lib.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/classes_spec.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/hourorder/order.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/hourorder/order_log.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/order/order.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/order/order_detail.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/order/order_log.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/order/service_order.php delete mode 100644 application/manystore/lang/zh-cn/school/classes/order/service_order_log.php delete mode 100644 application/manystore/model/SchoolClassesHourOrder.php delete mode 100644 application/manystore/model/SchoolClassesLib.php delete mode 100644 application/manystore/model/SchoolClassesLibSpec.php delete mode 100644 application/manystore/model/SchoolClassesOrder.php delete mode 100644 application/manystore/model/SchoolClassesOrderDetail.php delete mode 100644 application/manystore/model/school/classes/ClassesLib.php delete mode 100644 application/manystore/model/school/classes/ClassesSpec.php delete mode 100644 application/manystore/model/school/classes/hourorder/Order.php delete mode 100644 application/manystore/model/school/classes/hourorder/OrderLog.php delete mode 100644 application/manystore/model/school/classes/order/Order.php delete mode 100644 application/manystore/model/school/classes/order/OrderDetail.php delete mode 100644 application/manystore/model/school/classes/order/OrderLog.php delete mode 100644 application/manystore/model/school/classes/order/ServiceOrder.php delete mode 100644 application/manystore/model/school/classes/order/ServiceOrderLog.php delete mode 100644 application/manystore/validate/school/classes/ClassesLib.php delete mode 100644 application/manystore/validate/school/classes/ClassesSpec.php delete mode 100644 application/manystore/validate/school/classes/hourorder/Order.php delete mode 100644 application/manystore/validate/school/classes/hourorder/OrderLog.php delete mode 100644 application/manystore/validate/school/classes/order/Order.php delete mode 100644 application/manystore/validate/school/classes/order/OrderDetail.php delete mode 100644 application/manystore/validate/school/classes/order/OrderLog.php delete mode 100644 application/manystore/validate/school/classes/order/ServiceOrder.php delete mode 100644 application/manystore/validate/school/classes/order/ServiceOrderLog.php delete mode 100644 application/manystore/view/school/classes/classes_lib/add.html delete mode 100644 application/manystore/view/school/classes/classes_lib/addnew.html delete mode 100644 application/manystore/view/school/classes/classes_lib/copy.html delete mode 100644 application/manystore/view/school/classes/classes_lib/edit.html delete mode 100644 application/manystore/view/school/classes/classes_lib/index.html delete mode 100644 application/manystore/view/school/classes/classes_spec/add.html delete mode 100644 application/manystore/view/school/classes/classes_spec/edit.html delete mode 100644 application/manystore/view/school/classes/hourorder/order/add.html delete mode 100644 application/manystore/view/school/classes/hourorder/order/edit.html delete mode 100644 application/manystore/view/school/classes/hourorder/order/examine.html delete mode 100644 application/manystore/view/school/classes/hourorder/order/index.html delete mode 100644 application/manystore/view/school/classes/hourorder/order/recyclebin.html delete mode 100644 application/manystore/view/school/classes/hourorder/order_log/add.html delete mode 100644 application/manystore/view/school/classes/hourorder/order_log/edit.html delete mode 100644 application/manystore/view/school/classes/hourorder/order_log/index.html delete mode 100644 application/manystore/view/school/classes/order/order/after_sales.html delete mode 100644 application/manystore/view/school/classes/order/order/edit.html delete mode 100644 application/manystore/view/school/classes/order/order/index.html delete mode 100644 application/manystore/view/school/classes/order/order/recyclebin.html delete mode 100644 application/manystore/view/school/classes/order/order_detail/index.html delete mode 100644 application/manystore/view/school/classes/order/order_detail/recyclebin.html delete mode 100644 application/manystore/view/school/classes/order/order_log/add.html delete mode 100644 application/manystore/view/school/classes/order/order_log/edit.html delete mode 100644 application/manystore/view/school/classes/order/order_log/index.html delete mode 100644 application/manystore/view/school/classes/order/service_order/add.html delete mode 100644 application/manystore/view/school/classes/order/service_order/admin_confirmation.html delete mode 100644 application/manystore/view/school/classes/order/service_order/edit.html delete mode 100644 application/manystore/view/school/classes/order/service_order/index.html delete mode 100644 application/manystore/view/school/classes/order/service_order/recyclebin.html delete mode 100644 application/manystore/view/school/classes/order/service_order/shop_confirmation.html delete mode 100644 application/manystore/view/school/classes/order/service_order/user_confirmation.html delete mode 100644 application/manystore/view/school/classes/order/service_order_log/add.html delete mode 100644 application/manystore/view/school/classes/order/service_order_log/edit.html delete mode 100644 application/manystore/view/school/classes/order/service_order_log/index.html create mode 100644 public/assets/js/backend/school/activity/activity.js create mode 100644 public/assets/js/backend/school/activity/cate.js create mode 100644 public/assets/js/backend/school/activity/order/order.js create mode 100644 public/assets/js/backend/school/activity/order/order_code.js create mode 100644 public/assets/js/backend/school/activity/order/order_detail.js create mode 100644 public/assets/js/backend/school/activity/order/settle_log.js create mode 100644 public/assets/js/backend/user/withdrawal/userwithdrawal.js create mode 100644 public/assets/js/backend/user/withdrawal/userwithdrawal_log.js diff --git a/README.md b/README.md index 922d933..de29c8e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -FastAdmin是一款基于ThinkPHP+Bootstrap的极速后台开发框架。 +多样青春活动版本小程序后台项目 ## 主要特性 @@ -24,40 +24,12 @@ FastAdmin是一款基于ThinkPHP+Bootstrap的极速后台开发框架。 * 多语言支持,服务端及客户端支持 * 支持大文件分片上传、剪切板粘贴上传、拖拽上传,进度条显示,图片上传前压缩 * 支持表格固定列、固定表头、跨页选择、Excel导出、模板渲染等功能 -* 强大的第三方应用模块支持([CMS](https://www.fastadmin.net/store/cms.html)、[CRM](https://www.fastadmin.net/store/facrm.html)、[企业网站管理系统](https://www.fastadmin.net/store/ldcms.html)、[知识库文档系统](https://www.fastadmin.net/store/knowbase.html)、[在线投票系统](https://www.fastadmin.net/store/vote.html)、[B2C商城](https://www.fastadmin.net/store/shopro.html)、[B2B2C商城](https://www.fastadmin.net/store/wanlshop.html)) -* 整合第三方短信接口(阿里云、腾讯云短信) -* 无缝整合第三方云存储(七牛云、阿里云OSS、腾讯云存储、又拍云)功能,支持云储存分片上传 -* 第三方富文本编辑器支持(Summernote、百度编辑器) -* 第三方登录(QQ、微信、微博)整合 -* 第三方支付(微信、支付宝)无缝整合,微信支持PC端扫码支付 -* 丰富的插件应用市场 -## 安装使用 -https://doc.fastadmin.net - -## 在线演示 - -https://demo.fastadmin.net - -用户名:admin - -密 码:123456 - -提 示:演示站数据无法进行修改,请下载源码安装体验全部功能 ## 界面截图 ![控制台](https://images.gitee.com/uploads/images/2020/0929/202947_8db2d281_10933.gif "控制台") -## 问题反馈 - -在使用中有任何问题,请使用以下联系方式联系我们 - -问答社区: https://ask.fastadmin.net - -Github: https://github.com/karsonzhang/fastadmin - -Gitee: https://gitee.com/karson/fastadmin ## 特别鸣谢 @@ -81,13 +53,3 @@ Layer: https://layuion.com/layer/ DropzoneJS: https://www.dropzonejs.com - -## 版权信息 - -FastAdmin遵循Apache2开源协议发布,并提供免费使用。 - -本项目包含的第三方源码和二进制文件之版权信息另行标注。 - -版权所有Copyright © 2017-2024 by FastAdmin (https://www.fastadmin.net) - -All rights reserved。 diff --git a/application/admin/controller/school/classes/order/ServiceOrderLog.php b/application/admin/controller/school/activity/Activity.php similarity index 62% rename from application/admin/controller/school/classes/order/ServiceOrderLog.php rename to application/admin/controller/school/activity/Activity.php index 4e19bf5..9517167 100644 --- a/application/admin/controller/school/classes/order/ServiceOrderLog.php +++ b/application/admin/controller/school/activity/Activity.php @@ -1,30 +1,35 @@ model = new \app\admin\model\school\classes\order\ServiceOrderLog; + $this->model = new \app\admin\model\school\activity\Activity; $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("serviceStautsList", $this->model->getServiceStautsList()); - $this->view->assign("salesTypeList", $this->model->getSalesTypeList()); + $this->view->assign("cancelTypeList", $this->model->getCancelTypeList()); + $this->view->assign("recommendList", $this->model->getRecommendList()); + $this->view->assign("hotList", $this->model->getHotList()); + $this->view->assign("newList", $this->model->getNewList()); + $this->view->assign("addTypeList", $this->model->getAddTypeList()); + $this->view->assign("feelList", $this->model->getFeelList()); + $this->view->assign("authStatusList", $this->model->getAuthStatusList()); } @@ -53,18 +58,15 @@ class ServiceOrderLog extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['serviceorder','classesorder','user','detail','admin']) + ->with(['user','admin']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('serviceorder')->visible(['order_no']); - $row->getRelation('classesorder')->visible(['order_no','pay_no']); - $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); - $row->getRelation('detail')->visible(['title']); - $row->getRelation('admin')->visible(['nickname']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); + $row->getRelation('admin')->visible(['nickname','avatar']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/activity/Cate.php b/application/admin/controller/school/activity/Cate.php new file mode 100644 index 0000000..b929d83 --- /dev/null +++ b/application/admin/controller/school/activity/Cate.php @@ -0,0 +1,38 @@ +model = new \app\admin\model\school\activity\Cate; + $this->view->assign("statusList", $this->model->getStatusList()); + $this->view->assign("hotList", $this->model->getHotList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/manystore/controller/school/classes/order/OrderLog.php b/application/admin/controller/school/activity/order/Order.php similarity index 70% rename from application/manystore/controller/school/classes/order/OrderLog.php rename to application/admin/controller/school/activity/order/Order.php index 0b78b63..cbfdf8b 100644 --- a/application/manystore/controller/school/classes/order/OrderLog.php +++ b/application/admin/controller/school/activity/order/Order.php @@ -1,37 +1,35 @@ model = new \app\manystore\model\school\classes\order\OrderLog; + $this->model = new \app\admin\model\school\activity\order\Order; + $this->view->assign("payTypeList", $this->model->getPayTypeList()); $this->view->assign("statusList", $this->model->getStatusList()); $this->view->assign("beforeStatusList", $this->model->getBeforeStatusList()); $this->view->assign("serverStatusList", $this->model->getServerStatusList()); - $this->view->assign("resultStatusList", $this->model->getResultStatusList()); + $this->view->assign("authStatusList", $this->model->getAuthStatusList()); } - public function import() - { - parent::import(); - } + /** * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 @@ -57,14 +55,16 @@ class OrderLog extends ManystoreBase list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['schoolclassesorder']) + ->with(['user','activity','detail']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('schoolclassesorder')->visible(['order_no']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); + $row->getRelation('activity')->visible(['title','images']); + $row->getRelation('detail')->visible(['title']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/classes/hourorder/OrderLog.php b/application/admin/controller/school/activity/order/OrderCode.php similarity index 80% rename from application/admin/controller/school/classes/hourorder/OrderLog.php rename to application/admin/controller/school/activity/order/OrderCode.php index 18a415e..5fceda3 100644 --- a/application/admin/controller/school/classes/hourorder/OrderLog.php +++ b/application/admin/controller/school/activity/order/OrderCode.php @@ -1,27 +1,27 @@ model = new \app\admin\model\school\classes\hourorder\OrderLog; + $this->model = new \app\admin\model\school\activity\order\OrderCode; $this->view->assign("statusList", $this->model->getStatusList()); } @@ -51,7 +51,7 @@ class OrderLog extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['order']) + ->with(['order','user']) ->where($where) ->order($sort, $order) ->paginate($limit); @@ -59,6 +59,7 @@ class OrderLog extends Backend foreach ($list as $row) { $row->getRelation('order')->visible(['order_no']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/classes/order/OrderDetail.php b/application/admin/controller/school/activity/order/OrderDetail.php similarity index 68% rename from application/admin/controller/school/classes/order/OrderDetail.php rename to application/admin/controller/school/activity/order/OrderDetail.php index bcd985f..20dccd1 100644 --- a/application/admin/controller/school/classes/order/OrderDetail.php +++ b/application/admin/controller/school/activity/order/OrderDetail.php @@ -1,11 +1,11 @@ model = new \app\admin\model\school\classes\order\OrderDetail; + $this->model = new \app\admin\model\school\activity\order\OrderDetail; + $this->view->assign("recommendList", $this->model->getRecommendList()); + $this->view->assign("hotList", $this->model->getHotList()); + $this->view->assign("newList", $this->model->getNewList()); $this->view->assign("addTypeList", $this->model->getAddTypeList()); - $this->view->assign("typeList", $this->model->getTypeList()); - $this->view->assign("addressTypeList", $this->model->getAddressTypeList()); + $this->view->assign("feelList", $this->model->getFeelList()); } @@ -53,17 +55,16 @@ class OrderDetail extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['order','manystore','shop','user']) + ->with(['user','order','activity']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('order')->visible(['order_no']); - $row->getRelation('manystore')->visible(['nickname','avatar']); - $row->getRelation('shop')->visible(['name','image','address_city','province','city','district','address','address_detail']); - $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); + $row->getRelation('order')->visible(['order_no']); + $row->getRelation('activity')->visible(['title']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/classes/order/OrderLog.php b/application/admin/controller/school/activity/order/SettleLog.php similarity index 74% rename from application/admin/controller/school/classes/order/OrderLog.php rename to application/admin/controller/school/activity/order/SettleLog.php index a55cf22..4d25e3b 100644 --- a/application/admin/controller/school/classes/order/OrderLog.php +++ b/application/admin/controller/school/activity/order/SettleLog.php @@ -1,31 +1,28 @@ model = new \app\admin\model\school\classes\order\OrderLog; + $this->model = new \app\admin\model\school\activity\order\SettleLog; $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("beforeStatusList", $this->model->getBeforeStatusList()); - $this->view->assign("serverStatusList", $this->model->getServerStatusList()); - $this->view->assign("resultStatusList", $this->model->getResultStatusList()); } @@ -54,7 +51,7 @@ class OrderLog extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['order']) + ->with(['order','log','user','third']) ->where($where) ->order($sort, $order) ->paginate($limit); @@ -62,6 +59,9 @@ class OrderLog extends Backend foreach ($list as $row) { $row->getRelation('order')->visible(['order_no']); + $row->getRelation('log')->visible(['id','price']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); + $row->getRelation('third')->visible(['openname']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php deleted file mode 100644 index 71c6601..0000000 --- a/application/admin/controller/school/classes/ClassesLib.php +++ /dev/null @@ -1,1140 +0,0 @@ -model = new \app\admin\model\school\classes\ClassesLib; - parent::_initialize(); - - $this->view->assign("addTypeList", $this->model->getAddTypeList()); - $this->view->assign("typeList", $this->model->getTypeList()); - $this->view->assign("addressTypeList", $this->model->getAddressTypeList()); - $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("authStatusList", $this->model->getAuthStatusList()); - $this->view->assign("recommendList", $this->model->getRecommendList()); - $this->view->assign("hotList", $this->model->getHotList()); - $this->view->assign("newList", $this->model->getNewList()); - $this->view->assign("selfhotList", $this->model->getSelfhotList()); - - $this->view->assign("classesTypeList", $this->model->getClassesTypeList()); - $this->view->assign("classesTypeListJson", json_encode($this->model->getClassesTypeList(), JSON_UNESCAPED_UNICODE)); - $this->view->assign("classes_number_only_one", config("site.classes_number_only_one")); - - - $this->view->assign("specStatusList", (new \app\admin\model\school\classes\ClassesSpec)->getStatusList()); - $this->getCity(); - $this->getAuthMsg(); - } - - - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 - * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - - - /** - * 查看 - */ - public function index() - { - //当前是否为关联查询 - $this->relationSearch = true; - $this->searchFields = ["id","title","address","address_detail","address_city","user.nickname","user.realname","user.mobile","shop.name"]; - //设置过滤方法 - $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, $page, $alias, $bind, $excludearray) = $this->buildparams(null, null, ["has_expire"]); - - if (isset($excludearray['has_expire']['value']) && $excludearray['has_expire']['value']) { - $has_expire = $excludearray['has_expire']['value']; - $as = (new \app\common\model\school\classes\ClassesLib())->getWithAlisaName(); - switch ($has_expire) { - case '1': //查过期 - $expireWhere = [ - $as . '.end_time', '<=', time(), - ]; - break; - case '2': //查未过期 - $expireWhere = [ - $as . '.end_time', '>', time(), - ]; - break; - default: - } - - } else { - $expireWhere = [[]]; - } - - $list = $this->model - ->with(['manystore', 'shop', 'user', 'admin']) - ->where($where) - ->where(...$expireWhere) - ->order($sort, $order) - ->paginate($limit); - - foreach ($list as $row) { - - $row->getRelation('manystore')->visible(['nickname']); - $row->getRelation('shop')->visible(['name', 'image', 'address_city', 'province', 'city', 'district', 'address', 'address_detail']); - $row->getRelation('user')->visible(['nickname', 'realname', 'mobile', 'avatar']); - $row->getRelation('admin')->visible(['nickname']); - } - $rows = $list->items(); - $types = \app\admin\model\school\classes\Type::column("name", 'id'); - - foreach ($rows as $k => &$v) { - $v["classes_type_name"] = $types[$v["classes_type"]] ?? "无"; - $v["miniqrcode_link"] = Url::build("/school/classes/classes_lib/miniqrcode", ["ids" => $v["id"]]); - } - - $result = array("total" => $list->total(), "rows" => $rows); - - return json($result); - } - return $this->view->fetch(); - } - - - - protected function authClasses(&$params,$row=null){ - //审核失败需填写原因 - if($params["auth_status"] == '2' && empty($params["reason"])){ - $this->error("审核失败需填写原因"); - } - - if($params["auth_status"] == '2'){ - //审核不通过会平台下架 - $params["status"] = '3'; - } - - //更新 - if($row){ - - if($params["auth_status"] != '1' && $row["auth_status"] == '1'){ - $this->error("审核已通过的课程不允许再修改审核状态!"); - } - - if($params["auth_status"] != '0' && $row["auth_status"] == '0'){ - //填写审核时间和审核人 - $params["auth_time"] = time(); - $params["admin_id"] = $this->auth->id; - if($params["auth_status"] == '1'){ - //审核通过 - $this->success_auth = true; - } - - if($params["auth_status"] == '2'){ - //审核通过 - $this->error_auth = true; - } - } - //审核通过 - if($this->success_auth){ - //如果是平台下架,则更新成正常下架 - if($params["status"] == '3') $params["status"] = '2'; - - //调用通过事件 -// $data = ['shop' => $row]; -// \think\Hook::listen('classes_auth_success_after', $data); - } - - - if($this->error_auth){ - - //调用通过事件 -// $data = ['shop' => $row]; -// \think\Hook::listen('classes_auth_fail_after', $data); - - } - - }else{ - //新增 - } - - } - - - - protected function updateCheck($id,$params=[],$row=null){ - if($params && $row){ - - if(!$this->no_auth_fields_check($params,$row)){ - return true; - } - } - - // 课程存在未完成订单则不允许操作 - $order = Order::where("classes_lib_id",$id)->where("status","in","0,3")->find(); - if($order)$this->error("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!"); - // 课程存在售后订单则不允许操作 - - - - } - - - - protected function update_check(&$params,$row=null) - { - if($row){ - if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"]; - if(empty($params["teacher_id"]))$params["teacher_id"] = $row["teacher_id"]; - } - -// try { - $classesLib = new \app\common\model\school\classes\ClassesLib(); - $classesLib->no_auth_fields = $this->no_auth_fields; - $classesLib->need_auth = $this->need_auth; - $classesLib->have_auth = $this->have_auth; - - $classesLib->classesCheck($params,null,$row); - - $this->need_auth = $classesLib->need_auth; - $this->have_auth = $classesLib->have_auth; - -// }catch (\Exception $e){ -// $this->error($e->getMessage()); -// } - - - //特有认证判断 - $this->authClasses($params,$row); -// var_dump($row);die; - - - - //更新 - if($row){ - - - }else{ - //新增 - //新增 - $params["add_type"] = '2'; - $params["add_id"] = $this->auth->id; - - - } - - } - - protected function update_classes($classes_lib_id){ - //课时数必须大于等于课时核销数 - $count = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$classes_lib_id)->count(); - $classes_num = \app\common\model\school\classes\ClassesLib::where("id",$classes_lib_id)->value("classes_num"); - if($count < $classes_num){ - throw new \Exception("课时数必须大于等于课时核销数"); - } - - - \app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id); - - - } - - - /** - * 添加 - * - * @return string - * @throws \think\Exception - */ - public function add() - { - if (false === $this->request->isPost()) { - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; - $this->model->validateFailException()->validate($validate); - } - $this->update_check($params,$row=null); - $result = $this->model->allowField(true)->save($params); - \app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]); - $this->update_classes($this->model["id"]); - - if($this->have_auth){ - //调用通过事件 - $data = ['classes' => $this->model]; - \think\Hook::listen('classes_auth_need_after', $data); - - } - - if($this->success_auth){ - //调用通过事件 - $data = ['classes' => $this->model]; - \think\Hook::listen('classes_auth_success_after', $data); - } - - - if($this->error_auth){ - //调用通过事件 - $data = ['classes' => $this->model]; - \think\Hook::listen('classes_auth_fail_after', $data); - - } - - - Db::commit(); - } catch (ValidateException|PDOException|\Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($result === false) { - $this->error(__('No rows were inserted')); - } - $this->success(); - } - - - /** - * 添加 - * - * @return string - * @throws \think\Exception - */ - public function addnew($row=null) - { - if (false === $this->request->isPost()) { - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - unset($params["id"]); - if($row){ - //如果走的复制 - if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"]; - if(empty($params["teacher_id"]))$params["teacher_id"] = $row["teacher_id"]; - } - - - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; - $this->model->validateFailException()->validate($validate); - } - $this->update_check($params,$row=null); - $spec = $params["spec"]; - unset($params["spec"]); - $result = $this->model->allowField(true)->save($params); - \app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]); - - //添加课程规格 - foreach ($spec as $k=>$v){ - $v["classes_lib_id"] = $this->model["id"]; - unset($v["id"]); - (new \app\common\model\school\classes\ClassesSpec)->allowField(true)->save($v); - } - - //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 - $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$this->model["id"])->select(); - foreach ($specss as $k=>$specs){ - $params =$specs->toArray(); - (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs); - } - - - $this->update_classes($this->model["id"]); - - if($this->have_auth){ - //调用通过事件 - $data = ['classes' => $this->model]; - \think\Hook::listen('classes_auth_need_after', $data); - - } - - if($this->success_auth){ - //调用通过事件 - $data = ['classes' => $this->model]; - \think\Hook::listen('classes_auth_success_after', $data); - } - - - if($this->error_auth){ - //调用通过事件 - $data = ['classes' => $this->model]; - \think\Hook::listen('classes_auth_fail_after', $data); - - } - - - Db::commit(); - } catch (ValidateException|PDOException|\Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($result === false) { - $this->error(__('No rows were inserted')); - } - $this->success(); - } - - /** - * 编辑 - * - * @param $ids - * @return string - * @throws DbException - * @throws \think\Exception - */ - public function edit($ids = null) - { - $row = $this->model->get($ids); - if (!$row) { - $this->error(__('No Results were found')); - } - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } - if (false === $this->request->isPost()) { - $spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->field("id,classes_lib_id,name,start_time,end_time,limit_num,status,weigh")->order('weigh desc,id desc')->select(); - foreach ($spec as $k=>&$v){ - $v["time"] = date("Y/m/d H:i",$v["start_time"])." - ".date("Y/m/d H:i",$v["end_time"]); - } - $row["spec"] = json_encode($spec); - $this->view->assign('row', $row); - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; - - $row->validateFailException()->validate($validate); - } - - $this->update_check($params,$row); - - - $spec = $params["spec"] ?? []; - -// var_dump($spec); - - $delete_spec_ids = $params["delete_spec_ids"] ?? []; - unset($params["spec"]); - unset($params["delete_spec_ids"]); - $result = $row->allowField(true)->save($params); - //添加课程规格 - foreach ($spec as $k=>$v){ - $v["classes_lib_id"] = $row["id"]; - //有id更新,否则新增 - if(isset($v["id"]) && $v["id"]){ - \app\common\model\school\classes\ClassesSpec::update((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v)); - }else{ - - \app\common\model\school\classes\ClassesSpec::create((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v)); - } - - } - //删除规格 - foreach ($delete_spec_ids as $k=>$delete_spec){ - - - (new \app\common\model\school\classes\ClassesSpec)->updateCheck($delete_spec["id"]); - - $delete_spec->delete(); - } - - //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 - $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->select(); - foreach ($specss as $k=>$specs){ - - $params =$specs->toArray(); - (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs); - } - - $this->update_classes($row["id"]); - if($this->have_auth){ - //调用通过事件 - $data = ['classes' => $row]; - \think\Hook::listen('classes_auth_need_after', $data); - - } - - if($this->success_auth){ - //调用通过事件 - $data = ['classes' => $row]; - \think\Hook::listen('classes_auth_success_after', $data); - } - - - if($this->error_auth){ - //调用通过事件 - $data = ['classes' => $row]; - \think\Hook::listen('classes_auth_fail_after', $data); - - } - // protected $have_auth = false; - - - - - Db::commit(); - } catch (ValidateException|PDOException|\Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if (false === $result) { - $this->error(__('No rows were updated')); - } - $this->success(); - } - - /** - * 删除 - * - * @param $ids - * @return void - * @throws DbException - * @throws DataNotFoundException - * @throws ModelNotFoundException - */ - public function del($ids = null) - { - if (false === $this->request->isPost()) { - $this->error(__("Invalid parameters")); - } - $ids = $ids ?: $this->request->post("ids"); - if (empty($ids)) { - $this->error(__('Parameter %s can not be empty', 'ids')); - } - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $list = $this->model->where($pk, 'in', $ids)->select(); - foreach ($list as $item) { - $this->updateCheck($item->id); - } - - - $count = 0; - Db::startTrans(); - try { - foreach ($list as $item) { - //删除课程规格 - Spec::where("classes_lib_id",$item->id)->delete(); - - - $count += $item->delete(); - } - Db::commit(); - } catch (PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($count) { - $this->success(); - } - $this->error(__('No rows were deleted')); - } - - - - - - /** - * 复制课程 - * - * @param $ids - * @return string - * @throws DbException - * @throws \think\Exception - */ - public function copy($ids = null) - { - $row = $this->model->get($ids); - if (!$row) { - $this->error(__('No Results were found')); - } - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } - if (false === $this->request->isPost()) { - $spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->field("id,classes_lib_id,name,start_time,end_time,limit_num,status,weigh")->order('weigh desc,id desc')->select(); - foreach ($spec as $k=>&$v){ - $v["time"] = date("Y/m/d H:i",$v["start_time"])." - ".date("Y/m/d H:i",$v["end_time"]); - } - $row["spec"] = json_encode($spec); - $this->view->assign('row', $row); - return $this->view->fetch(); - } - - $this->addnew($row); - } - - - - - - /** - * Selectpage的实现方法 - * - * 当前方法只是一个比较通用的搜索匹配,请按需重载此方法来编写自己的搜索逻辑,$where按自己的需求写即可 - * 这里示例了所有的参数,所以比较复杂,实现上自己实现只需简单的几行即可 - * - */ - protected function selectpage() - { - //设置过滤方法 - $this->request->filter(['trim', 'strip_tags', 'htmlspecialchars']); - - //搜索关键词,客户端输入以空格分开,这里接收为数组 - $word = (array)$this->request->request("q_word/a"); - //当前页 - $page = $this->request->request("pageNumber"); - //分页大小 - $pagesize = $this->request->request("pageSize"); - //搜索条件 - $andor = $this->request->request("andOr", "and", "strtoupper"); - //排序方式 - $orderby = (array)$this->request->request("orderBy/a"); - //显示的字段 - $field = $this->request->request("showField"); - //主键 - $primarykey = $this->request->request("keyField"); - //主键值 - $primaryvalue = $this->request->request("keyValue"); - //搜索字段 -// $searchfield = (array)$this->request->request("searchField/a"); - - $searchfield = [ - 'id','title', 'address', 'address_detail' - ]; - - //自定义搜索条件 - $custom = (array)$this->request->request("custom/a"); - //是否返回树形结构 - $istree = $this->request->request("isTree", 0); - $ishtml = $this->request->request("isHtml", 0); - if ($istree) { - $word = []; - $pagesize = 999999; - } - $order = []; - foreach ($orderby as $k => $v) { - $order[$v[0]] = $v[1]; - } - $field = $field ? $field : 'name'; - - //如果有primaryvalue,说明当前是初始化传值 - if ($primaryvalue !== null) { - $where = [$primarykey => ['in', $primaryvalue]]; - $pagesize = 999999; - } else { - $where = function ($query) use ($word, $andor, $field, $searchfield, $custom) { - $logic = $andor == 'AND' ? '&' : '|'; - $searchfield = is_array($searchfield) ? implode($logic, $searchfield) : $searchfield; - $searchfield = str_replace(',', $logic, $searchfield); - $word = array_filter(array_unique($word)); - if (count($word) == 1) { - $query->where($searchfield, "like", "%" . reset($word) . "%"); - } else { - $query->where(function ($query) use ($word, $searchfield) { - foreach ($word as $index => $item) { - $query->whereOr(function ($query) use ($item, $searchfield) { - $query->where($searchfield, "like", "%{$item}%"); - }); - } - }); - } - if ($custom && is_array($custom)) { - foreach ($custom as $k => $v) { - if (is_array($v) && 2 == count($v)) { - $query->where($k, trim($v[0]), $v[1]); - } else { - $query->where($k, '=', $v); - } - } - } - }; - } - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - if($this->shopIdAutoCondition){ - - //判断省市区编码是否在授权列表内 - ["provinces" =>$provinces,"citys"=> $citys, "districts"=>$districts,"address_citys"=>$address_citys] = Admin::getHaveCity($this->auth->id); - - if(is_array($provinces)){ - $this->model->where('province',"in",$provinces); - } - if(is_array($citys)){ - $this->model->where('city',"in",$citys); - } - if(is_array($districts)){ - $this->model->where('district',"in",$districts); - } - - } - - $list = []; - $total = $this->model->where($where)->count(); - if ($total > 0) { - if($this->shopIdAutoCondition){ - //判断省市区编码是否在授权列表内 - ["provinces" =>$provinces,"citys"=> $citys, "districts"=>$districts,"address_citys"=>$address_citys] = Admin::getHaveCity($this->auth->id); - - if(is_array($provinces)){ - $this->model->where('province',"in",$provinces); - } - if(is_array($citys)){ - $this->model->where('city',"in",$citys); - } - if(is_array($districts)){ - $this->model->where('district',"in",$districts); - } - } - - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - - $fields = is_array($this->selectpageFields) ? $this->selectpageFields : ($this->selectpageFields && $this->selectpageFields != '*' ? explode(',', $this->selectpageFields) : []); - - //如果有primaryvalue,说明当前是初始化传值,按照选择顺序排序 - if ($primaryvalue !== null && preg_match("/^[a-z0-9_\-]+$/i", $primarykey)) { - $primaryvalue = array_unique(is_array($primaryvalue) ? $primaryvalue : explode(',', $primaryvalue)); - //修复自定义data-primary-key为字符串内容时,给排序字段添加上引号 - $primaryvalue = array_map(function ($value) { - return '\'' . $value . '\''; - }, $primaryvalue); - - $primaryvalue = implode(',', $primaryvalue); - - $this->model->orderRaw("FIELD(`{$primarykey}`, {$primaryvalue})"); - } else { - $this->model->order($order); - } - - $datalist = $this->model->where($where) - ->page($page, $pagesize) - ->select(); - - foreach ($datalist as $index => $item) { - unset($item['password'], $item['salt']); - if ($this->selectpageFields == '*') { - $result = [ - $primarykey => $item[$primarykey] ?? '', - $field => $item[$field] ?? '', - ]; - } else { - $result = array_intersect_key(($item instanceof Model ? $item->toArray() : (array)$item), array_flip($fields)); - } - $result['pid'] = isset($item['pid']) ? $item['pid'] : (isset($item['parent_id']) ? $item['parent_id'] : 0); - $list[] = $result; - } - if ($istree && !$primaryvalue) { - $tree = Tree::instance(); - $tree->init(collection($list)->toArray(), 'pid'); - $list = $tree->getTreeList($tree->getTreeArray(0), $field); - if (!$ishtml) { - foreach ($list as &$item) { - $item = str_replace(' ', ' ', $item); - } - unset($item); - } - } - } - //这里一定要返回有list这个字段,total是可选的,如果total<=list的数量,则会隐藏分页按钮 - return json(['list' => $list, 'total' => $total]); - } - - - - /** - * 生成查询所需要的条件,排序方式 - * @param mixed $searchfields 快速查询的字段 - * @param boolean $relationSearch 是否关联查询 - * @return array - */ - protected function buildparams($searchfields = null, $relationSearch = null,$excludefields = []) - { - $searchfields = is_null($searchfields) ? $this->searchFields : $searchfields; - $relationSearch = is_null($relationSearch) ? $this->relationSearch : $relationSearch; - $search = $this->request->get("search", ''); - $filter = $this->request->get("filter", ''); - $op = $this->request->get("op", '', 'trim'); - $sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id'); - $order = $this->request->get("order", "DESC"); - $offset = max(0, $this->request->get("offset/d", 0)); - $limit = max(0, $this->request->get("limit/d", 0)); - $limit = $limit ?: 999999; - //新增自动计算页码 - $page = $limit ? intval($offset / $limit) + 1 : 1; - if ($this->request->has("page")) { - $page = max(0, $this->request->get("page/d", 1)); - } - $this->request->get([config('paginate.var_page') => $page]); - $filter = (array)json_decode($filter, true); - $op = (array)json_decode($op, true); - $filter = $filter ? $filter : []; - $where = []; - $excludearray = []; - $alias = []; - $bind = []; - $name = ''; - $aliasName = ''; - if (!empty($this->model) && $relationSearch) { - $name = $this->model->getTable(); - $alias[$name] = Loader::parseName(basename(str_replace('\\', '/', get_class($this->model)))); - $aliasName = $alias[$name] . '.'; - } - $sortArr = explode(',', $sort); - foreach ($sortArr as $index => & $item) { - $item = stripos($item, ".") === false ? $aliasName . trim($item) : $item; - } - unset($item); - $sort = implode(',', $sortArr); - - if($this->shopIdAutoCondition){ - //判断省市区编码是否在授权列表内 - ["provinces" =>$provinces,"citys"=> $citys, "districts"=>$districts,"address_citys"=>$address_citys] = Admin::getHaveCity($this->auth->id); - - if(is_array($provinces)){ - $where[] = [$aliasName.'province','in',$provinces]; - } - if(is_array($citys)){ - $where[] = [$aliasName.'city','in',$citys]; - } - if(is_array($districts)){ - $where[] = [$aliasName.'district','in',$districts]; - } - } - - - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $where[] = [$aliasName . $this->dataLimitField, 'in', $adminIds]; - } - if ($search) { - $searcharr = is_array($searchfields) ? $searchfields : explode(',', $searchfields); - foreach ($searcharr as $k => &$v) { - $v = stripos($v, ".") === false ? $aliasName . $v : $v; - } - unset($v); - $where[] = [implode("|", $searcharr), "LIKE", "%{$search}%"]; - } - $index = 0; - foreach ($filter as $k => $v) { - if (!preg_match('/^[a-zA-Z0-9_\-\.]+$/', $k)) { - continue; - } - $sym = $op[$k] ?? '='; - //忽略的查询条件出现在忽略数组中 2022年9月6日18:55:17 - if(in_array($k, $excludefields)){ - $excludearray[$k]['value'] = $v; - $excludearray[$k]['op'] = $sym; - - if (stripos($k, ".") === false) { - $excludearray[$k]['alias'] = $aliasName; - } - unset($filter[$k]); - unset($op[$k]); - continue; - } - - if (stripos($k, ".") === false) { - $k = $aliasName . $k; - } - $v = !is_array($v) ? trim($v) : $v; - $sym = strtoupper($op[$k] ?? $sym); - //null和空字符串特殊处理 - if (!is_array($v)) { - if (in_array(strtoupper($v), ['NULL', 'NOT NULL'])) { - $sym = strtoupper($v); - } - if (in_array($v, ['""', "''"])) { - $v = ''; - $sym = '='; - } - } - - switch ($sym) { - case '=': - case '<>': - $where[] = [$k, $sym, (string)$v]; - break; - case 'LIKE': - case 'NOT LIKE': - case 'LIKE %...%': - case 'NOT LIKE %...%': - $where[] = [$k, trim(str_replace('%...%', '', $sym)), "%{$v}%"]; - break; - case '>': - case '>=': - case '<': - case '<=': - $where[] = [$k, $sym, intval($v)]; - break; - case 'FINDIN': - case 'FINDINSET': - case 'FIND_IN_SET': - $v = is_array($v) ? $v : explode(',', str_replace(' ', ',', $v)); - $findArr = array_values($v); - foreach ($findArr as $idx => $item) { - $bindName = "item_" . $index . "_" . $idx; - $bind[$bindName] = $item; - $where[] = "FIND_IN_SET(:{$bindName}, `" . str_replace('.', '`.`', $k) . "`)"; - } - break; - case 'IN': - case 'IN(...)': - case 'NOT IN': - case 'NOT IN(...)': - $where[] = [$k, str_replace('(...)', '', $sym), is_array($v) ? $v : explode(',', $v)]; - break; - case 'BETWEEN': - case 'NOT BETWEEN': - $arr = array_slice(explode(',', $v), 0, 2); - if (stripos($v, ',') === false || !array_filter($arr, function ($v) { - return $v != '' && $v !== false && $v !== null; - })) { - continue 2; - } - //当出现一边为空时改变操作符 - if ($arr[0] === '') { - $sym = $sym == 'BETWEEN' ? '<=' : '>'; - $arr = $arr[1]; - } elseif ($arr[1] === '') { - $sym = $sym == 'BETWEEN' ? '>=' : '<'; - $arr = $arr[0]; - } - $where[] = [$k, $sym, $arr]; - break; - case 'RANGE': - case 'NOT RANGE': - $v = str_replace(' - ', ',', $v); - $arr = array_slice(explode(',', $v), 0, 2); - if (stripos($v, ',') === false || !array_filter($arr)) { - continue 2; - } - //当出现一边为空时改变操作符 - if ($arr[0] === '') { - $sym = $sym == 'RANGE' ? '<=' : '>'; - $arr = $arr[1]; - } elseif ($arr[1] === '') { - $sym = $sym == 'RANGE' ? '>=' : '<'; - $arr = $arr[0]; - } - $tableArr = explode('.', $k); - if (count($tableArr) > 1 && $tableArr[0] != $name && !in_array($tableArr[0], $alias) - && !empty($this->model) && $this->relationSearch) { - //修复关联模型下时间无法搜索的BUG - $relation = Loader::parseName($tableArr[0], 1, false); - $alias[$this->model->$relation()->getTable()] = $tableArr[0]; - } - $where[] = [$k, str_replace('RANGE', 'BETWEEN', $sym) . ' TIME', $arr]; - break; - case 'NULL': - case 'IS NULL': - case 'NOT NULL': - case 'IS NOT NULL': - $where[] = [$k, strtolower(str_replace('IS ', '', $sym))]; - break; - default: - break; - } - $index++; - } - if (!empty($this->model)) { - $this->model->alias($alias); - } - $model = $this->model; - $where = function ($query) use ($where, $alias, $bind, &$model) { - if (!empty($model)) { - $model->alias($alias); - $model->bind($bind); - } - foreach ($where as $k => $v) { - if (is_array($v)) { - call_user_func_array([$query, 'where'], $v); - } else { - $query->where($v); - } - } - }; - return [$where, $sort, $order, $offset, $limit, $page, $alias, $bind,$excludearray]; - } - - - - /** - * 跳转链接 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function url($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $url = \app\common\model\school\classes\ClassesLib::getPath($ids); - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success($url); - } - $row = $this->model->get($ids); - $this->view->assign('vo', $row); - return $this->view->fetch(); - } - - - - - /** - * 微信小程序码 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function miniqrcode($ids = ''){ - $param = $this->request->param(); - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $url = \app\common\model\school\classes\ClassesLib::getMiniQrcodeLink($ids); - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - - return $url["response"]; - } - - - - - /** - * 查看微信小程序码 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function lookminiqrcode($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $url = \app\common\model\school\classes\ClassesLib::getMiniQrcodeLink($ids); - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success("生成小程序码成功",null,$url); - } - $row = $this->model->get($ids); - $this->view->assign('vo', $row); - return $this->view->fetch(); - } - - -} diff --git a/application/admin/controller/school/classes/ClassesSpec.php b/application/admin/controller/school/classes/ClassesSpec.php deleted file mode 100644 index 7137552..0000000 --- a/application/admin/controller/school/classes/ClassesSpec.php +++ /dev/null @@ -1,296 +0,0 @@ -model = new \app\admin\model\school\classes\ClassesSpec; - parent::_initialize(); - - $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->searchFields = ["id","name","lib.title"]; - - //设置过滤方法 - $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(['lib']) - ->where($where) - ->order($sort, $order) - ->paginate($limit); - - foreach ($list as $row) { - - $row->getRelation('lib')->visible(['title','headimage']); - } - - $result = array("total" => $list->total(), "rows" => $list->items()); - - return json($result); - } - return $this->view->fetch(); - } - - - - protected function update_classes($classes_lib_id){ - //更新课程规格库存 - //所有课时加起来 - \app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id); - } - - - protected function updateCheck($id,$params=[],$row=null){ - if($params && $row){ - - if(!$this->no_auth_fields_check($params,$row)){ - return true; - } - } - - // 课程存在售后订单则不允许操作 - // 课程存在未完成订单则不允许操作 - $order = \app\common\model\school\classes\hour\Order::where("classes_lib_spec_id",$id)->where("status","in","-1,0")->find(); - if($order)$this->error("存在正在使用中的课时订单报名学员,课时规格无法继续操作,如规格有误请下架!"); - } - - - protected function update_check(&$params,$row=null) - { - //限定人数必须大于0 - try { - - $classesLib = new \app\common\model\school\classes\ClassesSpec(); - $classesLib->no_auth_fields = $this->no_auth_fields; - $classesLib->need_auth = $this->need_auth; - $classesLib->have_auth = $this->have_auth; - $classesLib->specCheck($params,$shop_id=null,$row); - $this->need_auth = $classesLib->need_auth; - $this->have_auth = $classesLib->have_auth; - - //修改 - if($row){ - $classesLib->updateCheck($row->id,$params,$row); - - }else{ - //新增 - - - } - -// (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,$shop_id=null,$row); - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - - - -; - } - - - /** - * 添加 - * - * @return string - * @throws \think\Exception - */ - public function add() - { - if (false === $this->request->isPost()) { - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; - $this->model->validateFailException()->validate($validate); - } - $this->update_check($params,$row=null); - $result = $this->model->allowField(true)->save($params); - $this->update_classes($this->model["classes_lib_id"]); - Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($result === false) { - $this->error(__('No rows were inserted')); - } - $this->success(); - } - - /** - * 编辑 - * - * @param $ids - * @return string - * @throws DbException - * @throws \think\Exception - */ - public function edit($ids = null) - { - $row = $this->model->get($ids); - if (!$row) { - $this->error(__('No Results were found')); - } - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } - if (false === $this->request->isPost()) { - $this->view->assign('row', $row); - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; - $row->validateFailException()->validate($validate); - } - $this->update_check($params,$row); - $result = $row->allowField(true)->save($params); - $this->update_classes($row["classes_lib_id"]); - Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if (false === $result) { - $this->error(__('No rows were updated')); - } - $this->success(); - } - - /** - * 删除 - * - * @param $ids - * @return void - * @throws DbException - * @throws DataNotFoundException - * @throws ModelNotFoundException - */ - public function del($ids = null) - { - if (false === $this->request->isPost()) { - $this->error(__("Invalid parameters")); - } - $ids = $ids ?: $this->request->post("ids"); - if (empty($ids)) { - $this->error(__('Parameter %s can not be empty', 'ids')); - } - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $list = $this->model->where($pk, 'in', $ids)->select(); - $datas = []; - foreach ($list as $item) { - $this->updateCheck($item->id); - $datas[] = $item->classes_lib_id; - } - - - $count = 0; - Db::startTrans(); - try { - foreach ($list as $item) { - $count += $item->delete(); - } - foreach ($datas as $classes_lib_id) { - $this->update_classes($classes_lib_id); - } - - Db::commit(); - } catch (PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($count) { - $this->success(); - } - $this->error(__('No rows were deleted')); - } - - - -} diff --git a/application/admin/controller/school/classes/hourorder/Order.php b/application/admin/controller/school/classes/hourorder/Order.php deleted file mode 100644 index 7391389..0000000 --- a/application/admin/controller/school/classes/hourorder/Order.php +++ /dev/null @@ -1,329 +0,0 @@ -model = new \app\admin\model\school\classes\hourorder\Order; - parent::_initialize(); - - $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("authStatusList", $this->model->getAuthStatusList()); - $this->getAuthMsg(); -// $this->setUrlLock(); - } - - - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 - * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - - - /** - * 查看 - */ - public function index() - { - //当前是否为关联查询 - $this->relationSearch = true; - $this->searchFields = ["id","order_no","classesorder.order_no","classesorder.pay_no","user_id","spec.name","detail.title","user.nickname","user.realname","user.mobile"]; - - - //设置过滤方法 - $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(['classesorder','spec','user','detail','lib']) - ->where($where) - ->order($sort, $order) - ->paginate($limit); - - foreach ($list as $row) { - - $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','feel']); - $row->getRelation('lib')->visible(['title']); - } - - $result = array("total" => $list->total(), "rows" => $list->items()); - - return json($result); - } - return $this->view->fetch(); - } - - - - - - - - - /** - * 添加 - * - * @return string - * @throws \think\Exception - */ - public function add() - { - if (false === $this->request->isPost()) { - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - $result = false; - - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; - $this->model->validateFailException()->validate($validate); - } - - //记录代下单人信息 - $param = [ - "type" =>'2', - "help_user_id" =>$this->auth->id, - "help_type" => 'admin', - ]; - //确认订单 - $res = (new \app\common\model\school\classes\hourorder\Order)->confirm($this->auth->id,$params['classes_order_id'],null, $params['classes_lib_spec_id'],$param, true); - $remark = "总后台管理员帮忙下课时预约"; - //创建订单 - $result = (new \app\common\model\school\classes\hourorder\Order)->cacheCreateOrder($res['order_no'], $this->auth->id,$remark, true); - - - - } catch (ValidateException|PDOException|\Exception $e) { - - $this->error($e->getMessage()); - } - if ($result === false) { - $this->error(__('No rows were inserted')); - } - $this->success(); - } - - /** - * 编辑 - * - * @param $ids - * @return string - * @throws DbException - * @throws \think\Exception - */ - public function edit($ids = null) - { - $row = $this->model->get($ids); - if (!$row) { - $this->error(__('No Results were found')); - } - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } - if (false === $this->request->isPost()) { - $this->view->assign('row', $row); - return $this->view->fetch(); - } - $params = $this->request->post('row/a'); - if (empty($params)) { - $this->error(__('Parameter %s can not be empty', '')); - } - $params = $this->preExcludeFields($params); - $result = false; - - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; - $row->validateFailException()->validate($validate); - } - - - - - //记录代下单人信息 - - //修改订单课时 - $result = (new \app\common\model\school\classes\hourorder\Order)->updateClassesSpec($row["id"],$params["classes_lib_spec_id"],0,true,'admin',$this->auth->id,true); - - - - } catch (ValidateException|PDOException|\Exception $e) { - - $this->error($e->getMessage()); - } - if (false === $result) { - $this->error(__('No rows were updated')); - } - $this->success(); - } - - - - - /** - * 删除 - * - * @param $ids - * @return void - * @throws DbException - * @throws DataNotFoundException - * @throws ModelNotFoundException - */ - public function del($ids = null) - { - if (false === $this->request->isPost()) { - $this->error(__("Invalid parameters")); - } - $ids = $ids ?: $this->request->post("ids"); - if (empty($ids)) { - $this->error(__('Parameter %s can not be empty', 'ids')); - } - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $list = $this->model->where($pk, 'in', $ids)->select(); - - $count = 0; - - try { - foreach ($list as $item) { - $res = (new \app\common\model\school\classes\hourorder\Order)->cancel($item["id"],0,true,'admin',$this->auth->id,true); - $count++; - } - - } catch (PDOException|\Exception $e) { - - $this->error($e->getMessage()); - } - if ($count) { - $this->success(); - } - $this->error(__('No rows were deleted')); - } - - - - - /**预约审核 - * @return string - * @throws \think\Exception - * @throws \think\exception\DbException - */ - public function examine($ids = ""){ - - if($this->request->isPost()) - { - try{ - $params = $this->request->post("row/a"); - - - $auth_status = $params["auth_status"]; - $reason = $params["reason"]; - $model = (new \app\common\model\school\classes\hourorder\Order); - $model->examine($params["id"],$auth_status,$reason,0,true,'admin',$this->auth->id,true); - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - - $this->success("已完成审核"); - } - - $row = $this->model->where(array('id'=>$ids))->find(); - if (!$row) { - $this->error(__('No Results were found')); - } - -// $row = $this->model->get($param['ids']); - $this->view->assign('row', $row); - return $this->view->fetch(); - } - - - - - - /** - * 后台核销 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function verification($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\classes\hourorder\Order); - $model->verification($ids,0,true,'admin',$this->auth->id,true); - - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success('核销成功!'); - } - $row = $this->model->get($ids); - $this->view->assign('vo', $row); - return $this->view->fetch(); - } - - - - - -} diff --git a/application/admin/controller/school/classes/order/Order.php b/application/admin/controller/school/classes/order/Order.php deleted file mode 100644 index 246bd6c..0000000 --- a/application/admin/controller/school/classes/order/Order.php +++ /dev/null @@ -1,158 +0,0 @@ -model = new \app\admin\model\school\classes\order\Order; - $this->view->assign("payTypeList", $this->model->getPayTypeList()); - $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("beforeStatusList", $this->model->getBeforeStatusList()); - $this->view->assign("serverStatusList", $this->model->getServerStatusList()); - $this->view->assign("resultStatusList", $this->model->getResultStatusList()); - $this->getAuthMsg(); - } - - - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 - * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - - - /** - * 查看 - */ - public function index() - { - //当前是否为关联查询 - $this->relationSearch = true; - $this->searchFields = ["id","order_no","pay_no","user_id","code","shop.name","detail.title","user.nickname","user.realname","user.mobile"]; - - //设置过滤方法 - $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(['manystore','user','shop','lib','detail','admin']) - ->where($where) - ->order($sort, $order) - ->paginate($limit); - - foreach ($list as $row) { - - $row->getRelation('manystore')->visible(['nickname','avatar']); - $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); - $row->getRelation('shop')->visible(['name','image','address_city','province','city','district','address','address_detail']); - $row->getRelation('lib')->visible(['title','headimage']); - $row->getRelation('detail')->visible(['title','headimage',"feel","teacher_id"]); - $row->getRelation('admin')->visible(['nickname','avatar']); - } - - $result = array("total" => $list->total(), "rows" => $list->items()); - - return json($result); - } - return $this->view->fetch(); - } - - /** - * 课程订单取消 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function cancel($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\classes\order\Order); - $model->cancel($ids,0,true,'admin',$this->auth->id,true); - - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success('取消成功!'); - } - $row = $this->model->get($ids); - $this->view->assign('vo', $row); - return $this->view->fetch(); - } - - - - /**发起售后 - * @return string - * @throws \think\Exception - * @throws \think\exception\DbException - */ - public function after_sales($ids = ""){ - - if($this->request->isPost()) - { - try{ - $params = $this->request->post("row/a"); - $classes_order = $params["id"]; - $reason = $params["reason"]; - - - $model = (new \app\common\model\school\classes\order\ServiceOrder()); - $remark = "总后台管理员帮忙下售后单"; - $order = $model->afterSales($classes_order,$reason,$remark,'admin',$this->auth->id,true); - - $price = $params["price"]; - $status = "yes"; - $reject_reason = ""; - $reject_images = ""; - $model = (new \app\common\model\school\classes\order\ServiceOrder()); - $model->shopConfirmation($order["order_no"],$status,$price,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); - - - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success("执行成功"); - } - - $row = $this->model->where(array('id'=>$ids))->find(); - if (!$row) { - $this->error(__('No Results were found')); - } - $order_info = \app\common\model\school\classes\order\ServiceOrder::getCost("43246634123432564",$ids,"",[],true); -// $row = $this->model->get($param['ids']); - $this->view->assign('row',array_merge($row->toArray(),$order_info)); - return $this->view->fetch(); - } - - -} diff --git a/application/admin/controller/school/classes/order/ServiceOrder.php b/application/admin/controller/school/classes/order/ServiceOrder.php deleted file mode 100644 index 92fbd13..0000000 --- a/application/admin/controller/school/classes/order/ServiceOrder.php +++ /dev/null @@ -1,240 +0,0 @@ -model = new \app\admin\model\school\classes\order\ServiceOrder; - $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("serviceStautsList", $this->model->getServiceStautsList()); - $this->view->assign("salesTypeList", $this->model->getSalesTypeList()); - $this->view->assign("platformList", $this->model->getPlatformList()); - $this->view->assign("payTypeList", $this->model->getPayTypeList()); - $this->getAuthMsg(); - } - - - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 - * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - - - /** - * 查看 - */ - public function index() - { - //当前是否为关联查询 - $this->relationSearch = true; - - $this->searchFields = ["id","order_no","classesorder.order_no","classesorder.pay_no","user_id","shop.name","detail.title","user.nickname","user.realname","user.mobile"]; - - //设置过滤方法 - $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(['classesorder','user','detail','lib','manystore','shop']) - ->where($where) - ->order($sort, $order) - ->paginate($limit); - - foreach ($list as $row) { - - $row->getRelation('classesorder')->visible(['order_no','pay_no']); - $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); - $row->getRelation('detail')->visible(['title','headimage']); - $row->getRelation('lib')->visible(['title','headimage']); - $row->getRelation('manystore')->visible(['nickname']); - $row->getRelation('shop')->visible(['name','logo']); - } - - $result = array("total" => $list->total(), "rows" => $list->items()); - - return json($result); - } - return $this->view->fetch(); - } - - - - - - - - /**用户确认 - * @return string - * @throws \think\Exception - * @throws \think\exception\DbException - */ - public function user_confirmation($ids = ""){ - - if($this->request->isPost()) - { - try{ - $params = $this->request->post("row/a"); - $order_no = $params["order_no"]; - $reject_images = $params["reject_images"]; - $reject_reason = $params["reject_reason"]; - $status = $params["status"]; - $model = (new \app\common\model\school\classes\order\ServiceOrder()); - $model->userConfirmation($order_no,$status,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - - $this->success("已完成审核"); - } - - $row = $this->model->where(array('id'=>$ids))->find(); - if (!$row) { - $this->error(__('No Results were found')); - } - -// $row = $this->model->get($param['ids']); - $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); - $this->view->assign('row', $row); - return $this->view->fetch(); - } - - - - - /**机构确认 - * @return string - * @throws \think\Exception - * @throws \think\exception\DbException - */ - public function shop_confirmation($ids = ""){ - - if($this->request->isPost()) - { - try{ - $params = $this->request->post("row/a"); - $order_no = $params["order_no"]; - $reject_images = $params["reject_images"]; - $reject_reason = $params["reject_reason"]; - $price = $params["price"]; - $status = $params["status"]; - $model = (new \app\common\model\school\classes\order\ServiceOrder()); - $model->shopConfirmation($order_no,$status,$price,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - - $this->success("已完成审核"); - } - - $row = $this->model->where(array('id'=>$ids))->find(); - if (!$row) { - $this->error(__('No Results were found')); - } - -// $row = $this->model->get($param['ids']); - $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); - $this->view->assign('row', $row); - return $this->view->fetch(); - } - - - - /**系统确认 - * @return string - * @throws \think\Exception - * @throws \think\exception\DbException - */ - public function admin_confirmation($ids = ""){ - - if($this->request->isPost()) - { - try{ - $params = $this->request->post("row/a"); - $order_no = $params["order_no"]; - $reject_images = $params["reject_images"]; - $reject_reason = $params["reject_reason"]; - $status = $params["status"]; - $model = (new \app\common\model\school\classes\order\ServiceOrder()); - $model->adminConfirmation($order_no,$status,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - - $this->success("已完成审核"); - } - - $row = $this->model->where(array('id'=>$ids))->find(); - if (!$row) { - $this->error(__('No Results were found')); - } - -// $row = $this->model->get($param['ids']); - - $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); - $this->view->assign('row', $row); - return $this->view->fetch(); - } - - - - - - /** - * 后台核销 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function cancel($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\classes\order\ServiceOrder()); - $model->cancel($ids,0,true,'admin',$this->auth->id,true); - - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success('取消成功!'); - } - $row = $this->model->get($ids); - - $this->view->assign('vo', $row); - return $this->view->fetch(); - } - - - - - - - -} diff --git a/application/admin/controller/user/withdrawal/Userwithdrawal.php b/application/admin/controller/user/withdrawal/Userwithdrawal.php new file mode 100644 index 0000000..98cfb6e --- /dev/null +++ b/application/admin/controller/user/withdrawal/Userwithdrawal.php @@ -0,0 +1,71 @@ +model = new \app\admin\model\user\withdrawal\Userwithdrawal; + + } + + + + /** + * 默认生成的控制器所继承的父类中有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(['user']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/manystore/controller/school/classes/hourorder/OrderLog.php b/application/admin/controller/user/withdrawal/UserwithdrawalLog.php similarity index 71% rename from application/manystore/controller/school/classes/hourorder/OrderLog.php rename to application/admin/controller/user/withdrawal/UserwithdrawalLog.php index 7e9fe3d..4ede2c1 100644 --- a/application/manystore/controller/school/classes/hourorder/OrderLog.php +++ b/application/admin/controller/user/withdrawal/UserwithdrawalLog.php @@ -1,34 +1,33 @@ model = new \app\manystore\model\school\classes\hourorder\OrderLog; + $this->model = new \app\admin\model\user\withdrawal\UserwithdrawalLog; $this->view->assign("statusList", $this->model->getStatusList()); + $this->view->assign("withdrawalStatusList", $this->model->getWithdrawalStatusList()); + $this->view->assign("typeList", $this->model->getTypeList()); } - public function import() - { - parent::import(); - } + /** * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 @@ -54,14 +53,14 @@ class OrderLog extends ManystoreBase list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['schoolclasseshourorder']) + ->with(['user']) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('schoolclasseshourorder')->visible(['order_no']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/lang/zh-cn/school/activity/activity.php b/application/admin/lang/zh-cn/school/activity/activity.php new file mode 100644 index 0000000..2a4128b --- /dev/null +++ b/application/admin/lang/zh-cn/school/activity/activity.php @@ -0,0 +1,78 @@ + '发布用户', + 'Title' => '标题', + 'Images' => '轮播图', + 'Address_city' => '城市选择', + 'Cate_ids' => '平台分类ids', + 'Province' => '省编号', + 'City' => '市编号', + 'District' => '县区编号', + 'Address' => '活动地址', + 'Address_detail' => '活动详细地址', + 'Longitude' => '经度', + 'Latitude' => '纬度', + 'Start_time' => '活动开始时间', + 'End_time' => '活动结束时间', + 'Sign_start_time' => '报名开始时间', + 'Sign_end_time' => '报名结束时间', + 'Price' => '报名单价', + 'Stock' => '活动限制人数', + 'Content' => '活动详情', + 'Status' => '状态', + 'Status 1' => '未开始', + 'Set status to 1' => '设为未开始', + 'Status 2' => '报名中', + 'Set status to 2' => '设为报名中', + 'Status 3' => '待开始', + 'Set status to 3' => '设为待开始', + 'Status 4' => '进行中', + 'Set status to 4' => '设为进行中', + 'Status 5' => '已结束', + 'Set status to 5' => '设为已结束', + 'Status -1' => '已取消', + 'Set status to -1' => '设为已取消', + 'Cancel_type' => '取消类型', + 'Cancel_type 1' => '审核不通过', + 'Cancel_type 2' => '活动终止', + 'Weigh' => '权重', + 'Recommend' => '平台推荐', + 'Recommend 0' => '否', + 'Recommend 1' => '是', + 'Hot' => '平台热门', + 'Hot 0' => '否', + 'Hot 1' => '是', + 'New' => '平台最新', + 'New 0' => '否', + 'New 1' => '是', + 'Sale' => '总销量', + 'Views' => '浏览量', + 'Add_type' => '添加人类型', + 'Add_type 1' => '机构', + 'Add_type 2' => '总后台', + 'Add_id' => '添加人id', + 'Feel' => '是否免费', + 'Feel 0' => '否', + 'Feel 1' => '是', + 'Sign_num' => '总已报名人数', + 'Verification_num' => '总已核销人数', + 'Collect' => '实际收藏量', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间', + 'Auth_status' => '审核状态', + 'Auth_status 0' => '待审核', + 'Auth_status 1' => '审核通过', + 'Auth_status 2' => '审核不通过', + 'Reason' => '审核不通过原因', + 'Admin_id' => '审核管理员id', + 'Auth_time' => '审核时间', + 'Canceltime' => '取消时间', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', + 'Admin.nickname' => '昵称', + 'Admin.avatar' => '头像' +]; diff --git a/application/admin/lang/zh-cn/school/activity/cate.php b/application/admin/lang/zh-cn/school/activity/cate.php new file mode 100644 index 0000000..9705b31 --- /dev/null +++ b/application/admin/lang/zh-cn/school/activity/cate.php @@ -0,0 +1,17 @@ + '分类名', + 'Status' => '状态', + 'Status 1' => '上架', + 'Set status to 1'=> '设为上架', + 'Status 2' => '下架', + 'Set status to 2'=> '设为下架', + 'Hot' => '热门', + 'Hot 0' => '否', + 'Hot 1' => '是', + 'Weigh' => '权重', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间' +]; diff --git a/application/admin/lang/zh-cn/school/activity/order/order.php b/application/admin/lang/zh-cn/school/activity/order/order.php new file mode 100644 index 0000000..7a3cb47 --- /dev/null +++ b/application/admin/lang/zh-cn/school/activity/order/order.php @@ -0,0 +1,76 @@ + '订单号', + 'Pay_no' => '微信支付单号', + 'User_id' => '下单人用户id', + 'Activity_id' => '课程活动id', + 'Activity_order_detail_id' => '订单课程活动id', + 'Beforeprice' => '订单优惠前金额', + 'Totalprice' => '订单应付金额', + 'Payprice' => '订单实付金额', + 'Pay_type' => '支付方式', + 'Pay_type yue' => '余额', + 'Pay_type wechat' => '微信', + 'Status' => '订单状态', + 'Status -3' => '已取消', + 'Set status to -3' => '设为已取消', + 'Status 0' => '待支付', + 'Set status to 0' => '设为待支付', + 'Status 2' => '已报名', + 'Set status to 2' => '设为已报名', + 'Status 3' => '核销中', + 'Set status to 3' => '设为核销中', + 'Status 4' => '售后中', + 'Set status to 4' => '设为售后中', + 'Status 5' => '退款结算中', + 'Set status to 5' => '设为退款结算中', + 'Status 6' => '已退款', + 'Set status to 6' => '设为已退款', + 'Status 9' => '已完成', + 'Set status to 9' => '设为已完成', + 'Before_status' => '售后前状态', + 'Before_status -3' => '已取消', + 'Before_status 0' => '未售后', + 'Before_status 2' => '已报名', + 'Before_status 3' => '核销中', + 'Before_status 4' => '售后中', + 'Before_status 6' => '已退款', + 'Before_status 9' => '已完成', + 'Server_status' => '售后订单状态', + 'Server_status 0' => '正常', + 'Server_status 3' => '售后中', + 'Server_status 6' => '售后完成', + 'Canceltime' => '取消时间', + 'Paytime' => '支付时间', + 'Auth_time' => '售后时间', + 'Reservation_time' => '预约时间', + 'Finishtime' => '完成时间', + 'Refundtime' => '退款时间', + 'Total_refundprice' => '应退款金额', + 'Real_refundprice' => '实际退款金额', + 'Sub_refundprice' => '剩余未退金额', + 'Pay_json' => '三方支付信息json', + 'Platform' => '支付平台', + 'Reason' => '售后不通过原因', + 'Auth_status' => '售后结果状态', + 'Auth_status 0' => '待审核', + 'Auth_status 1' => '同意退款', + 'Auth_status 2' => '拒绝退款', + 'Auth_user_id' => '售后用户id', + 'Auth_type' => '售后用户类型', + 'Refund_no' => '退款单号', + 'Refund_json' => '三方支付退款信息json', + 'Refund_error' => '三方支付退款错误信息更新', + 'Refundsendtime' => '退款发起时间', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', + 'Activity.title' => '标题', + 'Activity.images' => '轮播图', + 'Detail.title' => '标题' +]; diff --git a/application/admin/lang/zh-cn/school/activity/order/order_code.php b/application/admin/lang/zh-cn/school/activity/order/order_code.php new file mode 100644 index 0000000..e94eb0f --- /dev/null +++ b/application/admin/lang/zh-cn/school/activity/order/order_code.php @@ -0,0 +1,24 @@ + '活动订单id', + 'Code' => '核销码', + 'Codeimage' => '核销二维码图片', + 'Codeoneimage' => '核销一维码图片', + 'Status' => '核销状态', + 'Status 3' => '未核销', + 'Set status to 3' => '设为未核销', + 'Status 6' => '已核销', + 'Set status to 6' => '设为已核销', + 'Verificationtime' => '核销时间', + 'Verification_user_id' => '核销人用户id', + 'Verification_type' => '核销用户类型', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间', + 'Order.order_no' => '订单号', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像' +]; diff --git a/application/admin/lang/zh-cn/school/activity/order/order_detail.php b/application/admin/lang/zh-cn/school/activity/order/order_detail.php new file mode 100644 index 0000000..4927579 --- /dev/null +++ b/application/admin/lang/zh-cn/school/activity/order/order_detail.php @@ -0,0 +1,56 @@ + '发布用户', + 'Activity_order_id' => '活动订单id', + 'Activity_id' => '活动id', + 'Title' => '标题', + 'Images' => '轮播图', + 'Address_city' => '城市选择', + 'Cate_ids' => '平台分类ids', + 'Province' => '省编号', + 'City' => '市编号', + 'District' => '县区编号', + 'Address' => '活动地址', + 'Address_detail' => '活动详细地址', + 'Longitude' => '经度', + 'Latitude' => '纬度', + 'Start_time' => '活动开始时间', + 'End_time' => '活动结束时间', + 'Sign_start_time' => '报名开始时间', + 'Sign_end_time' => '报名结束时间', + 'Price' => '报名单价', + 'Stock' => '活动限制人数', + 'Content' => '活动详情', + 'Weigh' => '权重', + 'Recommend' => '平台推荐', + 'Recommend 0' => '否', + 'Recommend 1' => '是', + 'Hot' => '平台热门', + 'Hot 0' => '否', + 'Hot 1' => '是', + 'New' => '平台最新', + 'New 0' => '否', + 'New 1' => '是', + 'Sale' => '总销量', + 'Views' => '浏览量', + 'Add_type' => '添加人类型', + 'Add_type 1' => '机构', + 'Add_type 2' => '总后台', + 'Add_id' => '添加人id', + 'Feel' => '是否免费', + 'Feel 0' => '否', + 'Feel 1' => '是', + 'Sign_num' => '总已报名人数', + 'Verification_num' => '总已核销人数', + 'Collect' => '实际收藏量', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', + 'Order.order_no' => '订单号', + 'Activity.title' => '标题' +]; diff --git a/application/admin/lang/zh-cn/school/activity/order/settle_log.php b/application/admin/lang/zh-cn/school/activity/order/settle_log.php new file mode 100644 index 0000000..04dab54 --- /dev/null +++ b/application/admin/lang/zh-cn/school/activity/order/settle_log.php @@ -0,0 +1,33 @@ + '活动订单id', + 'Withdrawal_log_id' => '提现记录id', + 'To_user_id' => '结算用户id', + 'Pay_user_id' => '支付用户id', + 'Status' => '结算状态', + 'Status 1' => '冻结中', + 'Set status to 1' => '设为冻结中', + 'Status 2' => '待结算', + 'Set status to 2' => '设为待结算', + 'Status 3' => '已结算', + 'Set status to 3' => '设为已结算', + 'Status -1' => '已关闭', + 'Set status to -1' => '设为已关闭', + 'Settletime' => '结算时间', + 'Createtime' => '创建时间', + 'Canceltime' => '关闭时间', + 'Unfreezetime' => '解冻时间点', + 'Deletetime' => '删除时间', + 'Order_price' => '订单金额', + 'Fee_price' => '手续费', + 'Fee_scale' => '手续费比例', + 'Settle_price' => '实际结算金额', + 'Order.order_no' => '订单号', + 'Log.price' => '提现金额', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像', + 'Third.openname' => '第三方会员昵称' +]; diff --git a/application/admin/lang/zh-cn/school/classes/classes_lib.php b/application/admin/lang/zh-cn/school/classes/classes_lib.php deleted file mode 100644 index 18b1361..0000000 --- a/application/admin/lang/zh-cn/school/classes/classes_lib.php +++ /dev/null @@ -1,96 +0,0 @@ - '机构账号id', - 'Shop_id' => '机构', - 'User_id' => '主讲师用户', - 'Classes_cate_ids' => '标签', - 'Classes_label_ids' => '热门', - - 'Has_expire' => '是否过期', - 'Has_expire 1' => '往期课程', - 'Has_expire 2' => '进行中课程', - - 'Start_time' => '开始时间', - 'End_time' => '结束时间', - - 'Self_label_tag' => '机构特色标签', - 'Add_type' => '添加人类型', - 'Add_type 1' => '机构', - 'Add_type 2' => '总后台', - 'Add_id' => '添加人id', - 'Title' => '课程名称', - 'Headimage' => '课程头图', - 'Images' => '课程轮播图', - 'Type' => '课程地点类型', - 'Type out' => '户外', - 'Type in' => '室内', - 'Classes_num' => '核销次数', - 'Address_type' => '地址类型', - 'Address_type 1' => '机构内授课', - 'Address_type 2' => '特定位置授课', - 'Address_city' => '城市选择', - 'Province' => '省编号', - 'City' => '市编号', - 'District' => '县区编号', - 'Address' => '地址', - 'Address_detail' => '详细地址', - 'Longitude' => '经度', - 'Latitude' => '纬度', - 'Classes_date_text' => '上课日期', - 'Classes_time_text' => '上课时间', - 'Content' => '课程详情', - 'Notice' => '课程须知', - 'Virtual_num' => '虚拟报名人数', - 'Sale' => '总销量', - 'Price' => '售价', - 'Underline_price' => '划线价', - 'Virtual_collect' => '虚拟收藏量', - 'Status' => '状态', - 'Status 1' => '上架', - 'Set status to 1' => '设为上架', - 'Status 2' => '下架', - 'Set status to 2' => '设为下架', - 'Status 3' => '(审核课程)平台下架', - 'Set status to 3' => '设为平台下架', - 'Auth_status' => '审核状态', - 'Auth_status 0' => '待审核', - 'Auth_status 1' => '审核通过', - 'Auth_status 2' => '审核失败', - 'Reason' => '审核不通过原因', - 'Auth_time' => '审核时间', - 'Admin_id' => '审核管理员id', - 'Weigh' => '权重', - 'Recommend' => '平台推荐', - 'Recommend 0' => '否', - 'Recommend 1' => '是', - 'Hot' => '平台热门', - 'Hot 0' => '否', - 'Hot 1' => '是', - 'New' => '平台最新', - 'New 0' => '否', - 'New 1' => '是', - 'Selfhot' => '机构热门', - 'Selfhot 0' => '否', - 'Selfhot 1' => '是', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Deletetime' => '删除时间', - 'Manystore.nickname' => '昵称', - 'Shop.name' => '机构名称', - 'Shop.image' => '机构封面图', - 'Shop.address_city' => '机构城市选择', - 'Shop.province' => '机构省编号', - 'Shop.city' => '机构市编号', - 'Shop.district' => '机构县区编号', - 'Shop.address' => '机构地址', - 'Shop.address_detail' => '机构详细地址', - 'User.nickname' => '讲师用户昵称', - 'User.realname' => '讲师用户真实姓名', - 'User.mobile' => '讲师用户手机号', - 'User.avatar' => '讲师用户头像', - 'Admin.nickname' => '管理员昵称', - 'Limit_num' => '总限定人数', - 'Sign_num' => '总已报名人数', - 'Verification_num' => '总已核销人数', -]; diff --git a/application/admin/lang/zh-cn/school/classes/classes_spec.php b/application/admin/lang/zh-cn/school/classes/classes_spec.php deleted file mode 100644 index 56db14c..0000000 --- a/application/admin/lang/zh-cn/school/classes/classes_spec.php +++ /dev/null @@ -1,23 +0,0 @@ - '课程id', - 'Name' => '每节课名', - 'Time' => '课时开始结束时间', - 'Start_time' => '开始时间', - 'End_time' => '结束时间', - 'Limit_num' => '本课时限定人数', - 'Sign_num' => '已报名人数', - 'Verification_num' => '已核销人数', - 'Status' => '状态', - 'Status 1' => '上架', - 'Set status to 1' => '设为上架', - 'Status 2' => '下架', - 'Set status to 2' => '设为下架', - 'Weigh' => '权重', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Deletetime' => '删除时间', - 'Lib.title' => '课程名称', - 'Lib.headimage' => '课程头图' -]; diff --git a/application/admin/lang/zh-cn/school/classes/hourorder/order.php b/application/admin/lang/zh-cn/school/classes/hourorder/order.php deleted file mode 100644 index 44fbe1e..0000000 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order.php +++ /dev/null @@ -1,54 +0,0 @@ - '预约单号', - - 'Edit'=>'修改用户预约的课时', - 'Add'=>'帮用户预约课时', - 'Delete'=>'帮用户取消预约', - 'Del'=>'帮用户取消预约', - 'Auth_status' => '审核状态', - 'Auth_status 0' => '待审核', - 'Auth_status 1' => '审核通过', - 'Auth_status 2' => '审核失败', - 'Reason' => '审核不通过原因', - 'Auth_time' => '审核时间', - 'Admin_id' => '审核管理员id', - - 'Classes_order_id' => '课程订单id', - 'Classes_lib_spec_id' => '选择要预约的课时', - 'User_id' => '下单人id', - 'Classes_order_detail_id' => '订单课程id', - 'Classes_lib_id' => '课程id', - 'Name' => '本节课名', - 'Start_time' => '开始时间', - 'End_time' => '结束时间', - 'Limit_num' => '本课时限定人数(0不限制)', - 'Sign_num' => '下单时已报名人数', - 'Verification_num' => '下单时已核销人数', - 'Status' => '订单状态', - 'Status -3' => '已取消', - 'Set status to -3' => '设为已取消', - 'Status -1' => '已报名待审核', - 'Set status to -1' => '设为已报名待审核', - 'Status 0' => '已预约', - 'Set status to 0' => '设为已预约', - 'Status 3' => '已完成', - 'Set status to 3' => '设为已完成', - 'Verification_user_id' => '核销人用户id', - 'Reservation_time' => '预约时间', - 'Finish_time' => '完成时间', - 'Cancel_time' => '取消时间', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Deletetime' => '删除时间', - 'Order.order_no' => '课程单号', - 'Spec.name' => '本节课名', - 'User.nickname' => '预约用户昵称', - 'User.realname' => '预约用户真实姓名', - 'User.mobile' => '预约用户手机号', - 'User.avatar' => '预约用户头像', - 'Detail.title' => '课程名称', - 'Detail.headimage' => '课程头图', - 'Lib.title' => '课程名称' -]; 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 deleted file mode 100644 index 8657d25..0000000 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order_log.php +++ /dev/null @@ -1,17 +0,0 @@ - '课时订单id', - 'Status' => '订单状态', - 'Status -3' => '已取消', - 'Set status to -3' => '设为已取消', - 'Status -1' => '已报名待审核', - 'Set status to -1' => '设为已报名待审核', - 'Status 0' => '已预约', - 'Set status to 0' => '设为已预约', - 'Status 3' => '已完成', - 'Set status to 3' => '设为已完成', - 'Log_text' => '记录内容', - 'Createtime' => '创建时间', - 'Order.order_no' => '课程单号' -]; diff --git a/application/admin/lang/zh-cn/school/classes/order/order.php b/application/admin/lang/zh-cn/school/classes/order/order.php deleted file mode 100644 index dbf3ccb..0000000 --- a/application/admin/lang/zh-cn/school/classes/order/order.php +++ /dev/null @@ -1,85 +0,0 @@ - '课程单号', - 'Edit'=>'订单详情', - 'Pay_no' => '微信支付单号', - 'User_id' => '下单人id', - 'Manystore_id' => '机构账号id', - 'Shop_id' => '机构id', - 'Code' => '核销码', - 'Codeimage' => '核销二维码图片', - 'Codeoneimage' => '核销一维码图片', - 'Classes_lib_id' => '课程id', - 'Classes_order_detail_id' => '订单课程id', - 'Beforeprice' => '订单优惠前金额', - 'Totalprice' => '订单应付金额', - 'Payprice' => '订单实付金额', - 'Pay_type' => '支付方式', - 'Pay_type yue' => '余额', - 'Pay_type wechat' => '微信', - 'Status' => '订单状态', - 'Status -3' => '已取消', - 'Set status to -3' => '设为已取消', - 'Status 0' => '待支付', - 'Set status to 0' => '设为待支付', - 'Status 3' => '使用中', - 'Set status to 3' => '设为使用中', - 'Status 4' => '售后中', - 'Set status to 4' => '设为售后中', - 'Status 6' => '已退款', - 'Set status to 6' => '设为已退款', - 'Status 9' => '已完成', - 'Set status to 9' => '设为已完成', - 'Before_status' => '售后前状态', - 'Before_status -3' => '已取消', - 'Before_status 0' => '未售后', - 'Before_status 3' => '使用中', - 'Before_status 6' => '已退款', - 'Before_status 9' => '已完成', - 'Server_status' => '售后订单状态', - 'Server_status 0' => '正常', - 'Server_status 3' => '售后中', - 'Server_status 6' => '售后完成', - 'Reason' => '售后申请原因', - 'Auth_manystore_id' => '机构审核人id', - 'Auth_opinion' => '机构审核意见', - 'Auth_file' => '机构审核附件', - 'Admin_id' => '平台审核人id', - 'Result_status' => '售后处理结果', - 'Result_status 0' => '未售后', - 'Result_status 3' => '退款', - 'Result_status 6' => '驳回', - 'Result_text' => '售后处理结果说明', - 'Result_file' => '售后处理结果说明附件', - 'Canceltime' => '取消时间', - 'Paytime' => '支付时间', - 'Finishtime' => '完成时间', - 'Refundtime' => '退款时间', - 'Total_refundprice' => '应退款金额', - 'Real_refundprice' => '实际退款金额', - 'Sub_refundprice' => '剩余未退金额', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Deletetime' => '删除时间', - 'Manystore.nickname' => '机构账号昵称', - 'Manystore.avatar' => '机构账号头像', - 'User.nickname' => '下单人昵称', - 'User.realname' => '下单人真实姓名', - 'User.mobile' => '下单人手机号', - 'User.avatar' => '下单人头像', - 'Shop.name' => '机构名称', - 'Shop.image' => '机构封面图', - 'Shop.address_city' => '机构城市选择', - 'Shop.province' => '机构省编号', - 'Shop.city' => '机构市编号', - 'Shop.district' => '机构县区编号', - 'Shop.address' => '机构地址', - 'Shop.address_detail' => '机构详细地址', - 'Lib.title' => '课程名称', - 'Lib.headimage' => '课程头图', - 'Detail.title' => '课程名称', - 'Detail.headimage' => '课程头图', - 'Admin.nickname' => '管理员昵称', - 'Admin.avatar' => '管理员头像' -]; diff --git a/application/admin/lang/zh-cn/school/classes/order/order_detail.php b/application/admin/lang/zh-cn/school/classes/order/order_detail.php deleted file mode 100644 index 6b6e210..0000000 --- a/application/admin/lang/zh-cn/school/classes/order/order_detail.php +++ /dev/null @@ -1,64 +0,0 @@ - '课程订单id', - 'Manystore_id' => '机构账号id', - 'Shop_id' => '机构id', - 'User_id' => '主讲师用户id', - 'Classes_cate_ids' => '标签', - 'Classes_label_ids' => '热门', - 'Self_label_tag' => '机构特色标签', - 'Add_type' => '添加人类型', - 'Add_type 1' => '机构', - 'Add_type 2' => '总后台', - 'Add_id' => '添加人id', - 'Title' => '课程名称', - 'Headimage' => '课程头图', - 'Images' => '课程轮播图', - 'Type' => '地点类型', - 'Type out' => '户外', - 'Type in' => '室内', - 'Classes_num' => '核销数', - 'Address_type' => '地址类型', - 'Address_type 1' => '按机构', - 'Address_type 2' => '独立位置', - 'Address_city' => '城市选择', - 'Province' => '省编号', - 'City' => '市编号', - 'District' => '县区编号', - 'Address' => '地址', - 'Address_detail' => '详细地址', - 'Longitude' => '经度', - 'Latitude' => '纬度', - 'Classes_date_text' => '上课日期', - 'Classes_time_text' => '上课时间', - 'Content' => '课程详情', - 'Notice' => '课程须知', - 'Virtual_num' => '虚拟报名人数', - 'Sale' => '总销量', - 'Price' => '售价', - 'Underline_price' => '划线价', - 'Virtual_collect' => '虚拟收藏量', - 'Use_num' => '已使用课时', - 'Sub_num' => '剩余课时', - 'Unit_price' => '计算单次单价', - 'Used_price' => '计算的已使用金额', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Deletetime' => '删除时间', - 'Order.order_no' => '课程单号', - 'Manystore.nickname' => '机构账号昵称', - 'Manystore.avatar' => '机构账号头像', - 'Shop.name' => '机构名称', - 'Shop.image' => '机构封面图', - 'Shop.address_city' => '机构城市选择', - 'Shop.province' => '机构省编号', - 'Shop.city' => '机构市编号', - 'Shop.district' => '机构县区编号', - 'Shop.address' => '机构地址', - 'Shop.address_detail' => '机构详细地址', - 'User.nickname' => '昵称', - 'User.realname' => '下单人真实姓名', - 'User.mobile' => '下单人手机号', - 'User.avatar' => '下单人头像' -]; diff --git a/application/admin/lang/zh-cn/school/classes/order/order_log.php b/application/admin/lang/zh-cn/school/classes/order/order_log.php deleted file mode 100644 index aa6cdd0..0000000 --- a/application/admin/lang/zh-cn/school/classes/order/order_log.php +++ /dev/null @@ -1,35 +0,0 @@ - '课程订单id', - 'Status' => '订单状态', - 'Status -3' => '已取消', - 'Set status to -3' => '设为已取消', - 'Status 0' => '待支付', - 'Set status to 0' => '设为待支付', - 'Status 3' => '使用中', - 'Set status to 3' => '设为使用中', - 'Status 4' => '售后中', - 'Set status to 4' => '设为售后中', - 'Status 6' => '已退款', - 'Set status to 6' => '设为已退款', - 'Status 9' => '已完成', - 'Set status to 9' => '设为已完成', - 'Before_status' => '售后前状态', - 'Before_status -3' => '已取消', - 'Before_status 0' => '未售后', - 'Before_status 3' => '使用中', - 'Before_status 6' => '已退款', - 'Before_status 9' => '已完成', - 'Server_status' => '售后订单状态', - 'Server_status 0' => '正常', - 'Server_status 3' => '售后中', - 'Server_status 6' => '售后完成', - 'Result_status' => '售后处理结果', - 'Result_status 0' => '未售后', - 'Result_status 3' => '退款', - 'Result_status 6' => '驳回', - 'Log_text' => '记录内容', - 'Createtime' => '创建时间', - 'Order.order_no' => '订单号' -]; diff --git a/application/admin/lang/zh-cn/school/classes/order/service_order.php b/application/admin/lang/zh-cn/school/classes/order/service_order.php deleted file mode 100644 index a780200..0000000 --- a/application/admin/lang/zh-cn/school/classes/order/service_order.php +++ /dev/null @@ -1,69 +0,0 @@ - '售后单号', - 'Reason' => '售后申请原因', - 'Classes_order_id' => '课程订单id', - 'User_id' => '下单人id', - 'Classes_order_detail_id' => '订单课程id', - 'Classes_lib_id' => '课程id', - 'Manystore_id' => '机构账号id', - 'Shop_id' => '机构店铺id', - 'Status' => '售后状态', - 'Status 1' => '待处理', - 'Set status to 1' => '设为待处理', - 'Status 4' => '处理中', - 'Set status to 4' => '设为处理中', - 'Status 7' => '已结单', - 'Set status to 7' => '设为已结单', - 'Status -3' => '已取消', - 'Set status to -3' => '设为已取消', - 'Service_stauts' => '售后处理状态', - 'Service_stauts 1' => '待机构处理', - 'Service_stauts 4' => '待用户确认', - 'Service_stauts 7' => '售后通过结单中', - 'Service_stauts 10' => '售后通过结单', - 'Service_stauts -3' => '售后驳回结单', - 'Sales_type' => '结单类型', - 'Sales_type -3' => '未结单', - 'Sales_type 1' => '机构驳回', - 'Sales_type 4' => '用户驳回', - 'Sales_type 7' => '平台驳回', - 'Sales_type 10' => '成功退款', - 'Reject_reason' => '驳回原因', - 'Reject_images' => '驳回图片资料', - 'Auto_price' => '自动计算应退全额', - 'Loss_proportion' => '课程损耗比例', - 'Auto_loss_price' => '自动计算损耗金额', - 'Tbc_price' => '售后待确认退款金额', - 'C_price' => '售后已确认退款金额', - 'Real_refundprice' => '实际退款金额', - 'Sub_refundprice' => '剩余未退金额', - 'Platform' => '退款平台', - 'Platform miniapp' => '微信小程序', - 'Pay_type' => '退款方式', - 'Pay_type yue' => '余额', - 'Pay_type wechat' => '微信', - 'Pay_json' => '三方支付信息json', - 'Deletetime' => '删除时间', - 'Refundtime' => '退款时间', - 'Rejecttime' => '驳回时间', - 'Handletime' => '处理时间', - 'Confirmtime' => '确认时间', - 'Checkouttime' => '结单时间', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Order.order_no' => '课程订单号', - 'Order.pay_no' => '微信支付单号', - 'User.nickname' => '售后用户昵称', - 'User.realname' => '售后用户真实姓名', - 'User.mobile' => '售后用户手机号', - 'User.avatar' => '售后用户头像', - 'Detail.title' => '课程名称', - 'Detail.headimage' => '课程头图', - 'Lib.title' => '课程标题', - 'Lib.headimage' => '课程头图', - 'Manystore.nickname' => '机构账号昵称', - 'Shop.name' => '机构名称', - 'Shop.logo' => '机构LOGO' -]; diff --git a/application/admin/lang/zh-cn/school/classes/order/service_order_log.php b/application/admin/lang/zh-cn/school/classes/order/service_order_log.php deleted file mode 100644 index 35f20b8..0000000 --- a/application/admin/lang/zh-cn/school/classes/order/service_order_log.php +++ /dev/null @@ -1,45 +0,0 @@ - '课程售后订单id', - 'Classes_order_id' => '课程订单id', - 'User_id' => '下单人id', - 'Classes_order_detail_id' => '订单课程id', - 'Classes_lib_id' => '课程id', - 'Manystore_id' => '机构账号id', - 'Shop_id' => '机构店铺id', - 'Status' => '售后状态', - 'Status 1' => '待处理', - 'Set status to 1' => '设为待处理', - 'Status 4' => '处理中', - 'Set status to 4' => '设为处理中', - 'Status 7' => '已结单', - 'Set status to 7' => '设为已结单', - 'Status -3' => '已取消', - 'Set status to -3' => '设为已取消', - 'Service_stauts' => '售后处理状态', - 'Service_stauts 1' => '待机构处理', - 'Service_stauts 4' => '待用户确认', - 'Service_stauts 7' => '售后通过结单中', - 'Service_stauts 10' => '售后通过结单', - 'Service_stauts -3' => '售后驳回结单', - 'Sales_type' => '结单类型', - 'Sales_type -3' => '未结单', - 'Sales_type 1' => '机构驳回', - 'Sales_type 4' => '用户驳回', - 'Sales_type 7' => '平台驳回', - 'Sales_type 10' => '成功退款', - 'Log_text' => '记录内容', - 'Oper_id' => '记录人id', - 'Oper_type' => '记录人类型', - 'Createtime' => '创建时间', - 'Updatetime' => '修改时间', - 'Order.order_no' => '课程订单号', - 'Order.pay_no' => '微信支付单号', - 'User.nickname' => '售后用户昵称', - 'User.realname' => '售后用户真实姓名', - 'User.mobile' => '售后用户手机号', - 'User.avatar' => '售后用户头像', - 'Detail.title' => '课程标题', - 'Admin.nickname' => '管理员昵称' -]; diff --git a/application/admin/lang/zh-cn/user/withdrawal/userwithdrawal.php b/application/admin/lang/zh-cn/user/withdrawal/userwithdrawal.php new file mode 100644 index 0000000..314706a --- /dev/null +++ b/application/admin/lang/zh-cn/user/withdrawal/userwithdrawal.php @@ -0,0 +1,15 @@ + '提现用户', + 'Name' => '转账账户名', + 'Bank_name' => '开户行名称(具体到支行)', + 'Bank_user_name' => '银行账户号', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像' +]; diff --git a/application/admin/lang/zh-cn/user/withdrawal/userwithdrawal_log.php b/application/admin/lang/zh-cn/user/withdrawal/userwithdrawal_log.php new file mode 100644 index 0000000..d91bfe7 --- /dev/null +++ b/application/admin/lang/zh-cn/user/withdrawal/userwithdrawal_log.php @@ -0,0 +1,34 @@ + '提现金额', + 'Fee_price' => '手续费', + 'Real_price' => '实际应打款额', + 'Status' => '提现申请状态', + 'Status 1' => '待审核', + 'Set status to 1' => '设为待审核', + 'Status 2' => '审核通过', + 'Set status to 2' => '设为审核通过', + 'Status 3' => '审核不通过', + 'Set status to 3' => '设为审核不通过', + 'Reason' => '审核不通过原因', + 'Withdrawal_status' => '打款状态', + 'Withdrawal_status 1' => '未打款', + 'Withdrawal_status 2' => '打款中', + 'Withdrawal_status 3' => '已打款', + 'User_id' => '提现用户id', + 'Type' => '提现类型', + 'Type bank' => '银行卡', + 'Type wechat' => '微信', + 'Type alipay' => '支付宝', + 'Name' => '转账账户名', + 'Bank_name' => '开户行名称(具体到支行)', + 'Bank_user_name' => '银行账户号', + 'Paytime' => '打款时间', + 'Createtime' => '创建时间', + 'Examinetime' => '审核时间', + 'User.nickname' => '昵称', + 'User.realname' => '真实姓名', + 'User.mobile' => '手机号', + 'User.avatar' => '头像' +]; diff --git a/application/admin/model/school/classes/ClassesLib.php b/application/admin/model/school/activity/Activity.php similarity index 57% rename from application/admin/model/school/classes/ClassesLib.php rename to application/admin/model/school/activity/Activity.php index 4ca17b4..ddfb72c 100644 --- a/application/admin/model/school/classes/ClassesLib.php +++ b/application/admin/model/school/activity/Activity.php @@ -1,12 +1,11 @@ __('Has_expire 1'), '2' => __('Has_expire 2')]; - } - - - public function getHasExpireAttr($value, $data) - { - $end_time = (isset($data['end_time']) ? $data['end_time'] : ''); - if(!$end_time) return '2'; - - if( $end_time < time()) { - return '1'; - }else{ - return '2'; - } - - } - - - - public function getClassesCateTitleAttr($value, $data) - { - $classes_cate_ids = (isset($data['classes_cate_ids']) ? $data['classes_cate_ids'] : ''); - if(!$classes_cate_ids) return ''; - //$classes_cate_ids 查询分类表 names 已逗号拼接返回 - $classes_cate_title = Cate::where('id','in',$classes_cate_ids)->column('name'); - return implode(',',$classes_cate_title); - } - - public function getClassesLabelTitleAttr($value, $data) - { - $classes_cate_ids = (isset($data['classes_label_ids']) ? $data['classes_label_ids'] : ''); - if(!$classes_cate_ids) return ''; - //$classes_cate_ids 查询分类表 names 已逗号拼接返回 - $classes_cate_title = Label::where('id','in',$classes_cate_ids)->column('name'); - return implode(',',$classes_cate_title); - } - - protected static function init() @@ -88,40 +47,20 @@ class ClassesLib extends Model self::afterInsert(function ($row) { if (!$row['weigh']) { $pk = $row->getPk(); -// $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); - $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => 0]); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); } }); } - public function getClassesTypeList(){ - return \app\admin\model\school\classes\Type::column("name", 'id'); - } - - public function getAddTypeList() - { - return ['1' => __('Add_type 1'), '2' => __('Add_type 2')]; - } - - public function getTypeList() - { - return ['out' => __('Type out'), 'in' => __('Type in')]; - } - - public function getAddressTypeList() - { - return ['1' => __('Address_type 1'), '2' => __('Address_type 2')]; - } - public function getStatusList() { - return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')]; + return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '-1' => __('Status -1')]; } - public function getAuthStatusList() + public function getCancelTypeList() { - return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; + return ['1' => __('Cancel_type 1'), '2' => __('Cancel_type 2')]; } public function getRecommendList() @@ -139,33 +78,47 @@ class ClassesLib extends Model return ['0' => __('New 0'), '1' => __('New 1')]; } - public function getSelfhotList() + public function getAddTypeList() { - return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')]; + return ['1' => __('Add_type 1'), '2' => __('Add_type 2')]; + } + + public function getFeelList() + { + return ['0' => __('Feel 0'), '1' => __('Feel 1')]; + } + + public function getAuthStatusList() + { + return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; } - public function getAddTypeTextAttr($value, $data) + public function getStartTimeTextAttr($value, $data) { - $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : ''); - $list = $this->getAddTypeList(); - return isset($list[$value]) ? $list[$value] : ''; + $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } - public function getTypeTextAttr($value, $data) + public function getEndTimeTextAttr($value, $data) { - $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); - $list = $this->getTypeList(); - return isset($list[$value]) ? $list[$value] : ''; + $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } - public function getAddressTypeTextAttr($value, $data) + public function getSignStartTimeTextAttr($value, $data) { - $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : ''); - $list = $this->getAddressTypeList(); - return isset($list[$value]) ? $list[$value] : ''; + $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getSignEndTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } @@ -177,21 +130,14 @@ class ClassesLib extends Model } - public function getAuthStatusTextAttr($value, $data) + public function getCancelTypeTextAttr($value, $data) { - $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); - $list = $this->getAuthStatusList(); + $value = $value ? $value : (isset($data['cancel_type']) ? $data['cancel_type'] : ''); + $list = $this->getCancelTypeList(); 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 getRecommendTextAttr($value, $data) { $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : ''); @@ -216,28 +162,71 @@ class ClassesLib extends Model } - public function getSelfhotTextAttr($value, $data) + public function getAddTypeTextAttr($value, $data) { - $value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : ''); - $list = $this->getSelfhotList(); + $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : ''); + $list = $this->getAddTypeList(); return isset($list[$value]) ? $list[$value] : ''; } + + public function getFeelTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['feel']) ? $data['feel'] : ''); + $list = $this->getFeelList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getAuthStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); + $list = $this->getAuthStatusList(); + 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 getCanceltimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + protected function setStartTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setEndTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setSignStartTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setSignEndTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + protected function setAuthTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } - - public function manystore() + protected function setCanceltimeAttr($value) { - return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function shop() - { - return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } diff --git a/application/admin/model/school/activity/Cate.php b/application/admin/model/school/activity/Cate.php new file mode 100644 index 0000000..6ed9b58 --- /dev/null +++ b/application/admin/model/school/activity/Cate.php @@ -0,0 +1,73 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getStatusList() + { + return ['1' => __('Status 1'), '2' => __('Status 2')]; + } + + public function getHotList() + { + return ['0' => __('Hot 0'), '1' => __('Hot 1')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getHotTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : ''); + $list = $this->getHotList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + +} diff --git a/application/admin/model/school/activity/Order.php b/application/admin/model/school/activity/Order.php new file mode 100644 index 0000000..2a28893 --- /dev/null +++ b/application/admin/model/school/activity/Order.php @@ -0,0 +1,12 @@ + __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')]; + return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '6' => __('Status 6'), '9' => __('Status 9')]; } public function getBeforeStatusList() { - return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '3' => __('Before_status 3'), '6' => __('Before_status 6'), '9' => __('Before_status 9')]; + return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '2' => __('Before_status 2'), '3' => __('Before_status 3'), '4' => __('Before_status 4'), '6' => __('Before_status 6'), '9' => __('Before_status 9')]; } public function getServerStatusList() @@ -58,9 +61,9 @@ class Order extends Model return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')]; } - public function getResultStatusList() + public function getAuthStatusList() { - return ['0' => __('Result_status 0'), '3' => __('Result_status 3'), '6' => __('Result_status 6')]; + return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; } @@ -96,14 +99,6 @@ class Order extends Model } - public function getResultStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['result_status']) ? $data['result_status'] : ''); - $list = $this->getResultStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - public function getCanceltimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : ''); @@ -118,6 +113,20 @@ class Order extends Model } + 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 getReservationTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + public function getFinishtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : ''); @@ -131,6 +140,21 @@ class Order extends Model return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } + + public function getAuthStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); + $list = $this->getAuthStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getRefundsendtimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['refundsendtime']) ? $data['refundsendtime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + protected function setCanceltimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); @@ -141,6 +165,16 @@ class Order extends Model return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } + protected function setAuthTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setReservationTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + protected function setFinishtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); @@ -151,10 +185,9 @@ class Order extends Model return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } - - public function manystore() + protected function setRefundsendtimeAttr($value) { - return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0); + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } @@ -164,26 +197,14 @@ class Order extends Model } - public function shop() + public function activity() { - return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function lib() - { - return $this->belongsTo('app\admin\model\school\classes\Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0); + return $this->belongsTo('app\admin\model\school\Activity', 'activity_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function detail() { - return $this->belongsTo('Detail', 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function admin() - { - return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0); + return $this->belongsTo('Detail', 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); } } diff --git a/application/admin/model/school/activity/order/OrderCode.php b/application/admin/model/school/activity/order/OrderCode.php new file mode 100644 index 0000000..1593ee4 --- /dev/null +++ b/application/admin/model/school/activity/order/OrderCode.php @@ -0,0 +1,70 @@ + __('Status 3'), '6' => __('Status 6')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getVerificationtimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['verificationtime']) ? $data['verificationtime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + protected function setVerificationtimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + public function order() + { + return $this->belongsTo('app\admin\model\school\activity\Order', 'activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function user() + { + return $this->belongsTo('app\admin\model\User', 'verification_user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/school/activity/order/OrderDetail.php b/application/admin/model/school/activity/order/OrderDetail.php new file mode 100644 index 0000000..13fbb6b --- /dev/null +++ b/application/admin/model/school/activity/order/OrderDetail.php @@ -0,0 +1,181 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getRecommendList() + { + return ['0' => __('Recommend 0'), '1' => __('Recommend 1')]; + } + + public function getHotList() + { + return ['0' => __('Hot 0'), '1' => __('Hot 1')]; + } + + public function getNewList() + { + return ['0' => __('New 0'), '1' => __('New 1')]; + } + + public function getAddTypeList() + { + return ['1' => __('Add_type 1'), '2' => __('Add_type 2')]; + } + + public function getFeelList() + { + return ['0' => __('Feel 0'), '1' => __('Feel 1')]; + } + + + public function getStartTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getEndTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getSignStartTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['sign_start_time']) ? $data['sign_start_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getSignEndTimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['sign_end_time']) ? $data['sign_end_time'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getRecommendTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : ''); + $list = $this->getRecommendList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getHotTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['hot']) ? $data['hot'] : ''); + $list = $this->getHotList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getNewTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['new']) ? $data['new'] : ''); + $list = $this->getNewList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getAddTypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : ''); + $list = $this->getAddTypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getFeelTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['feel']) ? $data['feel'] : ''); + $list = $this->getFeelList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + protected function setStartTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setEndTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setSignStartTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setSignEndTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + public function user() + { + return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function order() + { + return $this->belongsTo('app\admin\model\school\activity\Order', 'activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function activity() + { + return $this->belongsTo('app\admin\model\school\Activity', 'activity_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/school/activity/order/SettleLog.php b/application/admin/model/school/activity/order/SettleLog.php new file mode 100644 index 0000000..b759737 --- /dev/null +++ b/application/admin/model/school/activity/order/SettleLog.php @@ -0,0 +1,108 @@ + __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '-1' => __('Status -1')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getSettletimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['settletime']) ? $data['settletime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getCanceltimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getUnfreezetimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['unfreezetime']) ? $data['unfreezetime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + protected function setSettletimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setCanceltimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setUnfreezetimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + public function order() + { + return $this->belongsTo('app\admin\model\school\activity\Order', 'activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function log() + { + return $this->belongsTo('app\admin\model\user\withdrawal\Log', 'withdrawal_log_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function user() + { + return $this->belongsTo('app\admin\model\User', 'to_user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function third() + { + return $this->belongsTo('app\admin\model\Third', 'pay_user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/school/classes/ClassesSpec.php b/application/admin/model/school/classes/ClassesSpec.php deleted file mode 100644 index 2b7a62c..0000000 --- a/application/admin/model/school/classes/ClassesSpec.php +++ /dev/null @@ -1,88 +0,0 @@ -getPk(); - $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); - } - }); - } - - - public function getStatusList() - { - return ['1' => __('Status 1'), '2' => __('Status 2')]; - } - - - public function getStartTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getEndTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - protected function setStartTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setEndTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - - public function lib() - { - return $this->belongsTo('Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0); - } -} diff --git a/application/admin/model/school/classes/hour/Order.php b/application/admin/model/school/classes/hour/Order.php deleted file mode 100644 index d7624c5..0000000 --- a/application/admin/model/school/classes/hour/Order.php +++ /dev/null @@ -1,12 +0,0 @@ - __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; - } - - public function getAuthStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); - $list = $this->getAuthStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - - public function getStatusList() - { - return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; - } - - - public function getStartTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getEndTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - - - public function getReservationTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getFinishTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['finish_time']) ? $data['finish_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getCancelTimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['cancel_time']) ? $data['cancel_time'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - protected function setStartTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setEndTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setReservationTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setFinishTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setCancelTimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - - public function classesorder() - { - return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function spec() - { - return $this->belongsTo('app\admin\model\school\classes\lib\Spec', 'classes_lib_spec_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function user() - { - return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function detail() - { - return $this->belongsTo('app\admin\model\school\classes\order\Detail', 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function lib() - { - return $this->belongsTo('app\admin\model\school\classes\Lib', 'classes_lib_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 deleted file mode 100644 index 422394c..0000000 --- a/application/admin/model/school/classes/hourorder/OrderLog.php +++ /dev/null @@ -1,53 +0,0 @@ - __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - - - public function order() - { - return $this->belongsTo('app\admin\model\school\classes\hour\Order', 'classes_hour_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } -} diff --git a/application/admin/model/school/classes/lib/Spec.php b/application/admin/model/school/classes/lib/Spec.php deleted file mode 100644 index 157be30..0000000 --- a/application/admin/model/school/classes/lib/Spec.php +++ /dev/null @@ -1,12 +0,0 @@ - __('Add_type 1'), '2' => __('Add_type 2')]; - } - - public function getTypeList() - { - return ['out' => __('Type out'), 'in' => __('Type in')]; - } - - public function getAddressTypeList() - { - return ['1' => __('Address_type 1'), '2' => __('Address_type 2')]; - } - - - public function getAddTypeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : ''); - $list = $this->getAddTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getTypeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); - $list = $this->getTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getAddressTypeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : ''); - $list = $this->getAddressTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - - - public function order() - { - return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function manystore() - { - return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function shop() - { - return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function user() - { - return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); - } -} diff --git a/application/admin/model/school/classes/order/OrderLog.php b/application/admin/model/school/classes/order/OrderLog.php deleted file mode 100644 index a5237eb..0000000 --- a/application/admin/model/school/classes/order/OrderLog.php +++ /dev/null @@ -1,95 +0,0 @@ - __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')]; - } - - public function getBeforeStatusList() - { - return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '3' => __('Before_status 3'), '6' => __('Before_status 6'), '9' => __('Before_status 9')]; - } - - public function getServerStatusList() - { - return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')]; - } - - public function getResultStatusList() - { - return ['0' => __('Result_status 0'), '3' => __('Result_status 3'), '6' => __('Result_status 6')]; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getBeforeStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['before_status']) ? $data['before_status'] : ''); - $list = $this->getBeforeStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getServerStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['server_status']) ? $data['server_status'] : ''); - $list = $this->getServerStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getResultStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['result_status']) ? $data['result_status'] : ''); - $list = $this->getResultStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - - - public function order() - { - return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } -} diff --git a/application/admin/model/school/classes/order/ServiceOrder.php b/application/admin/model/school/classes/order/ServiceOrder.php deleted file mode 100644 index 4fe0a4a..0000000 --- a/application/admin/model/school/classes/order/ServiceOrder.php +++ /dev/null @@ -1,206 +0,0 @@ - __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')]; - } - - public function getServiceStautsList() - { - return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'),'10' => __('Service_stauts 10'), '-3' => __('Service_stauts -3')]; - } - - public function getSalesTypeList() - { - return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')]; - } - - public function getPlatformList() - { - return ['miniapp' => __('Platform miniapp')]; - } - - public function getPayTypeList() - { - return ['yue' => __('Pay_type yue'), 'wechat' => __('Pay_type wechat')]; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getServiceStautsTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : ''); - $list = $this->getServiceStautsList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getSalesTypeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : ''); - $list = $this->getSalesTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getPlatformTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['platform']) ? $data['platform'] : ''); - $list = $this->getPlatformList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getPayTypeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : ''); - $list = $this->getPayTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getRefundtimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getRejecttimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['rejecttime']) ? $data['rejecttime'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getHandletimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['handletime']) ? $data['handletime'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getConfirmtimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['confirmtime']) ? $data['confirmtime'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getCheckouttimeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['checkouttime']) ? $data['checkouttime'] : ''); - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - protected function setRefundtimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setRejecttimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setHandletimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setConfirmtimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - protected function setCheckouttimeAttr($value) - { - return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); - } - - - public function classesorder() - { - return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function user() - { - return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function detail() - { - return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function lib() - { - return $this->belongsTo(ClassesLib::class, 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function manystore() - { - return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function shop() - { - return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); - } -} diff --git a/application/admin/model/school/classes/order/ServiceOrderLog.php b/application/admin/model/school/classes/order/ServiceOrderLog.php deleted file mode 100644 index 44e0c00..0000000 --- a/application/admin/model/school/classes/order/ServiceOrderLog.php +++ /dev/null @@ -1,106 +0,0 @@ - __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')]; - } - - public function getServiceStautsList() - { - return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'),'10' => __('Service_stauts 10'), '-3' => __('Service_stauts -3')]; - } - - public function getSalesTypeList() - { - return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')]; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getServiceStautsTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : ''); - $list = $this->getServiceStautsList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getSalesTypeTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : ''); - $list = $this->getSalesTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - - - public function serviceorder() - { - return $this->belongsTo(ServiceOrder::class, 'classes_service_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function classesorder() - { - return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function user() - { - return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function detail() - { - return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); - } - - - public function admin() - { - return $this->belongsTo(Admin::class, 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0); - } -} diff --git a/application/admin/model/user/withdrawal/Log.php b/application/admin/model/user/withdrawal/Log.php new file mode 100644 index 0000000..c917c49 --- /dev/null +++ b/application/admin/model/user/withdrawal/Log.php @@ -0,0 +1,12 @@ +belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/model/user/withdrawal/UserwithdrawalLog.php b/application/admin/model/user/withdrawal/UserwithdrawalLog.php new file mode 100644 index 0000000..f29afa9 --- /dev/null +++ b/application/admin/model/user/withdrawal/UserwithdrawalLog.php @@ -0,0 +1,105 @@ + __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')]; + } + + public function getWithdrawalStatusList() + { + return ['1' => __('Withdrawal_status 1'), '2' => __('Withdrawal_status 2'), '3' => __('Withdrawal_status 3')]; + } + + public function getTypeList() + { + return ['bank' => __('Type bank'), 'wechat' => __('Type wechat'), 'alipay' => __('Type alipay')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getWithdrawalStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['withdrawal_status']) ? $data['withdrawal_status'] : ''); + $list = $this->getWithdrawalStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getTypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); + $list = $this->getTypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getPaytimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + + public function getExaminetimeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['examinetime']) ? $data['examinetime'] : ''); + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; + } + + protected function setPaytimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + protected function setExaminetimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + public function user() + { + return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/validate/school/classes/ClassesSpec.php b/application/admin/validate/school/activity/Activity.php similarity index 78% rename from application/admin/validate/school/classes/ClassesSpec.php rename to application/admin/validate/school/activity/Activity.php index e65144a..d6672a6 100644 --- a/application/admin/validate/school/classes/ClassesSpec.php +++ b/application/admin/validate/school/activity/Activity.php @@ -1,10 +1,10 @@ [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/school/classes/order/OrderDetail.php b/application/admin/validate/school/activity/order/OrderDetail.php similarity index 86% rename from application/admin/validate/school/classes/order/OrderDetail.php rename to application/admin/validate/school/activity/order/OrderDetail.php index a80e488..e39e68c 100644 --- a/application/admin/validate/school/classes/order/OrderDetail.php +++ b/application/admin/validate/school/activity/order/OrderDetail.php @@ -1,6 +1,6 @@ [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/school/classes/ClassesLib.php b/application/admin/validate/school/classes/ClassesLib.php deleted file mode 100644 index 30f763f..0000000 --- a/application/admin/validate/school/classes/ClassesLib.php +++ /dev/null @@ -1,43 +0,0 @@ - 'require|length:1,50|alphaNum', - 'title' => 'require|length:1,50', - // 'alphaNum' 是自定义的规则,用于过滤中文、数字和拼音字符 - ]; - /** - * 提示消息 - */ - protected $message = [ - 'title.require' => '课程名不能为空', - 'title.length' => '课程名长度必须在1到50之间', -// 'title.alphaNum' =>'课程名只允许中文、数字和拼音字符' - ]; - /** - * 验证场景 - */ - protected $scene = [ - 'add' => ["title"], - 'edit' => ["title"], - ]; - - // 自定义验证规则 - protected function alphaNum($value, $rule, $data = []) - { - $pattern = '/^[\x{4e00}-\x{9fa5}\d]+$/u'; // 正则表达式,匹配中文和数字 - if (preg_match($pattern, $value)) { - return true; - } else { - return false; - } - } -} diff --git a/application/admin/validate/school/classes/order/ServiceOrder.php b/application/admin/validate/school/classes/order/ServiceOrder.php deleted file mode 100644 index 7f23f79..0000000 --- a/application/admin/validate/school/classes/order/ServiceOrder.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/school/classes/order/ServiceOrderLog.php b/application/admin/validate/school/classes/order/ServiceOrderLog.php deleted file mode 100644 index 9ed94a9..0000000 --- a/application/admin/validate/school/classes/order/ServiceOrderLog.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/school/classes/hourorder/Order.php b/application/admin/validate/user/withdrawal/Userwithdrawal.php similarity index 77% rename from application/admin/validate/school/classes/hourorder/Order.php rename to application/admin/validate/user/withdrawal/Userwithdrawal.php index 9cd9f1a..10438dc 100644 --- a/application/admin/validate/school/classes/hourorder/Order.php +++ b/application/admin/validate/user/withdrawal/Userwithdrawal.php @@ -1,10 +1,10 @@ -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - - -
-
-
- -
- -
-
- -
-
-
- -
-
- -
- - -
- -
- +
- +
- +
@@ -88,42 +26,18 @@
    -
    - -
    - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - - -
    -
    +
    + +
    + +
    +
    @@ -167,88 +81,207 @@
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - + +
    + {foreach name="statusList" item="vo"} + + {/foreach} +
    +
    - +
    - + + +
    - +
    - +
    - +
    - + + + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    + {foreach name="authStatusList" item="vo"} + + {/foreach} +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    diff --git a/application/admin/view/school/classes/order/order_detail/edit.html b/application/admin/view/school/activity/activity/edit.html similarity index 53% rename from application/admin/view/school/classes/order/order_detail/edit.html rename to application/admin/view/school/activity/activity/edit.html index 967567d..6fa69cb 100644 --- a/application/admin/view/school/classes/order/order_detail/edit.html +++ b/application/admin/view/school/activity/activity/edit.html @@ -1,90 +1,22 @@
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    - -
    -
    - -
    - - -
    - -
    -
      +
      - +
      @@ -94,42 +26,18 @@
        -
        - -
        - - - -
        -
        -
        - -
        - -
        -
        -
        - -
        - - - -
        -
        +
        + +
        + +
        +
        @@ -173,33 +81,111 @@
        - +
        - +
        - +
        - + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        +
        - +
        - +
        - + +
        + {foreach name="statusList" item="vo"} + + {/foreach} +
        +
        - +
        - + + + +
        +
        +
        + +
        + +
        +
        +
        + +
        + + + +
        +
        +
        + +
        + + + +
        +
        +
        + +
        + + +
        @@ -209,45 +195,87 @@
        - +
        - +
        - +
        - + + +
        - +
        - +
        - +
        - + + +
        - +
        - +
        - +
        - +
        - +
        - + +
        +
        +
        + +
        + +
        + {foreach name="authStatusList" item="vo"} + + {/foreach} +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        +
        - +
        - + + + +
        +
        +
        + +
        +
        - +
        - + + + +
        +
        +
        + +
        +
        - +
        - +
        - +
        - -
        -
        -
        - -
        - -
        -
        -
        - -
        -
        - -
        - - -
        - -
        -
          -
          -
          -
          - -
          -
          - -
          - - -
          - -
          -
            -
            -
            -
            - -
            - -
            -
            -
            - -
            - +
            @@ -142,70 +96,6 @@
            -
            - -
            - -
            -
            -
            - -
            - -
            -
            -
            - -
            - -
            -
            -
            - -
            -
            - -
            - - -
            - -
            -
              -
              -
              -
              - -
              - -
              - {foreach name="resultStatusList" item="vo"} - - {/foreach} -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              -
              - -
              - - -
              - -
              -
                -
                -
                @@ -218,6 +108,18 @@
                +
                + +
                + +
                +
                +
                + +
                + +
                +
                @@ -248,6 +150,92 @@
                +
                + +
                + +
                +
                + {:__('Key')} + {:__('Value')} +
                +
                {:__('Append')}
                + +
                + + +
                +
                +
                + +
                + +
                +
                +
                + +
                + +
                +
                +
                + +
                + +
                + {foreach name="authStatusList" item="vo"} + + {/foreach} +
                + +
                +
                +
                + +
                + +
                +
                +
                + +
                + +
                +
                +
                + +
                + +
                +
                +
                + +
                + +
                +
                + {:__('Key')} + {:__('Value')} +
                +
                {:__('Append')}
                + +
                + + +
                +
                +
                + +
                + +
                +
                +
                + +
                + +
                +