From 8efdd69259df392ff59f22e471754170bd87fbe2 Mon Sep 17 00:00:00 2001 From: 15090180611 <215509543@qq.com> Date: Mon, 30 Dec 2024 18:09:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=AE=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/school/classes/ClassesLib.php | 26 +- .../controller/school/classes/ClassesSpec.php | 21 -- .../school/classes/activity/Activity.php | 26 +- .../school/classes/activity/ActivityAuth.php | 27 +- .../school/classes/activity/order/Order.php | 135 ++++++- .../admin/controller/school/help/Article.php | 42 +++ .../admin/controller/school/help/Cate.php | 165 +++++++++ .../school/classes/activity/order/order.php | 7 +- .../classes/activity/order/order_log.php | 1 + .../admin/lang/zh-cn/school/help/article.php | 20 + .../admin/lang/zh-cn/school/help/cate.php | 15 + .../school/classes/activity/Activity.php | 2 + .../school/classes/activity/ActivityAuth.php | 1 + .../school/classes/activity/order/Order.php | 7 +- .../classes/activity/order/OrderLog.php | 2 +- .../admin/model/school/help/Article.php | 84 +++++ application/admin/model/school/help/Cate.php | 60 +++ .../admin/validate/school/help/Article.php | 27 ++ .../admin/validate/school/help/Cate.php | 27 ++ .../admin/view/manystore/index/add.html | 1 + .../school/classes/activity/activity/add.html | 14 +- .../classes/activity/activity/edit.html | 14 +- .../classes/activity/activity_auth/add.html | 2 + .../classes/activity/activity_auth/edit.html | 2 + .../classes/activity/order/order/edit.html | 150 ++++---- .../classes/activity/order/order/examine.html | 32 ++ .../classes/activity/order/order/index.html | 26 +- .../activity/order/order_detail/index.html | 28 +- .../activity/order/order_item/index.html | 30 +- .../activity/order/order_log/index.html | 30 +- .../school/classes/classes_lib/addnew.html | 26 +- .../view/school/classes/classes_lib/copy.html | 26 +- .../view/school/classes/classes_lib/edit.html | 26 +- .../view/school/classes/teacher/add.html | 2 + .../view/school/classes/teacher/edit.html | 2 + .../admin/view/school/help/article/add.html | 69 ++++ .../admin/view/school/help/article/edit.html | 69 ++++ .../admin/view/school/help/article/index.html | 46 +++ .../view/school/help/article/recyclebin.html | 25 ++ .../admin/view/school/help/cate/add.html | 39 ++ .../admin/view/school/help/cate/edit.html | 39 ++ .../admin/view/school/help/cate/index.html | 95 +++++ .../view/school/help/cate/recyclebin.html | 25 ++ .../admin/view/style/home_images/add.html | 3 +- .../admin/view/style/home_images/edit.html | 1 + application/api/controller/Index.php | 6 +- application/api/controller/school/Help.php | 160 ++++++++ application/api/controller/school/Pay.php | 2 +- .../api/controller/school/activity/Order.php | 4 +- .../api/controller/school/activity/Pay.php | 10 +- .../controller/school/worker/HourOrder.php | 9 +- .../school/worker/activity/Order.php | 56 ++- application/common/controller/Backend.php | 2 + .../common/controller/ManystoreBase.php | 1 + application/common/hooks.php | 21 +- .../listener/activityorder/OrderHook.php | 53 ++- application/common/model/BaseModel.php | 5 +- .../model/school/classes/ClassesLib.php | 4 +- .../school/classes/activity/Activity.php | 27 +- .../school/classes/activity/ActivityAuth.php | 16 + .../school/classes/activity/ActivityItem.php | 4 +- .../school/classes/activity/order/Order.php | 232 +++++++++++- .../classes/activity/order/OrderLog.php | 2 +- .../model/school/classes/hourorder/Order.php | 18 +- .../model/school/classes/order/Order.php | 3 + .../school/classes/order/ServiceOrder.php | 4 + .../common/model/school/help/Article.php | 219 +++++++++++ application/common/model/school/help/Cate.php | 133 +++++++ .../controller/school/classes/ClassesLib.php | 6 +- .../controller/school/classes/ClassesSpec.php | 22 -- .../school/classes/activity/Activity.php | 15 +- .../school/classes/activity/ActivityAuth.php | 23 +- .../school/classes/activity/order/Order.php | 131 ++++++- .../controller/school/classes/order/Order.php | 2 +- .../manystore/controller/user/User.php | 4 +- .../school/classes/activity/activity.php | 2 +- .../school/classes/activity/activity_auth.php | 2 +- .../school/classes/activity/order/order.php | 7 +- .../classes/activity/order/order_log.php | 1 + .../school/classes/activity/order/Order.php | 7 +- .../classes/activity/order/OrderLog.php | 2 +- .../school/classes/activity/activity/add.html | 14 +- .../classes/activity/activity/edit.html | 16 +- .../classes/activity/activity_auth/add.html | 4 +- .../classes/activity/activity_auth/edit.html | 4 +- .../classes/activity/order/order/edit.html | 198 +++++----- .../classes/activity/order/order/examine.html | 32 ++ .../classes/activity/order/order/index.html | 22 +- .../activity/order/order_detail/index.html | 26 +- .../activity/order/order_item/index.html | 26 +- .../activity/order/order_log/index.html | 26 +- .../school/classes/classes_lib/addnew.html | 26 +- .../view/school/classes/classes_lib/copy.html | 26 +- .../view/school/classes/classes_lib/edit.html | 26 +- .../view/school/classes/teacher/add.html | 2 + .../view/school/classes/teacher/edit.html | 2 + public/assets/js/backend/example/tablelink.js | 81 ++++ public/assets/js/backend/manystore/index.js | 46 ++- .../school/classes/activity/activity.js | 26 +- .../school/classes/activity/activity_auth.js | 6 +- .../school/classes/activity/order/order.js | 278 ++++++++++++-- .../classes/activity/order/order_detail.js | 56 +-- .../classes/activity/order/order_item.js | 35 +- .../classes/activity/order/order_log.js | 8 +- .../js/backend/school/classes/order/order.js | 3 +- .../assets/js/backend/school/help/article.js | 121 ++++++ public/assets/js/backend/school/help/cate.js | 345 ++++++++++++++++++ public/assets/js/backend/user/user.js | 19 + .../school/classes/activity/activity.js | 36 +- .../school/classes/activity/activity_auth.js | 8 +- .../school/classes/activity/order/order.js | 249 +++++++++++-- .../classes/activity/order/order_detail.js | 58 +-- .../classes/activity/order/order_item.js | 35 +- .../classes/activity/order/order_log.js | 8 +- public/assets/js/manystore/user/user.js | 18 + 115 files changed, 3918 insertions(+), 700 deletions(-) create mode 100644 application/admin/controller/school/help/Article.php create mode 100644 application/admin/controller/school/help/Cate.php create mode 100644 application/admin/lang/zh-cn/school/help/article.php create mode 100644 application/admin/lang/zh-cn/school/help/cate.php create mode 100644 application/admin/model/school/help/Article.php create mode 100644 application/admin/model/school/help/Cate.php create mode 100644 application/admin/validate/school/help/Article.php create mode 100644 application/admin/validate/school/help/Cate.php create mode 100644 application/admin/view/school/classes/activity/order/order/examine.html create mode 100644 application/admin/view/school/help/article/add.html create mode 100644 application/admin/view/school/help/article/edit.html create mode 100644 application/admin/view/school/help/article/index.html create mode 100644 application/admin/view/school/help/article/recyclebin.html create mode 100644 application/admin/view/school/help/cate/add.html create mode 100644 application/admin/view/school/help/cate/edit.html create mode 100644 application/admin/view/school/help/cate/index.html create mode 100644 application/admin/view/school/help/cate/recyclebin.html create mode 100644 application/api/controller/school/Help.php create mode 100644 application/common/model/school/help/Article.php create mode 100644 application/common/model/school/help/Cate.php create mode 100644 application/manystore/view/school/classes/activity/order/order/examine.html create mode 100644 public/assets/js/backend/school/help/article.js create mode 100644 public/assets/js/backend/school/help/cate.js diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php index 0eecd7d..88ae2a9 100644 --- a/application/admin/controller/school/classes/ClassesLib.php +++ b/application/admin/controller/school/classes/ClassesLib.php @@ -209,29 +209,7 @@ class ClassesLib extends Backend } - protected function no_auth_fields_check($params,$row){ - foreach ($params as $k=>$v){ - - //说明数值有变动 - //$params[$k] 去掉两端空格 - $params[$k] = trim($v); - - if($row[$k]!=$params[$k]){ - //当修改参数不在允许修改的字段中 - if(!in_array($k,$this->no_auth_fields)){ -// var_dump($row[$k],$params[$k]); - - $this->have_auth = true;break; - - } - } - - } - - return $this->have_auth; - - } protected function updateCheck($id,$params=[],$row=null){ if($params && $row){ @@ -432,7 +410,7 @@ class ClassesLib extends Backend //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$this->model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs); } @@ -551,7 +529,7 @@ class ClassesLib extends Backend $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs); } diff --git a/application/admin/controller/school/classes/ClassesSpec.php b/application/admin/controller/school/classes/ClassesSpec.php index 7371d11..7137552 100644 --- a/application/admin/controller/school/classes/ClassesSpec.php +++ b/application/admin/controller/school/classes/ClassesSpec.php @@ -88,28 +88,7 @@ class ClassesSpec extends Backend return $this->view->fetch(); } - protected function no_auth_fields_check($params,$row){ - foreach ($params as $k=>$v){ - - //说明数值有变动 - //$params[$k] 去掉两端空格 - $params[$k] = trim($v); - - if($row[$k]!=$params[$k]){ - //当修改参数不在允许修改的字段中 - if(!in_array($k,$this->no_auth_fields)){ - - $this->have_auth = true;break; - - } - } - - } - - return $this->have_auth; - - } protected function update_classes($classes_lib_id){ //更新课程规格库存 diff --git a/application/admin/controller/school/classes/activity/Activity.php b/application/admin/controller/school/classes/activity/Activity.php index cd23d1a..548c4fa 100644 --- a/application/admin/controller/school/classes/activity/Activity.php +++ b/application/admin/controller/school/classes/activity/Activity.php @@ -30,6 +30,11 @@ class Activity extends Backend protected $qSwitch = true; protected $qFields = ["user_id","shop_id","manystore_id"]; + + //不用审核允许修改的字段 + protected $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"]; + + public function _initialize() { @@ -70,6 +75,7 @@ class Activity extends Backend { //当前是否为关联查询 $this->relationSearch = true; + $this->searchFields = ["id","title","address","address_detail","address_city","shop.name"]; //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -162,8 +168,8 @@ class Activity extends Backend } // 课程存在售后订单则不允许操作 - $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find(); - if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); + $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find(); + if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); } @@ -174,7 +180,7 @@ class Activity extends Backend if(empty($params["shop_id"]))$params["shop_id"] = $row["shop_id"]; } - try { +// try { $classesLib = new \app\common\model\school\classes\activity\Activity(); $classesLib->no_auth_fields = $this->no_auth_fields; $classesLib->need_auth = $this->need_auth; @@ -185,9 +191,9 @@ class Activity extends Backend $this->need_auth = $classesLib->need_auth; $this->have_auth = $classesLib->have_auth; - }catch (\Exception $e){ - $this->error($e->getMessage()); - } +// }catch (\Exception $e){ +// $this->error($e->getMessage()); +// } @@ -255,14 +261,14 @@ class Activity extends Backend //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$this->model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs); } $this->update_classes($this->model["id"]); Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { + } catch (ValidateException|PDOException|\Exception $e) { Db::rollback(); $this->error($e->getMessage().$e->getFile().$e->getLine()); } @@ -352,14 +358,14 @@ class Activity extends Backend $specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs); } $this->update_classes($row["id"]); Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { + } catch (ValidateException|PDOException|\Exception $e) { Db::rollback(); $this->error($e->getMessage()); } diff --git a/application/admin/controller/school/classes/activity/ActivityAuth.php b/application/admin/controller/school/classes/activity/ActivityAuth.php index 1b25cf1..db4beb6 100644 --- a/application/admin/controller/school/classes/activity/ActivityAuth.php +++ b/application/admin/controller/school/classes/activity/ActivityAuth.php @@ -33,7 +33,10 @@ class ActivityAuth extends Backend protected $error_auth = false; //不用审核允许修改的字段 - protected $no_auth_fields = ['headimage','images','content',"price"]; + protected $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"]; + + + public function _initialize() @@ -78,6 +81,7 @@ class ActivityAuth extends Backend { //当前是否为关联查询 $this->relationSearch = true; + $this->searchFields = ["id","classes_activity_id","title","address","address_detail","address_city","shop.name"]; //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -154,8 +158,8 @@ class ActivityAuth extends Backend } // 课程存在售后订单则不允许操作 - $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find(); - if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); + $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find(); + if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); } @@ -179,7 +183,7 @@ class ActivityAuth extends Backend // - try { +// try { $classesLib = new \app\common\model\school\classes\activity\ActivityAuth(); $classesLib->no_auth_fields = $this->no_auth_fields; $classesLib->need_auth = $this->need_auth; @@ -190,9 +194,9 @@ class ActivityAuth extends Backend $this->need_auth = $classesLib->need_auth; $this->have_auth = $classesLib->have_auth; - }catch (\Exception $e){ - $this->error($e->getMessage()); - } +// }catch (\Exception $e){ +// $this->error($e->getMessage()); +// } @@ -285,14 +289,14 @@ class ActivityAuth extends Backend //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\activity\ActivityItemAuth::where("classes_activity_auth_id",$this->model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItemAuth)->specCheck($params,null,$specs); } $this->update_classes($this->model["classes_activity_id"] ?? 0,$this->model); Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { + } catch (ValidateException|PDOException|\Exception $e) { Db::rollback(); $this->error($e->getMessage().$e->getFile().$e->getLine()); } @@ -384,11 +388,12 @@ class ActivityAuth extends Backend $specss = \app\common\model\school\classes\activity\ActivityItemAuth::where("classes_activity_auth_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItemAuth)->specCheck($params,null,$specs); } $this->update_classes($row["classes_activity_id"] ?? 0 ,$row); if($this->success_auth){ + $activity = (new \app\common\model\school\classes\activity\Activity)->successAuth($row["id"]); $this->update_classes($activity["id"] ?? 0 ,$row); @@ -409,7 +414,7 @@ class ActivityAuth extends Backend Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { + } catch (ValidateException|PDOException|\Exception $e) { Db::rollback(); $this->error($e->getMessage()); } diff --git a/application/admin/controller/school/classes/activity/order/Order.php b/application/admin/controller/school/classes/activity/order/Order.php index 800bccc..35e1930 100644 --- a/application/admin/controller/school/classes/activity/order/Order.php +++ b/application/admin/controller/school/classes/activity/order/Order.php @@ -45,6 +45,10 @@ class Order extends Backend { //当前是否为关联查询 $this->relationSearch = true; + + $this->searchFields = ["id","refund_error","code","refund_no","order_no","pay_no","user_id","orderitem.name","detail.title","user.nickname","user.realname","user.mobile","shop.name"]; + + //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -55,7 +59,7 @@ class Order extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['user','manystore','shop','activity','detail']) + ->with(['user',"orderitem",'manystore','shop','activity','detail']) ->where($where) ->order($sort, $order) ->paginate($limit); @@ -67,6 +71,7 @@ class Order extends Backend $row->getRelation('shop')->visible(['name','logo']); $row->getRelation('activity')->visible(['title','headimage']); $row->getRelation('detail')->visible(['title','headimage']); + $row->getRelation('orderitem')->visible(['name','price','feel']); } $result = array("total" => $list->total(), "rows" => $list->items()); @@ -76,4 +81,132 @@ class Order extends Backend 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\activity\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 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\activity\order\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\activity\order\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(); + } + + + /** + * 退款重试 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function refund($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $model = (new \app\common\model\school\classes\activity\order\Order); + $model->orderRefund($ids,null,'admin',$this->auth->id,true,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/help/Article.php b/application/admin/controller/school/help/Article.php new file mode 100644 index 0000000..89b2f05 --- /dev/null +++ b/application/admin/controller/school/help/Article.php @@ -0,0 +1,42 @@ +model = new \app\admin\model\school\help\Article; + parent::_initialize(); + + $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/admin/controller/school/help/Cate.php b/application/admin/controller/school/help/Cate.php new file mode 100644 index 0000000..d4fc7c6 --- /dev/null +++ b/application/admin/controller/school/help/Cate.php @@ -0,0 +1,165 @@ +model = new \app\admin\model\school\help\Cate; + parent::_initialize(); + + $this->view->assign("statusList", $this->model->getStatusList()); + + Tree::instance()->init(collection($this->model->order('weigh DESC,id ASC')->select())->toArray())->icon = ['    ', '    ', '    ']; + $this->rulelist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'name'); + $ruledata = [0 => __('None')]; + foreach ($this->rulelist as $k => &$v) { + $ruledata[$v['id']] = $v['name']; + } + unset($v); + $this->view->assign('ruledata', $ruledata); + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + + /** + * 查看 + */ + public function index() + { + if ($this->request->isAjax()) { + $list = $this->rulelist; + $total = count($this->rulelist); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + return $this->view->fetch(); + } + + /** + * 添加 + */ + public function add() + { + if ($this->request->isPost()) { + $this->token(); + $params = $this->request->post("row/a", [], 'strip_tags'); + if ($params) { +// if (!$params['ismenu'] && !$params['pid']) { +// $this->error(__('The non-menu rule must have parent')); +// } + $result = $this->model->save($params); + if ($result === false) { + $this->error($this->model->getError()); + } + + $this->success(); + } + $this->error(); + } + return $this->view->fetch(); + } + + /** + * 编辑 + */ + public function edit($ids = null) + { + $row = $this->model->get(['id' => $ids]); + if (!$row) { + $this->error(__('No Results were found')); + } + if ($this->request->isPost()) { + $this->token(); + $params = $this->request->post("row/a", [], 'strip_tags'); + if ($params) { +// if (!$params['ismenu'] && !$params['pid']) { +// $this->error(__('The non-menu rule must have parent')); +// } + if ($params['pid'] == $row['id']) { + $this->error(__('Can not change the parent to self')); + } + if ($params['pid'] != $row['pid']) { + $childrenIds = Tree::instance()->init(collection($this->model->order('weigh DESC,id ASC')->select())->toArray())->getChildrenIds($row['id']); + if (in_array($params['pid'], $childrenIds)) { + $this->error(__('Can not change the parent to child')); + } + } + //这里需要针对name做唯一验证 + $ruleValidate = \app\admin\model\school\help\Cate::where( 'name' , $params['name'] )-> where( 'id' , '<>' , $row['id'] )->find(); + + if( $ruleValidate ){ + $this->error( '分类名称已存在' ); + } + + $result = $row->save($params); + if ($result === false) { + $this->error($row->getError()); + } + + $this->success(); + } + $this->error(); + } + $this->view->assign("row", $row); + return $this->view->fetch(); + } + + /** + * 删除 + */ + public function del($ids = "") + { + if (!$this->request->isPost()) { + $this->error(__("Invalid parameters")); + } + $ids = $ids ? $ids : $this->request->post("ids"); + if ($ids) { + $delIds = []; + foreach (explode(',', $ids) as $k => $v) { + $delIds = array_merge($delIds, Tree::instance()->getChildrenIds($v, true)); + } + $delIds = array_unique($delIds); + $count = $this->model->where('id', 'in', $delIds)->delete(); + if ($count) { + + $this->success(); + } + } + $this->error(); + } + +} diff --git a/application/admin/lang/zh-cn/school/classes/activity/order/order.php b/application/admin/lang/zh-cn/school/classes/activity/order/order.php index 2c327da..0997b1f 100644 --- a/application/admin/lang/zh-cn/school/classes/activity/order/order.php +++ b/application/admin/lang/zh-cn/school/classes/activity/order/order.php @@ -27,6 +27,7 @@ return [ 'Status 3' => '已预约', 'Set status to 3' => '设为已预约', 'Status 4' => '售后中', + 'Status 5' => '退款结算中', 'Set status to 4' => '设为售后中', 'Status 6' => '已退款', 'Set status to 6' => '设为已退款', @@ -77,5 +78,9 @@ return [ 'Activity.title' => '标题', 'Activity.headimage' => '头图', 'Detail.title' => '标题', - 'Detail.headimage' => '头图' + 'Detail.headimage' => '头图', + 'Orderitem.name' => '活动规格', + 'Feel' => '是否免费', + 'Feel 0' => '否', + 'Feel 1' => '是', ]; diff --git a/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php b/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php index 97a87fd..408d472 100644 --- a/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php +++ b/application/admin/lang/zh-cn/school/classes/activity/order/order_log.php @@ -12,6 +12,7 @@ return [ 'Status 3' => '已预约', 'Set status to 3' => '设为已预约', 'Status 4' => '售后中', + 'Status 5' => '退款结算中', 'Set status to 4' => '设为售后中', 'Status 6' => '已退款', 'Set status to 6' => '设为已退款', diff --git a/application/admin/lang/zh-cn/school/help/article.php b/application/admin/lang/zh-cn/school/help/article.php new file mode 100644 index 0000000..ac6957e --- /dev/null +++ b/application/admin/lang/zh-cn/school/help/article.php @@ -0,0 +1,20 @@ + '平台帮助分类ids', + 'Title' => '标题', + 'Content' => '文章详情', + 'Status' => '状态', + 'Status 1' => '上架', + 'Set status to 1'=> '设为上架', + 'Status 2' => '下架', + 'Set status to 2'=> '设为下架', + 'Hot' => '平台热门', + 'Hot 0' => '否', + 'Hot 1' => '是', + 'Start_time' => '更新时间', + 'Weigh' => '权重', + 'Views' => '浏览量', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间' +]; diff --git a/application/admin/lang/zh-cn/school/help/cate.php b/application/admin/lang/zh-cn/school/help/cate.php new file mode 100644 index 0000000..d7c75b1 --- /dev/null +++ b/application/admin/lang/zh-cn/school/help/cate.php @@ -0,0 +1,15 @@ + 'pid', + 'Name' => '帮助分类名', + 'Status' => '状态', + 'Status 1' => '上架', + 'Set status to 1'=> '设为上架', + 'Status 2' => '下架', + 'Set status to 2'=> '设为下架', + 'Weigh' => '权重', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间' +]; diff --git a/application/admin/model/school/classes/activity/Activity.php b/application/admin/model/school/classes/activity/Activity.php index 50ca95e..c06be26 100644 --- a/application/admin/model/school/classes/activity/Activity.php +++ b/application/admin/model/school/classes/activity/Activity.php @@ -43,6 +43,8 @@ class Activity extends Model 'has_sign_expire', ]; + //不用审核允许修改的字段 + public $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"]; public function getHasSignExpireAttr($value, $data) { diff --git a/application/admin/model/school/classes/activity/ActivityAuth.php b/application/admin/model/school/classes/activity/ActivityAuth.php index 6c8debb..01428c5 100644 --- a/application/admin/model/school/classes/activity/ActivityAuth.php +++ b/application/admin/model/school/classes/activity/ActivityAuth.php @@ -24,6 +24,7 @@ class ActivityAuth extends Model protected $createTime = 'createtime'; protected $updateTime = 'updatetime'; protected $deleteTime = 'deletetime'; + public $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"]; // 追加属性 protected $append = [ diff --git a/application/admin/model/school/classes/activity/order/Order.php b/application/admin/model/school/classes/activity/order/Order.php index 784b96f..d4ec665 100644 --- a/application/admin/model/school/classes/activity/order/Order.php +++ b/application/admin/model/school/classes/activity/order/Order.php @@ -50,7 +50,7 @@ class Order extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '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() @@ -209,4 +209,9 @@ class Order extends Model { return $this->belongsTo(OrderDetail::class, 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); } + public function orderitem() + { + return $this->belongsTo(OrderItem::class, 'activity_order_item_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + } diff --git a/application/admin/model/school/classes/activity/order/OrderLog.php b/application/admin/model/school/classes/activity/order/OrderLog.php index 74e71e0..e7a9907 100644 --- a/application/admin/model/school/classes/activity/order/OrderLog.php +++ b/application/admin/model/school/classes/activity/order/OrderLog.php @@ -32,7 +32,7 @@ class OrderLog extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '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')]; } diff --git a/application/admin/model/school/help/Article.php b/application/admin/model/school/help/Article.php new file mode 100644 index 0000000..bfd5dd9 --- /dev/null +++ b/application/admin/model/school/help/Article.php @@ -0,0 +1,84 @@ +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] : ''; + } + + + 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; + } + + protected function setStartTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + +} diff --git a/application/admin/model/school/help/Cate.php b/application/admin/model/school/help/Cate.php new file mode 100644 index 0000000..096bac3 --- /dev/null +++ b/application/admin/model/school/help/Cate.php @@ -0,0 +1,60 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getStatusList() + { + return ['1' => __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + + +} diff --git a/application/admin/validate/school/help/Article.php b/application/admin/validate/school/help/Article.php new file mode 100644 index 0000000..d51fb23 --- /dev/null +++ b/application/admin/validate/school/help/Article.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/validate/school/help/Cate.php b/application/admin/validate/school/help/Cate.php new file mode 100644 index 0000000..c516dd3 --- /dev/null +++ b/application/admin/validate/school/help/Cate.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/manystore/index/add.html b/application/admin/view/manystore/index/add.html index 5253ba9..d55e71d 100644 --- a/application/admin/view/manystore/index/add.html +++ b/application/admin/view/manystore/index/add.html @@ -136,6 +136,7 @@ +
diff --git a/application/admin/view/school/classes/activity/activity/add.html b/application/admin/view/school/classes/activity/activity/add.html index be4f46a..137a318 100644 --- a/application/admin/view/school/classes/activity/activity/add.html +++ b/application/admin/view/school/classes/activity/activity/add.html @@ -33,6 +33,7 @@
+
( 推荐图片尺寸:690*482 )
@@ -47,6 +48,7 @@
+
( 推荐图片尺寸:750*450 )
@@ -198,12 +200,12 @@ -
- -
- -
-
+ + + + + +
diff --git a/application/admin/view/school/classes/activity/activity/edit.html b/application/admin/view/school/classes/activity/activity/edit.html index 6e031e0..03893de 100644 --- a/application/admin/view/school/classes/activity/activity/edit.html +++ b/application/admin/view/school/classes/activity/activity/edit.html @@ -35,6 +35,7 @@
+
( 推荐图片尺寸:690*482 )
@@ -49,6 +50,7 @@
+
( 推荐图片尺寸:750*450 )
@@ -193,12 +195,12 @@ -
- -
- -
-
+ + + + + +
diff --git a/application/admin/view/school/classes/activity/activity_auth/add.html b/application/admin/view/school/classes/activity/activity_auth/add.html index c7dcc61..10865f6 100644 --- a/application/admin/view/school/classes/activity/activity_auth/add.html +++ b/application/admin/view/school/classes/activity/activity_auth/add.html @@ -33,6 +33,7 @@
+
( 推荐图片尺寸:690*482 )
@@ -47,6 +48,7 @@
+
( 推荐图片尺寸:750*450 )
diff --git a/application/admin/view/school/classes/activity/activity_auth/edit.html b/application/admin/view/school/classes/activity/activity_auth/edit.html index f4d17a5..e4129b5 100644 --- a/application/admin/view/school/classes/activity/activity_auth/edit.html +++ b/application/admin/view/school/classes/activity/activity_auth/edit.html @@ -57,6 +57,7 @@ +
( 推荐图片尺寸:690*482 )
@@ -71,6 +72,7 @@
+
( 推荐图片尺寸:750*450 )
diff --git a/application/admin/view/school/classes/activity/order/order/edit.html b/application/admin/view/school/classes/activity/order/order/edit.html index b34561e..d75950a 100644 --- a/application/admin/view/school/classes/activity/order/order/edit.html +++ b/application/admin/view/school/classes/activity/order/order/edit.html @@ -1,46 +1,57 @@
+ {if condition="$row.refund_error"} +
+ +
+ + {$row.refund_error} +
+
+ {/if} + +
- +
- +
- -
-
-
- -
- -
-
-
- -
- +
+ + + + + + + + + + + +
- +
- +
@@ -54,7 +65,7 @@
- +
@@ -64,41 +75,41 @@
    -
    - -
    - -
    -
    + + + + + +
    - +
    - +
    - +
    - +
    - {foreach name="payTypeList" item="vo"} {/foreach} @@ -112,7 +123,7 @@
    {foreach name="statusList" item="vo"} - + {/foreach}
    @@ -124,7 +135,7 @@
    {foreach name="beforeStatusList" item="vo"} - + {/foreach}
    @@ -136,7 +147,7 @@
    {foreach name="serverStatusList" item="vo"} - + {/foreach}
    @@ -145,95 +156,95 @@
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    -
    - -
    - -
    -
    - {:__('Key')} - {:__('Value')} -
    -
    {:__('Append')}
    - -
    + + + + + + + + + + + + -
    -
    + +
    - +
    - +
    - +
    - +
    @@ -242,7 +253,7 @@
    {foreach name="authStatusList" item="vo"} - + {/foreach}
    @@ -251,19 +262,22 @@
    - +
    - -
    -
    - + + + + + + + + + diff --git a/application/admin/view/school/classes/activity/order/order/examine.html b/application/admin/view/school/classes/activity/order/order/examine.html new file mode 100644 index 0000000..8c5c6fc --- /dev/null +++ b/application/admin/view/school/classes/activity/order/order/examine.html @@ -0,0 +1,32 @@ +
    + +
    +

    预约报名资格审核,如果您审核不通过,请您填写审核失败原因告知对方!

    +
    + +
    + +
    + {foreach name="authStatusList" item="vo"} + + {/foreach} +
    + +
    +
    +
    + +
    + +
    +
    +
    + + + +
    \ No newline at end of file diff --git a/application/admin/view/school/classes/activity/order/order/index.html b/application/admin/view/school/classes/activity/order/order/index.html index 91db8b9..24dc1fb 100644 --- a/application/admin/view/school/classes/activity/order/order/index.html +++ b/application/admin/view/school/classes/activity/order/order/index.html @@ -17,25 +17,25 @@
    - {:__('Add')} + {:__('Edit')} - {:__('Delete')} - + + - + + + + + + + + - {:__('Recycle bin')} +
    diff --git a/application/admin/view/school/classes/activity/order/order_detail/index.html b/application/admin/view/school/classes/activity/order/order_detail/index.html index b754564..c8c02b2 100644 --- a/application/admin/view/school/classes/activity/order/order_detail/index.html +++ b/application/admin/view/school/classes/activity/order/order_detail/index.html @@ -17,25 +17,25 @@
    - {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + + - {:__('Recycle bin')} +
    diff --git a/application/admin/view/school/classes/activity/order/order_item/index.html b/application/admin/view/school/classes/activity/order/order_item/index.html index 53a6f57..7046765 100644 --- a/application/admin/view/school/classes/activity/order/order_item/index.html +++ b/application/admin/view/school/classes/activity/order/order_item/index.html @@ -17,25 +17,25 @@
    - {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + + - {:__('Recycle bin')} +
    diff --git a/application/admin/view/school/classes/activity/order/order_log/index.html b/application/admin/view/school/classes/activity/order/order_log/index.html index a1fc53d..195c51f 100644 --- a/application/admin/view/school/classes/activity/order/order_log/index.html +++ b/application/admin/view/school/classes/activity/order/order_log/index.html @@ -17,25 +17,25 @@
    - {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + + - {:__('Recycle bin')} +
    diff --git a/application/admin/view/school/classes/classes_lib/addnew.html b/application/admin/view/school/classes/classes_lib/addnew.html index d29ce3b..e554421 100644 --- a/application/admin/view/school/classes/classes_lib/addnew.html +++ b/application/admin/view/school/classes/classes_lib/addnew.html @@ -131,6 +131,7 @@
      +
      ( 推荐图片尺寸:280*200 )
      @@ -145,6 +146,7 @@
        +
        ( 推荐图片尺寸:750*450 )
        @@ -276,18 +278,18 @@
        -
        - -
        - -
        -
        -
        - -
        - -
        -
        + + + + + + + + + + + +
        diff --git a/application/admin/view/school/classes/classes_lib/copy.html b/application/admin/view/school/classes/classes_lib/copy.html index d0e74cc..e77a7d4 100644 --- a/application/admin/view/school/classes/classes_lib/copy.html +++ b/application/admin/view/school/classes/classes_lib/copy.html @@ -169,6 +169,7 @@
          +
          ( 推荐图片尺寸:280*200 )
          @@ -183,6 +184,7 @@
            +
            ( 推荐图片尺寸:750*450 )
            @@ -320,18 +322,18 @@ -
            - -
            - -
            -
            -
            - -
            - -
            -
            + + + + + + + + + + + +
            diff --git a/application/admin/view/school/classes/classes_lib/edit.html b/application/admin/view/school/classes/classes_lib/edit.html index 5b85c6c..e2d2b1f 100644 --- a/application/admin/view/school/classes/classes_lib/edit.html +++ b/application/admin/view/school/classes/classes_lib/edit.html @@ -169,6 +169,7 @@
            +
            ( 推荐图片尺寸:280*200 )
            @@ -183,6 +184,7 @@
            +
            ( 推荐图片尺寸:750*450 )
            @@ -320,18 +322,18 @@ -
            - -
            - -
            -
            -
            - -
            - -
            -
            + + + + + + + + + + + +
            diff --git a/application/admin/view/school/classes/teacher/add.html b/application/admin/view/school/classes/teacher/add.html index c8dfa2c..1e272e0 100644 --- a/application/admin/view/school/classes/teacher/add.html +++ b/application/admin/view/school/classes/teacher/add.html @@ -43,6 +43,7 @@
            +
            ( 推荐图片尺寸:200*250 )
            @@ -89,6 +90,7 @@
            +
            ( 推荐图片尺寸:200*250 )
            diff --git a/application/admin/view/school/classes/teacher/edit.html b/application/admin/view/school/classes/teacher/edit.html index 996836e..17925f9 100644 --- a/application/admin/view/school/classes/teacher/edit.html +++ b/application/admin/view/school/classes/teacher/edit.html @@ -43,6 +43,7 @@
            +
            ( 推荐图片尺寸:200*250 )
            @@ -90,6 +91,7 @@
            +
            ( 推荐图片尺寸:200*250 )
            diff --git a/application/admin/view/school/help/article/add.html b/application/admin/view/school/help/article/add.html new file mode 100644 index 0000000..c38c373 --- /dev/null +++ b/application/admin/view/school/help/article/add.html @@ -0,0 +1,69 @@ +
            + +
            + +
            + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            + {foreach name="statusList" item="vo"} + + {/foreach} +
            + +
            +
            +
            + +
            + + + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            +
            + +
            diff --git a/application/admin/view/school/help/article/edit.html b/application/admin/view/school/help/article/edit.html new file mode 100644 index 0000000..059684c --- /dev/null +++ b/application/admin/view/school/help/article/edit.html @@ -0,0 +1,69 @@ +
            + +
            + +
            + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            + {foreach name="statusList" item="vo"} + + {/foreach} +
            + +
            +
            +
            + +
            + + + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            +
            + +
            diff --git a/application/admin/view/school/help/article/index.html b/application/admin/view/school/help/article/index.html new file mode 100644 index 0000000..6cab1de --- /dev/null +++ b/application/admin/view/school/help/article/index.html @@ -0,0 +1,46 @@ +
            + +
            + {:build_heading(null,FALSE)} + +
            + + +
            +
            +
            +
            +
            + + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + {:__('Recycle bin')} +
            + +
            +
            +
            + +
            +
            +
            diff --git a/application/admin/view/school/help/article/recyclebin.html b/application/admin/view/school/help/article/recyclebin.html new file mode 100644 index 0000000..43f56f8 --- /dev/null +++ b/application/admin/view/school/help/article/recyclebin.html @@ -0,0 +1,25 @@ +
            + {:build_heading()} + +
            +
            +
            + +
            + +
            +
            +
            diff --git a/application/admin/view/school/help/cate/add.html b/application/admin/view/school/help/cate/add.html new file mode 100644 index 0000000..adbe0ec --- /dev/null +++ b/application/admin/view/school/help/cate/add.html @@ -0,0 +1,39 @@ +
            + {:token()} +
            + +
            + {:build_select('row[pid]', $ruledata, $q_pid, ['class'=>'form-control', 'required'=>''])} +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            + {foreach name="statusList" item="vo"} + + {/foreach} +
            + +
            +
            +
            + +
            + +
            +
            + +
            diff --git a/application/admin/view/school/help/cate/edit.html b/application/admin/view/school/help/cate/edit.html new file mode 100644 index 0000000..8b5a266 --- /dev/null +++ b/application/admin/view/school/help/cate/edit.html @@ -0,0 +1,39 @@ +
            + {:token()} +
            + +
            + {:build_select('row[pid]', $ruledata, $row['pid'], ['class'=>'form-control', 'required'=>''])} +
            +
            +
            + +
            + +
            +
            +
            + +
            + +
            + {foreach name="statusList" item="vo"} + + {/foreach} +
            + +
            +
            +
            + +
            + +
            +
            + +
            diff --git a/application/admin/view/school/help/cate/index.html b/application/admin/view/school/help/cate/index.html new file mode 100644 index 0000000..09e2a49 --- /dev/null +++ b/application/admin/view/school/help/cate/index.html @@ -0,0 +1,95 @@ + +
            +
            + + +
            + {:build_heading()} + + +
            + +
            +
            + + +
            + +
            + {:build_heading(null,FALSE)} + +
            + + +
            +
            +
            +
            +
            + + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + {:__('Recycle bin')} +
            + +
            +
            +
            + +
            +
            +
            + + +
            +
            + diff --git a/application/admin/view/school/help/cate/recyclebin.html b/application/admin/view/school/help/cate/recyclebin.html new file mode 100644 index 0000000..0cfb186 --- /dev/null +++ b/application/admin/view/school/help/cate/recyclebin.html @@ -0,0 +1,25 @@ +
            + {:build_heading()} + +
            +
            +
            + +
            + +
            +
            +
            diff --git a/application/admin/view/style/home_images/add.html b/application/admin/view/style/home_images/add.html index ebee74e..bd9b1fe 100644 --- a/application/admin/view/style/home_images/add.html +++ b/application/admin/view/style/home_images/add.html @@ -12,6 +12,7 @@
            +
            ( 推荐图片尺寸:690*400 )
            @@ -20,7 +21,7 @@ diff --git a/application/admin/view/style/home_images/edit.html b/application/admin/view/style/home_images/edit.html index d89e972..bf552cd 100644 --- a/application/admin/view/style/home_images/edit.html +++ b/application/admin/view/style/home_images/edit.html @@ -12,6 +12,7 @@
            +
            ( 推荐图片尺寸:690*400 )
            diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php index f7b84c2..b91e065 100644 --- a/application/api/controller/Index.php +++ b/application/api/controller/Index.php @@ -97,9 +97,13 @@ class Index extends Api "site_city"=> Virtual::getNowCity(), "site_timezone"=>config('site.timezone'), ]; + $customer_service = [ + "image"=>cdnurl(config('site.customer_service_image'),true), + "mobile"=>config('site.customer_service_mobile'), + ]; $upload_config = config('upload'); - $this->success('',["upload_config"=>$upload_config,"base_info"=>$base_info,"home_data"=>$home_data]); + $this->success('',["customer_service"=>$customer_service,"upload_config"=>$upload_config,"base_info"=>$base_info,"home_data"=>$home_data]); } /** diff --git a/application/api/controller/school/Help.php b/application/api/controller/school/Help.php new file mode 100644 index 0000000..beb7d9e --- /dev/null +++ b/application/api/controller/school/Help.php @@ -0,0 +1,160 @@ +model = new \app\common\model\school\help\Article; + $this->catemodel = new \app\common\model\school\help\Cate; + parent::_initialize(); + + //判断登录用户是否是员工 + } + + + + + + /** + * @ApiTitle( 帮助文章列表接口) + * @ApiSummary(帮助文章列表接口) + * @ApiMethod(GET) + * @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字") + * @ApiParams(name = "page", type = "string",required=true,description = "页数") + * @ApiParams(name = "limit", type = "string",required=true,description = "条数") + * @ApiParams(name = "help_cate_ids", type = "string",required=false,description = "帮助分类id") + * @ApiParams(name = "hot", type = "string",required=false,description = "平台热门:0=否,1=是") + * @ApiParams(name = "time", type = "string",required=false,description = "复合时间查询:today今天,week本周,month本月,year本年,yesterday昨天,last year上一年,last week上周,last month上個月,lately7最近7天 , lately30最近30天,按开始时间区间查传值格式:Y/m/d H:M:S-Y/m/d H:M:S") + * + * @ApiReturn({ + * + *}) + */ + public function article_list() + { + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + + $params = []; + $my = $this->request->get('my/d', 0); //我的评价 + if($my && $user_id){ + $params['user_id'] = $user_id; + } + $page = $this->request->get('page/d', 0); //页数 + $limit = $this->request->get('limit/d', 0); //条数 + $params["keywords"] = $this->request->get('keywords/s', ''); //搜索关键字 + $params["help_cate_ids"] = $this->request->get('help_cate_ids/s', ''); //搜索关键字 + + $params["hot"] = $this->request->get('hot/s', ''); //时间 + + $params["time"] = $this->request->get('time/s', ''); //时间 + + try{ + //当前申请状态 + $res = $this->model::articleList($page, $limit,$params); +// if($user_id =='670153'){ +// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); +// } + }catch (\Exception $e){ + + $this->error($e->getMessage()); + } + $this->success('查询成功', $res); + } + + + + /** + * @ApiTitle( 帮助分类列表接口) + * @ApiSummary(帮助分类列表接口) + * @ApiMethod(GET) + * @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字") + * @ApiParams(name = "page", type = "string",required=true,description = "页数") + * @ApiParams(name = "limit", type = "string",required=true,description = "条数") + * @ApiParams(name = "pid", type = "string",required=true,description = "父级id") + * @ApiReturn({ + * + *}) + */ + public function cate_list() + { + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + + $params = []; + $my = $this->request->get('my/d', 0); //我的评价 + if($my && $user_id){ + $params['user_id'] = $user_id; + } + $page = $this->request->get('page/d', 0); //页数 + $limit = $this->request->get('limit/d', 0); //条数 + $params["keywords"] = $this->request->get('keywords/s', ''); //搜索关键字 + $params["pid"] = $this->request->get('pid/s', ''); //搜索关键字 + + try{ + //当前申请状态 + $res = $this->catemodel::cateList($page, $limit,$params); +// if($user_id =='670153'){ +// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); +// } + }catch (\Exception $e){ + + $this->error($e->getMessage()); + } + $this->success('查询成功', $res); + } + + + + + + /** + * @ApiTitle( 文章详情) + * @ApiSummary(文章详情) + * @ApiMethod(GET) + * @ApiParams(name = "id", type = "int",required=true,description = "文章id") + * @ApiReturn({ + * + *}) + */ + public function detail(){ + $id = $this->request->get('id/d',''); + + if(empty($id)){ + $this->error(__('缺少必要参数')); + } + + try { + $res = $this->model->detail($id); + } catch (\Exception $e){ +// Log::log($e->getMessage()); + $this->error($e->getMessage(),['errcode'=>$e->getCode()]); + } + $this->success('获取成功', ['detail' => $res]); + } + + + +} + diff --git a/application/api/controller/school/Pay.php b/application/api/controller/school/Pay.php index 9ee4416..25c4a62 100644 --- a/application/api/controller/school/Pay.php +++ b/application/api/controller/school/Pay.php @@ -293,7 +293,7 @@ class Pay extends Base return $pay->success()->send(); // Log::debug('Wechat notify', $data->all()); } catch (\Exception $e) { - Log::write('notifyreturn-error:' . json_encode($e->getMessage())); + Log::write('notifyreturn-error:' . $e->getMessage()); } return $pay->success()->send(); } diff --git a/application/api/controller/school/activity/Order.php b/application/api/controller/school/activity/Order.php index 93baec6..da38029 100644 --- a/application/api/controller/school/activity/Order.php +++ b/application/api/controller/school/activity/Order.php @@ -70,6 +70,7 @@ class Order extends Base * @ApiParams(name = "page", type = "string",required=true,description = "页数") * @ApiParams(name = "limit", type = "string",required=true,description = "条数") * @ApiParams(name = "status", type = "string",required=false,description = "订单状态:-3=已取消,0=待支付,2=已报名待审核,3=已预约,4=售后中,6=已退款,9=已完成") + * @ApiParams(name = "auth_status", type = "string",required=false,description = "审核状态:0=待审核,1=审核通过,2=审核失败") * @ApiParams(name = "classes_activity_id", type = "int",required=false,description = "课程活动id") * @ApiReturn({ * @@ -84,6 +85,7 @@ class Order extends Base $limit = $this->request->get('limit/d', 0); //条数 $keywords = $this->request->get('keywords/s', ''); //搜索关键字 $status = $this->request->get('status/s', ''); //搜索关键字 + $auth_status = $this->request->get('auth_status/s', ''); //搜索关键字 $classes_activity_id = $this->request->get('classes_activity_id/s', ''); //搜索关键字 $has_evaluate = $this->request->get('has_evaluate/d', 0); //搜索关键字 @@ -91,7 +93,7 @@ class Order extends Base try{ //当前申请状态 - $res = $this->model::allList($user_id,$page, $limit,$keywords,$status,$classes_activity_id,$has_evaluate); + $res = $this->model::allList($user_id,$page, $limit,$keywords,$status,$classes_activity_id,$has_evaluate,$auth_status); // if($user_id =='670153'){ // file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); // } diff --git a/application/api/controller/school/activity/Pay.php b/application/api/controller/school/activity/Pay.php index 6123537..d195656 100644 --- a/application/api/controller/school/activity/Pay.php +++ b/application/api/controller/school/activity/Pay.php @@ -289,19 +289,21 @@ class Pay extends Base $out_trade_no = $data['out_trade_no']; // 退款 - $this->refundFinish($out_trade_no, $out_refund_no,$platform); + $this->refundFinish($out_trade_no, $out_refund_no,$platform,$data); return $pay->success()->send(); // Log::debug('Wechat notify', $data->all()); } catch (\Exception $e) { - Log::write('notifyreturn-error:' . json_encode($e->getMessage())); + Log::write('notifyreturn-error:' . $e->getMessage()); + $this->model::orderRefundFail($out_trade_no,$e->getMessage(),'user',0,true); + } return $pay->success()->send(); } - private function refundFinish($out_trade_no, $out_refund_no,$platform) { + private function refundFinish($out_trade_no, $out_refund_no,$platform,$refund_json) { // $order = Order::where('order_sn', $out_trade_no)->find(); // $refundLog = \app\admin\model\shopro\order\RefundLog::where('refund_sn', $out_refund_no)->find(); @@ -316,7 +318,7 @@ class Pay extends Base // Db::transaction(function () use ($order, $item, $refundLog) { // \app\admin\model\shopro\order\Order::refundFinish($order, $item, $refundLog); // }); - $this->model::refundSuccess($out_refund_no,true); + $this->model::refundSuccess($out_refund_no,$refund_json,true); return true; } diff --git a/application/api/controller/school/worker/HourOrder.php b/application/api/controller/school/worker/HourOrder.php index 0e80aac..da6e6c2 100644 --- a/application/api/controller/school/worker/HourOrder.php +++ b/application/api/controller/school/worker/HourOrder.php @@ -267,6 +267,7 @@ class HourOrder extends Base * @ApiParams(name = "status", type = "string",required=false,description = "订单状态:-3=已取消,-1=已报名待审核,0=已预约,3=已完成") * @ApiParams(name = "classes_order_id", type = "string",required=false,description = "课程订单id") * @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id") + * @ApiParams(name = "shop_id", type = "int",required=false,description = "机构shopid") * @ApiParams(name = "start_time", type = "string",required=false,description = "按开始时间区间查(传值格式:Y/m/d H:M:S-Y/m/d H:M:S)") * @ApiParams(name = "createtime", type = "string",required=false,description = "按创建时间区间查(传值格式:Y/m/d H:M:S-Y/m/d H:M:S)") * @ApiParams(name = "time", type = "string",required=false,description = "按开始和结束时间区间查(传值格式:Y/m/d H:M:S-Y/m/d H:M:S)") @@ -287,16 +288,17 @@ class HourOrder extends Base $status = $this->request->get('status/s', ''); //搜索关键字 $classes_order_id = $this->request->get('classes_order_id/d', 0); //搜索关键字 $classes_lib_ids = $this->request->get('classes_lib_id/s', 0); //搜索关键字 + $shop_id = $this->request->get('shop_id/d', 0); //搜索关键字 $start_time = $this->request->get('start_time/s', ''); //搜索关键字 $createtime = $this->request->get('createtime/s', ''); //搜索关键字 $time = $this->request->get('time/s', ''); //搜索关键字 // $type = $this->request->get('type/s', ''); //筛选学员和教练单 - +// var_dump($this->classes_lib_ids);die; try{ //当前申请状态 - $res = $this->model::workList($page, $limit,$keywords,$status,$classes_order_id,0,$this->classes_lib_ids,$classes_lib_ids,$start_time,$createtime,$time); + $res = $this->model::workList($page, $limit,$keywords,$status,$classes_order_id,0,$classes_lib_ids,$this->classes_lib_ids,$start_time,$createtime,$time,$shop_id); // var_dump($this->model->getLastSql());die; // if($user_id =='670153'){ // file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); @@ -325,9 +327,10 @@ class HourOrder extends Base $classes_order_id = $this->request->get('classes_order_id/d', 0); //搜索关键字 $classes_lib_ids = $this->request->get('classes_lib_id/s', 0); //搜索关键字 + $shop_id = $this->request->get('shop_id/d', 0); //搜索关键字 try{ - $res = $this->model::workCount($this->classes_lib_ids,$classes_lib_ids,$classes_order_id); + $res = $this->model::workCount($classes_lib_ids,$this->classes_lib_ids,$classes_order_id,$shop_id); }catch (\Throwable $e){ $this->error($e->getMessage()); } diff --git a/application/api/controller/school/worker/activity/Order.php b/application/api/controller/school/worker/activity/Order.php index d3ead0a..f18d180 100644 --- a/application/api/controller/school/worker/activity/Order.php +++ b/application/api/controller/school/worker/activity/Order.php @@ -68,6 +68,7 @@ class Order extends Base * @ApiParams(name = "page", type = "string",required=true,description = "页数") * @ApiParams(name = "limit", type = "string",required=true,description = "条数") * @ApiParams(name = "status", type = "string",required=false,description = "状态搜索条件:-3=已取消,0=待支付,2=已报名待审核,3=已预约,4=售后中,6=已退款,9=已完成") + * @ApiParams(name = "auth_status", type = "string",required=false,description = "审核状态:0=待审核,1=审核通过,2=审核失败") * @ApiParams(name = "classes_activity_id", type = "int",required=false,description = "课程活动id") * @ApiReturn({ * @@ -82,13 +83,14 @@ class Order extends Base $limit = $this->request->get('limit/d', 0); //条数 $keywords = $this->request->get('keywords/s', ''); //搜索关键字 $status = $this->request->get('status/s', ''); //搜索关键字 + $auth_status = $this->request->get('auth_status/s', ''); //搜索关键字 $classes_activity_id = $this->request->get('classes_activity_id/s', ''); //搜索关键字 // $type = $this->request->get('type/s', ''); //筛选学员和教练单 try{ //当前申请状态 - $res = $this->model::workList($user_id,$page, $limit,$keywords,$status,$classes_activity_id,$this->classes_activity_ids); + $res = $this->model::workList($user_id,$page, $limit,$keywords,$status,$classes_activity_id,$this->classes_activity_ids,0,$auth_status); // var_dump($this->model->getLastSql()); }catch (\Exception $e){ @@ -148,5 +150,57 @@ class Order extends Base $this->success('预约课时取消成功', $res); } + + /** + * @ApiTitle( 员工代操作:预约报名审核接口) + * @ApiSummary(预约报名审核接口) + * @ApiMethod(POST) + * @ApiParams(name = "order_no", type = "string",required=true,description = "活动订单号") + * @ApiParams(name = "auth_status", type = "int",required=true,description = "审核状态:1=审核通过,2=审核失败") + * @ApiParams(name = "reason", type = "string",required=false,description = "审核失败理由") + * @ApiReturn({ + * + *}) + */ + public function examine(){ + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + $order_no = $this->request->post('order_no/s', ''); //订单号 + $auth_status = $this->request->post('auth_status/d', ''); //审核状态 + $reason = $this->request->post('reason/s', ''); //审核失败理由 + try{ + //当前申请状态 + $res = $this->model->examine($order_no,$auth_status,$reason,0,true,'user',$user_id,true); + }catch (\Throwable $e){ + $this->error($e->getMessage()); + } + $this->success('预约课时取消成功', $res); + } + + + /** + * @ApiTitle( 员工代操作:活动核销完成接口) + * @ApiSummary(活动核销完成接口) + * @ApiMethod(POST) + * @ApiParams(name = "order_no", type = "string",required=true,description = "活动订单号") + * @ApiReturn({ + * + *}) + */ + public function verification(){ + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + $order_no = $this->request->post('order_no/s', ''); //订单号 + try{ + //当前申请状态 + $res = $this->model->verification($order_no,0,true,'user',$user_id,true); + }catch (\Throwable $e){ + $this->error($e->getMessage()); + } + $this->success('预约课时核销成功', $res); + } + } diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 5559744..dcf9093 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -164,6 +164,8 @@ class Backend extends Controller protected function no_auth_fields_check($params,$row){ + if($this->no_auth_fields == "*")return $this->have_auth; + foreach ($params as $k=>$v){ //说明数值有变动 diff --git a/application/common/controller/ManystoreBase.php b/application/common/controller/ManystoreBase.php index 74b6531..fc5726f 100644 --- a/application/common/controller/ManystoreBase.php +++ b/application/common/controller/ManystoreBase.php @@ -128,6 +128,7 @@ class ManystoreBase extends Controller protected $no_auth_fields = []; protected function no_auth_fields_check($params,$row){ + if($this->no_auth_fields == "*")return $this->have_auth; foreach ($params as $k=>$v){ diff --git a/application/common/hooks.php b/application/common/hooks.php index f156aa1..d7cf463 100644 --- a/application/common/hooks.php +++ b/application/common/hooks.php @@ -175,10 +175,10 @@ $activityHooks = [ 'activity_view_after' => [ // 活动触发浏览后 'app\\common\\listener\\classes\\ActivityHook' ], - 'activity_collect_success_after' => [ // 课程收藏后 + 'activity_collect_success_after' => [ // 活动收藏后 'app\\common\\listener\\classes\\ActivityHook' ], - 'activity_collect_cancel_after' => [ // 课程取消收藏后 + 'activity_collect_cancel_after' => [ // 活动取消收藏后 'app\\common\\listener\\classes\\ActivityHook' ], @@ -200,6 +200,23 @@ $activityOrderHooks = [ 'classes_activity_order_cancel_after' => [ // 订单取消后 'app\\common\\listener\\activityorder\\OrderHook' ], + 'classes_activity_order_auth_success_after' => [ // 订单审核通过后 + 'app\\common\\listener\\activityorder\\OrderHook' + ], + 'classes_activity_order_auth_fail_after' => [ // 订单审核失败后 + 'app\\common\\listener\\activityorder\\OrderHook' + ], + + 'classes_activity_order_refund_success_after'=> [ // 订单审核失败后退款成功 + 'app\\common\\listener\\activityorder\\OrderHook' + ], + 'classes_activity_order_refund_fail_after'=> [ // 订单审核失败后退款成功 + 'app\\common\\listener\\activityorder\\OrderHook' + ], + 'classes_activity_order_finish_after' => [ // 订单完成后 + 'app\\common\\listener\\activityorder\\OrderHook' + ], + // // 'classes_order_finish_after' => [ // 订单完成后 // 'app\\common\\listener\\classesorder\\OrderHook' diff --git a/application/common/listener/activityorder/OrderHook.php b/application/common/listener/activityorder/OrderHook.php index 97029e6..8619f5d 100644 --- a/application/common/listener/activityorder/OrderHook.php +++ b/application/common/listener/activityorder/OrderHook.php @@ -43,11 +43,7 @@ class OrderHook } - // 订单完成后 - public function classesActivityOrderFinishAfter(&$params) - { - } @@ -74,5 +70,54 @@ class OrderHook + // 订单审核通过后 + public function classesActivityOrderAuthSuccessAfter(&$params) + { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + } + + // 订单审核失败后 + public function classesActivityOrderAuthFailAfter(&$params) + { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + + } + + + // 订单审核失败退款后 + public function classesActivityOrderRefundSuccessAfter(&$params) + { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + } + + // 订单审核失败退款失败后 + public function classesActivityOrderRefundFailAfter(&$params) + { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + } + + + + + // 订单核销完成后 + public function classesActivityOrderFinishAfter(&$params) + { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + + + } + + + } \ No newline at end of file diff --git a/application/common/model/BaseModel.php b/application/common/model/BaseModel.php index bbd1f1b..354ff97 100644 --- a/application/common/model/BaseModel.php +++ b/application/common/model/BaseModel.php @@ -77,7 +77,10 @@ class BaseModel extends Model public function no_auth_fields_check($params,$row){ - $this->getTableFields(); + + $this->have_auth = false; + if($this->no_auth_fields == "*")return $this->have_auth; +// $this->getTableFields(); $params = $this->checkAssemblyParameters($params); foreach ($params as $k=>$v){ diff --git a/application/common/model/school/classes/ClassesLib.php b/application/common/model/school/classes/ClassesLib.php index df623ab..3d927a3 100644 --- a/application/common/model/school/classes/ClassesLib.php +++ b/application/common/model/school/classes/ClassesLib.php @@ -1607,7 +1607,7 @@ $user_unpaid_order = $user_paid_order =null; //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs,true,$oper_type,$oper_id); } @@ -1715,7 +1715,7 @@ $user_unpaid_order = $user_paid_order =null; //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs,true,$oper_type,$oper_id); } diff --git a/application/common/model/school/classes/activity/Activity.php b/application/common/model/school/classes/activity/Activity.php index ddc1ba1..906401d 100644 --- a/application/common/model/school/classes/activity/Activity.php +++ b/application/common/model/school/classes/activity/Activity.php @@ -56,6 +56,9 @@ class Activity extends BaseModel 'has_sign_expire', ]; + public $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"]; + + public function getHasSignExpireAttr($value, $data) { @@ -344,6 +347,16 @@ class Activity extends BaseModel + if($row){ + //统一时间格式成时间戳 + if( is_string($row["start_time"]))$row["start_time"]=strtotime($row["start_time"]); + if( is_string($row["end_time"]))$row["end_time"]=strtotime($row["end_time"]); + if( is_string($row["sign_start_time"]))$row["sign_start_time"]=strtotime($row["sign_start_time"]); + if( is_string($row["sign_end_time"]))$row["sign_end_time"]=strtotime($row["sign_end_time"]); + + + } + @@ -545,6 +558,11 @@ class Activity extends BaseModel self::check($params,$rule,$rule_msg); + //统一时间格式成时间戳 + if( is_string($params["start_time"]))$params["start_time"]=strtotime($params["start_time"]); + if( is_string($params["end_time"]))$params["end_time"]=strtotime($params["end_time"]); + if( is_string($params["sign_start_time"]))$params["sign_start_time"]=strtotime($params["sign_start_time"]); + if( is_string($params["sign_end_time"]))$params["sign_end_time"]=strtotime($params["sign_end_time"]); @@ -660,15 +678,15 @@ class Activity extends BaseModel public function updateCheck($id,$params=[],$row=null){ if($params && $row){ -// var_dump($this->no_auth_fields_check($params,$row)); + if(!$this->no_auth_fields_check($params,$row)){ return true; } } // 课程存在售后订单则不允许操作 - $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find(); - if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); + $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find(); + if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); } @@ -697,7 +715,8 @@ class Activity extends BaseModel //如果未创建则创建活动 $activityData = $activityAuth->toArray(); unset($activityData["id"]); - $activity = new self; + $activity = self::where("title",$activityData["title"])->find(); + if(!$activity)$activity = new self; $activity->allowField(true)->save($activityData); //添加活动规格 foreach ($itemauths as $k=>$itemauth){ diff --git a/application/common/model/school/classes/activity/ActivityAuth.php b/application/common/model/school/classes/activity/ActivityAuth.php index 6e40bde..12ad828 100644 --- a/application/common/model/school/classes/activity/ActivityAuth.php +++ b/application/common/model/school/classes/activity/ActivityAuth.php @@ -49,6 +49,9 @@ class ActivityAuth extends BaseModel 'has_expire', ]; + public $no_auth_fields = ["status","weigh","recommend","hot","new","selfhot","feel","start_time","end_time","sign_start_time","sign_end_time","longitude","latitude","address_city","province","city","district","address","address_detail","address_type","title",'headimage','images','content',"price"]; + + public function getHasExpireList() { return ['1' => __('Has_expire 1'), '2' => __('Has_expire 2')]; @@ -294,8 +297,16 @@ class ActivityAuth extends BaseModel public function activityCheck(&$params,$shop_id=null,$row=null,$oper_type='user',$oper_id=0) { + if($row){ + //统一时间格式成时间戳 + if( is_string($row["start_time"]))$row["start_time"]=strtotime($row["start_time"]); + if( is_string($row["end_time"]))$row["end_time"]=strtotime($row["end_time"]); + if( is_string($row["sign_start_time"]))$row["sign_start_time"]=strtotime($row["sign_start_time"]); + if( is_string($row["sign_end_time"]))$row["sign_end_time"]=strtotime($row["sign_end_time"]); + } + @@ -497,6 +508,11 @@ class ActivityAuth extends BaseModel self::check($params,$rule,$rule_msg); + //统一时间格式成时间戳 + if( is_string($params["start_time"]))$params["start_time"]=strtotime($params["start_time"]); + if( is_string($params["end_time"]))$params["end_time"]=strtotime($params["end_time"]); + if( is_string($params["sign_start_time"]))$params["sign_start_time"]=strtotime($params["sign_start_time"]); + if( is_string($params["sign_end_time"]))$params["sign_end_time"]=strtotime($params["sign_end_time"]); diff --git a/application/common/model/school/classes/activity/ActivityItem.php b/application/common/model/school/classes/activity/ActivityItem.php index f00fc1a..2616a1e 100644 --- a/application/common/model/school/classes/activity/ActivityItem.php +++ b/application/common/model/school/classes/activity/ActivityItem.php @@ -240,6 +240,8 @@ class ActivityItem extends BaseModel } +// //不用审核允许修改的字段 + public $no_auth_fields = ["name","price"]; public function updateCheck($id,$params=[],$row=null){ if($params && $row){ @@ -251,7 +253,7 @@ class ActivityItem extends BaseModel // 课程存在售后订单则不允许操作 $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find(); - if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); + if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); } diff --git a/application/common/model/school/classes/activity/order/Order.php b/application/common/model/school/classes/activity/order/Order.php index 50be643..0f987e3 100644 --- a/application/common/model/school/classes/activity/order/Order.php +++ b/application/common/model/school/classes/activity/order/Order.php @@ -63,7 +63,7 @@ class Order extends BaseModel public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '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() @@ -318,8 +318,8 @@ class Order extends BaseModel if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']); if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']); - if (isset($whereData['auth_status'])) $model = $model->where("{$alisa}auth_status", 'in', $whereData['auth_status']); - if (isset($whereData['not_auth_status'])) $model = $model->where("{$alisa}auth_status", 'not in', $whereData['not_auth_status']); + if (isset($whereData['auth_status']) && $whereData['auth_status']!=="") $model = $model->where("{$alisa}auth_status", 'in', $whereData['auth_status']); + if (isset($whereData['not_auth_status'])&& $whereData['not_auth_status']!=="") $model = $model->where("{$alisa}auth_status", 'not in', $whereData['not_auth_status']); if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}order_no|{$alisa}pay_no|{$alisa}code", '=', $whereData['keywords']); @@ -355,7 +355,7 @@ class Order extends BaseModel - public static function allList($user_id,$page, $limit,$keywords,$status,$classes_activity_id=[],$has_evaluate=0){ + public static function allList($user_id,$page, $limit,$keywords,$status,$classes_activity_id=[],$has_evaluate=0,$auth_status=""){ $with_field = [ 'user'=>['nickname','mobile','avatar','realname'], 'base'=>['*'], @@ -370,9 +370,11 @@ class Order extends BaseModel $REFUND = '6'; $FINISH = '9'; $IN_SERVICE = '4'; + $IN_REFUND = '5'; + $alisa = (new self)->getWithAlisaName(); - $sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}') asc,{$alisa}.id desc"; - $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,"classes_activity_id"=>$classes_activity_id,"has_evaluate"=>$has_evaluate]; + $sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}' ,'{$IN_REFUND}') asc,{$alisa}.id desc"; + $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,"classes_activity_id"=>$classes_activity_id,"has_evaluate"=>$has_evaluate,"auth_status"=>$auth_status]; // if($type)$serch_where['type'] = $type; return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); } @@ -388,6 +390,8 @@ class Order extends BaseModel $REFUND = '6'; $FINISH = '9'; $IN_SERVICE = '4'; + $IN_REFUND = '5'; + $cancel_number = self::getBaseWhere(array_merge(['status'=>$CANCEL],$where))->count(); $nopay_number = self::getBaseWhere(array_merge(['status'=>$NOPAY],$where))->count(); $payed_number = self::getBaseWhere(array_merge(['status'=>$PAYED],$where))->count(); @@ -395,10 +399,12 @@ class Order extends BaseModel $retund_number = self::getBaseWhere(array_merge(['status'=>$REFUND],$where))->count(); + $in_retund_number = self::getBaseWhere(array_merge(['status'=>$IN_REFUND],$where))->count(); + $finish_number = self::getBaseWhere(array_merge(['status'=>$FINISH],$where))->count(); $in_service_number = self::getBaseWhere(array_merge(['status'=>$IN_SERVICE],$where))->count(); - return compact('cancel_number','nopay_number','payed_number','in_service_number','retund_number','finish_number','reserv_number'); + return compact('cancel_number','nopay_number','payed_number','in_service_number','retund_number','in_retund_number','finish_number','reserv_number'); } @@ -415,7 +421,9 @@ class Order extends BaseModel - public static function workList($user_id,$page, $limit,$keywords,$status,$classes_activity_id=[],$classes_activity_ids=[],$has_evaluate=0){ + public static function workList($user_id,$page, $limit,$keywords,$status,$classes_activity_id=[],$classes_activity_ids=[],$has_evaluate=0,$auth_status=""){ + if(!$classes_activity_ids) $classes_activity_ids = [-5]; + $with_field = [ 'user'=>['nickname','mobile','avatar','realname'], 'base'=>['*'], @@ -430,9 +438,10 @@ class Order extends BaseModel $REFUND = '6'; $FINISH = '9'; $IN_SERVICE = '4'; + $IN_REFUND = '5'; $alisa = (new self)->getWithAlisaName(); - $sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}') asc,{$alisa}.id desc"; - $serch_where = ['status'=>$status,'keywords'=>$keywords,"classes_activity_id"=>$classes_activity_id,"classes_activity_ids"=>$classes_activity_ids]; + $sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}','{$IN_REFUND}') asc,{$alisa}.id desc"; + $serch_where = ['status'=>$status,'keywords'=>$keywords,"classes_activity_id"=>$classes_activity_id,"classes_activity_ids"=>$classes_activity_ids,"auth_status"=>$auth_status]; // if($type)$serch_where['type'] = $type; return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); } @@ -447,6 +456,8 @@ class Order extends BaseModel * @return array */ public static function workCount($classes_activity_id=[],$classes_activity_ids=[]){ + if(!$classes_activity_ids) $classes_activity_ids = [-5]; + return self::baseCount(["classes_activity_id"=>$classes_activity_id,"classes_activity_ids"=>$classes_activity_ids]); } @@ -1452,6 +1463,28 @@ class Order extends BaseModel } + /**更新订单结算中状态 + * @param $order + * @return array|false|\PDOStatement|string|Model + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public static function updateExamineFailSettlement($order,$reason,$oper_id = 0,$oper_type='user'){ + if(is_string($order))$order = self::getHaveExamineOrder($order); + $order->status = "5"; + $order->auth_status = "2"; + $order->auth_time = time(); + $order->refundsendtime = time(); + $order->reason = $reason; + $order->auth_user_id = $oper_id; + $order->auth_type = $oper_type; + $order->save(); + return $order; + } + + + @@ -1517,7 +1550,7 @@ class Order extends BaseModel $order = self::updateExamineFail($order,$reason,$user_id ?: $oper_id,$oper_type); //审核失败逻辑 - OrderLog::log($order['id'],$pron."课程活动单审核不通过,原因;{$reason},该活动单将取消(若已支付将自动退款)以便重新下单",$oper_type ?: 'user', $oper_id ?: $order['user_id']); + OrderLog::log($order['id'],$pron."课程活动单审核不通过,原因;{$reason},该活动单将取消",$oper_type ?: 'user', $oper_id ?: $order['user_id']); //调用订单事件 $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classes_activity_order_auth_fail_after', $data); @@ -1525,6 +1558,16 @@ class Order extends BaseModel $this->cancel($order_no,$user_id,false,$oper_type,$oper_id); }else{ //调用退款发起 + //更新订单状态 + $order = self::updateExamineFailSettlement($order,$reason,$user_id ?: $oper_id,$oper_type); + + //审核失败逻辑 + OrderLog::log($order['id'],$pron."课程活动单审核不通过,原因;{$reason},该活动单将自动退款以便重新下单",$oper_type ?: 'user', $oper_id ?: $order['user_id']); + //调用订单事件 + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; + \think\Hook::listen('classes_activity_order_auth_fail_after', $data); + + self::orderRefund($order,$order['sub_refundprice'],$oper_type,$oper_id,$trans=false,$admin=false); } @@ -1553,7 +1596,7 @@ class Order extends BaseModel * @param $trans */ public static function orderRefund($order,$refund_money,$oper_type='user',$oper_id=0,$trans=false,$admin=false){ - if(is_numeric($order))$order = self::getBaseWhere(['id'=>$order])->find(); + if(is_numeric($order))$order = self::getHaveRefundOrder($order); if(!$order)throw new \Exception("找不到订单"); //判断逻辑 if($trans){ @@ -1562,9 +1605,13 @@ class Order extends BaseModel $res = true; try{ //生成退款单号 - $order['refund_no'] = get_order_sn(); - $order->save(); - + if(!$order['refund_no']){ + $order['refund_no'] = get_order_sn(); + $order->save(); + } + if(!$refund_money)$refund_money = $order['sub_refundprice']; + if($refund_money<=0)$refund_money = 0; + if(!$refund_money)throw new \Exception("退款金额异常!"); //事务逻辑 switch ($order['pay_type']) { case "wechat": //微信退款 @@ -1597,6 +1644,13 @@ class Order extends BaseModel + + + + + + + /**微信退款 * @param $order * @param $refund_money @@ -1672,7 +1726,7 @@ class Order extends BaseModel */ public static function getHaveRefundOrder($refund_sn){ // $where = [self::STATUS_NOPAY,self::STATUS_PAYED]; - $order = self::where('refund_no',$refund_sn)->where("sub_refundprice",">",0)->find(); + $order = self::where('refund_no|order_no|id',$refund_sn)->where('status','5')->where("sub_refundprice",">",0)->find(); if(!$order)throw new \Exception("不是可直接退款的订单!"); return $order; @@ -1713,7 +1767,7 @@ class Order extends BaseModel * @return bool * @throws \Exception */ - public static function refundSuccess($refund_sn,$trans=false){ + public static function refundSuccess($refund_sn,$refund_json=[],$trans=false){ //得到机构售后提交确认订单 $order = self::getHaveRefundOrder($refund_sn); @@ -1726,7 +1780,7 @@ class Order extends BaseModel //事务逻辑 //更新订单状态为同意 - $order = self::updateRefundOrder($refund_sn); + $order = self::updateRefundOrder($refund_sn,$refund_json); //插入订单日志 OrderLog::log($order['id'],"活动订单退全款已原路退回", 'admin', 0); @@ -1736,7 +1790,7 @@ class Order extends BaseModel //调用订单取消事件 $data = ['order' => $order,"user_id"=>$order['user_id'],"oper_type"=>'admin',"oper_id"=>0]; - \think\Hook::listen('classes_activity_order_auth_success_after', $data); + \think\Hook::listen('classes_activity_order_refund_success_after', $data); @@ -1755,4 +1809,144 @@ class Order extends BaseModel + /**订单退款失败记录 + * @param $order + * @param $refund_money + * @param $trans + */ + public static function orderRefundFail($order,$msg,$oper_type='user',$oper_id=0,$trans=false,$admin=false){ + if(is_numeric($order))$order = self::getOrder($order); + if(!$order)throw new \Exception("找不到订单"); + //判断逻辑 + if($trans){ + self::beginTrans(); + } + $res = true; + try{ + + //事务逻辑 + $order->refund_error = $msg; + $order->save(); + //插入订单日志 + OrderLog::log($order['id'],"活动订单退款失败:".$msg, $oper_type, $oper_id); + + //调用订单取消事件 + $data = ['order' => $order,"user_id"=>$order['user_id'],"oper_type"=>$oper_type,"oper_id"=>$oper_id]; + \think\Hook::listen('classes_activity_order_refund_fail_after', $data); + + if($trans){ + self::commitTrans(); + } + }catch (\Exception $e){ + if($trans){ + self::rollbackTrans(); + } + throw new \Exception($e->getMessage()); + } + return $res; + } + + + + + + /**更新订单核销状态 + * @param $order + * @return array|false|\PDOStatement|string|Model + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public static function updateVerification($order,$oper_id = 0,$oper_type='user'){ + if(is_string($order))$order = self::getHaveVerificationOrder($order); + $order->status = "9";//refund_status + $order->verification_user_id = $oper_id; + $order->verification_type = $oper_type; + $order->finishtime = time(); + $order->save(); + return $order; + } + + + + + + /**得到可核销订单 + * @param $order_no + * @return array|false|\PDOStatement|string|Model + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public static function getHaveVerificationOrder($order_no){ +// $where = [self::STATUS_NOPAY,self::STATUS_PAYED]; + $order = self::where('order_no|id|code',$order_no)->where("status","in",["3"])->find(); + if(!$order)throw new \Exception("不是待核销的订单!"); + + return $order; + } + + + + + /**订单核销 + * @param $order_no + * @param int $user_id + * @param bool $check + * @param bool $trans + * @return bool + * @throws \Exception + */ + public function verification($order_no,$user_id=0,$check=false,$oper_type='user',$oper_id=0,$trans=false){ + //得到可取消订单 + $order = self::getHaveVerificationOrder($order_no); + if($check){ + //用户操作权限检测 + self::checkOptionAuth($order['id'],$user_id ?: $oper_id,$oper_type); + +// self::serverCheck($order['classes_order_id']); + + } + + //判断逻辑 + if($trans){ + self::beginTrans(); + } + $res = true; + try{ + //事务逻辑 + //更新订单状态 + //如果没有审核,先审核成功再核销 +// if($order["status"] == '2'){ +// $order = $this->examine($order_no,'1',"",$user_id,$check,$oper_type,$oper_id); +// } + $order = self::updateVerification($order,$user_id ?: $oper_id,$oper_type); + //插入订单取消日志 + if(!$user_id ||$order["user_id"] !=$user_id ){ + OrderLog::log($order['id'],"[员工操作]活动单核销成功,当前活动已完成",$oper_type ?: 'user', $oper_id ?: $order['user_id']); + }else{ + OrderLog::log($order['id'],"活动单核销成功,当前活动已完成",$oper_type ?: 'user', $oper_id ?: $order['user_id']); + } + + //调用订单取消事件 + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; + \think\Hook::listen('classes_activity_order_finish_after', $data); + //执行课时数更新 + self::statisticsAndUpdateClassesNumber($order['id']); + + + if($trans){ + self::commitTrans(); + } + }catch (\Exception $e){ + if($trans){ + self::rollbackTrans(); + } + throw new \Exception($e->getMessage()); + } + return $res; + } + + + } diff --git a/application/common/model/school/classes/activity/order/OrderLog.php b/application/common/model/school/classes/activity/order/OrderLog.php index 421b1c5..2a1efb0 100644 --- a/application/common/model/school/classes/activity/order/OrderLog.php +++ b/application/common/model/school/classes/activity/order/OrderLog.php @@ -34,7 +34,7 @@ class OrderLog extends BaseModel public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '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')]; } diff --git a/application/common/model/school/classes/hourorder/Order.php b/application/common/model/school/classes/hourorder/Order.php index cd28cc5..b500653 100644 --- a/application/common/model/school/classes/hourorder/Order.php +++ b/application/common/model/school/classes/hourorder/Order.php @@ -346,7 +346,11 @@ class Order extends BaseModel - public static function workList($page, $limit,$keywords,$status,$classes_order_id=0,$user_id=0,$classes_lib_id = [],$classes_lib_ids = [],$start_time = null,$createtime = null,$time=null){ + public static function workList($page, $limit,$keywords,$status,$classes_order_id=0,$user_id=0,$classes_lib_id = [],$classes_lib_ids = [],$start_time = null,$createtime = null,$time=null,$shop_id=0){ + if(!$classes_lib_ids) $classes_lib_ids = [-5]; + +// var_dump($classes_lib_ids);die; + $with_field = [ 'user'=>['nickname','mobile','avatar','realname'], 'base'=>['*'], @@ -356,12 +360,13 @@ class Order extends BaseModel $CANCEL = '-3'; $NOAUDIT = '-1'; $HAVE = '0'; - +// var_dump($classes_lib_ids);die; $FINISH = '3'; $alisa = (new self)->getWithAlisaName(); $sort = "field({$alisa}.status,'{$NOAUDIT}','{$HAVE}','{$FINISH}','{$CANCEL}') asc,{$alisa}.id desc"; - $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,'classes_order_id'=>$classes_order_id,"classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"start_time"=>$start_time,"createtime"=>$createtime,"time"=>$time]; -// if($type)$serch_where['type'] = $type; + $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,'classes_order_id'=>$classes_order_id,"classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"start_time"=>$start_time,"createtime"=>$createtime,"time"=>$time,"shop_id"=>$shop_id]; + + return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); } @@ -372,8 +377,9 @@ class Order extends BaseModel * @param int $user_id * @return array */ - public static function workCount($classes_lib_id = [],$classes_lib_ids = [],$classes_order_id=0){ - return self::baseCount(['classes_lib_id'=>$classes_lib_id,'classes_order_id'=>$classes_order_id,"classes_lib_ids"=>$classes_lib_ids]); + public static function workCount($classes_lib_id = [],$classes_lib_ids = [],$classes_order_id=0,$shop_id=0){ + if(!$classes_lib_ids) $classes_lib_ids = [-5]; + return self::baseCount(['classes_lib_id'=>$classes_lib_id,'classes_order_id'=>$classes_order_id,"classes_lib_ids"=>$classes_lib_ids,"shop_id"=>$shop_id]); } diff --git a/application/common/model/school/classes/order/Order.php b/application/common/model/school/classes/order/Order.php index 7f75fb4..cae450f 100644 --- a/application/common/model/school/classes/order/Order.php +++ b/application/common/model/school/classes/order/Order.php @@ -973,6 +973,8 @@ class Order extends BaseModel public static function workList($user_id,$page, $limit,$keywords,$status,$classes_lib_id=[],$classes_lib_ids=[],$has_evaluate=0){ + + if(!$classes_lib_ids) $classes_lib_ids = [-5]; $with_field = [ 'user'=>['nickname','mobile','avatar','realname'], 'base'=>['*'], @@ -1004,6 +1006,7 @@ class Order extends BaseModel * @return array */ public static function workCount($classes_lib_id=[],$classes_lib_ids=[]){ + if(!$classes_lib_ids) $classes_lib_ids = [-5]; return self::baseCount(["classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids]); } diff --git a/application/common/model/school/classes/order/ServiceOrder.php b/application/common/model/school/classes/order/ServiceOrder.php index 804d6d5..d318e0a 100644 --- a/application/common/model/school/classes/order/ServiceOrder.php +++ b/application/common/model/school/classes/order/ServiceOrder.php @@ -791,6 +791,8 @@ class ServiceOrder extends BaseModel public static function workList($page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_order_id=[],$classes_order_detail_id=[],$classes_lib_id=[],$classes_lib_ids=[]){ + if(!$classes_lib_ids) $classes_lib_ids = [-5]; + $with_field = [ 'user'=>['nickname','mobile','avatar','realname'], 'base'=>['*'], @@ -817,6 +819,8 @@ class ServiceOrder extends BaseModel * @return array */ public static function workCount($classes_order_id=0,$classes_lib_id=[],$classes_lib_ids=[]){ + if(!$classes_lib_ids) $classes_lib_ids = [-5]; + return self::baseCount(["classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"classes_order_id"=>$classes_order_id]); } diff --git a/application/common/model/school/help/Article.php b/application/common/model/school/help/Article.php new file mode 100644 index 0000000..975031c --- /dev/null +++ b/application/common/model/school/help/Article.php @@ -0,0 +1,219 @@ +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] : ''; + } + + + 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; + } + + protected function setStartTimeAttr($value) + { + return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); + } + + + + + + /**得到基础条件 + * @param $status + * @param null $model + * @param string $alisa + */ + public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false) + { + + if (!$model) { + $model = new static; + if ($alisa&&!$with) $model = $model->alias($alisa); + } + if ($alisa) $alisa = $alisa . '.'; + $tableFields = (new static)->getTableFields(); + foreach ($tableFields as $fields) + { + if(in_array($fields, ['status',"help_cate_ids"]))continue; +// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]); + + if (isset($whereData[$fields]) && $whereData[$fields]){ + if(is_array($whereData[$fields])){ + $model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]); + }else{ + $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]); + } + + } + + + } + if (isset($whereData['status']) && $whereData['status']) $model = $model->where("{$alisa}status", 'in', $whereData['status']); + if (isset($whereData['not_status']) && $whereData['not_status']) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']); + + + if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}title|{$alisa}content", 'like', "%". $whereData['keywords']."%"); + if (isset($whereData['time'])&&$whereData['time']){ + $model = $model->time(["{$alisa}start_time",$whereData['time']]); + } + + if (isset($whereData['help_cate_ids']) && $whereData['help_cate_ids']){ + $help_cate_ids = implode("|",explode(',',$whereData['help_cate_ids'])); + $model = $model->whereRaw(" {$alisa}help_cate_ids REGEXP '({$help_cate_ids})'"); + } + + + + return $model; + } + + + + + public static function articleList($page, $limit,$params=[]){ + $with_field = [ + 'base'=>['*'], + ]; + $alisa = (new self)->getWithAlisaName(); + $sort = "{$alisa}.hot desc,{$alisa}.weigh desc,{$alisa}.id desc"; + $serch_where = ["status"=>'1']; + $serch_where = array_merge($serch_where,$params); + return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); + } + + + + /** 文章详情 + * @param $id + * @throws \think\exception\DbException + */ + public function detail($id,$user_id=0,$oper_type='user',$trans=false){ + $self = self::get($id); + if(!$self) throw new \Exception("未找到相关数据"); + if($self["status"] != 1) throw new \Exception("未找到相关数据"); + + if($user_id){ +// if($self["user_id"] != $user_id) throw new \Exception("非法访问"); + } + +// $self->getRelation('user')->visible(['nickname','realname','mobile','avatar']); +// $self->getRelation('shop')->visible(['name','logo']); +// $self->getRelation('lib')->visible(['title','headimage']); +// $self->getRelation('classesorder')->visible(['order_no']); +// $self->getRelation('teacher')->visible(['name',"head_image"]); + //增加浏览量 + $this->setViews($id,$user_id,$oper_type,$user_id,$trans); + + return $self; + } + + + /**设置浏览量 + * @param $id + * @param int $user_id + * @param bool $check + * @param bool $trans + * @throws \Exception + */ + public function setViews($id,$user_id,$oper_type='user',$oper_id=0,$trans=false){ + $classes_lib = self::where("id",$id)->find(); + if(!$classes_lib)throw new \Exception("找不到活动!"); + //判断逻辑 + if($trans){ + self::beginTrans(); + } + + try{ + //事务逻辑 + $classes_lib->views = $classes_lib->views + 1; + //查询是否已收藏 + $classes_lib->save(); + + //调用事件 + $data = ['help_article' => $classes_lib,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; + \think\Hook::listen('help_article_view_after', $data); + + + if($trans){ + self::commitTrans(); + } + }catch (\Exception $e){ + if($trans){ + self::rollbackTrans(); + } + throw new \Exception($e->getMessage()); + } + return $classes_lib; + } + + + + +} diff --git a/application/common/model/school/help/Cate.php b/application/common/model/school/help/Cate.php new file mode 100644 index 0000000..744907f --- /dev/null +++ b/application/common/model/school/help/Cate.php @@ -0,0 +1,133 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getStatusList() + { + return ['1' => __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + public function parent() + { + return $this->belongsTo(self::class, 'pid', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + + /**得到基础条件 + * @param $status + * @param null $model + * @param string $alisa + */ + public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false) + { + + if (!$model) { + $model = new static; + if ($alisa&&!$with) $model = $model->alias($alisa); + } + if ($alisa) $alisa = $alisa . '.'; + $tableFields = (new static)->getTableFields(); + foreach ($tableFields as $fields) + { + if(in_array($fields, ['status',"id","pid"]))continue; +// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]); + + if (isset($whereData[$fields]) && $whereData[$fields]){ + if(is_array($whereData[$fields])){ + $model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]); + }else{ + $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]); + } + + } + + + } + if (isset($whereData['status']) && $whereData['status']) $model = $model->where("{$alisa}status", 'in', $whereData['status']); + if (isset($whereData['not_status']) && $whereData['not_status']) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']); + + + if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}name", 'like', "%". $whereData['keywords']."%"); + if (isset($whereData['time'])&&$whereData['time']){ + $model = $model->time(["{$alisa}start_time",$whereData['time']]); + } + + if (isset($whereData['id']) && $whereData['id']){ + $model = $model->where("{$alisa}id", 'in', $whereData['id']); + } + + if (isset($whereData['pid']) && $whereData['pid']){ + $model = $model->where("{$alisa}pid", 'in', $whereData['pid']); + } + + + + return $model; + } + + + + + public static function cateList($page, $limit,$params=[]){ + $with_field = [ + 'base'=>['*'], + ]; + $alisa = (new self)->getWithAlisaName(); + $sort = "{$alisa}.weigh desc,{$alisa}.id desc"; + $serch_where = ["status"=>'1']; + $serch_where = array_merge($serch_where,$params); + return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); + } + + + + +} diff --git a/application/manystore/controller/school/classes/ClassesLib.php b/application/manystore/controller/school/classes/ClassesLib.php index f11b1e4..4a8726f 100644 --- a/application/manystore/controller/school/classes/ClassesLib.php +++ b/application/manystore/controller/school/classes/ClassesLib.php @@ -199,7 +199,7 @@ class ClassesLib extends ManystoreBase } protected function no_auth_fields_check($params,$row){ - + if($this->no_auth_fields == "*")return $this->have_auth; foreach ($params as $k=>$v){ //说明数值有变动 @@ -370,7 +370,7 @@ class ClassesLib extends ManystoreBase //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$this->model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs); } @@ -530,7 +530,7 @@ class ClassesLib extends ManystoreBase //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs); } diff --git a/application/manystore/controller/school/classes/ClassesSpec.php b/application/manystore/controller/school/classes/ClassesSpec.php index 896cb79..b1648ec 100644 --- a/application/manystore/controller/school/classes/ClassesSpec.php +++ b/application/manystore/controller/school/classes/ClassesSpec.php @@ -95,28 +95,6 @@ class ClassesSpec extends ManystoreBase } - protected function no_auth_fields_check($params,$row){ - - foreach ($params as $k=>$v){ - - //说明数值有变动 - //$params[$k] 去掉两端空格 - $params[$k] = trim($v); - - if($row[$k]!=$params[$k]){ - //当修改参数不在允许修改的字段中 - if(!in_array($k,$this->no_auth_fields)){ - - $this->have_auth = true;break; - - } - } - - } - - return $this->have_auth; - - } protected function updateCheck($id,$params=[],$row=null){ if($params && $row){ diff --git a/application/manystore/controller/school/classes/activity/Activity.php b/application/manystore/controller/school/classes/activity/Activity.php index 6705085..5acdf38 100644 --- a/application/manystore/controller/school/classes/activity/Activity.php +++ b/application/manystore/controller/school/classes/activity/Activity.php @@ -77,6 +77,8 @@ class Activity extends ManystoreBase { //当前是否为关联查询 $this->relationSearch = true; + $this->searchFields = ["id","title","address","address_detail","address_city","manystoreshop.name"]; + //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -167,8 +169,8 @@ class Activity extends ManystoreBase } // 课程存在售后订单则不允许操作 - $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find(); - if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); + $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find(); + if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); } @@ -196,6 +198,7 @@ class Activity extends ManystoreBase $this->need_auth = $classesLib->need_auth; $this->have_auth = $classesLib->have_auth; + }catch (\Exception $e){ $this->error($e->getMessage()); } @@ -229,7 +232,7 @@ class Activity extends ManystoreBase $params = $this->request->post("row/a"); if ($params) { $params = $this->preExcludeFields($params); - + $this->error(__('添加功能已被禁用!', '')); if($this->storeIdFieldAutoFill && STORE_ID ){ $params['store_id'] = STORE_ID; } @@ -266,7 +269,7 @@ class Activity extends ManystoreBase //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$this->model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs); } @@ -323,10 +326,12 @@ class Activity extends ManystoreBase $row->validateFailException(true)->validate($validate); } $this->update_check($params,$row); + if($this->have_auth){ (new \app\common\model\school\classes\activity\Activity)->applyAuth($row["id"],$params); $result = true; }else{ +// var_dump($this->have_auth); $spec = $params["item_json"] ?? []; @@ -365,7 +370,7 @@ class Activity extends ManystoreBase $specss = \app\common\model\school\classes\activity\ActivityItem::where("classes_activity_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItem)->specCheck($params,null,$specs); } diff --git a/application/manystore/controller/school/classes/activity/ActivityAuth.php b/application/manystore/controller/school/classes/activity/ActivityAuth.php index 48fd8eb..cffc86c 100644 --- a/application/manystore/controller/school/classes/activity/ActivityAuth.php +++ b/application/manystore/controller/school/classes/activity/ActivityAuth.php @@ -73,6 +73,7 @@ class ActivityAuth extends ManystoreBase { //当前是否为关联查询 $this->relationSearch = true; + $this->searchFields = ["id","classes_activity_id","title","address","address_detail","address_city","manystoreshop.name"]; //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -148,8 +149,8 @@ class ActivityAuth extends ManystoreBase } // 课程存在售后订单则不允许操作 - $order = Order::where("classes_activity_item_id",$id)->where("status","not in","-3,6,9")->find(); - if($order)throw new \Exception("{$order['name']}存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); + $order = Order::where("classes_activity_id",$id)->where("status","not in","-3,6,9")->find(); + if($order)throw new \Exception("存在正在使用中的订单报名学员,规格无法继续操作,如规格有误请下架!"); } @@ -238,7 +239,18 @@ class ActivityAuth extends ManystoreBase $this->update_check($params,$row=null); $spec = $params["item_json"]; unset($params["item_json"]); +// $params["status"] = "2"; $result = $this->model->allowField(true)->save($params); +// $this->model = new \app\manystore\model\school\classes\activity\Activity; +// $this->itemmodel = new \app\manystore\model\school\classes\activity\ActivityItem(); + + $activity = \app\manystore\model\school\classes\activity\Activity::where("title",$params["title"])->find(); + if(!$activity){ + $params["status"] = "3"; + $params["classes_activity_auth_id"] = $this->model["id"]; + $activity = new \app\manystore\model\school\classes\activity\Activity; + $result2 = $activity->allowField(true)->save($params); + } //添加课程规格 foreach ($spec as $k=>$v){ @@ -251,12 +263,15 @@ class ActivityAuth extends ManystoreBase unset($v["id"]); (new \app\common\model\school\classes\activity\ActivityItemAuth())->allowField(true)->save($v); + if(isset($result2)){ + (new \app\common\model\school\classes\activity\ActivityItem())->allowField(true)->save($v); + } } //因为是批量添加,所有规格重新进行检测,防止出现时间重叠 $specss = \app\common\model\school\classes\activity\ActivityItemAuth::where("classes_activity_auth_id",$this->model["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItemAuth)->specCheck($params,null,$specs); } @@ -358,7 +373,7 @@ class ActivityAuth extends ManystoreBase $specss = \app\common\model\school\classes\activity\ActivityItemAuth::where("classes_activity_auth_id",$row["id"])->select(); foreach ($specss as $k=>$specs){ - $params =$specs; + $params =$specs->toArray(); (new \app\common\model\school\classes\activity\ActivityItemAuth)->specCheck($params,null,$specs); } diff --git a/application/manystore/controller/school/classes/activity/order/Order.php b/application/manystore/controller/school/classes/activity/order/Order.php index 43f1b6b..fc8ae8c 100644 --- a/application/manystore/controller/school/classes/activity/order/Order.php +++ b/application/manystore/controller/school/classes/activity/order/Order.php @@ -48,6 +48,8 @@ class Order extends ManystoreBase { //当前是否为关联查询 $this->relationSearch = true; + $this->searchFields = ["id","refund_error","code","refund_no","order_no","pay_no","user_id","orderitem.name","schoolclassesactivityorderdetail.title","user.nickname","user.realname","user.mobile","manystoreshop.name"]; + //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -58,7 +60,7 @@ class Order extends ManystoreBase list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model - ->with(['user','manystore','manystoreshop','schoolclassesactivity','schoolclassesactivityorderdetail']) + ->with(['user',"orderitem",'manystore','manystoreshop','schoolclassesactivity','schoolclassesactivityorderdetail']) ->where($where) ->order($sort, $order) ->paginate($limit); @@ -70,6 +72,7 @@ class Order extends ManystoreBase $row->getRelation('manystoreshop')->visible(['name','logo']); $row->getRelation('schoolclassesactivity')->visible(['title','headimage']); $row->getRelation('schoolclassesactivityorderdetail')->visible(['title','headimage']); + $row->getRelation('orderitem')->visible(['name','price','feel']); } $result = array("total" => $list->total(), "rows" => $list->items()); @@ -79,4 +82,130 @@ class Order extends ManystoreBase 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\activity\order\Order); + $model->cancel($ids,0,true,'shop',$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 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\activity\order\Order); + $model->examine($params["id"],$auth_status,$reason,0,true,'shop',$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\activity\order\Order); + $model->verification($ids,0,true,'shop',$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\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function refund($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $model = (new \app\common\model\school\classes\activity\order\Order); + $model->orderRefund($ids,null,'shop',$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/manystore/controller/school/classes/order/Order.php b/application/manystore/controller/school/classes/order/Order.php index 64bf6ad..8e73509 100644 --- a/application/manystore/controller/school/classes/order/Order.php +++ b/application/manystore/controller/school/classes/order/Order.php @@ -101,7 +101,7 @@ class Order extends ManystoreBase if(isset($param['ids']))$ids = $param['ids']; //设置模拟资格 $model = (new \app\common\model\school\classes\order\Order); - $model->cancel($ids,0,true,'shop',$this->auth->id,true);; + $model->cancel($ids,0,true,'shop',$this->auth->id,true); }catch (\Exception $e){ diff --git a/application/manystore/controller/user/User.php b/application/manystore/controller/user/User.php index 18be03d..999df03 100644 --- a/application/manystore/controller/user/User.php +++ b/application/manystore/controller/user/User.php @@ -58,8 +58,8 @@ class User extends ManystoreBase list($where, $sort, $order, $offset, $limit) = $this->buildparams(); // $where[] = [$aliasName.'shop_id','eq',SHOP_ID]; $user_ids = Order::where("shop_id",SHOP_ID)->where("status","<>","-3")->column("user_id"); - - + $activity_user_ids = \app\manystore\model\school\classes\activity\order\Order::where("shop_id",SHOP_ID)->where("status","<>","-3")->column("user_id"); + $user_ids = array_merge($user_ids ,$activity_user_ids); $list = $this->model ->where($where) ->where("id","in",$user_ids) diff --git a/application/manystore/lang/zh-cn/school/classes/activity/activity.php b/application/manystore/lang/zh-cn/school/classes/activity/activity.php index a1ac964..3dec8ce 100644 --- a/application/manystore/lang/zh-cn/school/classes/activity/activity.php +++ b/application/manystore/lang/zh-cn/school/classes/activity/activity.php @@ -68,6 +68,6 @@ return [ 'Has_expire' => '活动是否过期', 'Has_expire 1' => '往期活动', 'Has_expire 2' => '进行中活动', - 'OK' => '确认提交审核', + 'OK' => '确认', 'Has_sign_expire' => '报名是否过期', ]; diff --git a/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php b/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php index 27b1b23..8ce6a78 100644 --- a/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php +++ b/application/manystore/lang/zh-cn/school/classes/activity/activity_auth.php @@ -76,5 +76,5 @@ return [ 'Has_expire' => '是否过期', 'Has_expire 1' => '往期活动', 'Has_expire 2' => '进行中活动', - 'OK' => '确认提交重新审核', + 'OK' => '确认提交', ]; diff --git a/application/manystore/lang/zh-cn/school/classes/activity/order/order.php b/application/manystore/lang/zh-cn/school/classes/activity/order/order.php index c9c1fd8..f2fabfa 100644 --- a/application/manystore/lang/zh-cn/school/classes/activity/order/order.php +++ b/application/manystore/lang/zh-cn/school/classes/activity/order/order.php @@ -23,6 +23,7 @@ return [ 'Status 2' => '已报名待审核', 'Status 3' => '已预约', 'Status 4' => '售后中', + 'Status 5' => '退款结算中', 'Status 6' => '已退款', 'Status 9' => '已完成', 'Before_status' => '售后前状态', @@ -70,5 +71,9 @@ return [ 'Schoolclassesactivity.title' => '标题', 'Schoolclassesactivity.headimage' => '头图', 'Schoolclassesactivityorderdetail.title' => '标题', - 'Schoolclassesactivityorderdetail.headimage' => '头图' + 'Schoolclassesactivityorderdetail.headimage' => '头图', + 'Orderitem.name' => '活动规格', + 'Feel' => '是否免费', + 'Feel 0' => '否', + 'Feel 1' => '是', ]; diff --git a/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php b/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php index 15f53b3..1c4265c 100644 --- a/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php +++ b/application/manystore/lang/zh-cn/school/classes/activity/order/order_log.php @@ -8,6 +8,7 @@ return [ 'Status 2' => '已报名待审核', 'Status 3' => '已预约', 'Status 4' => '售后中', + 'Status 5' => '退款结算中', 'Status 6' => '已退款', 'Status 9' => '已完成', 'Log_text' => '记录内容', diff --git a/application/manystore/model/school/classes/activity/order/Order.php b/application/manystore/model/school/classes/activity/order/Order.php index 27512a8..14442be 100644 --- a/application/manystore/model/school/classes/activity/order/Order.php +++ b/application/manystore/model/school/classes/activity/order/Order.php @@ -50,7 +50,7 @@ class Order extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '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() @@ -209,4 +209,9 @@ class Order extends Model { return $this->belongsTo(OrderDetail::class, 'activity_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); } + + public function orderitem() + { + return $this->belongsTo(OrderItem::class, 'activity_order_item_id', 'id', [], 'LEFT')->setEagerlyType(0); + } } diff --git a/application/manystore/model/school/classes/activity/order/OrderLog.php b/application/manystore/model/school/classes/activity/order/OrderLog.php index b0a7d02..8e056fd 100644 --- a/application/manystore/model/school/classes/activity/order/OrderLog.php +++ b/application/manystore/model/school/classes/activity/order/OrderLog.php @@ -32,7 +32,7 @@ class OrderLog extends Model public function getStatusList() { - return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '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')]; } diff --git a/application/manystore/view/school/classes/activity/activity/add.html b/application/manystore/view/school/classes/activity/activity/add.html index eecc0fd..49c9348 100644 --- a/application/manystore/view/school/classes/activity/activity/add.html +++ b/application/manystore/view/school/classes/activity/activity/add.html @@ -20,6 +20,7 @@
            +
            ( 推荐图片尺寸:690*482 )
            @@ -34,6 +35,7 @@
            +
            ( 推荐图片尺寸:750*450 )
            @@ -185,12 +187,12 @@ -
            - -
            - -
            -
            + + + + + +
            diff --git a/application/manystore/view/school/classes/activity/activity/edit.html b/application/manystore/view/school/classes/activity/activity/edit.html index 4eba5ee..2f3936a 100644 --- a/application/manystore/view/school/classes/activity/activity/edit.html +++ b/application/manystore/view/school/classes/activity/activity/edit.html @@ -19,6 +19,7 @@
            +
            ( 推荐图片尺寸:690*482 )
            @@ -33,6 +34,7 @@
            +
            ( 推荐图片尺寸:750*450 )
            @@ -177,12 +179,12 @@ -
            - -
            - -
            -
            + + + + + +
            @@ -270,7 +272,7 @@ diff --git a/application/manystore/view/school/classes/activity/activity_auth/add.html b/application/manystore/view/school/classes/activity/activity_auth/add.html index 254afb8..b25f823 100644 --- a/application/manystore/view/school/classes/activity/activity_auth/add.html +++ b/application/manystore/view/school/classes/activity/activity_auth/add.html @@ -20,6 +20,7 @@
            +
            ( 推荐图片尺寸:690*482 )
            @@ -34,6 +35,7 @@
            +
            ( 推荐图片尺寸:750*450 )
            @@ -283,7 +285,7 @@ diff --git a/application/manystore/view/school/classes/activity/activity_auth/edit.html b/application/manystore/view/school/classes/activity/activity_auth/edit.html index a72d6de..598a089 100644 --- a/application/manystore/view/school/classes/activity/activity_auth/edit.html +++ b/application/manystore/view/school/classes/activity/activity_auth/edit.html @@ -38,6 +38,7 @@ +
            ( 推荐图片尺寸:690*482 )
            @@ -52,6 +53,7 @@
            +
            ( 推荐图片尺寸:750*450 )
            @@ -289,7 +291,7 @@ diff --git a/application/manystore/view/school/classes/activity/order/order/edit.html b/application/manystore/view/school/classes/activity/order/order/edit.html index 25187db..526698c 100644 --- a/application/manystore/view/school/classes/activity/order/order/edit.html +++ b/application/manystore/view/school/classes/activity/order/order/edit.html @@ -1,98 +1,109 @@
            + {if condition="$row.refund_error"} +
            + +
            + + {$row.refund_error} +
            +
            + {/if} + +
            - +
            - +
            - -
            -
            -
            - -
            - +
            + + + + + +
            - -
            -
            -
            - -
            -
            - -
            - - -
            - -
            -
              -
              -
              -
              - -
              -
              - -
              - - -
              - -
              -
                -
                -
                -
                - -
                - +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                - +
                - +
                - +
                - +
                - {foreach name="payTypeList" item="vo"} {/foreach} @@ -106,7 +117,7 @@
                {foreach name="statusList" item="vo"} - + {/foreach}
                @@ -118,7 +129,7 @@
                {foreach name="beforeStatusList" item="vo"} - + {/foreach}
                @@ -130,7 +141,7 @@
                {foreach name="serverStatusList" item="vo"} - + {/foreach}
                @@ -139,95 +150,95 @@
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                -
                - -
                - -
                -
                - {:__('Key')} - {:__('Value')} -
                -
                {:__('Append')}
                - -
                + + + + + + + + + + + + -
                -
                + +
                - +
                - +
                - +
                - +
                @@ -236,7 +247,7 @@
                {foreach name="authStatusList" item="vo"} - + {/foreach}
                @@ -245,20 +256,29 @@
                - +
                - -
                -
                - + + + + + + + + + + + + + + + + diff --git a/application/manystore/view/school/classes/activity/order/order/examine.html b/application/manystore/view/school/classes/activity/order/order/examine.html new file mode 100644 index 0000000..e0a4fde --- /dev/null +++ b/application/manystore/view/school/classes/activity/order/order/examine.html @@ -0,0 +1,32 @@ +
                +
                +

                预约报名资格审核,如果您审核不通过,请您填写审核失败原因告知对方!

                +
                + + +
                + +
                + {foreach name="authStatusList" item="vo"} + + {/foreach} +
                + +
                +
                +
                + +
                + +
                +
                +
                + + + +
                \ No newline at end of file diff --git a/application/manystore/view/school/classes/activity/order/order/index.html b/application/manystore/view/school/classes/activity/order/order/index.html index a05b883..9046a7a 100644 --- a/application/manystore/view/school/classes/activity/order/order/index.html +++ b/application/manystore/view/school/classes/activity/order/order/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/activity/order/order_detail/index.html b/application/manystore/view/school/classes/activity/order/order_detail/index.html index dd1507c..87abd40 100644 --- a/application/manystore/view/school/classes/activity/order/order_detail/index.html +++ b/application/manystore/view/school/classes/activity/order/order_detail/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/activity/order/order_item/index.html b/application/manystore/view/school/classes/activity/order/order_item/index.html index 52ba31b..62f4c46 100644 --- a/application/manystore/view/school/classes/activity/order/order_item/index.html +++ b/application/manystore/view/school/classes/activity/order/order_item/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/activity/order/order_log/index.html b/application/manystore/view/school/classes/activity/order/order_log/index.html index 5516031..350f8a3 100644 --- a/application/manystore/view/school/classes/activity/order/order_log/index.html +++ b/application/manystore/view/school/classes/activity/order/order_log/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/classes_lib/addnew.html b/application/manystore/view/school/classes/classes_lib/addnew.html index d98cce7..e9e858f 100644 --- a/application/manystore/view/school/classes/classes_lib/addnew.html +++ b/application/manystore/view/school/classes/classes_lib/addnew.html @@ -106,6 +106,7 @@
                  +
                  ( 推荐图片尺寸:280*200 )
                  @@ -120,6 +121,7 @@
                  +
                  ( 推荐图片尺寸:750*450 )
                  @@ -253,18 +255,18 @@
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  + + + + + + + + + + + +
                  diff --git a/application/manystore/view/school/classes/classes_lib/copy.html b/application/manystore/view/school/classes/classes_lib/copy.html index 619b313..9401119 100644 --- a/application/manystore/view/school/classes/classes_lib/copy.html +++ b/application/manystore/view/school/classes/classes_lib/copy.html @@ -141,6 +141,7 @@
                  +
                  ( 推荐图片尺寸:280*200 )
                  @@ -155,6 +156,7 @@
                  +
                  ( 推荐图片尺寸:750*450 )
                  @@ -290,18 +292,18 @@ -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  + + + + + + + + + + + +
                  diff --git a/application/manystore/view/school/classes/classes_lib/edit.html b/application/manystore/view/school/classes/classes_lib/edit.html index d655881..204ce31 100644 --- a/application/manystore/view/school/classes/classes_lib/edit.html +++ b/application/manystore/view/school/classes/classes_lib/edit.html @@ -141,6 +141,7 @@
                  +
                  ( 推荐图片尺寸:280*200 )
                  @@ -155,6 +156,7 @@
                  +
                  ( 推荐图片尺寸:750*450 )
                  @@ -290,18 +292,18 @@ -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  + + + + + + + + + + + +
                  diff --git a/application/manystore/view/school/classes/teacher/add.html b/application/manystore/view/school/classes/teacher/add.html index 8907159..197cf55 100644 --- a/application/manystore/view/school/classes/teacher/add.html +++ b/application/manystore/view/school/classes/teacher/add.html @@ -41,6 +41,7 @@
                  +
                  ( 推荐图片尺寸:200*250 )
                  @@ -73,6 +74,7 @@
                  +
                  ( 推荐图片尺寸:200*250 )
                  diff --git a/application/manystore/view/school/classes/teacher/edit.html b/application/manystore/view/school/classes/teacher/edit.html index 52077f2..ea1aa6d 100644 --- a/application/manystore/view/school/classes/teacher/edit.html +++ b/application/manystore/view/school/classes/teacher/edit.html @@ -38,6 +38,7 @@
                  +
                  ( 推荐图片尺寸:200*250 )
                  @@ -70,6 +71,7 @@
                  +
                  ( 推荐图片尺寸:200*250 )
                  diff --git a/public/assets/js/backend/example/tablelink.js b/public/assets/js/backend/example/tablelink.js index e69de29..689d63d 100644 --- a/public/assets/js/backend/example/tablelink.js +++ b/public/assets/js/backend/example/tablelink.js @@ -0,0 +1,81 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init(); + this.table.first(); + this.table.second(); + }, + table: { + first: function () { + // 表格1 + var table1 = $("#table1"); + table1.bootstrapTable({ + url: 'example/tablelink/table1', + toolbar: '#toolbar1', + sortName: 'id', + search: false, + columns: [ + [ + // {field: 'state', checkbox: true,}, + {field: 'id', title: 'ID'}, + {field: 'username', title: __('Nickname')}, + { + field: 'operate', title: __('Operate'), table: table1, events: Table.api.events.operate, buttons: [ + { + name: 'log', + title: '日志列表', + text: '日志列表', + icon: 'fa fa-list', + classname: 'btn btn-primary btn-xs btn-click', + click: function (e, data) { + $("#myTabContent2 .form-commonsearch input[name='username']").val(data.username); + $("#myTabContent2 .btn-refresh").trigger("click"); + } + } + ], formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格1绑定事件 + Table.api.bindevent(table1); + }, + second: function () { + // 表格2 + var table2 = $("#table2"); + table2.bootstrapTable({ + url: 'example/tablelink/table2', + extend: { + index_url: '', + add_url: '', + edit_url: '', + del_url: '', + multi_url: '', + table: '', + }, + toolbar: '#toolbar2', + sortName: 'id', + search: false, + columns: [ + [ + {field: 'state', checkbox: true,}, + {field: 'id', title: 'ID'}, + {field: 'username', title: __('Nickname')}, + {field: 'title', title: __('Title')}, + {field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url}, + {field: 'ip', title: __('ip')}, + {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, + ] + ] + }); + + // 为表格2绑定事件 + Table.api.bindevent(table2); + } + }, + }; + return Controller; +}); diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index 2827d00..9ff3094 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -123,6 +123,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'activity', + text: __('机构线上活动'), + title: __('机构线上活动'), + classname: 'btn btn-dialog', + icon: 'fa fa-leanpub', + dropdown : '更多', + url: activity_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, { name: 'teacher', @@ -199,6 +214,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'activity_order', + text: __('机构活动订单'), + title: __('机构活动订单'), + classname: 'btn btn-dialog', + icon: 'fa fa-cart-arrow-down', + dropdown : '更多', + url: activity_order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, { name: 'user_auth', text: __('机构授权用户'), @@ -381,23 +411,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var order_url = function (row,dom) { - return 'school/classes/order/order/index?shop_id='+row.id; + return 'school/classes/order/order/index?shop_id='+row.shop_id; } //hourorder_url var hourorder_url = function (row,dom) { - return 'school/classes/hourorder/order/index?shop_id='+row.id; + return 'school/classes/hourorder/order/index?shop_id='+row.shop_id; } var user_auth_url = function (row,dom) { - return 'manystore/user_auth/index?shop_id='+row.id; + return 'manystore/user_auth/index?shop_id='+row.shop_id; } var evaluate_url= function (row,dom) { - return 'school/classes/evaluate/index?shop_id='+row.id; + return 'school/classes/evaluate/index?shop_id='+row.shop_id; } + var activity_order_url = function (row,dom) { + return 'school/classes/activity/order/order/index?shop_id='+row.shop_id; + } + + var activity_url = function (row,dom) { + return 'school/classes/activity/activity/index?shop_id='+row.shop_id; + } + var generrate = { listen:function () { diff --git a/public/assets/js/backend/school/classes/activity/activity.js b/public/assets/js/backend/school/classes/activity/activity.js index 91682c3..045b708 100644 --- a/public/assets/js/backend/school/classes/activity/activity.js +++ b/public/assets/js/backend/school/classes/activity/activity.js @@ -28,8 +28,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, @@ -57,7 +57,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'sign_start_time', title: __('Sign_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'sign_end_time', title: __('Sign_end_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, - {field: 'people_num', title: __('People_num')}, + // {field: 'people_num', title: __('People_num')}, {field: 'item', title: __('Item'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'weigh', title: __('Weigh'), operate: false}, {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, @@ -94,6 +94,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'order', + text: __('活动订单'), + title: __('活动订单'), + classname: 'btn btn-dialog', + icon: 'fa fa-cart-arrow-down', + dropdown : '更多', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + { name: 'manystore', text: __('查看机构'), @@ -363,5 +379,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'school/classes/activity/activity_auth/edit/ids/'+row.classes_activity_auth_id; } + var order_url = function (row,dom) { + return 'school/classes/activity/order/order/index?classes_activity_id='+row.id; + } + return Controller; }); diff --git a/public/assets/js/backend/school/classes/activity/activity_auth.js b/public/assets/js/backend/school/classes/activity/activity_auth.js index 6e66b1d..2741040 100644 --- a/public/assets/js/backend/school/classes/activity/activity_auth.js +++ b/public/assets/js/backend/school/classes/activity/activity_auth.js @@ -28,9 +28,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, + {field: 'classes_activity_id',visible:false, title: __('Classes_activity_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, diff --git a/public/assets/js/backend/school/classes/activity/order/order.js b/public/assets/js/backend/school/classes/activity/order/order.js index 2ea1a16..6728f37 100644 --- a/public/assets/js/backend/school/classes/activity/order/order.js +++ b/public/assets/js/backend/school/classes/activity/order/order.js @@ -9,6 +9,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin add_url: 'school/classes/activity/order/order/add', edit_url: 'school/classes/activity/order/order/edit', del_url: 'school/classes/activity/order/order/del', + cancel_url: 'school/classes/activity/order/order/cancel', + examine_url: 'school/classes/activity/order/order/examine', + verification_url: 'school/classes/activity/order/order/verification', + refund_url: 'school/classes/activity/order/order/refund', + + + multi_url: 'school/classes/activity/order/order/multi', import_url: 'school/classes/activity/order/order/import', table: 'school_classes_activity_order', @@ -29,22 +36,45 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'pay_no', title: __('Pay_no'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, + + {field: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'detail.headimage', title: __('Detail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'orderitem.name', title: __('Orderitem.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'orderitem.feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, + + {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, + + + {field: 'user_id', title: __('User_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + + + + {field: 'reason', title: __('Reason'), operate: 'LIKE'}, + + {field: 'auth_user_id',visible:false, title: __('Auth_user_id')}, + {field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'}, + + + {field: 'manystore_id', title: __('Manystore_id'),visible:false}, {field: 'shop_id', title: __('Shop_id')}, {field: 'code', title: __('Code'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'codeimage', title: __('Codeimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'codeoneimage', title: __('Codeoneimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'activity_order_detail_id', title: __('Activity_order_detail_id')}, + {field: 'classes_activity_id', title: __('Classes_activity_id'),visible:false}, + {field: 'activity_order_detail_id', title: __('Activity_order_detail_id'),visible:false}, {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'}, - {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, - {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'}, + {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'}, {field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, - {field: 'before_status', title: __('Before_status'), searchList: {"-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')}, formatter: Table.api.formatter.status}, - {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, + // {field: 'before_status', title: __('Before_status'), searchList: {"-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')}, formatter: Table.api.formatter.status}, + // {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, {field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'auth_time', title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, @@ -57,24 +87,191 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'platform', title: __('Platform'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'verification_user_id', title: __('Verification_user_id')}, {field: 'verification_type', title: __('Verification_type'), operate: 'LIKE'}, - {field: 'reason', title: __('Reason'), operate: 'LIKE'}, - {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, - {field: 'auth_user_id', title: __('Auth_user_id')}, - {field: 'auth_type', title: __('Auth_type'), operate: 'LIKE'}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'}, - {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'}, - {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'detail.headimage', title: __('Detail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'shop.name',visible:false, title: __('Shop.name'), operate: 'LIKE'}, + {field: 'shop.logo',visible:false, title: __('Shop.logo'), operate: 'LIKE'}, + {field: 'activity.title',visible:false, title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activity.headimage',visible:false, title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + + {name: 'cancel', + text: '取消订单', + icon: 'fa fa-user-times', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.cancel_url, + confirm: '确认取消订单', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //非免费订单只有未支付可取消 + if(row.status == '0' && row.orderitem.feel == '0'){ + return true; + } + //免费订单未支付和进行中都可取消 + if((row.status == '0' || row.status == '2'|| row.status == '3' )&& row.orderitem.feel == '1'){ + return true; + } + return false; + }}, + + {name: 'verification', + text: '预约核销', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.verification_url, + confirm: '预约核销', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //显示条件 只能待入住订单 + if(row.status == '3'){ + return true; + } + return false; + }}, + + {name: 'refund', + text: '退款重试(若失败双击本行查看原因)', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.refund_url, + confirm: '(本功能主要适用平台退款因账户原因失败需要重新操作的订单)重新发起退款,如果是第三方支付请等待回调!', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //显示条件 只能待入住订单 + if(row.status == '5'){ + return true; + } + return false; + } + }, + + + { + name: 'examine', + text: __('预约审核'), + title: __('预约审核'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.examine_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '2'; + } + }, + + + + { + name: 'order_detail', + text: __('下单活动'), + title: __('下单活动'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: order_detail_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + { + name: 'order_item', + text: __('下单规格'), + title: __('下单规格'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: order_item_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-dialog', + icon: 'fa fa-list', + dropdown : '更多', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + { + name: 'activity', + text: __('线上活动查看'), + title: __('线上活动查看'), + classname: 'btn btn-dialog', + icon: 'fa fa-leanpub', + dropdown : '更多', + url: activity_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + { + name: 'manystore', + text: __('查看机构'), + title: __('查看机构'), + classname: 'btn btn-dialog', + icon: 'fa fa-home', + dropdown : '更多', + url: manystore_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.classes_evaluate_id; + // } + }, + + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + + + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -148,11 +345,42 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + examine: function(){ + $("#examine").on('click', function() { + $("#examine-form").attr("action",'school/classes/activity/order/order/examine').submit(); + }); + Controller.api.bindevent(); + }, + verification: function () { + Controller.api.bindevent(); + }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; + + + var activity_url = function (row,dom) { + return 'school/classes/activity/activity/index?id='+row.classes_activity_id+ '&shop_id='+row.shop_id; + } + + var order_log_url = function (row,dom) { + return 'school/classes/activity/order/order_log/index?classes_activity_order_id='+row.id; + } + + var order_detail_url = function (row,dom) { + return 'school/classes/activity/order/order_detail/index?classes_activity_order_id='+row.id; + } + var order_item_url = function (row,dom) { + return 'school/classes/activity/order/order_item/index?classes_activity_order_id='+row.id; + } + + var manystore_url = function (row,dom) { + return 'manystore/index/index?shop_id='+row.shop_id; + } + + return Controller; }); diff --git a/public/assets/js/backend/school/classes/activity/order/order_detail.js b/public/assets/js/backend/school/classes/activity/order/order_detail.js index 41ea0cf..5712348 100644 --- a/public/assets/js/backend/school/classes/activity/order/order_detail.js +++ b/public/assets/js/backend/school/classes/activity/order/order_detail.js @@ -28,11 +28,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, - {field: 'user_id', title: __('User_id')}, + {field: 'classes_activity_order_id',visible:false, title: __('Classes_activity_order_id')}, + {field: 'classes_activity_id',visible:false, title: __('Classes_activity_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, + {field: 'user_id',visible:false, title: __('User_id')}, {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, @@ -50,33 +50,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'sign_start_time', title: __('Sign_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'sign_end_time', title: __('Sign_end_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, - {field: 'people_num', title: __('People_num')}, + {field: 'people_num', visible:false, title: __('People_num')}, {field: 'item', title: __('Item'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, - {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, - {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, - {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal}, - {field: 'sale', title: __('Sale')}, - {field: 'stock', title: __('Stock')}, - {field: 'views', title: __('Views')}, + {field: 'status',visible:false, title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + {field: 'weigh',visible:false, title: __('Weigh'), operate: false}, + // {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, + // {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, + // {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, + // {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal}, + // {field: 'sale', title: __('Sale')}, + // {field: 'stock', title: __('Stock')}, + // {field: 'views', title: __('Views')}, // {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status}, - {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal}, - {field: 'add_id', title: __('Add_id')}, + {field: 'add_type', title: __('Add_type'),visible:false, searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal}, + {field: 'add_id', visible:false, title: __('Add_id')}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'activityorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activityorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'}, - {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'activityorder.order_no',visible:false, title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activityorder.pay_no',visible:false, title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activity.title',visible:false, title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activity.headimage',visible:false, title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'shop.name', visible:false,title: __('Shop.name'), operate: 'LIKE'}, + {field: 'shop.logo', visible:false,title: __('Shop.logo'), operate: 'LIKE'}, + {field: 'user.nickname',visible:false, title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname', visible:false,title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.mobile',visible:false, title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar',visible:false, title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/backend/school/classes/activity/order/order_item.js b/public/assets/js/backend/school/classes/activity/order/order_item.js index e12031c..04034b6 100644 --- a/public/assets/js/backend/school/classes/activity/order/order_item.js +++ b/public/assets/js/backend/school/classes/activity/order/order_item.js @@ -28,11 +28,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'classes_activity_item_id', title: __('Classes_activity_item_id')}, + {field: 'feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, + + {field: 'classes_activity_order_id',visible:false, title: __('Classes_activity_order_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, + {field: 'classes_activity_id',visible:false, title: __('Classes_activity_id')}, + {field: 'classes_activity_item_id',visible:false, title: __('Classes_activity_item_id')}, {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'limit_num', title: __('Limit_num')}, @@ -40,20 +42,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'sex', title: __('Sex'), searchList: {"1":__('Sex 1'),"2":__('Sex 2'),"3":__('Sex 3')}, formatter: Table.api.formatter.normal}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'sign_num', title: __('Sign_num')}, - {field: 'verification_num', title: __('Verification_num')}, + // {field: 'sign_num', title: __('Sign_num')}, + // {field: 'verification_num', title: __('Verification_num')}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, - {field: 'activityorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activityorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'}, - {field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'}, - {field: 'activity.title', title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activity.headimage', title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'item.name', title: __('Item.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'item.price', title: __('Item.price'), operate:'BETWEEN'}, + {field: 'activityorder.order_no',visible:false, title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activityorder.pay_no',visible:false, title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'shop.name',visible:false, title: __('Shop.name'), operate: 'LIKE'}, + {field: 'shop.logo',visible:false, title: __('Shop.logo'), operate: 'LIKE'}, + {field: 'activity.title',visible:false, title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activity.headimage',visible:false, title: __('Activity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'item.name',visible:false, title: __('Item.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'item.price',visible:false, title: __('Item.price'), operate:'BETWEEN'}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/backend/school/classes/activity/order/order_log.js b/public/assets/js/backend/school/classes/activity/order/order_log.js index 15b748f..0d7c2c6 100644 --- a/public/assets/js/backend/school/classes/activity/order/order_log.js +++ b/public/assets/js/backend/school/classes/activity/order/order_log.js @@ -26,15 +26,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + {field: 'classes_activity_order_id',visible:false, title: __('Classes_activity_order_id')}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'oper_type', title: __('Oper_type'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'oper_id', title: __('Oper_id')}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'activityorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'activityorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activityorder.order_no',visible:false, title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'activityorder.pay_no',visible:false, title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/backend/school/classes/order/order.js b/public/assets/js/backend/school/classes/order/order.js index 9712fab..16d666b 100644 --- a/public/assets/js/backend/school/classes/order/order.js +++ b/public/assets/js/backend/school/classes/order/order.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { +define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { @@ -26,6 +26,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin sortName: 'id', fixedColumns: true, fixedRightNumber: 1, + // asyndownload: true, columns: [ [ {checkbox: true}, diff --git a/public/assets/js/backend/school/help/article.js b/public/assets/js/backend/school/help/article.js new file mode 100644 index 0000000..c751001 --- /dev/null +++ b/public/assets/js/backend/school/help/article.js @@ -0,0 +1,121 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'school/help/article/index' + location.search, + add_url: 'school/help/article/add', + edit_url: 'school/help/article/edit', + del_url: 'school/help/article/del', + multi_url: 'school/help/article/multi', + import_url: 'school/help/article/import', + table: 'school_help_article', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'weigh', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'help_cate_ids', title: __('Help_cate_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, + {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, + {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'weigh', title: __('Weigh'), operate: false}, + {field: 'views', title: __('Views')}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + recyclebin: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + 'dragsort_url': '' + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: 'school/help/article/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'title', title: __('Title'), align: 'left'}, + { + field: 'deletetime', + title: __('Deletetime'), + operate: 'RANGE', + addclass: 'datetimerange', + formatter: Table.api.formatter.datetime + }, + { + field: 'operate', + width: '140px', + title: __('Operate'), + table: table, + events: Table.api.events.operate, + buttons: [ + { + name: 'Restore', + text: __('Restore'), + classname: 'btn btn-xs btn-info btn-ajax btn-restoreit', + icon: 'fa fa-rotate-left', + url: 'school/help/article/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'school/help/article/destroy', + refresh: true + } + ], + formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/school/help/cate.js b/public/assets/js/backend/school/help/cate.js new file mode 100644 index 0000000..ac7035e --- /dev/null +++ b/public/assets/js/backend/school/help/cate.js @@ -0,0 +1,345 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) { + + + + + var Controller = { + index: function () { + Table.api.init(); + this.table.first(); + this.table.second(); + }, + table:{ + first: function () { + + var table = $("#table1"); + + // 初始化表格 + table.bootstrapTable({ + url: 'school/help/cate/index' + location.search, + toolbar: '#toolbar1', + pk: 'id', + extend: { + index_url: 'school/help/cate/index' + location.search, + add_url: 'school/help/cate/add'+ location.search, + edit_url: 'school/help/cate/edit'+ location.search, + del_url: 'school/help/cate/del', + multi_url: 'school/help/cate/multi', + import_url: 'school/help/cate/import', + table: 'school_help_cate', + }, + sortName: 'weigh', + fixedColumns: true, + fixedRightNumber: 1, + onLoadSuccess: function (data) { + $("#table1").on("change", "input[data-index][type='checkbox']", function (e) { + // var ids = $(this).data("index"); //数据id + // var checked = $(this).prop('checked'); //选中状态 + // Layer.alert(JSON.stringify(Table.api.selecteddata(table))); + + + let numbers = Table.api.selecteddata(table); + +// 过滤偶数,然后将其乘以10,最后求和 + let sumOfDoubledEvens = numbers.map(item => item.id).join(","); // 求和 + + $("#myTabContent2 .form-commonsearch input[name='help_cate_ids']").val(sumOfDoubledEvens); + $("#myTabContent2 .btn-refresh").trigger("click"); + + + }); + }, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'pid', title: __('Pid'),visible:false}, + {field: 'name', title: __('Name') , align: 'left', formatter: Controller.api.formatter.name, clickToSelect: !false}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.toggle}, + {field: 'weigh', title: __('Weigh'), operate: false}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'),visible:false, operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + { + field: 'id', + title: '展开子项', + icon: 'fa fa-chevron-up', + operate: false, + formatter: Controller.api.formatter.subnode + }, + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + { + name: 'add', + text: __('添加子分类'), + title: __('添加子分类'), + classname: 'btn btn-xs btn-warning btn-magic btn-dialog', + icon: 'fa fa-plus', + url: add_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + { + name: 'article', + title: '文章列表', + text: '文章列表', + icon: 'fa fa-list', + classname: 'btn btn-primary btn-xs btn-click', + click: function (e, data) { + $("#myTabContent2 .form-commonsearch input[name='help_cate_ids']").val(data.id); + $("#myTabContent2 .btn-refresh").trigger("click"); + } + } + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ], + pagination: false, + search: false, + commonSearch: false, + rowAttributes: function (row, index) { + return row.pid == 0 ? {} : {style: "display:none"}; + } + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + + var btnSuccessEvent = function (data, ret) { + if ($(this).hasClass("btn-change")) { + var index = $(this).data("index"); + var row = Table.api.getrowbyindex(table, index); + row.ismenu = $("i.fa.text-gray", this).length > 0 ? 1 : 0; + table.bootstrapTable("updateRow", {index: index, row: row}); + } else if ($(this).hasClass("btn-delone")) { + if ($(this).closest("tr[data-index]").find("a.btn-node-sub.disabled").length > 0) { + $(this).closest("tr[data-index]").remove(); + } else { + table.bootstrapTable('refresh'); + } + } else if ($(this).hasClass("btn-dragsort")) { + table.bootstrapTable('refresh'); + } + // Fast.api.refreshmenu(); + $(".btn-refresh").trigger("click"); + return false; + }; + + //表格内容渲染前 + table.on('pre-body.bs.table', function (e, data) { + var options = table.bootstrapTable("getOptions"); + options.escape = true; + }); + + //当内容渲染完成后 + table.on('post-body.bs.table', function (e, data) { + var options = table.bootstrapTable("getOptions"); + options.escape = false; + + //点击切换/排序/删除操作后刷新左侧菜单 + $(".btn-change[data-id],.btn-delone,.btn-dragsort").data("success", btnSuccessEvent); + + }); + + table.on('post-body.bs.table', function (e, settings, json, xhr) { + //显示隐藏子节点 + $(">tbody>tr[data-index] > td", this).on('click', "a.btn-node-sub", function () { + var status = $(this).data("shown") ? true : false; + $("a[data-pid='" + $(this).data("id") + "']").each(function () { + $(this).closest("tr").toggle(!status); + }); + if (status) { + $("a[data-pid='" + $(this).data("id") + "']").trigger("collapse"); + } + $(this).data("shown", !status); + $("i", this).toggleClass("fa-caret-down").toggleClass("fa-caret-right"); + return false; + }); + }); + + //隐藏子节点 + $(document).on("collapse", ".btn-node-sub", function () { + if ($("i", this).length > 0) { + $("a[data-pid='" + $(this).data("id") + "']").trigger("collapse"); + } + $("i", this).removeClass("fa-caret-down").addClass("fa-caret-right"); + $(this).data("shown", false); + $(this).closest("tr").toggle(false); + }); + + //批量删除后的回调 + $(".toolbar > .btn-del,.toolbar .btn-more~ul>li>a").data("success", function (e) { + // Fast.api.refreshmenu(); + $(".btn-refresh").trigger("click"); + }); + + //展开隐藏一级 + $(document.body).on("click", ".btn-toggle", function (e) { + $("a[data-id][data-pid][data-pid!=0].disabled").closest("tr").hide(); + var that = this; + var show = $("i", that).hasClass("fa-chevron-down"); + $("i", that).toggleClass("fa-chevron-down", !show).toggleClass("fa-chevron-up", show); + $("a[data-id][data-pid][data-pid!=0]").not('.disabled').closest("tr").toggle(show); + $(".btn-node-sub[data-pid=0]").data("shown", show); + }); + + //展开隐藏全部 + $(document.body).on("click", ".btn-toggle-all", function (e) { + var that = this; + var show = $("i", that).hasClass("fa-plus"); + $("i", that).toggleClass("fa-plus", !show).toggleClass("fa-minus", show); + $(".btn-node-sub:not([data-pid=0])").closest("tr").toggle(show); + $(".btn-node-sub").data("shown", show); + $(".btn-node-sub > i").toggleClass("fa-caret-down", show).toggleClass("fa-caret-right", !show); + }); + + + // 获取选中项 + $(document).on("click", "#table1 .btn-selected", function () { + Layer.alert(JSON.stringify(Table.api.selecteddata(table))); + }); + + }, + second: function () { + var table = $("#table2"); + + // 初始化表格 + table.bootstrapTable({ + url: 'school/help/article/index' + location.search, + toolbar: '#toolbar2', + extend: { + index_url: 'school/help/article/index' + location.search, + add_url: 'school/help/article/add'+ location.search, + edit_url: 'school/help/article/edit', + del_url: 'school/help/article/del', + multi_url: 'school/help/article/multi', + import_url: 'school/help/article/import', + table: 'school_help_article', + }, + pk: 'id', + sortName: 'weigh', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'help_cate_ids', title: __('Help_cate_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, + {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, + {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'weigh', title: __('Weigh'), operate: false}, + {field: 'views', title: __('Views')}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + }, + recyclebin: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + 'dragsort_url': '' + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: 'school/help/cate/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), align: 'left'}, + { + field: 'deletetime', + title: __('Deletetime'), + operate: 'RANGE', + addclass: 'datetimerange', + formatter: Table.api.formatter.datetime + }, + { + field: 'operate', + width: '140px', + title: __('Operate'), + table: table, + events: Table.api.events.operate, + buttons: [ + { + name: 'Restore', + text: __('Restore'), + classname: 'btn btn-xs btn-info btn-ajax btn-restoreit', + icon: 'fa fa-rotate-left', + url: 'school/help/cate/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'school/help/cate/destroy', + refresh: true + } + ], + formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + formatter: { + name: function (value, row, index) { + value = value.toString().replace(/(&|&)nbsp;/g, ' '); + var caret = row.haschild == 1 || row.ismenu == 1 ? '' : ''; + value = value.indexOf(" ") > -1 ? value.replace(/(.*) /, "$1" + caret) : caret + value; + + value = !row.ismenu || row.status == 'hidden' ? "" + value + "" : value; + return '' + value + ''; + }, + subnode: function (value, row, index) { + return ''; + } + }, + bindevent: function () { + Form.api.bindevent($("form[role=form]")); + } + } + }; + + + var add_url = function (row,dom) { + return 'school/help/cate/add?pid='+row.id; + } + + return Controller; +}); diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js index 603f0f8..a88f481 100644 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -166,6 +166,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'activity_order', + text: __('机构活动订单'), + title: __('机构活动订单'), + classname: 'btn btn-dialog', + icon: 'fa fa-cart-arrow-down', + dropdown : '更多', + url: activity_order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, { name: 'evaluate', text: __('查看用户评价'), @@ -289,6 +304,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'general/attachment/index?user_id='+row.id; } + var activity_order_url = function (row,dom) { + return 'school/classes/activity/order/order/index?user_id='+row.shop_id; + } + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/activity/activity.js b/public/assets/js/manystore/school/classes/activity/activity.js index 964680a..1d44f78 100644 --- a/public/assets/js/manystore/school/classes/activity/activity.js +++ b/public/assets/js/manystore/school/classes/activity/activity.js @@ -28,8 +28,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, {field: 'title', title: __('Title'), operate: 'LIKE'}, {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, @@ -59,7 +59,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'sign_start_time', title: __('Sign_start_time')}, {field: 'sign_end_time', title: __('Sign_end_time')}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, - {field: 'people_num', title: __('People_num')}, + // {field: 'people_num', title: __('People_num')}, {field: 'item', title: __('Item'), operate: 'LIKE'}, {field: 'weigh', title: __('Weigh'), operate: false}, {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, @@ -96,20 +96,35 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // } }, { - name: 'manystore', - text: __('查看机构'), - title: __('查看机构'), + name: 'order', + text: __('活动订单'), + title: __('活动订单'), classname: 'btn btn-dialog', - icon: 'fa fa-home', + icon: 'fa fa-calendar-check-o', dropdown : '更多', - url: manystore_url, + url: order_url, callback: function (data) { }, // visible: function (row) { - // return row.classes_evaluate_id; + // return row.status == '2'||row.status == '3'; // } }, + // { + // name: 'manystore', + // text: __('查看机构'), + // title: __('查看机构'), + // classname: 'btn btn-dialog', + // icon: 'fa fa-home', + // dropdown : '更多', + // url: manystore_url, + // callback: function (data) { + // + // }, + // // visible: function (row) { + // // return row.classes_evaluate_id; + // // } + // }, { name: 'activity', text: __('有审核!'), @@ -362,6 +377,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var activity_url = function (row,dom) { return 'school/classes/activity/activity_auth/edit/ids/'+row.classes_activity_auth_id; } + var order_url = function (row,dom) { + return 'school/classes/activity/order/order/index?classes_activity_id='+row.id; + } return Controller; diff --git a/public/assets/js/manystore/school/classes/activity/activity_auth.js b/public/assets/js/manystore/school/classes/activity/activity_auth.js index c14840e..db20a41 100644 --- a/public/assets/js/manystore/school/classes/activity/activity_auth.js +++ b/public/assets/js/manystore/school/classes/activity/activity_auth.js @@ -22,13 +22,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'weigh', + fixedColumns: true, + fixedRightNumber: 1, columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, + {field: 'classes_activity_id',visible:false, title: __('Classes_activity_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, {field: 'title', title: __('Title'), operate: 'LIKE'}, {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, diff --git a/public/assets/js/manystore/school/classes/activity/order/order.js b/public/assets/js/manystore/school/classes/activity/order/order.js index 8fdc160..cf3c428 100644 --- a/public/assets/js/manystore/school/classes/activity/order/order.js +++ b/public/assets/js/manystore/school/classes/activity/order/order.js @@ -9,6 +9,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin add_url: 'school/classes/activity/order/order/add', edit_url: 'school/classes/activity/order/order/edit', del_url: 'school/classes/activity/order/order/del', + cancel_url: 'school/classes/activity/order/order/cancel', + examine_url: 'school/classes/activity/order/order/examine', + verification_url: 'school/classes/activity/order/order/verification', + refund_url: 'school/classes/activity/order/order/refund', multi_url: 'school/classes/activity/order/order/multi', import_url: 'school/classes/activity/order/order/import', table: 'school_classes_activity_order', @@ -22,27 +26,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE'}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, + + {field: 'schoolclassesactivityorderdetail.title',visible:false, title: __('Schoolclassesactivityorderdetail.title'), operate: 'LIKE'}, + {field: 'schoolclassesactivityorderdetail.headimage',visible:false, title: __('Schoolclassesactivityorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'orderitem.name', title: __('Orderitem.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'orderitem.feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, + + {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, + + {field: 'user_id', title: __('User_id')}, + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + + + + {field: 'reason', title: __('Reason'), operate: 'LIKE'}, + {field: 'auth_user_id',visible:false, title: __('Auth_user_id')}, + {field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'}, + + {field: 'manystore_id', title: __('Manystore_id')}, {field: 'shop_id', title: __('Shop_id')}, {field: 'code', title: __('Code'), operate: 'LIKE'}, - {field: 'codeimage', title: __('Codeimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'codeoneimage', title: __('Codeoneimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'activity_order_detail_id', title: __('Activity_order_detail_id')}, + // {field: 'codeimage', title: __('Codeimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'codeoneimage', title: __('Codeoneimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'classes_activity_id', title: __('Classes_activity_id'),visible:false}, + {field: 'activity_order_detail_id', title: __('Activity_order_detail_id'),visible:false}, {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'}, - {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, - {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'}, + {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'}, {field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, - {field: 'before_status', title: __('Before_status'), searchList: {"-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')}, formatter: Table.api.formatter.status}, - {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, + // {field: 'before_status', title: __('Before_status'), searchList: {"-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')}, formatter: Table.api.formatter.status}, + // {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, {field: 'canceltime', title: __('Canceltime')}, {field: 'paytime', title: __('Paytime')}, {field: 'auth_time', title: __('Auth_time')}, @@ -55,24 +82,172 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'platform', title: __('Platform'), operate: 'LIKE'}, {field: 'verification_user_id', title: __('Verification_user_id')}, {field: 'verification_type', title: __('Verification_type'), operate: 'LIKE'}, - {field: 'reason', title: __('Reason'), operate: 'LIKE'}, - {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, - {field: 'auth_user_id', title: __('Auth_user_id')}, - {field: 'auth_type', title: __('Auth_type'), operate: 'LIKE'}, {field: 'createtime', title: __('Createtime')}, {field: 'updatetime', title: __('Updatetime')}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, - {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'}, - {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'}, - {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolclassesactivityorderdetail.title', title: __('Schoolclassesactivityorderdetail.title'), operate: 'LIKE'}, - {field: 'schoolclassesactivityorderdetail.headimage', title: __('Schoolclassesactivityorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'manystoreshop.name',visible:false, title: __('Manystoreshop.name'), operate: 'LIKE'}, + {field: 'manystoreshop.logo',visible:false, title: __('Manystoreshop.logo'), operate: 'LIKE'}, + {field: 'schoolclassesactivity.title',visible:false, title: __('Schoolclassesactivity.title'), operate: 'LIKE'}, + {field: 'schoolclassesactivity.headimage',visible:false, title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + + {name: 'cancel', + text: '取消订单', + icon: 'fa fa-user-times', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.cancel_url, + confirm: '确认取消订单', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //非免费订单只有未支付可取消 + if(row.status == '0' && row.orderitem.feel == '0'){ + return true; + } + //免费订单未支付和进行中都可取消 + if((row.status == '0' || row.status == '2'|| row.status == '3' )&& row.orderitem.feel == '1'){ + return true; + } + return false; + }}, + + {name: 'verification', + text: '预约核销', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.verification_url, + confirm: '预约核销', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //显示条件 只能待入住订单 + if(row.status == '3'){ + return true; + } + return false; + }}, + + {name: 'refund', + text: '退款重试(若失败双击本行查看原因)', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.refund_url, + confirm: '(本功能主要适用平台退款因账户原因失败需要重新操作的订单)重新发起退款,如果是第三方支付请等待回调!', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //显示条件 只能待入住订单 + if(row.status == '5'){ + return true; + } + return false; + } + }, + + { + name: 'examine', + text: __('预约审核'), + title: __('预约审核'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.examine_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '2'; + } + }, + + + { + name: 'order_detail', + text: __('下单活动'), + title: __('下单活动'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: order_detail_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + { + name: 'order_item', + text: __('下单规格'), + title: __('下单规格'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: order_item_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-dialog', + icon: 'fa fa-list', + dropdown : '更多', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + { + name: 'activity', + text: __('线上活动查看'), + title: __('线上活动查看'), + classname: 'btn btn-dialog', + icon: 'fa fa-leanpub', + dropdown : '更多', + url: activity_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -145,11 +320,35 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + examine: function(){ + $("#examine").on('click', function() { + $("#examine-form").attr("action",'school/classes/activity/order/order/examine').submit(); + }); + Controller.api.bindevent(); + }, + verification: function () { + Controller.api.bindevent(); + }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; + + var activity_url = function (row,dom) { + return 'school/classes/activity/activity/index?id='+row.classes_activity_id+ '&shop_id='+row.shop_id; + } + + var order_log_url = function (row,dom) { + return 'school/classes/activity/order/order_log/index?classes_activity_order_id='+row.id; + } + + var order_detail_url = function (row,dom) { + return 'school/classes/activity/order/order_detail/index?classes_activity_order_id='+row.id; + } + var order_item_url = function (row,dom) { + return 'school/classes/activity/order/order_item/index?classes_activity_order_id='+row.id; + } return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/activity/order/order_detail.js b/public/assets/js/manystore/school/classes/activity/order/order_detail.js index 5cbda23..84fcbde 100644 --- a/public/assets/js/manystore/school/classes/activity/order/order_detail.js +++ b/public/assets/js/manystore/school/classes/activity/order/order_detail.js @@ -26,11 +26,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, - {field: 'user_id', title: __('User_id')}, + {field: 'classes_activity_order_id',visible:false, title: __('Classes_activity_order_id')}, + {field: 'classes_activity_id',visible:false, title: __('Classes_activity_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, + {field: 'user_id',visible:false, title: __('User_id')}, {field: 'title', title: __('Title'), operate: 'LIKE'}, {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, @@ -48,33 +48,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'sign_start_time', title: __('Sign_start_time')}, {field: 'sign_end_time', title: __('Sign_end_time')}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, - {field: 'people_num', title: __('People_num')}, + {field: 'people_num',visible:false, title: __('People_num')}, {field: 'item', title: __('Item'), operate: 'LIKE'}, - {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, - {field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, - {field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, - {field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal}, - {field: 'sale', title: __('Sale')}, - {field: 'stock', title: __('Stock')}, - {field: 'views', title: __('Views')}, - // {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status}, - {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal}, - {field: 'add_id', title: __('Add_id')}, + {field: 'status',visible:false, title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + {field: 'weigh',visible:false, title: __('Weigh'), operate: false}, + // {field: 'recommend',visible:false, title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, + // {field: 'hot', visible:false,title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, + // {field: 'new',visible:false, title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, + // {field: 'selfhot',visible:false, title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal}, + // {field: 'sale', visible:false,title: __('Sale')}, + // {field: 'stock',visible:false, title: __('Stock')}, + // {field: 'views',visible:false, title: __('Views')}, + // // {field: 'expirestatus', title: __('Expirestatus'), searchList: {"1":__('Expirestatus 1'),"2":__('Expirestatus 2')}, formatter: Table.api.formatter.status}, + // {field: 'add_type',visible:false, title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal}, + // {field: 'add_id',visible:false, title: __('Add_id')}, {field: 'createtime', title: __('Createtime')}, {field: 'updatetime', title: __('Updatetime')}, - {field: 'schoolclassesactivityorder.order_no', title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolclassesactivityorder.pay_no', title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'}, - {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'}, - {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, - {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'schoolclassesactivityorder.order_no',visible:false, title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'}, + {field: 'schoolclassesactivityorder.pay_no',visible:false, title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'}, + {field: 'schoolclassesactivity.title',visible:false, title: __('Schoolclassesactivity.title'), operate: 'LIKE'}, + {field: 'schoolclassesactivity.headimage',visible:false, title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'manystoreshop.name',visible:false, title: __('Manystoreshop.name'), operate: 'LIKE'}, + {field: 'manystoreshop.logo',visible:false, title: __('Manystoreshop.logo'), operate: 'LIKE'}, + {field: 'user.nickname',visible:false, title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname',visible:false, title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.mobile',visible:false, title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar',visible:false, title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/manystore/school/classes/activity/order/order_item.js b/public/assets/js/manystore/school/classes/activity/order/order_item.js index 4473fe8..a7de2cc 100644 --- a/public/assets/js/manystore/school/classes/activity/order/order_item.js +++ b/public/assets/js/manystore/school/classes/activity/order/order_item.js @@ -26,11 +26,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, - {field: 'classes_activity_id', title: __('Classes_activity_id')}, - {field: 'classes_activity_item_id', title: __('Classes_activity_item_id')}, + {field: 'feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, + {field: 'classes_activity_order_id',visible:false, title: __('Classes_activity_order_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, + {field: 'classes_activity_id',visible:false, title: __('Classes_activity_id')}, + {field: 'classes_activity_item_id',visible:false, title: __('Classes_activity_item_id')}, {field: 'name', title: __('Name'), operate: 'LIKE'}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'limit_num', title: __('Limit_num')}, @@ -38,20 +39,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'sex', title: __('Sex'), searchList: {"1":__('Sex 1'),"2":__('Sex 2'),"3":__('Sex 3')}, formatter: Table.api.formatter.normal}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'sign_num', title: __('Sign_num')}, - {field: 'verification_num', title: __('Verification_num')}, + // {field: 'sign_num', title: __('Sign_num')}, + // {field: 'verification_num', title: __('Verification_num')}, {field: 'createtime', title: __('Createtime')}, {field: 'updatetime', title: __('Updatetime')}, - {field: 'feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, - {field: 'schoolclassesactivityorder.order_no', title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolclassesactivityorder.pay_no', title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, - {field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'}, - {field: 'schoolclassesactivity.title', title: __('Schoolclassesactivity.title'), operate: 'LIKE'}, - {field: 'schoolclassesactivity.headimage', title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolclassesactivityitem.name', title: __('Schoolclassesactivityitem.name'), operate: 'LIKE'}, - {field: 'schoolclassesactivityitem.price', title: __('Schoolclassesactivityitem.price'), operate:'BETWEEN'}, + + {field: 'schoolclassesactivityorder.order_no',visible:false, title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'}, + {field: 'schoolclassesactivityorder.pay_no',visible:false, title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'}, + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'manystoreshop.name',visible:false, title: __('Manystoreshop.name'), operate: 'LIKE'}, + {field: 'manystoreshop.logo',visible:false, title: __('Manystoreshop.logo'), operate: 'LIKE'}, + {field: 'schoolclassesactivity.title',visible:false, title: __('Schoolclassesactivity.title'), operate: 'LIKE'}, + {field: 'schoolclassesactivity.headimage',visible:false, title: __('Schoolclassesactivity.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'schoolclassesactivityitem.name',visible:false, title: __('Schoolclassesactivityitem.name'), operate: 'LIKE'}, + {field: 'schoolclassesactivityitem.price',visible:false, title: __('Schoolclassesactivityitem.price'), operate:'BETWEEN'}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/manystore/school/classes/activity/order/order_log.js b/public/assets/js/manystore/school/classes/activity/order/order_log.js index d9f53f8..69c9629 100644 --- a/public/assets/js/manystore/school/classes/activity/order/order_log.js +++ b/public/assets/js/manystore/school/classes/activity/order/order_log.js @@ -26,15 +26,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_activity_order_id', title: __('Classes_activity_order_id')}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + {field: 'classes_activity_order_id',visible:false, title: __('Classes_activity_order_id')}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, {field: 'log_text', title: __('Log_text'), operate: 'LIKE'}, {field: 'oper_type', title: __('Oper_type'), operate: 'LIKE'}, {field: 'oper_id', title: __('Oper_id')}, {field: 'createtime', title: __('Createtime')}, {field: 'updatetime', title: __('Updatetime')}, - {field: 'schoolclassesactivityorder.order_no', title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolclassesactivityorder.pay_no', title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'}, + {field: 'schoolclassesactivityorder.order_no',visible:false, title: __('Schoolclassesactivityorder.order_no'), operate: 'LIKE'}, + {field: 'schoolclassesactivityorder.pay_no',visible:false, title: __('Schoolclassesactivityorder.pay_no'), operate: 'LIKE'}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/manystore/user/user.js b/public/assets/js/manystore/user/user.js index 2e0aa40..512db13 100644 --- a/public/assets/js/manystore/user/user.js +++ b/public/assets/js/manystore/user/user.js @@ -96,6 +96,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'activity_order', + text: __('机构活动订单'), + title: __('机构活动订单'), + classname: 'btn btn-dialog', + icon: 'fa fa-cart-arrow-down', + dropdown : '更多', + url: activity_order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, { name: 'evaluate', text: __('查看用户评价'), @@ -148,6 +163,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var evaluate_url= function (row,dom) { return 'school/classes/evaluate/index?user_id='+row.id; } + var activity_order_url = function (row,dom) { + return 'school/classes/activity/order/order/index?user_id='+row.shop_id; + } return Controller; }); \ No newline at end of file