diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index 4f638d2..e529569 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -58,6 +58,8 @@ class Index extends Backend $this->shopModel = new ManystoreShop(); $this->view->assign("statusList", $this->shopModel->getStatusList()); $this->view->assign("typeList", $this->shopModel->getTypeList()); + $this->view->assign("shop_backend_url", config("site.shop_backend_url")); + } @@ -190,11 +192,11 @@ class Index extends Backend if($params["status"] == 'hidden')$params["status"] = 'normal'; //当前密码 - $password = $params['password'] ? $params['password'] : \app\common\model\dyqc\ManystoreShop::getDefaultPassword($params["type"],$params["user_id"],$params); +// $password = $params['password'] ? $params['password'] : \app\common\model\dyqc\ManystoreShop::getDefaultPassword($params["type"],$params["user_id"],$params); //调用通过事件 - $data = ['shop' => $row,"password"=>$password]; - \think\Hook::listen('shop_auth_success_after', $data); +// $data = ['shop' => $row,"password"=>$password]; +// \think\Hook::listen('shop_auth_success_after', $data); } @@ -203,8 +205,8 @@ class Index extends Backend $params["status"] = 'hidden'; //调用通过事件 //调用通过事件 - $data = ['shop' => $row]; - \think\Hook::listen('shop_auth_fail_after', $data); +// $data = ['shop' => $row]; +// \think\Hook::listen('shop_auth_fail_after', $data); } @@ -403,6 +405,21 @@ class Index extends Backend $this->error(__("修改商家信息资料失败")); } + if($this->success_auth){ + //当前密码 + $password = $params['password'] ? $params['password'] : \app\common\model\dyqc\ManystoreShop::getDefaultPassword($params["type"],$params["user_id"],$params); + //调用通过事件 + $data = ['shop' => $row,"password"=>$password]; + \think\Hook::listen('shop_auth_success_after', $data); + } + if($this->error_auth){ + + //调用通过事件 + $data = ['shop' => $row]; + \think\Hook::listen('shop_auth_fail_after', $data); + } + + if ($params['password']) { if (!Validate::is($params['password'], '\S{6,16}')) { $this->error(__("Please input correct password")); diff --git a/application/admin/controller/school/Message.php b/application/admin/controller/school/Message.php index 3726907..728d563 100644 --- a/application/admin/controller/school/Message.php +++ b/application/admin/controller/school/Message.php @@ -25,6 +25,7 @@ class Message extends Backend $this->view->assign("platformList", $this->model->getPlatformList()); $this->view->assign("operTypeList", $this->model->getOperTypeList()); $this->view->assign("toTypeList", $this->model->getToTypeList()); + $this->view->assign("typeList", $this->model->getTypeList()); $this->view->assign("statusList", $this->model->getStatusList()); $this->view->assign("miniTypeList", $this->model->getMiniTypeList()); } diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php index a82012f..9eabad6 100644 --- a/application/admin/controller/school/classes/ClassesLib.php +++ b/application/admin/controller/school/classes/ClassesLib.php @@ -40,6 +40,7 @@ class ClassesLib extends Backend protected $have_auth = false; protected $success_auth = false; + protected $error_auth = false; public function _initialize() { @@ -130,11 +131,29 @@ class ClassesLib extends Backend //审核通过 $this->success_auth = true; } + + if($params["auth_status"] == '2'){ + //审核通过 + $this->error_auth = true; + } } //审核通过 if($this->success_auth){ //如果是平台下架,则更新成正常下架 if($params["status"] == '3') $params["status"] = '2'; + + //调用通过事件 +// $data = ['shop' => $row]; +// \think\Hook::listen('classes_auth_success_after', $data); + } + + + if($this->error_auth){ + + //调用通过事件 +// $data = ['shop' => $row]; +// \think\Hook::listen('classes_auth_fail_after', $data); + } }else{ @@ -387,6 +406,31 @@ class ClassesLib extends Backend } $this->update_check($params,$row); $result = $row->allowField(true)->save($params); + + + if($this->success_auth){ + //调用通过事件 + $data = ['classes' => $row]; + \think\Hook::listen('classes_auth_success_after', $data); + } + + + if($this->error_auth){ + //调用通过事件 + $data = ['classes' => $row]; + \think\Hook::listen('classes_auth_fail_after', $data); + + } + // protected $have_auth = false; + if($this->have_auth){ + //调用通过事件 + $data = ['classes' => $row]; + \think\Hook::listen('classes_auth_need_after', $data); + + } + + + Db::commit(); } catch (ValidateException|PDOException|Exception $e) { Db::rollback(); diff --git a/application/admin/controller/school/classes/hourorder/Order.php b/application/admin/controller/school/classes/hourorder/Order.php index 2b6f4a2..e0d105b 100644 --- a/application/admin/controller/school/classes/hourorder/Order.php +++ b/application/admin/controller/school/classes/hourorder/Order.php @@ -3,6 +3,12 @@ namespace app\admin\controller\school\classes\hourorder; use app\common\controller\Backend; +use think\Db; +use think\db\exception\DataNotFoundException; +use think\db\exception\ModelNotFoundException; +use think\exception\DbException; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 课时订单 @@ -18,11 +24,16 @@ class Order extends Backend */ protected $model = null; + protected $qSwitch = true; + protected $qFields = ["classes_order_id","classes_lib_spec_id","user_id","classes_order_detail_id","classes_lib_id"]; + public function _initialize() { - parent::_initialize(); $this->model = new \app\admin\model\school\classes\hourorder\Order; + parent::_initialize(); + $this->view->assign("statusList", $this->model->getStatusList()); + $this->view->assign("authStatusList", $this->model->getAuthStatusList()); } @@ -72,4 +83,242 @@ class Order extends Backend return $this->view->fetch(); } + + + + + + + + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + + //记录代下单人信息 + $param = [ + "type" =>'2', + "help_user_id" =>$this->auth->id, + "help_type" => 'admin', + ]; + //确认订单 + $res = (new \app\common\model\school\classes\hourorder\Order)->confirm($this->auth->id,$params['classes_order_id'],null, $params['classes_lib_spec_id'],$param, true); + $remark = "总后台管理员帮忙下课时预约"; + //创建订单 + $result = (new \app\common\model\school\classes\hourorder\Order)->cacheCreateOrder($res['order_no'], $this->auth->id,$remark, true); + + + + } catch (ValidateException|PDOException|\Exception $e) { + + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + /** + * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + public function edit($ids = null) + { + $row = $this->model->get($ids); + if (!$row) { + $this->error(__('No Results were found')); + } + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + $result = false; + + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException()->validate($validate); + } + + + + + //记录代下单人信息 + + //修改订单课时 + $result = (new \app\common\model\school\classes\hourorder\Order)->updateClassesSpec($row["id"],$params["classes_lib_spec_id"],0,true,'admin',$this->auth->id,true); + + + + } catch (ValidateException|PDOException|\Exception $e) { + + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); + } + + + + + /** + * 删除 + * + * @param $ids + * @return void + * @throws DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + */ + public function del($ids = null) + { + if (false === $this->request->isPost()) { + $this->error(__("Invalid parameters")); + } + $ids = $ids ?: $this->request->post("ids"); + if (empty($ids)) { + $this->error(__('Parameter %s can not be empty', 'ids')); + } + $pk = $this->model->getPk(); + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds)) { + $this->model->where($this->dataLimitField, 'in', $adminIds); + } + $list = $this->model->where($pk, 'in', $ids)->select(); + + $count = 0; + + try { + foreach ($list as $item) { + $res = (new \app\common\model\school\classes\hourorder\Order)->cancel($item["id"],0,true,'admin',$this->auth->id,true); + $count++; + } + + } catch (PDOException|\Exception $e) { + + $this->error($e->getMessage()); + } + if ($count) { + $this->success(); + } + $this->error(__('No rows were deleted')); + } + + + + + /**预约审核 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function examine($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + + + $auth_status = $params["auth_status"]; + $reason = $params["reason"]; + $model = (new \app\common\model\school\classes\hourorder\Order); + $model->examine($params["id"],$auth_status,$reason,0,true,'admin',$this->auth->id,true); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + + + /** + * 后台核销 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function verification($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $model = (new \app\common\model\school\classes\hourorder\Order); + $model->verification($ids,0,true,'admin',$this->auth->id,true); + + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success('核销成功!'); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + + + + + } diff --git a/application/admin/controller/school/classes/order/Order.php b/application/admin/controller/school/classes/order/Order.php index c40c9fd..894655a 100644 --- a/application/admin/controller/school/classes/order/Order.php +++ b/application/admin/controller/school/classes/order/Order.php @@ -77,4 +77,32 @@ 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\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(); + } + } diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index 3ce698a..948664b 100644 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -247,4 +247,33 @@ class User extends Backend return json(['list' => $list, 'total' => $total]); } + + + /**变更学员信息(教练专属) + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function changeuser(){ + if($this->request->isPost()) + { + try{ + $people_name = $this->request->param('people_name/s'); + $people_mobile = $this->request->param('people_mobile/s'); + $user = \app\common\model\User::where("mobile",$people_mobile)->find(); + //检测更新教练下单学员账号创建状态 2022/8/27 new + if(!$user)$user = (new \app\common\model\User)->addUserByMobile($people_mobile,$people_name); + $user['nickname'] = $people_name; + $user->save(); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + //退押金 + $this->success("已成功创建{$people_name}"); + } +// $row = $this->model->get($param['ids']); +// $this->view->assign('vo', $row); + return $this->view->fetch(); + } + } diff --git a/application/admin/lang/zh-cn/school/classes/classes_lib.php b/application/admin/lang/zh-cn/school/classes/classes_lib.php index 372c5ef..a586afc 100644 --- a/application/admin/lang/zh-cn/school/classes/classes_lib.php +++ b/application/admin/lang/zh-cn/school/classes/classes_lib.php @@ -4,8 +4,8 @@ return [ 'Manystore_id' => '机构账号id', 'Shop_id' => '机构店铺id', 'User_id' => '主讲师用户id', - 'Classes_cate_ids' => '平台课程分类ids', - 'Classes_label_ids' => '平台课程类型ids', + 'Classes_cate_ids' => '平台课程分类', + 'Classes_label_ids' => '平台课程热门标签', 'Self_label_tag' => '机构特色标签', 'Add_type' => '添加人类型', 'Add_type 1' => '机构', diff --git a/application/admin/lang/zh-cn/school/classes/hourorder/order.php b/application/admin/lang/zh-cn/school/classes/hourorder/order.php index 3432102..d9fb0de 100644 --- a/application/admin/lang/zh-cn/school/classes/hourorder/order.php +++ b/application/admin/lang/zh-cn/school/classes/hourorder/order.php @@ -2,8 +2,21 @@ return [ 'Order_no' => '订单号', + + 'Edit'=>'修改用户预约的课时', + 'Add'=>'帮用户预约课时', + 'Delete'=>'帮用户取消预约', + 'Del'=>'帮用户取消预约', + 'Auth_status' => '审核状态', + 'Auth_status 0' => '待审核', + 'Auth_status 1' => '审核通过', + 'Auth_status 2' => '审核失败', + 'Reason' => '审核不通过原因', + 'Auth_time' => '审核时间', + 'Admin_id' => '审核管理员id', + 'Classes_order_id' => '课程订单id', - 'Classes_lib_spec_id' => '课时id', + 'Classes_lib_spec_id' => '选择要预约的课时', 'User_id' => '下单人id', 'Classes_order_detail_id' => '订单课程id', 'Classes_lib_id' => '课程id', diff --git a/application/admin/lang/zh-cn/school/message.php b/application/admin/lang/zh-cn/school/message.php index d2c0e84..82dcca1 100644 --- a/application/admin/lang/zh-cn/school/message.php +++ b/application/admin/lang/zh-cn/school/message.php @@ -1,6 +1,10 @@ '已读状态', + 'Type 1' => '未读', + 'Type 2' => '已读', + 'Weigh' => '权重', 'Platform' => '消息平台', 'Platform admin' => '总后台', 'Platform user' => '用户端', diff --git a/application/admin/model/school/Message.php b/application/admin/model/school/Message.php index 45e1393..e9c6ab0 100644 --- a/application/admin/model/school/Message.php +++ b/application/admin/model/school/Message.php @@ -29,11 +29,36 @@ class Message extends Model 'oper_type_text', 'to_type_text', 'status_text', - 'mini_type_text' + 'mini_type_text', + "type_text" ]; - - + protected static function init() + { + self::afterInsert(function ($row) { + if (!$row['weigh']) { + $pk = $row->getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + + public function getTypeList() + { + return ['1' => __('Type 1'), '2' => __('Type 2')]; + } + + public function getTypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); + $list = $this->getTypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getPlatformList() { return ['admin' => __('Platform admin'), 'user' => __('Platform user'), 'shop' => __('Platform shop')]; @@ -60,6 +85,8 @@ class Message extends Model } + + public function getPlatformTextAttr($value, $data) { $value = $value ?: ($data['platform'] ?? ''); diff --git a/application/admin/model/school/classes/hourorder/Order.php b/application/admin/model/school/classes/hourorder/Order.php index 5fa1483..e52c1dd 100644 --- a/application/admin/model/school/classes/hourorder/Order.php +++ b/application/admin/model/school/classes/hourorder/Order.php @@ -30,11 +30,33 @@ class Order extends Model 'status_text', 'reservation_time_text', 'finish_time_text', - 'cancel_time_text' + 'cancel_time_text', + 'auth_status_text', ]; - - + + public function getAuthStatusList() + { + return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; + } + + public function getAuthStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); + $list = $this->getAuthStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getStatusList() { return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; @@ -55,12 +77,6 @@ class Order extends Model } - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } public function getReservationTimeTextAttr($value, $data) diff --git a/application/admin/view/manystore/index/add.html b/application/admin/view/manystore/index/add.html index 1165bb4..22a177f 100644 --- a/application/admin/view/manystore/index/add.html +++ b/application/admin/view/manystore/index/add.html @@ -39,9 +39,16 @@
+ + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + +
+
diff --git a/application/admin/view/manystore/index/edit.html b/application/admin/view/manystore/index/edit.html index 469a0a4..f45c967 100644 --- a/application/admin/view/manystore/index/edit.html +++ b/application/admin/view/manystore/index/edit.html @@ -40,7 +40,16 @@
+ + + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + + +
+
diff --git a/application/admin/view/manystore/index/index.html b/application/admin/view/manystore/index/index.html index 6d4c4d4..6d2f500 100644 --- a/application/admin/view/manystore/index/index.html +++ b/application/admin/view/manystore/index/index.html @@ -36,3 +36,6 @@
+ \ No newline at end of file diff --git a/application/admin/view/manystore/user_auth/add.html b/application/admin/view/manystore/user_auth/add.html index a111e11..18b283c 100644 --- a/application/admin/view/manystore/user_auth/add.html +++ b/application/admin/view/manystore/user_auth/add.html @@ -10,6 +10,12 @@
+ + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + +
diff --git a/application/admin/view/manystore/user_auth/edit.html b/application/admin/view/manystore/user_auth/edit.html index c9afde6..606a80a 100644 --- a/application/admin/view/manystore/user_auth/edit.html +++ b/application/admin/view/manystore/user_auth/edit.html @@ -10,6 +10,13 @@
+ + + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + +
diff --git a/application/admin/view/school/classes/classes_lib/add.html b/application/admin/view/school/classes/classes_lib/add.html index 90335b3..ddc36d2 100644 --- a/application/admin/view/school/classes/classes_lib/add.html +++ b/application/admin/view/school/classes/classes_lib/add.html @@ -22,6 +22,13 @@
+ + + + (没找到讲师则点击按钮创建讲师后重新下拉框选讲师) + {:__('Add')} + +
@@ -29,12 +36,25 @@
+ + + (没找到分类则点击按钮创建分类后重新下拉框选分类) + {:__('Add')} + +
+ + + (没找到标签则点击按钮创建标签后重新下拉框选标签) + {:__('Add')} + + +
diff --git a/application/admin/view/school/classes/classes_lib/edit.html b/application/admin/view/school/classes/classes_lib/edit.html index 63bacf3..7d3dc21 100644 --- a/application/admin/view/school/classes/classes_lib/edit.html +++ b/application/admin/view/school/classes/classes_lib/edit.html @@ -23,6 +23,12 @@
+ + + (没找到讲师则点击按钮创建讲师后重新下拉框选讲师) + {:__('Add')} + +
@@ -30,12 +36,24 @@
+ + + (没找到分类则点击按钮创建分类后重新下拉框选分类) + {:__('Add')} + +
+ + + (没找到标签则点击按钮创建标签后重新下拉框选标签) + {:__('Add')} + +
@@ -338,6 +356,8 @@
+ +
diff --git a/application/admin/view/school/classes/classes_lib/index.html b/application/admin/view/school/classes/classes_lib/index.html index f7a8351..364a02e 100644 --- a/application/admin/view/school/classes/classes_lib/index.html +++ b/application/admin/view/school/classes/classes_lib/index.html @@ -16,6 +16,9 @@
+ + + {:__('Add')} {:__('Edit')} diff --git a/application/admin/view/school/classes/hourorder/order/add.html b/application/admin/view/school/classes/hourorder/order/add.html index ffe329c..b089e83 100644 --- a/application/admin/view/school/classes/hourorder/order/add.html +++ b/application/admin/view/school/classes/hourorder/order/add.html @@ -1,113 +1,16 @@
-
- -
- -
-
-
- -
- -
-
+ + +
- +
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- {foreach name="statusList" item="vo"} - - {/foreach} -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
+
diff --git a/application/admin/view/school/classes/order/order_detail/index.html b/application/admin/view/school/classes/order/order_detail/index.html index 9b0c19e..8d47510 100644 --- a/application/admin/view/school/classes/order/order_detail/index.html +++ b/application/admin/view/school/classes/order/order_detail/index.html @@ -7,18 +7,18 @@ diff --git a/application/admin/view/school/classes/order/order_log/index.html b/application/admin/view/school/classes/order/order_log/index.html index b50b562..8e46594 100644 --- a/application/admin/view/school/classes/order/order_log/index.html +++ b/application/admin/view/school/classes/order/order_log/index.html @@ -17,25 +17,25 @@
- {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + +
diff --git a/application/admin/view/school/classes/teacher/add.html b/application/admin/view/school/classes/teacher/add.html index ad20a3a..5df8909 100644 --- a/application/admin/view/school/classes/teacher/add.html +++ b/application/admin/view/school/classes/teacher/add.html @@ -16,8 +16,15 @@
+ + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + +
+
diff --git a/application/admin/view/school/classes/teacher/edit.html b/application/admin/view/school/classes/teacher/edit.html index 099f263..c870409 100644 --- a/application/admin/view/school/classes/teacher/edit.html +++ b/application/admin/view/school/classes/teacher/edit.html @@ -16,6 +16,13 @@
+ + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + + +
diff --git a/application/admin/view/school/classes/verification/add.html b/application/admin/view/school/classes/verification/add.html index 9fcdc8b..b65bef3 100644 --- a/application/admin/view/school/classes/verification/add.html +++ b/application/admin/view/school/classes/verification/add.html @@ -16,6 +16,12 @@
+ + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + +
diff --git a/application/admin/view/school/classes/verification/edit.html b/application/admin/view/school/classes/verification/edit.html index ee5ca46..1faffd1 100644 --- a/application/admin/view/school/classes/verification/edit.html +++ b/application/admin/view/school/classes/verification/edit.html @@ -16,6 +16,12 @@
+ + + (没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + +
diff --git a/application/admin/view/school/classes/virtual_user/edit.html b/application/admin/view/school/classes/virtual_user/edit.html index a9411fc..ce52094 100644 --- a/application/admin/view/school/classes/virtual_user/edit.html +++ b/application/admin/view/school/classes/virtual_user/edit.html @@ -23,8 +23,7 @@
- -
+
@@ -32,6 +31,30 @@
+
+ +
+ + + +
+
+
+ +
+ + + +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ model = new \app\common\model\school\Message(); + parent::_initialize(); + + //判断登录用户是否是员工 + } + + + /** + * @ApiTitle( 站内信详情-确认已读) + * @ApiSummary(站内信详情-确认已读) + * @ApiRoute(/api/school/message/detail) + * @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::getDetail($id); + } catch (\Exception $e){ +// Log::log($e->getMessage()); + $this->error($e->getMessage(),['errcode'=>$e->getCode()]); + } + $this->success('获取成功', ['detail' => $res]); + } + + + + + + /** + * @ApiTitle( 我的消息列表接口) + * @ApiSummary(我的消息列表接口) + * @ApiRoute(/api/school/message/message_list) + * @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 = "status", type = "string",required=false,description = "消息总类型:system=系统消息,classes=课程消息,order=订单消息") + * @ApiParams(name = "mini_type", type = "string",required=false,description = "小消息类型:order_notice=课程订单通知,classes_auth=课程报名审核,classes_apply=课程上新审核,shop_apply=机构审核,classes_order_notice=课时预约,user_auth=机构授权用户信息,aftercare=售后服务,other=其他") + *@ApiParams(name = "type", type = "string",required=false,description = "已读状态:1=未读,2=已读") + * + * @ApiReturn({ + * + *}) + */ + public function message_list() + { + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + $page = $this->request->get('page/d', 0); //页数 + $limit = $this->request->get('limit/d', 0); //条数 + $keywords = $this->request->get('keywords/s', ''); //搜索关键字 + $status = $this->request->get('status/s', ''); //搜索关键字 + $mini_type = $this->request->get('mini_type/s', ''); //搜索关键字 + $type = $this->request->get('type/s', ''); //搜索关键字 +// $type = $this->request->get('type/s', ''); //筛选学员和教练单 + $to_id = $user_id; + try{ + //当前申请状态 + $res = $this->model::messageList($page, $limit,$to_id,$keywords,$status,$mini_type,$type); +// if($user_id =='670153'){ +// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); +// } + }catch (\Exception $e){ + + $this->error($e->getMessage()); + } + $this->success('查询成功', $res); + } + + + /** + * @ApiTitle( 我的消息数量接口) + * @ApiSummary(我的消息数量接口) + * @ApiRoute(/api/school/message/message_count) + * @ApiMethod(GET) + * @ApiReturn({ + * + *}) + */ + public function message_count(){ + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + + try{ + $res = $this->model::messageCount($user_id); + }catch (\Throwable $e){ + $this->error($e->getMessage()); + } + $this->success('查询成功', $res); + } + + +} + diff --git a/application/common/hooks.php b/application/common/hooks.php index de55ef9..7c0374e 100644 --- a/application/common/hooks.php +++ b/application/common/hooks.php @@ -12,7 +12,7 @@ $defaultHooks = [ 'app\\common\\listener\\classesorder\\OrderHook' ], 'classes_order_cancel_after' => [ // 订单取消后 - 'addons\\shopro\\listener\\classesorder\\OrderHook' + 'app\\common\\listener\\classesorder\\OrderHook' ], 'classes_order_finish_after' => [ // 订单完成后 @@ -54,7 +54,7 @@ $hourHooks = [ 'app\\common\\listener\\classeshourorder\\OrderHook' ], 'classeshour_order_cancel_after' => [ // 订单取消后 - 'addons\\shopro\\listener\\classeshourorder\\OrderHook' + 'app\\common\\listener\\classeshourorder\\OrderHook' ], ]; diff --git a/application/common/library/Auth.php b/application/common/library/Auth.php index cea4d32..c98aa9a 100644 --- a/application/common/library/Auth.php +++ b/application/common/library/Auth.php @@ -201,6 +201,77 @@ class Auth return true; } + + /** + * 注册用户(自定义) + * + * @param string $username 用户名 + * @param string $password 密码 + * @param string $email 邮箱 + * @param string $mobile 手机号 + * @param array $extend 扩展参数 + */ + public function registerNoLogin($username, $password, $email = '', $mobile = '', $extend = []) + { + // 检测用户名、昵称、邮箱、手机号是否存在 + if (User::getByUsername($username)) { + $this->setError('Username already exist'); + return false; + } + if (User::getByNickname($username)) { + $this->setError('Nickname already exist'); + return false; + } + if ($email && User::getByEmail($email)) { + $this->setError('Email already exist'); + return false; + } + if ($mobile && User::getByMobile($mobile)) { + $this->setError('Mobile already exist'); + return false; + } + + $ip = request()->ip(); + $time = time(); + + $data = [ + 'username' => $username, + 'password' => $password, + 'email' => $email, + 'mobile' => $mobile, + 'level' => 1, + 'score' => 0, + 'avatar' => '', + ]; + $params = array_merge($data, [ + 'nickname' => preg_match("/^1[3-9]{1}\d{9}$/",$username) ? substr_replace($username,'****',3,4) : $username, + 'salt' => Random::alnum(), + 'jointime' => $time, + 'joinip' => $ip, + 'logintime' => $time, + 'loginip' => $ip, + 'prevtime' => $time, + 'status' => 'normal' + ]); + $params['password'] = $this->getEncryptPassword($password, $params['salt']); + $params = array_merge($params, $extend); + + //账号注册时需要开启事务,避免出现垃圾数据 + Db::startTrans(); + try { + $user = User::create($params, true); + + //注册成功的事件 + Hook::listen("user_register_successed", $this->_user, $data); + Db::commit(); + } catch (Exception $e) { + $this->setError($e->getMessage()); + Db::rollback(); + return false; + } + return User::get($user->id); + } + /** * 用户登录 * diff --git a/application/common/listener/classes/ClassesHook.php b/application/common/listener/classes/ClassesHook.php new file mode 100644 index 0000000..a0d26f1 --- /dev/null +++ b/application/common/listener/classes/ClassesHook.php @@ -0,0 +1,106 @@ +$shop] = $params; + + + //记录订单日志 + + $desc = "您申请的认证{$shop['name']}已提交审核,审核时间为1-3日内,请耐心等待审核结果"; + + $title = "入驻申请提交"; + $mini_type = "shop_apply"; + $to_type="user"; + $to_id = $shop["user_id"]; + $status ="system"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"shop_create_after", + "shop_id"=>$shop["id"], + "desc"=>$shop["desc"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + + + + } + + + + // 机构账号审核成功后 + public function shopAuthSuccessAfter(&$params) + { + ['shop' => $shop,"password"=>$password] = $params; + $user = $shop->user; + $mobile = $user['mobile'] ?? ""; + $shop_backend_url = config("site.shop_backend_ur"); + $desc = "您申请的认证:{$shop['name']}已审核通过,您可登录官方后台补充完其余资料,并开始发布课程
+ 后台地址是: {$shop_backend_url}
+ 账号是: {$shop['username']} 或 您的手机号 {$mobile}
+ 初始化密码是: {$password}
+"; + + $title = "入驻申请通过"; + $mini_type = "shop_apply"; + $to_type="user"; + $to_id = $shop["user_id"]; + $status ="system"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"shop_auth_success_after", + "shop_id"=>$shop["id"], + "desc"=>$shop["desc"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + + + } + + // 机构账号审核失败后 + public function shopAuthFailAfter(&$params) + { + ["shop"=>$shop] = $params; + + + //记录订单日志 + + $desc = "您申请的认证{$shop['name']}审核未通过,未通过原因为:{$shop['reason']},如已整改,可重新发起申请"; + + $title = "入驻申请失败"; + $mini_type = "shop_apply"; + $to_type="user"; + $to_id = $shop["user_id"]; + $status ="system"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"shop_auth_fail_after", + "shop_id"=>$shop["id"], + "desc"=>$shop["desc"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + + + + } + + +} \ No newline at end of file diff --git a/application/common/listener/classeshourorder/OrderHook.php b/application/common/listener/classeshourorder/OrderHook.php index b471cb1..c6a0f0d 100644 --- a/application/common/listener/classeshourorder/OrderHook.php +++ b/application/common/listener/classeshourorder/OrderHook.php @@ -1,18 +1,46 @@ $user_id, 'classes_order_id'=>$classes_order_id,'param'=>$param, 'order_no'=>$order_no, 'price_info'=>$price_info,'classes_lib_spec_id'=>$classes_lib_spec_id] = $params; + + } // 订单创建成功后 public function classeshourOrderCreateAfter(&$params) { + ["order"=>$order] = $params; + $detail = $order->detail; + //记录订单日志 + if($order["type"] == "1"){ + $desc = "{$detail["title"]}课程课时{$order["name"]}课程预约下单成功,等待机构老师审核"; + }else{ + $desc = "{$detail["title"]}课程课时{$order["name"]}预约机构老师代下单成功"; + } + $title = "创建课时预约成功"; + $mini_type = "classes_auth"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="order"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classeshour_order_create_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); } @@ -20,6 +48,30 @@ class OrderHook // 订单变更课时后 public function classeshourOrderUpdateAfter(&$params) { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + //插入订单取消日志 + if(!$user_id ||$order["user_id"] !=$user_id ){ + $desc = "[员工操作]预约{$detail["title"]}课程订单规格已变更课时为{$order["name"]}"; + }else{ + $desc = "预约{$detail["title"]}课程订单规格已变更课时为{$order["name"]}"; + } + + $title = "课时预约单更换课时"; + $mini_type = "classes_order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="order"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classeshour_order_update_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + } @@ -29,18 +81,93 @@ class OrderHook // 订单审核通过后 public function classeshourOrderAuthSuccessAfter(&$params) { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + //插入订单取消日志 + if(!$user_id ||$order["user_id"] !=$user_id ){ + $pron = "[员工操作]"; + }else{ + $pron = ""; + } + $desc = $pron."{$detail["title"]}课程课时{$order["name"]}预约单审核成功,预约成功等待核销!"; + $title = "课时预约单审核通过"; + $mini_type = "classes_auth"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="order"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classeshour_order_auth_success_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); } // 订单审核失败后 public function classeshourOrderAuthFailAfter(&$params) { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + //插入订单取消日志 + if(!$user_id ||$order["user_id"] !=$user_id ){ + $pron = "[员工操作]"; + }else{ + $pron = ""; + } + $desc = $pron."{$detail["title"]}课程课时{$order["name"]}预约单审核不通过,原因;{$order['reason']},该课时单将取消以便重新下单"; + + $title = "课时预约单审核不通过"; + $mini_type = "classes_auth"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="order"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classeshour_order_auth_fail_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + "reason"=>$order['reason'] + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + } // 订单核销完成后 public function classeshourOrderFinishAfter(&$params) { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + + if(!$user_id ||$order["user_id"] !=$user_id ){ + $desc = "[员工操作]{$detail["title"]}课程课时{$order["name"]}预约单核销成功,当前课时已完成"; + }else{ + $desc = "{$detail["title"]}课程课时{$order["name"]}预约单核销成功,当前课时已完成"; + } + + $title = "课时预约单已核销"; + $mini_type = "classes_order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="order"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classeshour_order_finish_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + } @@ -50,6 +177,32 @@ class OrderHook // 订单取消成功后 public function classeshourOrderCancelAfter(&$params) { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + $detail = $order->detail; + + if(!$user_id ||$order["user_id"] !=$user_id ){ + $desc = "[员工代操作]{$detail["title"]}课程课时{$order["name"]}预约单取消成功,课时已原路退回"; + }else{ + $desc = "{$detail["title"]}课程课时{$order["name"]}预约单取消成功,课时已原路退回"; + } + + $title = "课时预约单已取消"; + $mini_type = "classes_order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="order"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classeshour_order_cancel_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + + } diff --git a/application/common/listener/classesorder/OrderHook.php b/application/common/listener/classesorder/OrderHook.php index 4d667c9..ca68ebb 100644 --- a/application/common/listener/classesorder/OrderHook.php +++ b/application/common/listener/classesorder/OrderHook.php @@ -1,18 +1,41 @@ $user_id, 'classes_lib_id'=>$classes_lib_id,'param'=>$param, 'order_no'=>$order_no, 'price_info'=>$price_info] = $params; } // 订单创建成功后 public function classesOrderCreateAfter(&$params) { + ["order"=>$order] = $params; + $detail = $order->detail; + //记录订单日志 + + $desc = "课程{$detail["title"]}订单创建成功,等待【学员】支付"; + + $title = "课程订单创建成功"; + $mini_type = "order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="classes"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classes_order_create_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + } @@ -21,18 +44,85 @@ class OrderHook // 订单支付成功后 public function classesOrderPayedAfter(&$params) { + ["order"=>$order] = $params; + $detail = $order->detail; + //记录订单日志 + + $desc = "课程{$detail["title"]}订单支付成功,您可以正常约课了"; + + $title = "课程订单支付成功"; + $mini_type = "order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="classes"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classes_order_payed_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + "classes_lib_id"=>$order["classes_lib_id"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + } // 订单取消成功后 public function classesOrderCancelAfter(&$params) { + ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; + + $detail = $order->detail; + if(!$user_id ||$order["user_id"] !=$user_id ){ + $desc = "[系统操作]课程{$detail["title"]}订单未支付取消成功"; + }else{ + $desc = "课程{$detail["title"]}订单未支付取消成功"; + } + + $title = "课程订单已取消"; + $mini_type = "order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="classes"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classes_order_cancel_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); } // 订单完成后 public function classesOrderFinishAfter(&$params) { + ["order"=>$order] = $params; + $detail = $order->detail; + + //记录订单日志 + + $desc = "恭喜您!您的{$detail["title"]}课程完结啦"; + + $title = "课程完结撒花!"; + $mini_type = "order_notice"; + $to_type="user"; + $to_id = $order["user_id"]; + $status ="classes"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"classes_order_finish_after", + "order_id"=>$order["id"], + "order_no"=>$order["order_no"], + "classes_lib_id"=>$order["classes_lib_id"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); } diff --git a/application/common/listener/manystore/ShopHook.php b/application/common/listener/manystore/ShopHook.php index c46f2e8..cf082b6 100644 --- a/application/common/listener/manystore/ShopHook.php +++ b/application/common/listener/manystore/ShopHook.php @@ -1,5 +1,7 @@ $shop] = $params; + + + + } @@ -15,6 +22,30 @@ class ShopHook // 机构账号提交审核申请后 public function shopApplyAfter(&$params) { + ["shop"=>$shop] = $params; + + + //记录订单日志 + + $desc = "您申请的认证{$shop['name']}已提交审核,审核时间为1-3日内,请耐心等待审核结果"; + + $title = "入驻申请提交"; + $mini_type = "shop_apply"; + $to_type="user"; + $to_id = $shop["user_id"]; + $status ="system"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"shop_create_after", + "shop_id"=>$shop["id"], + "desc"=>$shop["desc"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + + } @@ -23,12 +54,62 @@ class ShopHook // 机构账号审核成功后 public function shopAuthSuccessAfter(&$params) { + ['shop' => $shop,"password"=>$password] = $params; + $user = $shop->user; + $mobile = $user['mobile'] ?? ""; + $shop_backend_url = config("site.shop_backend_ur"); + $desc = "您申请的认证:{$shop['name']}已审核通过,您可登录官方后台补充完其余资料,并开始发布课程
+ 后台地址是: {$shop_backend_url}
+ 账号是: {$shop['username']} 或 您的手机号 {$mobile}
+ 初始化密码是: {$password}
+"; + + $title = "入驻申请通过"; + $mini_type = "shop_apply"; + $to_type="user"; + $to_id = $shop["user_id"]; + $status ="system"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"shop_auth_success_after", + "shop_id"=>$shop["id"], + "desc"=>$shop["desc"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + } // 机构账号审核失败后 public function shopAuthFailAfter(&$params) { + ["shop"=>$shop] = $params; + + + //记录订单日志 + + $desc = "您申请的认证{$shop['name']}审核未通过,未通过原因为:{$shop['reason']},如已整改,可重新发起申请"; + + $title = "入驻申请失败"; + $mini_type = "shop_apply"; + $to_type="user"; + $to_id = $shop["user_id"]; + $status ="system"; + $platform="user"; + $oper_id=0; + $oper_type="system"; + $params=[ + "event"=>"shop_auth_fail_after", + "shop_id"=>$shop["id"], + "desc"=>$shop["desc"], + ]; + Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); + + + } diff --git a/application/common/model/User.php b/application/common/model/User.php index 46e8565..9e77ba2 100644 --- a/application/common/model/User.php +++ b/application/common/model/User.php @@ -13,7 +13,7 @@ use think\Model; /** * 会员模型 */ -class User extends Model +class User extends BaseModel { // 开启自动写入时间戳字段 @@ -70,7 +70,7 @@ class User extends Model public function getVerificationAttr($value, $data) { $value = array_filter((array)json_decode($value, true)); - $value = array_merge(['email' => 0, 'mobile' => 0], $value); + $value = array_merge(['email' => 0, 'mobile' => 0, 'mini_wechat' => 0], $value); return (object)$value; } @@ -253,4 +253,53 @@ class User extends Model } + + + /**添加用户:通过 手机号 和昵称 + * @param $mobile + * @param $nickname + */ + public function addUserByMobile($mobile,$nickname,$check=true){ + if($check){ + //去除空格 + $nickname = trim($nickname); + $mobile = trim($mobile); + if(!is_numeric($mobile))throw new \Exception("不是合法手机号!"); + if(strlen($mobile)!=11)throw new \Exception("请输入11位手机号!"); + if (!preg_match("/[\x7f-\xff]/", $nickname)) throw new \Exception("名称必须是汉字,请去除空格和其他特殊符号!"); + preg_match_all("/[\x{4e00}-\x{9fa5}]/u","$nickname",$result); + if(!$result || join('',$result[0])!=$nickname)throw new \Exception("名称必须是汉字,请去除空格和其他特殊符号!"); + } + + + //判断用户存不存在 + $user = self::where("mobile",$mobile)->find(); + if($user){ + //如果存在,直接返回 + return $user; + }else{ + //如果不存在,创建并返回 + //得到认证实例 + $auth = Auth::instance(); + //拼装提交参数 +// $extend = $this->getUserDefaultFields(); + $extend=[]; + $extend['nickname'] = $nickname; + $extend['avatar'] = config("site.default_avatar"); + //调用注册方法 + $user = $auth->registerNoLogin("{$mobile}_user", rand(100000,999999), "{$mobile}@user.com", $mobile,$extend); + if(!$user)throw new \Exception($auth->getError()); + //更新已认证方式 + $user = self::where("id", $user->id)->find(); + $verification = $user->verification; + $verification->mobile = 1; + $user->verification = $verification; + $user->save(); + //返回对象 + return self::where("id", $user->id)->find(); + } + } + + + } diff --git a/application/common/model/school/Message.php b/application/common/model/school/Message.php index 5719707..d11421a 100644 --- a/application/common/model/school/Message.php +++ b/application/common/model/school/Message.php @@ -2,10 +2,11 @@ namespace app\common\model\school; +use app\common\model\BaseModel; use think\Model; -class Message extends Model +class Message extends BaseModel { @@ -29,11 +30,24 @@ class Message extends Model 'oper_type_text', 'to_type_text', 'status_text', - 'mini_type_text' + 'mini_type_text', + "type_text" ]; - + public function getTypeList() + { + return ['1' => __('Type 1'), '2' => __('Type 2')]; + } + + public function getTypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); + $list = $this->getTypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + - public function getPlatformList() { return ['admin' => __('Platform admin'), 'user' => __('Platform user'), 'shop' => __('Platform shop')]; @@ -149,4 +163,163 @@ class Message extends Model } + + /**展示订单信息 + * @param $order_no + * @param $price_info + * @return array + */ + public static function showInfo($id, $price_info = []){ + $data = []; + $data['id'] =$id; + $data['message_info'] = self::getDetail($id); + return array_merge($data,$price_info); + } + + + + + /**得到订单详情 + * @param $order_no + */ + public static function getDetail($id,$oper_id = []){ + $model = self::where('id',$id); + if($oper_id)$model = $model->where("oper_id","in",$oper_id); + $data = $model->find(); + + if(!$data) return $data; + + //如果非全局消息,更新成已读 + + if($data->to_id != 0){ + $data["type"]= '2'; + $data->save(); + } + +// //加载订单详情 +// $data->detail->teacher; +// //订单用户 +//// $data->user; +// $data->user->visible(['id','nickname','mobile','avatar','realname']); +// + + return $data; + } + + + + + + + + + /**得到基础条件 + * @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, ['platform','oper_type','to_type','status','mini_type','to_id']))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'])) $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['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}title|{$alisa}desc", '=', $whereData['keywords']); + if (isset($whereData['time'])&&$whereData['time']){ + $model = $model->time($whereData['time']); + } + if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}to_id", '=', $whereData['user_id']); + + if (isset($whereData['platform']) && $whereData['platform']){ + $platforms = implode("|",explode(',',$whereData['platform'])); + $model = $model->whereRaw(" {$alisa}platform REGEXP '({$platforms})'"); +// $model = $model->where("{$alisa}platform", 'in', $whereData['platform']); + } + + + if (isset($whereData['oper_type']) && $whereData['oper_type']) $model = $model->where("{$alisa}oper_type", 'in', $whereData['oper_type']); + if (isset($whereData['to_type']) && $whereData['to_type']) $model = $model->where("{$alisa}to_type", 'in', $whereData['to_type']); + if (isset($whereData['mini_type']) && $whereData['mini_type']) $model = $model->where("{$alisa}mini_type", 'in', $whereData['mini_type']); + + + if (isset($whereData['to_id']) && $whereData['to_id']){ + $model = $model->where(function ($query) use($whereData,$alisa) { + $query->where("{$alisa}to_id", $whereData['to_id']) + ->whereOr("{$alisa}to_id", '=', 0); + }); + + } + + + return $model; + } + + + + + + + public static function baseCount($where = []){ + $where["type"] = '1'; + $where["platform"]= 'user'; + $unread_number = self::getBaseWhere($where)->count(); + $unread_system_number = self::getBaseWhere(array_merge(['status'=>'system'],$where))->count(); + $unread_classes_number = self::getBaseWhere(array_merge(['status'=>'classes'],$where))->count(); + $unread_order_number = self::getBaseWhere(array_merge(['status'=>'order'],$where))->count(); + + return compact('unread_number','unread_system_number','unread_classes_number','unread_order_number'); + } + + + + /**订单数量统计 + * @param int $user_id + * @return array + */ + public static function messageCount($user_id = 0){ + return self::baseCount(['user_id'=>$user_id]); + } + + + + + + public static function messageList($page, $limit,$to_id,$keywords,$status,$mini_type,$type){ + $with_field = [ + 'user'=>['nickname','mobile','avatar','realname'], + 'base'=>['*'], +// 'shop'=>['*'], +// 'detail'=>['*'], + ]; + + $alisa = (new self)->getWithAlisaName(); + $sort = "field({$alisa}.type,'1','2') asc,{$alisa}.weigh desc,{$alisa}.id desc"; + $serch_where = ["to_id"=>$to_id,'platform'=>"user",'status'=>$status,'keywords'=>$keywords,"mini_type"=>$mini_type,"type"=>$type]; +// if($type)$serch_where['type'] = $type; + return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); + } + + + } diff --git a/application/common/model/school/classes/ClassesLib.php b/application/common/model/school/classes/ClassesLib.php index 84e8555..f788052 100644 --- a/application/common/model/school/classes/ClassesLib.php +++ b/application/common/model/school/classes/ClassesLib.php @@ -426,7 +426,7 @@ class ClassesLib extends BaseModel $order = $order?? 'normal'; - $per_page = $params['page'] ?? 10; + $per_page = $limit ?? 10; $field = "{$a}id,{$a}shop_id,{$a}user_id,{$a}teacher_id,{$a}classes_cate_ids,{$a}classes_label_ids,{$a}self_label_tag,{$a}title,{$a}headimage,{$a}type,{$a}classes_date_text,{$a}classes_time_text,{$a}virtual_num,{$a}sale,{$a}price,{$a}underline_price,{$a}virtual_collect,{$a}status,{$a}auth_status,{$a}weigh,{$a}recommend,{$a}hot,{$a}new,{$a}selfhot,{$a}createtime,{$a}virtual_people,{$a}feel,{$a}limit_num,{$a}sign_num,{$a}verification_num"; @@ -568,6 +568,7 @@ class ClassesLib extends BaseModel $selfetch = $selfetch->paginate($per_page); +// var_dump(self::getLastSql()); //额外附加数据 return $selfetch; diff --git a/application/common/model/school/classes/hourorder/Order.php b/application/common/model/school/classes/hourorder/Order.php index d3d42df..1057d2a 100644 --- a/application/common/model/school/classes/hourorder/Order.php +++ b/application/common/model/school/classes/hourorder/Order.php @@ -6,6 +6,7 @@ use app\admin\model\Admin; use app\common\model\school\classes\ClassesLib; use app\common\model\school\classes\ClassesSpec; use app\common\model\User; +use app\manystore\model\Manystore; use bw\Common; use fast\Random; use think\Cache; @@ -594,12 +595,16 @@ class Order extends BaseModel $order = $this->createOrder($user_id,$orderInfo['classes_order_id'],$orderInfo['classes_lib_spec_id'],$order_no,$orderInfo['param'],$remark); //5删除缓存 self::deleteOrderCache($user_id, $order_no); +// var_dump($order["type"]); //代下单直接执行审核成功的预约中状态 if($order["type"] == '2'){ //兼容代下单逻辑,修正下单人信息 // $user_id =$order['user_id']; + +// var_dump($order["status"]); + //do something... - $this->examine($order_no,1,"",0,false,$order["help_type"],$order["help_user_id"],false); + if(config("site.admin_approved_swtich"))$this->examine($order_no,1,"",0,false,$order["help_type"],$order["help_user_id"],false); } if ($trans) { @@ -668,6 +673,7 @@ class Order extends BaseModel $classes_lib_spec_data = $classes_lib_spec->toArray(); $classes_lib_spec_data['classes_lib_spec_id'] = $classes_lib_spec_data['id']; unset($classes_lib_spec_data['id']); + unset($classes_lib_spec_data['status']); unset($classes_lib_spec_data['createtime']); unset($classes_lib_spec_data['updatetime']); unset($classes_lib_spec_data['deletetime']); @@ -705,13 +711,13 @@ class Order extends BaseModel $order = self::buildLibSpec($res1,$classes_lib_spec_id); //扣减课程数 - $res1 = \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($classes_order_id); + \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($classes_order_id); //记录订单日志 if($order["type"] == "1"){ - OrderLog::log($res1['id'],"课时预约下单成功,等待机构老师审核",'user',$user_id); + OrderLog::log($order['id'],"课时预约下单成功,等待机构老师审核",'user',$user_id); }else{ - OrderLog::log($res1['id'],"课时预约机构老师代下单成功",'user',$order["help_user_id"]); + OrderLog::log($order['id'],"课时预约机构老师代下单成功",'user',$order["help_user_id"]); } //7事件 @@ -772,10 +778,10 @@ class Order extends BaseModel } //调用订单取消事件 - $data = ['order' => $order]; + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classeshour_order_cancel_after', $data); //执行课时数更新 - $res1 = \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']); + \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']); if($trans){ @@ -877,6 +883,10 @@ class Order extends BaseModel $admin_info = Admin::where('id',$oper_id)->find(); if(!$admin_info) throw new \Exception("代下单管理员不存在!"); break; + case 'shop': + $admin_info = Manystore::where('id',$oper_id)->find(); + if(!$admin_info) throw new \Exception("代下单管理员不存在!"); + break; default: throw new \Exception("请选择正确的代下单类型!"); } @@ -957,8 +967,11 @@ class Order extends BaseModel * @throws \Exception */ public function examine($order_no,$auth_status,$reason="",$user_id=0,$check=false,$oper_type='user',$oper_id=0,$trans=false){ + + //得到可取消订单 $order = self::getHaveExamineOrder($order_no); + if($check){ //用户操作权限检测 self::checkOptionAuth($order['classes_order_id'],$user_id ?: $oper_id,$oper_type); @@ -991,7 +1004,7 @@ class Order extends BaseModel OrderLog::log($order['id'],$pron."课时预约单审核成功,预约成功等待核销!",$oper_type ?: 'user', $oper_id ?: $order['user_id']); //调用订单事件 - $data = ['order' => $order]; + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classeshour_order_auth_success_after', $data); }else{ @@ -1002,7 +1015,7 @@ class Order extends BaseModel //审核失败逻辑 OrderLog::log($order['id'],$pron."课时预约单审核不通过,原因;{$reason},该课时单将取消以便重新下单",$oper_type ?: 'user', $oper_id ?: $order['user_id']); //调用订单事件 - $data = ['order' => $order]; + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classeshour_order_auth_fail_after', $data); //执行订单取消逻辑 @@ -1103,10 +1116,10 @@ class Order extends BaseModel } //调用订单取消事件 - $data = ['order' => $order]; + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classeshour_order_finish_after', $data); //执行课时数更新 - $res1 = \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']); + \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']); if($trans){ @@ -1171,7 +1184,7 @@ class Order extends BaseModel } //调用订单事件 - $data = ['order' => $order]; + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classeshour_order_update_after', $data); //执行课时数更新 $res1 = \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']); diff --git a/application/common/model/school/classes/hourorder/OrderLog.php b/application/common/model/school/classes/hourorder/OrderLog.php index d3755e6..f602d1a 100644 --- a/application/common/model/school/classes/hourorder/OrderLog.php +++ b/application/common/model/school/classes/hourorder/OrderLog.php @@ -59,7 +59,10 @@ class OrderLog extends BaseModel * @throws \Exception */ public static function log($order,$mark='更新订单状态',$oper_type='user',$oper_id = 0,$trans=false){ - if(is_numeric($order))$order = Order::where('order_no|id',$order)->find(); +// var_dump($order); + if(is_numeric($order)||is_string($order))$order = Order::where('order_no|id',$order)->find(); + + if(!$order)throw new \Exception("找不到订单"); //操作人信息(可扩展) $data = [ diff --git a/application/common/model/school/classes/order/Order.php b/application/common/model/school/classes/order/Order.php index 4b37e65..6c0e0fb 100644 --- a/application/common/model/school/classes/order/Order.php +++ b/application/common/model/school/classes/order/Order.php @@ -1044,7 +1044,7 @@ class Order extends BaseModel } //调用订单取消事件 - $data = ['order' => $order]; + $data = ['order' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id]; \think\Hook::listen('classes_order_cancel_after', $data); //执行课时数更新 $res1 = self::statisticsAndUpdateClassesNumber($order['id']); diff --git a/application/common/model/school/classes/order/OrderLog.php b/application/common/model/school/classes/order/OrderLog.php index fed2494..c912f0f 100644 --- a/application/common/model/school/classes/order/OrderLog.php +++ b/application/common/model/school/classes/order/OrderLog.php @@ -104,7 +104,7 @@ class OrderLog extends BaseModel * @throws \Exception */ public static function log($order,$mark='更新订单状态',$oper_type='user',$oper_id = 0,$trans=false){ - if(is_numeric($order))$order = Order::where('order_no|id|pay_no',$order)->find(); + if(is_numeric($order)||is_string($order))$order = Order::where('order_no|id|pay_no',$order)->find(); if(!$order)throw new \Exception("找不到订单"); //操作人信息(可扩展) $data = [ diff --git a/application/manystore/controller/manystore/UserAuth.php b/application/manystore/controller/manystore/UserAuth.php index 139a15b..45ede7e 100644 --- a/application/manystore/controller/manystore/UserAuth.php +++ b/application/manystore/controller/manystore/UserAuth.php @@ -72,4 +72,33 @@ class UserAuth extends ManystoreBase return $this->view->fetch(); } + + + /**变更学员信息(教练专属) + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function changeuser(){ + if($this->request->isPost()) + { + try{ + $people_name = $this->request->param('people_name/s'); + $people_mobile = $this->request->param('people_mobile/s'); + $user = \app\common\model\User::where("mobile",$people_mobile)->find(); + //检测更新教练下单学员账号创建状态 2022/8/27 new + if(!$user)$user = (new \app\common\model\User)->addUserByMobile($people_mobile,$people_name); + $user['nickname'] = $people_name; + $user->save(); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + //退押金 + $this->success("已成功创建{$people_name}"); + } +// $row = $this->model->get($param['ids']); +// $this->view->assign('vo', $row); + return $this->view->fetch(); + } + } diff --git a/application/manystore/controller/school/classes/ClassesLib.php b/application/manystore/controller/school/classes/ClassesLib.php index f214ba9..e7b4052 100644 --- a/application/manystore/controller/school/classes/ClassesLib.php +++ b/application/manystore/controller/school/classes/ClassesLib.php @@ -326,6 +326,7 @@ class ClassesLib extends ManystoreBase if($check_title){ $this->error("课程名称已存在或被其他机构占用,请更改!"); } + $this->have_auth = true; } } @@ -365,6 +366,15 @@ class ClassesLib extends ManystoreBase } $this->update_check($params,$row=null); $result = $this->model->allowField(true)->save($params); + + if($this->have_auth){ + //调用通过事件 + $data = ['classes' => $this->model]; + \think\Hook::listen('classes_auth_need_after', $data); + + } + + Db::commit(); } catch (ValidateException $e) { Db::rollback(); @@ -417,6 +427,15 @@ class ClassesLib extends ManystoreBase $result = $row->allowField(true)->save($params); + + if($this->have_auth){ + //调用通过事件 + $data = ['classes' => $row]; + \think\Hook::listen('classes_auth_need_after', $data); + + } + + Db::commit(); } catch (ValidateException $e) { Db::rollback(); diff --git a/application/manystore/controller/school/classes/ClassesSpec.php b/application/manystore/controller/school/classes/ClassesSpec.php index c8887ac..804e5d8 100644 --- a/application/manystore/controller/school/classes/ClassesSpec.php +++ b/application/manystore/controller/school/classes/ClassesSpec.php @@ -261,9 +261,9 @@ class ClassesSpec extends ManystoreBase } - $user = User::where("id", $row["user_id"])->find(); -// if(!$user) $this->error("未找到用户请先让用户登录小程序再提交表单"); - $row["user_id"] = $user["mobile"]?? ""; //nickname|realname|mobile +// $user = User::where("id", $row["user_id"])->find(); +//// if(!$user) $this->error("未找到用户请先让用户登录小程序再提交表单"); +// $row["user_id"] = $user["mobile"]?? ""; //nickname|realname|mobile $this->view->assign("row", $row); return $this->view->fetch(); } diff --git a/application/manystore/controller/school/classes/hourorder/Order.php b/application/manystore/controller/school/classes/hourorder/Order.php index b21f1a2..1084f25 100644 --- a/application/manystore/controller/school/classes/hourorder/Order.php +++ b/application/manystore/controller/school/classes/hourorder/Order.php @@ -3,6 +3,9 @@ namespace app\manystore\controller\school\classes\hourorder; use app\common\controller\ManystoreBase; +use think\Db; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 课时订单 @@ -18,11 +21,17 @@ class Order extends ManystoreBase */ protected $model = null; + protected $qSwitch = true; + protected $qFields = ["classes_order_id","classes_lib_spec_id","user_id","classes_order_detail_id","classes_lib_id"]; + + public function _initialize() { - parent::_initialize(); $this->model = new \app\manystore\model\school\classes\hourorder\Order; + parent::_initialize(); + $this->view->assign("statusList", $this->model->getStatusList()); + $this->view->assign("authStatusList", $this->model->getAuthStatusList()); } public function import() @@ -75,4 +84,237 @@ class Order extends ManystoreBase return $this->view->fetch(); } + + + + /** + * 添加 + */ + public function add() + { + if ($this->request->isPost()) { + $params = $this->request->post("row/a"); + if ($params) { + $params = $this->preExcludeFields($params); + + if($this->storeIdFieldAutoFill && STORE_ID ){ + $params['store_id'] = STORE_ID; + } + + if($this->shopIdAutoCondition && SHOP_ID){ + $params['shop_id'] = SHOP_ID; + } + + $result = false; + + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException(true)->validate($validate); + } + + + //记录代下单人信息 + $param = [ + "type" =>'2', + "help_user_id" =>$this->auth->id, + "help_type" => 'shop', + ]; + //确认订单 + $res = (new \app\common\model\school\classes\hourorder\Order)->confirm($this->auth->id,$params['classes_order_id'],null, $params['classes_lib_spec_id'],$param, true); + $remark = "总后台管理员帮忙下课时预约"; + //创建订单 + $result = (new \app\common\model\school\classes\hourorder\Order)->cacheCreateOrder($res['order_no'], $this->auth->id,$remark, true); + + + + + } catch (ValidateException $e) { + + $this->error($e->getMessage()); + } catch (PDOException $e) { + + $this->error($e->getMessage()); + } catch (\Exception $e) { + + $this->error($e->getMessage()); + } + if ($result !== false) { + $this->success(); + } else { + $this->error(__('No rows were inserted')); + } + } + $this->error(__('Parameter %s can not be empty', '')); + } + return $this->view->fetch(); + } + + /** + * 编辑 + */ + public function edit($ids = null) + { + if($this->shopIdAutoCondition){ + $this->model->where(array('shop_id'=>SHOP_ID)); + } + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + + if ($this->request->isPost()) { + $params = $this->request->post("row/a"); + if ($params) { + $params = $this->preExcludeFields($params); + $result = false; + + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException(true)->validate($validate); + } + + + $result = (new \app\common\model\school\classes\hourorder\Order)->updateClassesSpec($row["id"],$params["classes_lib_spec_id"],0,true,'shop',$this->auth->id,true); + + + + } catch (ValidateException $e) { + + $this->error($e->getMessage()); + } catch (PDOException $e) { + + $this->error($e->getMessage()); + } catch (\Exception $e) { + + $this->error($e->getMessage()); + } + if ($result !== false) { + $this->success(); + } else { + $this->error(__('No rows were updated')); + } + } + $this->error(__('Parameter %s can not be empty', '')); + } + $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) { + $pk = $this->model->getPk(); + if($this->shopIdAutoCondition){ + $this->model->where(array('shop_id'=>SHOP_ID)); + } + $list = $this->model->where($pk, 'in', $ids)->select(); + + $count = 0; + + try { + foreach ($list as $k => $v) { + $res = (new \app\common\model\school\classes\hourorder\Order)->cancel($v["id"],0,true,'shop',$this->auth->id,true); + + $count ++; + } + + } catch (PDOException $e) { + + $this->error($e->getMessage()); + } catch (\Exception $e) { + + $this->error($e->getMessage()); + } + if ($count) { + $this->success(); + } else { + $this->error(__('No rows were deleted')); + } + } + $this->error(__('Parameter %s can not be empty', 'ids')); + } + + + + /**预约审核 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function examine($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + + + $auth_status = $params["auth_status"]; + $reason = $params["reason"]; + $model = (new \app\common\model\school\classes\hourorder\Order); + $model->examine($params["id"],$auth_status,$reason,0,true,'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\hourorder\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(); + } + } diff --git a/application/manystore/controller/school/classes/order/Order.php b/application/manystore/controller/school/classes/order/Order.php index b47fde2..e742407 100644 --- a/application/manystore/controller/school/classes/order/Order.php +++ b/application/manystore/controller/school/classes/order/Order.php @@ -80,4 +80,34 @@ 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\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(); + } + } diff --git a/application/manystore/lang/zh-cn/school/classes/classes_lib.php b/application/manystore/lang/zh-cn/school/classes/classes_lib.php index 90a7ca7..c7e0b18 100644 --- a/application/manystore/lang/zh-cn/school/classes/classes_lib.php +++ b/application/manystore/lang/zh-cn/school/classes/classes_lib.php @@ -4,8 +4,8 @@ return [ 'Manystore_id' => '机构账号id', 'Shop_id' => '机构店铺id', 'User_id' => '主讲师用户id', - 'Classes_cate_ids' => '平台课程分类ids', - 'Classes_label_ids' => '平台课程类型ids', + 'Classes_cate_ids' => '平台课程分类', + 'Classes_label_ids' => '平台课程热门标签', 'Self_label_tag' => '机构特色标签', 'Add_type' => '添加人类型', 'Add_type 1' => '机构', diff --git a/application/manystore/lang/zh-cn/school/classes/hourorder/order.php b/application/manystore/lang/zh-cn/school/classes/hourorder/order.php index baf1820..79195f2 100644 --- a/application/manystore/lang/zh-cn/school/classes/hourorder/order.php +++ b/application/manystore/lang/zh-cn/school/classes/hourorder/order.php @@ -2,8 +2,21 @@ return [ 'Order_no' => '订单号', + + 'Edit'=>'修改用户预约的课时', + 'Add'=>'帮用户预约课时', + 'Delete'=>'帮用户取消预约', + 'Del'=>'帮用户取消预约', + 'Auth_status' => '审核状态', + 'Auth_status 0' => '待审核', + 'Auth_status 1' => '审核通过', + 'Auth_status 2' => '审核失败', + 'Reason' => '审核不通过原因', + 'Auth_time' => '审核时间', + 'Admin_id' => '审核管理员id', + 'Classes_order_id' => '课程订单id', - 'Classes_lib_spec_id' => '课时id', + 'Classes_lib_spec_id' => '选择要预约的课时', 'User_id' => '下单人id', 'Classes_order_detail_id' => '订单课程id', 'Classes_lib_id' => '课程id', diff --git a/application/manystore/lang/zh-cn/school/classes/order/order.php b/application/manystore/lang/zh-cn/school/classes/order/order.php index 934399c..c8bd3b9 100644 --- a/application/manystore/lang/zh-cn/school/classes/order/order.php +++ b/application/manystore/lang/zh-cn/school/classes/order/order.php @@ -4,6 +4,7 @@ return [ 'Order_no' => '订单号', 'Pay_no' => '微信支付单号', 'User_id' => '下单人id', + 'Edit'=>'订单详情', 'Manystore_id' => '机构账号id', 'Shop_id' => '机构店铺id', 'Code' => '核销码', diff --git a/application/manystore/model/ManystoreShop.php b/application/manystore/model/ManystoreShop.php index ac59e87..6b9207f 100644 --- a/application/manystore/model/ManystoreShop.php +++ b/application/manystore/model/ManystoreShop.php @@ -29,7 +29,10 @@ class ManystoreShop extends Model 'update_time_text' ]; - + public function user() + { + return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } diff --git a/application/manystore/model/school/classes/hourorder/Order.php b/application/manystore/model/school/classes/hourorder/Order.php index f1c0ddf..d75f040 100644 --- a/application/manystore/model/school/classes/hourorder/Order.php +++ b/application/manystore/model/school/classes/hourorder/Order.php @@ -30,11 +30,25 @@ class Order extends Model 'status_text', 'reservation_time_text', 'finish_time_text', - 'cancel_time_text' + 'cancel_time_text', + 'auth_status_text', ]; - - + + public function getAuthStatusList() + { + return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')]; + } + + public function getAuthStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : ''); + $list = $this->getAuthStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + public function getStatusList() { return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')]; diff --git a/application/manystore/view/general/profile/index.html b/application/manystore/view/general/profile/index.html index 2384734..8af6e5d 100644 --- a/application/manystore/view/general/profile/index.html +++ b/application/manystore/view/general/profile/index.html @@ -213,9 +213,9 @@ data-toggle="city-picker" name="shop[address_city]" value="{$shop_info.address_city}" type="text"> - - - + + +
diff --git a/application/manystore/view/manystore/user_auth/changeuser.html b/application/manystore/view/manystore/user_auth/changeuser.html new file mode 100644 index 0000000..87052f3 --- /dev/null +++ b/application/manystore/view/manystore/user_auth/changeuser.html @@ -0,0 +1,27 @@ +
+ +
+

根据手机号和姓名创建用户(已存在则不更改任何信息!)

+
+ +
+ +
+
+
+ +
+ + (手机号将自动创建并关联对应微信小程序账号,请认真核对确认无误!) +
+
+
+ + + + \ No newline at end of file diff --git a/application/manystore/view/school/classes/classes_lib/add.html b/application/manystore/view/school/classes/classes_lib/add.html index ea20a7f..67338c7 100644 --- a/application/manystore/view/school/classes/classes_lib/add.html +++ b/application/manystore/view/school/classes/classes_lib/add.html @@ -22,6 +22,13 @@
+ +

+ (没找到讲师则点击按钮创建讲师后重新下拉框选讲师) + {:__('Add')} + +
+
@@ -203,12 +210,12 @@ - - - - - - +
+ +
+ +
+
@@ -227,12 +234,12 @@ ( 如果填零则为免费课程,课程下单后无需支付,直接可去预约课时! ) -
- -
- -
-
+ + + + + +
diff --git a/application/manystore/view/school/classes/classes_lib/edit.html b/application/manystore/view/school/classes/classes_lib/edit.html index dacdb6f..3568f27 100644 --- a/application/manystore/view/school/classes/classes_lib/edit.html +++ b/application/manystore/view/school/classes/classes_lib/edit.html @@ -23,6 +23,12 @@
+ +

+ (没找到讲师则点击按钮创建讲师后重新下拉框选讲师) + {:__('Add')} + +
@@ -218,12 +224,12 @@ ( 如果填零则为免费课程,课程下单后无需支付,直接可去预约课时! )
-
- -
- -
-
+ + + + + +
diff --git a/application/manystore/view/school/classes/hourorder/order/add.html b/application/manystore/view/school/classes/hourorder/order/add.html index 70ccf03..c0e4927 100644 --- a/application/manystore/view/school/classes/hourorder/order/add.html +++ b/application/manystore/view/school/classes/hourorder/order/add.html @@ -1,111 +1,12 @@
-
- -
- -
-
-
- -
- -
-
+ + +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- {foreach name="statusList" item="vo"} - - {/foreach} -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
diff --git a/application/manystore/view/school/classes/hourorder/order_log/index.html b/application/manystore/view/school/classes/hourorder/order_log/index.html index a7be660..ea6b153 100644 --- a/application/manystore/view/school/classes/hourorder/order_log/index.html +++ b/application/manystore/view/school/classes/hourorder/order_log/index.html @@ -17,23 +17,23 @@
diff --git a/application/manystore/view/school/classes/order/order/edit.html b/application/manystore/view/school/classes/order/order/edit.html index 190fe24..c8e27fa 100644 --- a/application/manystore/view/school/classes/order/order/edit.html +++ b/application/manystore/view/school/classes/order/order/edit.html @@ -3,98 +3,99 @@
- +
- +
- -
-
-
- -
- +
+ + + + + + +
- -
-
-
- -
-
- -
- - -
- -
-
    -
    -
    -
    - -
    -
    - -
    - - -
    - -
    -
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      - -
      -
      -
      - -
      - +
      + + + + + +
      - +
      - +
      - +
      - - {foreach name="payTypeList" item="vo"} - + {/foreach} @@ -103,156 +104,150 @@
      - +
      - {foreach name="statusList" item="vo"} - - {/foreach} + {foreach name="statusList" item="vo"} + + {/foreach}
      -
      - -
      - -
      - {foreach name="beforeStatusList" item="vo"} - - {/foreach} -
      + + + + + + + + + -
      -
      -
      - -
      - -
      - {foreach name="serverStatusList" item="vo"} - - {/foreach} -
      + + + + + + + + + + + -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      -
      - -
      - - -
      - -
      -
        -
        -
        -
        - -
        - -
        -
        -
        - -
        - -
        - {foreach name="resultStatusList" item="vo"} - - {/foreach} -
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
        -
        -
        - -
        - -
        -
        -
        - -
        -
        - -
        - - -
        - -
        -
          -
          -
          + + + + + + + + + + + + + + + + + + + + + +
          - +
          - +
          - +
          - +
          - +
          - +
          - +
          diff --git a/application/manystore/view/school/classes/order/order/index.html b/application/manystore/view/school/classes/order/order/index.html index 406574a..e810be1 100644 --- a/application/manystore/view/school/classes/order/order/index.html +++ b/application/manystore/view/school/classes/order/order/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/order/order_detail/index.html b/application/manystore/view/school/classes/order/order_detail/index.html index a7fce2c..72dcd16 100644 --- a/application/manystore/view/school/classes/order/order_detail/index.html +++ b/application/manystore/view/school/classes/order/order_detail/index.html @@ -7,23 +7,23 @@ diff --git a/application/manystore/view/school/classes/order/order_log/index.html b/application/manystore/view/school/classes/order/order_log/index.html index a10fa4f..563088a 100644 --- a/application/manystore/view/school/classes/order/order_log/index.html +++ b/application/manystore/view/school/classes/order/order_log/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/teacher/add.html b/application/manystore/view/school/classes/teacher/add.html index 332cf8b..37a7e0d 100644 --- a/application/manystore/view/school/classes/teacher/add.html +++ b/application/manystore/view/school/classes/teacher/add.html @@ -10,7 +10,11 @@
          - (请先让对方登录小程序,之后输入小程序端用户:手机号,昵称 或 姓名 ) + + + (没找到用户则点击按钮创建用户后重新填入用户手机号) + 根据手机号生成用户 +
          diff --git a/application/manystore/view/school/classes/teacher/edit.html b/application/manystore/view/school/classes/teacher/edit.html index 02f7ff7..56e67b2 100644 --- a/application/manystore/view/school/classes/teacher/edit.html +++ b/application/manystore/view/school/classes/teacher/edit.html @@ -10,7 +10,11 @@
          - (请先让对方登录小程序,之后输入小程序端用户:手机号,昵称 或 姓名 ) + + + (没找到用户则点击按钮创建用户后重新填入用户手机号) + 根据手机号生成用户 +
          diff --git a/application/manystore/view/school/classes/verification/add.html b/application/manystore/view/school/classes/verification/add.html index 09882e6..b6661ba 100644 --- a/application/manystore/view/school/classes/verification/add.html +++ b/application/manystore/view/school/classes/verification/add.html @@ -10,7 +10,11 @@
          - (请先让对方登录小程序,之后输入小程序端用户:手机号,昵称 或 姓名 ) + + + (没找到用户则点击按钮创建用户后重新填入用户手机号) + 根据手机号生成用户 +
          diff --git a/application/manystore/view/school/classes/verification/edit.html b/application/manystore/view/school/classes/verification/edit.html index 96ace03..df6f52e 100644 --- a/application/manystore/view/school/classes/verification/edit.html +++ b/application/manystore/view/school/classes/verification/edit.html @@ -10,7 +10,11 @@
          - (请先让对方登录小程序,之后输入小程序端用户:手机号,昵称 或 姓名 ) + + + (没找到用户则点击按钮创建用户后重新填入用户手机号) + 根据手机号生成用户 +
          diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index cdffda4..5475962 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, - {field: 'operate', title: __('Operate'),width:700, table: table , buttons: [ + {field: 'operate', title: __('Operate'),width:750, table: table , buttons: [ {name: 'free', text: '免登录进入机构后台', icon: 'fa fa-sign-in', @@ -38,7 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin //js获取当前域名 - window.open("https://"+window.location.host + "/manystore", '_blank'); + window.open(shop_backend_url, '_blank'); }, error: function (data, ret) { Layer.alert(ret.msg); @@ -108,6 +108,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'order', + text: __('机构课程订单'), + title: __('机构课程订单'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, // // {name: 'unsetmockauth', @@ -195,6 +209,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } $(this).blur(); }); + + + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + + + Form.api.bindevent($("form[role=form]")); }, edit: function () { @@ -213,6 +251,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin $("#district").val(district); } }); + + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + + Form.api.bindevent($("form[role=form]")); } }; @@ -233,5 +293,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var verification_url = function (row,dom) { return 'school/classes/verification/index?shop_id='+row.shop_id; } + + + var order_url = function (row,dom) { + return 'school/classes/order/order/index?shop_id='+row.id; + } + + return Controller; }); diff --git a/public/assets/js/backend/manystore/user_auth.js b/public/assets/js/backend/manystore/user_auth.js index 1b5b2ef..ed6401b 100644 --- a/public/assets/js/backend/manystore/user_auth.js +++ b/public/assets/js/backend/manystore/user_auth.js @@ -51,6 +51,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + Form.api.bindevent($("form[role=form]")); } } diff --git a/public/assets/js/backend/school/classes/classes_lib.js b/public/assets/js/backend/school/classes/classes_lib.js index d77023c..4756850 100644 --- a/public/assets/js/backend/school/classes/classes_lib.js +++ b/public/assets/js/backend/school/classes/classes_lib.js @@ -33,7 +33,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin name: 'classes_spec', text: __('设置课程规格'), title: __('设置课程规格'), - classname: 'btn btn-xs btn-primary btn-dialog', + classname: 'btn btn-xs btn-danger btn-magic btn-dialog', icon: 'fa fa-list', url: classes_spec_url, callback: function (data) { @@ -57,6 +57,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + + + { name: 'teacher', text: __('主讲老师信息'), @@ -71,6 +74,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'order', + text: __('课程订单查看'), + title: __('课程订单查看'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, // // {name: 'unsetmockauth', // text: '取消加圈资格', @@ -279,6 +296,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + + + Form.api.bindevent($("form[role=form]")); } } @@ -321,7 +359,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var teacher_url = function (row,dom) { return 'school/classes/teacher/index?id='+row.teacher_id +'&shop_id='+row.shop_id; } - + var order_url = function (row,dom) { + return 'school/classes/order/order/index?classes_lib_id='+row.id +'&shop_id='+row.shop_id; + } return Controller; diff --git a/public/assets/js/backend/school/classes/classes_spec.js b/public/assets/js/backend/school/classes/classes_spec.js index 1fee8d2..8dfd38c 100644 --- a/public/assets/js/backend/school/classes/classes_spec.js +++ b/public/assets/js/backend/school/classes/classes_spec.js @@ -27,6 +27,46 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + {field: 'operate', title: __('Operate'), table: table , buttons: [ + { + name: 'order', + text: __('课时预约查看'), + title: __('课时预约查看'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_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 == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + {field: 'id', title: __('Id')}, {field: 'classes_lib_id', title: __('Classes_lib_id')}, {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, @@ -41,7 +81,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'lib.headimage', title: __('Lib.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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -122,5 +162,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + var order_url = function (row,dom) { + return 'school/classes/hourorder/order/index?classes_lib_spec_id='+row.id; + } + + return Controller; }); diff --git a/public/assets/js/backend/school/classes/hourorder/order.js b/public/assets/js/backend/school/classes/hourorder/order.js index 166b51e..ed74dd6 100644 --- a/public/assets/js/backend/school/classes/hourorder/order.js +++ b/public/assets/js/backend/school/classes/hourorder/order.js @@ -6,8 +6,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/hourorder/order/index' + location.search, - add_url: 'school/classes/hourorder/order/add', - edit_url: 'school/classes/hourorder/order/edit', + add_url: 'school/classes/hourorder/order/add'+ location.search, + edit_url: 'school/classes/hourorder/order/edit'+ location.search, + examine_url: 'school/classes/hourorder/order/examine', + verification_url: 'school/classes/hourorder/order/verification', del_url: 'school/classes/hourorder/order/del', multi_url: 'school/classes/hourorder/order/multi', import_url: 'school/classes/hourorder/order/import', @@ -27,20 +29,107 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + {field: 'operate', title: __('Operate'), table: table , buttons: [ + {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 == 0){ + 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 == '-1'; + } + }, + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_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 == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + {field: 'id', title: __('Id')}, - {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'classes_order_id', title: __('Classes_order_id')}, - {field: 'classes_lib_spec_id', title: __('Classes_lib_spec_id')}, - {field: 'user_id', title: __('User_id')}, - {field: 'classes_order_detail_id', title: __('Classes_order_detail_id')}, - {field: 'classes_lib_id', title: __('Classes_lib_id')}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'classes_lib_spec_id',visible:false, title: __('Classes_lib_spec_id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'classes_lib_id',visible:false, title: __('Classes_lib_id')}, {field: 'limit_num', title: __('Limit_num')}, - {field: 'sign_num', title: __('Sign_num')}, - {field: 'verification_num', title: __('Verification_num')}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + // {field: 'sign_num', title: __('Sign_num')}, + // {field: 'verification_num', title: __('Verification_num')}, + + {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: '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: 'verification_user_id', title: __('Verification_user_id')}, {field: 'reservation_time', title: __('Reservation_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'finish_time', title: __('Finish_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, @@ -48,21 +137,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {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: 'classesorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'spec.name', title: __('Spec.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {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: '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: 'lib.title', title: __('Lib.title'), 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} + // {field: 'spec.name', title: __('Spec.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'lib.title', title: __('Lib.title'), 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} ] ] }); // 为表格绑定事件 Table.api.bindevent(table); + + + + }, recyclebin: function () { // 初始化表格参数配置 @@ -131,11 +218,36 @@ 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/hourorder/order/examine').submit(); + }); + Controller.api.bindevent(); + }, + verification: function () { + Controller.api.bindevent(); + }, api: { bindevent: function () { + + + //老师必须是上面机构中的 + $("#c-classes_lib_spec_id").data("params", function (obj) { + //obj为SelectPage对象 + return {custom: {classes_lib_id: $("#c-classes_lib_id").val(),status: '1'}}; + }); + + + + Form.api.bindevent($("form[role=form]")); } } }; + + var order_log_url = function (row,dom) { + return 'school/classes/hourorder/order_log/index?classes_hour_order_id='+row.id; + } + return Controller; }); diff --git a/public/assets/js/backend/school/classes/hourorder/order_log.js b/public/assets/js/backend/school/classes/hourorder/order_log.js index ec76b15..ed3331f 100644 --- a/public/assets/js/backend/school/classes/hourorder/order_log.js +++ b/public/assets/js/backend/school/classes/hourorder/order_log.js @@ -26,12 +26,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_hour_order_id', title: __('Classes_hour_order_id')}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'order.order_no', title: __('Order.order_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} + {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + + {field: 'classes_hour_order_id', title: __('Classes_hour_order_id')}, + {field: 'order.order_no', title: __('Order.order_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 03d426e..2007ab6 100644 --- a/public/assets/js/backend/school/classes/order/order.js +++ b/public/assets/js/backend/school/classes/order/order.js @@ -9,6 +9,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin add_url: 'school/classes/order/order/add', edit_url: 'school/classes/order/order/edit', del_url: 'school/classes/order/order/del', + cancel_url: 'school/classes/order/order/cancel', multi_url: 'school/classes/order/order/multi', import_url: 'school/classes/order/order/import', table: 'school_classes_order', @@ -27,62 +28,159 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + {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'){ + return true; + } + return false; + }}, + { + name: 'order_detail', + text: __('课时使用情况'), + title: __('课时使用情况'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_detail_url, + callback: function (data) { + + }, + visible: function (row) { + return row.paytime; + } + }, + { + name: 'order', + text: __('课时预约记录'), + title: __('课时预约记录'), + classname: 'btn btn-xs btn-danger btn-magic btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + visible: function (row) { + return row.paytime; + } + }, + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_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 == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + {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: 'user_id', title: __('User_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {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_lib_id', title: __('Classes_lib_id')}, - {field: 'classes_order_detail_id', title: __('Classes_order_detail_id')}, - {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'}, - {field: 'totalprice', title: __('Totalprice'), 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'),"3":__('Status 3'),"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'),"3":__('Before_status 3'),"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: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'auth_manystore_id', title: __('Auth_manystore_id')}, - {field: 'auth_opinion', title: __('Auth_opinion'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'auth_file', title: __('Auth_file'), operate: false, formatter: Table.api.formatter.file}, - {field: 'admin_id', title: __('Admin_id')}, - {field: 'result_status', title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, - {field: 'result_text', title: __('Result_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'result_file', title: __('Result_file'), operate: false, formatter: Table.api.formatter.file}, - {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: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'refundtime', title: __('Refundtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, - {field: 'total_refundprice', title: __('Total_refundprice'), operate:'BETWEEN'}, - {field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'}, - {field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'}, - {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: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + + {field: 'pay_no',visible:false, title: __('Pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {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: 'user_id', title: __('User_id'),visible:false}, {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: 'shop.name', title: __('Shop.name'), operate: 'LIKE'}, - {field: 'shop.image', title: __('Shop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'shop.address_city', title: __('Shop.address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'shop.province', title: __('Shop.province')}, - {field: 'shop.city', title: __('Shop.city')}, - {field: 'shop.district', title: __('Shop.district')}, - {field: 'shop.address', title: __('Shop.address'), operate: 'LIKE'}, - {field: 'shop.address_detail', title: __('Shop.address_detail'), operate: 'LIKE'}, - {field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'lib.headimage', title: __('Lib.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: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'}, - {field: 'admin.avatar', title: __('Admin.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} + {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: 'manystore_id', title: __('Manystore_id'),visible:false}, + {field: 'shop_id', title: __('Shop_id'),visible:false}, + {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_lib_id', title: __('Classes_lib_id')}, + {field: 'classes_order_detail_id', title: __('Classes_order_detail_id'),visible:false}, + {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN',visible:false}, + {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, + {field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status}, + {field: 'server_status',visible:false, title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, + {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'auth_manystore_id',visible:false, title: __('Auth_manystore_id')}, + {field: 'auth_opinion',visible:false, title: __('Auth_opinion'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'auth_file',visible:false, title: __('Auth_file'), operate: false, formatter: Table.api.formatter.file}, + {field: 'admin_id',visible:false, title: __('Admin_id')}, + {field: 'result_status',visible:false, title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, + {field: 'result_text',visible:false, title: __('Result_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'result_file',visible:false, title: __('Result_file'), operate: false, formatter: Table.api.formatter.file}, + {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: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'refundtime', title: __('Refundtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'total_refundprice',visible:false, title: __('Total_refundprice'), operate:'BETWEEN'}, + {field: 'real_refundprice',visible:false, title: __('Real_refundprice'), operate:'BETWEEN'}, + {field: 'sub_refundprice',visible:false, title: __('Sub_refundprice'), operate:'BETWEEN'}, + {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: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'manystore.avatar',visible:false, title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'shop.name',visible:false, title: __('Shop.name'), operate: 'LIKE'}, + {field: 'shop.image',visible:false, title: __('Shop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'shop.address_city',visible:false, title: __('Shop.address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'shop.province',visible:false, title: __('Shop.province')}, + {field: 'shop.city',visible:false, title: __('Shop.city')}, + {field: 'shop.district',visible:false, title: __('Shop.district')}, + {field: 'shop.address',visible:false, title: __('Shop.address'), operate: 'LIKE'}, + {field: 'shop.address_detail',visible:false, title: __('Shop.address_detail'), operate: 'LIKE'}, + // {field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'lib.headimage', title: __('Lib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'}, + // {field: 'admin.avatar', title: __('Admin.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} ] ] }); @@ -162,5 +260,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + + var order_detail_url = function (row,dom) { + return 'school/classes/order/order_detail/index?classes_order_id='+row.id; + } + + var order_log_url = function (row,dom) { + return 'school/classes/order/order_log/index?classes_order_id='+row.id; + } + + var order_url = function (row,dom) { + return 'school/classes/hourorder/order/index?classes_order_id='+row.id + '&classes_lib_id='+row.classes_lib_id; + } + return Controller; }); diff --git a/public/assets/js/backend/school/classes/order/order_detail.js b/public/assets/js/backend/school/classes/order/order_detail.js index 01ef682..9898ee6 100644 --- a/public/assets/js/backend/school/classes/order/order_detail.js +++ b/public/assets/js/backend/school/classes/order/order_detail.js @@ -28,20 +28,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_order_id', title: __('Classes_order_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, + {field: 'classes_num', title: __('Classes_num')}, + {field: 'use_num', title: __('Use_num')}, + {field: 'sub_num', title: __('Sub_num')}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, {field: 'shop_id', title: __('Shop_id')}, - {field: 'user_id', title: __('User_id')}, - {field: 'classes_cate_ids', title: __('Classes_cate_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'classes_label_ids', title: __('Classes_label_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'user_id',visible:false, title: __('User_id')}, + {field: 'classes_cate_ids',visible:false, title: __('Classes_cate_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'classes_label_ids',visible:false, title: __('Classes_label_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'self_label_tag', title: __('Self_label_tag'), operate: 'LIKE', formatter: Table.api.formatter.flag}, - {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',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: '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}, {field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal}, - {field: 'classes_num', title: __('Classes_num')}, + {field: 'price', title: __('Price'), operate:'BETWEEN'}, + + {field: 'unit_price', title: __('Unit_price'), operate:'BETWEEN'}, + {field: 'used_price', title: __('Used_price'), operate:'BETWEEN'}, + + + {field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal}, {field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'province', title: __('Province')}, @@ -49,37 +58,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'district', title: __('District')}, {field: 'address', title: __('Address'), operate: 'LIKE'}, {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'}, - {field: 'longitude', title: __('Longitude'), operate: 'LIKE'}, - {field: 'latitude', title: __('Latitude'), operate: 'LIKE'}, + {field: 'longitude',visible:false, title: __('Longitude'), operate: 'LIKE'}, + {field: 'latitude',visible:false, title: __('Latitude'), operate: 'LIKE'}, {field: 'classes_date_text', title: __('Classes_date_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'classes_time_text', title: __('Classes_time_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'virtual_num', title: __('Virtual_num')}, - {field: 'sale', title: __('Sale')}, - {field: 'price', title: __('Price'), operate:'BETWEEN'}, - {field: 'underline_price', title: __('Underline_price'), operate:'BETWEEN'}, - {field: 'virtual_collect', title: __('Virtual_collect')}, - {field: 'use_num', title: __('Use_num')}, - {field: 'sub_num', title: __('Sub_num')}, - {field: 'unit_price', title: __('Unit_price'), operate:'BETWEEN'}, - {field: 'used_price', title: __('Used_price'), operate:'BETWEEN'}, + {field: 'virtual_num',visible:false, title: __('Virtual_num')}, + // {field: 'sale',visible:false, title: __('Sale')}, + + {field: 'underline_price',visible:false, title: __('Underline_price'), operate:'BETWEEN'}, + {field: 'virtual_collect',visible:false, title: __('Virtual_collect')}, {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: 'order.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'}, - {field: 'shop.image', title: __('Shop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'shop.address_city', title: __('Shop.address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'shop.province', title: __('Shop.province')}, - {field: 'shop.city', title: __('Shop.city')}, - {field: 'shop.district', title: __('Shop.district')}, - {field: 'shop.address', title: __('Shop.address'), operate: 'LIKE'}, - {field: 'shop.address_detail', title: __('Shop.address_detail'), 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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'order.order_no',visible:false, title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + // {field: 'manystore.avatar',visible:false, title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'shop.name',visible:false, title: __('Shop.name'), operate: 'LIKE'}, + // {field: 'shop.image',visible:false, title: __('Shop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'shop.address_city', title: __('Shop.address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'shop.province', title: __('Shop.province')}, + // {field: 'shop.city', title: __('Shop.city')}, + // {field: 'shop.district', title: __('Shop.district')}, + // {field: 'shop.address', title: __('Shop.address'), operate: 'LIKE'}, + // {field: 'shop.address_detail', title: __('Shop.address_detail'), 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: '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_log.js b/public/assets/js/backend/school/classes/order/order_log.js index e6fefab..20dd9bd 100644 --- a/public/assets/js/backend/school/classes/order/order_log.js +++ b/public/assets/js/backend/school/classes/order/order_log.js @@ -26,15 +26,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_order_id', title: __('Classes_order_id')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + {field: 'classes_order_id', title: __('Classes_order_id')}, {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"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: 'result_status', title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, - {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, - {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'order.order_no', title: __('Order.order_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} + // {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/teacher.js b/public/assets/js/backend/school/classes/teacher.js index 780197c..0193d26 100644 --- a/public/assets/js/backend/school/classes/teacher.js +++ b/public/assets/js/backend/school/classes/teacher.js @@ -130,6 +130,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + + Form.api.bindevent($("form[role=form]")); } } diff --git a/public/assets/js/backend/school/classes/verification.js b/public/assets/js/backend/school/classes/verification.js index bd0d678..b226239 100644 --- a/public/assets/js/backend/school/classes/verification.js +++ b/public/assets/js/backend/school/classes/verification.js @@ -69,6 +69,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin api: { bindevent: function () { + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + //老师必须是上面机构中的 $("#c-classes_lib_ids").data("params", function (obj) { //obj为SelectPage对象 diff --git a/public/assets/js/backend/school/classes/virtual_user.js b/public/assets/js/backend/school/classes/virtual_user.js index 08053ee..4a73a10 100644 --- a/public/assets/js/backend/school/classes/virtual_user.js +++ b/public/assets/js/backend/school/classes/virtual_user.js @@ -30,6 +30,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'nickname', title: __('Nickname'), operate: 'LIKE'}, {field: 'head_image', title: __('Head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'classes_lib_id', title: __('Classes_lib_id')}, + {field: 'jointype', title: __('Jointype'), searchList: {"1":__('Jointype 1'),"0":__('Jointype 0')}, formatter: Table.api.formatter.normal}, + {field: 'havetype', title: __('Havetype'), searchList: {"1":__('Havetype 1'),"0":__('Havetype 0')}, formatter: Table.api.formatter.normal}, + {field: 'time', title: __('Time'),operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'lib.headimage', title: __('Lib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, diff --git a/public/assets/js/backend/school/message.js b/public/assets/js/backend/school/message.js index aaa3d68..d6ed92d 100644 --- a/public/assets/js/backend/school/message.js +++ b/public/assets/js/backend/school/message.js @@ -21,13 +21,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', - sortName: 'id', - fixedColumns: true, - fixedRightNumber: 1, + sortName: 'weigh', + // fixedColumns: true, + // fixedRightNumber: 1, columns: [ [ {checkbox: true}, - {field: 'id', title: __('Id')}, + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + {field: 'id', title: __('Id'),sortable: true}, + {field: 'weigh', title: __('Weigh'), operate: false,sortable: true}, + + {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal}, + {field: 'platform', title: __('Platform'), searchList: {"admin":__('Platform admin'),"user":__('Platform user'),"shop":__('Platform shop')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label}, {field: 'oper_type', title: __('Oper_type'), searchList: {"admin":__('Oper_type admin'),"user":__('Oper_type user'),"system":__('Oper_type system'),"shop":__('Oper_type shop')}, formatter: Table.api.formatter.normal}, {field: 'oper_id', title: __('Oper_id')}, @@ -43,8 +49,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'user.avatar', 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/user/user.js b/public/assets/js/backend/user/user.js index 6ecd518..2920e0a 100644 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -48,6 +48,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // 为表格绑定事件 Table.api.bindevent(table); + + /** + * 发放y预约订单 + * cc + * 2020年8月5日 + */ + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + } + }; + Fast.api.open(url,title,options); + }); }, add: function () { Controller.api.bindevent(); @@ -55,6 +77,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + changeuser: function(){ + $("#changeuser").on('click', function() { + $("#changeuser-form").attr("action",'user/user/changeuser').submit(); + }); + Controller.api.bindevent(); + }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); diff --git a/public/assets/js/manystore/manystore/user_auth.js b/public/assets/js/manystore/manystore/user_auth.js index 4f5b6a2..fdf0360 100644 --- a/public/assets/js/manystore/manystore/user_auth.js +++ b/public/assets/js/manystore/manystore/user_auth.js @@ -40,6 +40,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ] }); + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + } + }; + Fast.api.open(url,title,options); + }); + // 为表格绑定事件 Table.api.bindevent(table); }, @@ -49,6 +67,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + changeuser: function(){ + $("#changeuser").on('click', function() { + $("#changeuser-form").attr("action",'manystore/user_auth/changeuser').submit(); + }); + Controller.api.bindevent(); + }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); diff --git a/public/assets/js/manystore/school/classes/cate.js b/public/assets/js/manystore/school/classes/cate.js index 52d7ff0..36e9675 100644 --- a/public/assets/js/manystore/school/classes/cate.js +++ b/public/assets/js/manystore/school/classes/cate.js @@ -29,8 +29,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'name', title: __('Name'), operate: 'LIKE'}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, + {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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] diff --git a/public/assets/js/manystore/school/classes/classes_lib.js b/public/assets/js/manystore/school/classes/classes_lib.js index ff386df..6e1c1c1 100644 --- a/public/assets/js/manystore/school/classes/classes_lib.js +++ b/public/assets/js/manystore/school/classes/classes_lib.js @@ -32,7 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin name: 'classes_spec', text: __('设置课程规格'), title: __('设置课程规格'), - classname: 'btn btn-xs btn-primary btn-dialog', + classname: 'btn btn-xs btn-danger btn-magic btn-dialog', icon: 'fa fa-list', url: classes_spec_url, callback: function (data) { @@ -70,6 +70,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // return row.status == '2'||row.status == '3'; // } }, + { + name: 'order', + text: __('课程订单查看'), + title: __('课程订单查看'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, // {name: 'unsetmockauth', // text: '取消加圈资格', // icon: 'fa fa-sign-in', @@ -279,6 +293,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); Form.api.bindevent($("form[role=form]")); } @@ -323,5 +355,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'school/classes/teacher/index?id='+row.teacher_id +'&shop_id='+row.shop_id; } + var order_url = function (row,dom) { + return 'school/classes/order/order/index?classes_lib_id='+row.id +'&shop_id='+row.shop_id; + } + return Controller; }); diff --git a/public/assets/js/manystore/school/classes/classes_spec.js b/public/assets/js/manystore/school/classes/classes_spec.js index b166c42..93ead6b 100644 --- a/public/assets/js/manystore/school/classes/classes_spec.js +++ b/public/assets/js/manystore/school/classes/classes_spec.js @@ -25,21 +25,61 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + {field: 'operate', title: __('Operate'), table: table , buttons: [ + { + name: 'order', + text: __('课时预约查看'), + title: __('课时预约查看'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_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 == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + {field: 'id', title: __('Id')}, {field: 'classes_lib_id', title: __('Classes_lib_id')}, {field: 'name', title: __('Name'), operate: 'LIKE'}, - {field: 'start_time', title: __('Start_time')}, - {field: 'end_time', title: __('End_time')}, + {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'limit_num', title: __('Limit_num')}, {field: 'sign_num', title: __('Sign_num')}, {field: 'verification_num', title: __('Verification_num')}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, + {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: 'schoolclasseslib.title', title: __('Schoolclasseslib.title'), operate: 'LIKE'}, {field: 'schoolclasseslib.headimage', title: __('Schoolclasseslib.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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -126,5 +166,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + var order_url = function (row,dom) { + return 'school/classes/hourorder/order/index?classes_lib_spec_id='+row.id; + } + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/collect.js b/public/assets/js/manystore/school/classes/collect.js index 6d5de8f..6521f36 100644 --- a/public/assets/js/manystore/school/classes/collect.js +++ b/public/assets/js/manystore/school/classes/collect.js @@ -29,7 +29,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'user_id', title: __('User_id')}, {field: 'classes_lib_id', title: __('Classes_lib_id')}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'createtime', title: __('Createtime')}, + {field: 'createtime', title: __('Createtime'), 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'}, diff --git a/public/assets/js/manystore/school/classes/hourorder/order.js b/public/assets/js/manystore/school/classes/hourorder/order.js index d51277c..b94e90c 100644 --- a/public/assets/js/manystore/school/classes/hourorder/order.js +++ b/public/assets/js/manystore/school/classes/hourorder/order.js @@ -6,8 +6,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/hourorder/order/index' + location.search, - add_url: 'school/classes/hourorder/order/add', - edit_url: 'school/classes/hourorder/order/edit', + add_url: 'school/classes/hourorder/order/add'+ location.search, + edit_url: 'school/classes/hourorder/order/edit'+ location.search, + examine_url: 'school/classes/hourorder/order/examine', + verification_url: 'school/classes/hourorder/order/verification', del_url: 'school/classes/hourorder/order/del', multi_url: 'school/classes/hourorder/order/multi', import_url: 'school/classes/hourorder/order/import', @@ -25,36 +27,118 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + {field: 'operate', title: __('Operate'), table: table , buttons: [ + {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 == 0){ + 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 == '-1'; + } + }, + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_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 == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + {field: 'id', title: __('Id')}, - {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, - {field: 'classes_order_id', title: __('Classes_order_id')}, - {field: 'classes_lib_spec_id', title: __('Classes_lib_spec_id')}, - {field: 'user_id', title: __('User_id')}, - {field: 'classes_order_detail_id', title: __('Classes_order_detail_id')}, - {field: 'classes_lib_id', title: __('Classes_lib_id')}, - {field: 'name', title: __('Name'), operate: 'LIKE'}, - {field: 'start_time', title: __('Start_time')}, - {field: 'end_time', title: __('End_time')}, - {field: 'limit_num', title: __('Limit_num')}, - {field: 'sign_num', title: __('Sign_num')}, - {field: 'verification_num', title: __('Verification_num')}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'verification_user_id', title: __('Verification_user_id')}, - {field: 'reservation_time', title: __('Reservation_time')}, - {field: 'finish_time', title: __('Finish_time')}, - {field: 'cancel_time', title: __('Cancel_time')}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, - {field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, - {field: 'schoolclasseslibspec.name', title: __('Schoolclasseslibspec.name'), operate: 'LIKE'}, + + + {field: 'name', title: __('Name'), operate: 'LIKE'}, + {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'classes_lib_spec_id',visible:false, title: __('Classes_lib_spec_id')}, + {field: 'user_id', title: __('User_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'classes_lib_id',visible:false, title: __('Classes_lib_id')}, + {field: 'limit_num', title: __('Limit_num')}, + {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: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'}, - {field: 'schoolclassesorderdetail.headimage', title: __('Schoolclassesorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolclasseslib.title', title: __('Schoolclasseslib.title'), operate: 'LIKE'}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'schoolclassesorderdetail.title',visible:false, title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'}, + {field: 'schoolclassesorderdetail.headimage',visible:false, title: __('Schoolclassesorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + + + + // {field: 'sign_num',visible:false, title: __('Sign_num')}, + // {field: 'verification_num',visible:false, title: __('Verification_num')}, + {field: 'verification_user_id',visible:false, title: __('Verification_user_id')}, + {field: 'reservation_time', title: __('Reservation_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'finish_time', title: __('Finish_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'cancel_time', title: __('Cancel_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {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: 'schoolclassesorder.order_no',visible:false, title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, + // {field: 'schoolclasseslibspec.name',visible:false, title: __('Schoolclasseslibspec.name'), operate: 'LIKE'}, + // {field: 'schoolclasseslib.title',visible:false, title: __('Schoolclasseslib.title'), operate: 'LIKE'}, + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -128,11 +212,33 @@ 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/hourorder/order/examine').submit(); + }); + Controller.api.bindevent(); + }, + verification: function () { + Controller.api.bindevent(); + }, api: { bindevent: function () { + + //老师必须是上面机构中的 + $("#c-classes_lib_spec_id").data("params", function (obj) { + //obj为SelectPage对象 + return {custom: {classes_lib_id: $("#c-classes_lib_id").val(),status: '1'}}; + }); + + Form.api.bindevent($("form[role=form]")); } } }; + + var order_log_url = function (row,dom) { + return 'school/classes/hourorder/order_log/index?classes_hour_order_id='+row.id; + } + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/hourorder/order_log.js b/public/assets/js/manystore/school/classes/hourorder/order_log.js index ebc763c..2baa31c 100644 --- a/public/assets/js/manystore/school/classes/hourorder/order_log.js +++ b/public/assets/js/manystore/school/classes/hourorder/order_log.js @@ -26,12 +26,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_hour_order_id', title: __('Classes_hour_order_id')}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'log_text', title: __('Log_text'), operate: 'LIKE'}, - {field: 'createtime', title: __('Createtime')}, + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + + {field: 'classes_hour_order_id', title: __('Classes_hour_order_id')}, {field: 'schoolclasseshourorder.order_no', title: __('Schoolclasseshourorder.order_no'), operate: 'LIKE'}, - {field: 'operate', title: __('Operate'), table: table, 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} ] ] }); diff --git a/public/assets/js/manystore/school/classes/order/order.js b/public/assets/js/manystore/school/classes/order/order.js index c432f0d..e6234ce 100644 --- a/public/assets/js/manystore/school/classes/order/order.js +++ b/public/assets/js/manystore/school/classes/order/order.js @@ -9,6 +9,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin add_url: 'school/classes/order/order/add', edit_url: 'school/classes/order/order/edit', del_url: 'school/classes/order/order/del', + cancel_url: 'school/classes/order/order/cancel', multi_url: 'school/classes/order/order/multi', import_url: 'school/classes/order/order/import', table: 'school_classes_order', @@ -25,62 +26,162 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + + {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'){ + return true; + } + return false; + }}, + { + name: 'order_detail', + text: __('课时使用情况'), + title: __('课时使用情况'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_detail_url, + callback: function (data) { + + }, + visible: function (row) { + return row.paytime; + } + }, + + + + { + name: 'order', + text: __('课时预约记录'), + title: __('课时预约记录'), + classname: 'btn btn-xs btn-danger btn-magic btn-dialog', + icon: 'fa fa-list', + url: order_url, + callback: function (data) { + + }, + visible: function (row) { + return row.paytime; + } + }, + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_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 == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + {field: 'id', title: __('Id')}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, - {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE'}, - {field: 'user_id', title: __('User_id')}, - {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_lib_id', title: __('Classes_lib_id')}, - {field: 'classes_order_detail_id', title: __('Classes_order_detail_id')}, - {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'}, - {field: 'totalprice', title: __('Totalprice'), 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'),"3":__('Status 3'),"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'),"3":__('Before_status 3'),"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: 'reason', title: __('Reason'), operate: 'LIKE'}, - {field: 'auth_manystore_id', title: __('Auth_manystore_id')}, - {field: 'auth_opinion', title: __('Auth_opinion'), operate: 'LIKE'}, - {field: 'auth_file', title: __('Auth_file'), operate: false}, - {field: 'admin_id', title: __('Admin_id')}, - {field: 'result_status', title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, - {field: 'result_text', title: __('Result_text'), operate: 'LIKE'}, - {field: 'result_file', title: __('Result_file'), operate: false}, - {field: 'canceltime', title: __('Canceltime')}, - {field: 'paytime', title: __('Paytime')}, - {field: 'finishtime', title: __('Finishtime')}, - {field: 'refundtime', title: __('Refundtime')}, - {field: 'total_refundprice', title: __('Total_refundprice'), operate:'BETWEEN'}, - {field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'}, - {field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + + {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE',visible:false}, + {field: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'}, + {field: 'schoolclassesorderdetail.headimage', title: __('Schoolclassesorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {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: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, - {field: 'manystoreshop.image', title: __('Manystoreshop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystoreshop.address_city', title: __('Manystoreshop.address_city'), operate: 'LIKE'}, - {field: 'manystoreshop.province', title: __('Manystoreshop.province')}, - {field: 'manystoreshop.city', title: __('Manystoreshop.city')}, - {field: 'manystoreshop.district', title: __('Manystoreshop.district')}, - {field: 'manystoreshop.address', title: __('Manystoreshop.address'), operate: 'LIKE'}, - {field: 'manystoreshop.address_detail', title: __('Manystoreshop.address_detail'), operate: 'LIKE'}, - {field: 'schoolclasseslib.title', title: __('Schoolclasseslib.title'), operate: 'LIKE'}, - {field: 'schoolclasseslib.headimage', title: __('Schoolclasseslib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'}, - {field: 'schoolclassesorderdetail.headimage', title: __('Schoolclassesorderdetail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'}, - {field: 'admin.avatar', title: __('Admin.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} + + + {field: 'user_id', title: __('User_id')}, + {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: 'manystore_id', title: __('Manystore_id'),visible:false}, + {field: 'shop_id', title: __('Shop_id'),visible:false}, + {field: 'code', title: __('Code'),visible:false, 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_lib_id', title: __('Classes_lib_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'beforeprice',visible:false, title: __('Beforeprice'), operate:'BETWEEN'}, + {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, + {field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status}, + {field: 'server_status',visible:false, title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, + {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'}, + {field: 'auth_manystore_id',visible:false, title: __('Auth_manystore_id')}, + {field: 'auth_opinion',visible:false, title: __('Auth_opinion'), operate: 'LIKE'}, + {field: 'auth_file',visible:false, title: __('Auth_file'), operate: false}, + {field: 'admin_id',visible:false, title: __('Admin_id')}, + {field: 'result_status',visible:false, title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, + {field: 'result_text',visible:false, title: __('Result_text'), operate: 'LIKE'}, + {field: 'result_file',visible:false, title: __('Result_file'), operate: false}, + {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: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'refundtime', title: __('Refundtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'total_refundprice',visible:false, title: __('Total_refundprice'), operate:'BETWEEN'}, + {field: 'real_refundprice',visible:false, title: __('Real_refundprice'), operate:'BETWEEN'}, + {field: 'sub_refundprice',visible:false, title: __('Sub_refundprice'), operate:'BETWEEN'}, + {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: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'manystore.avatar',visible:false, title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'manystoreshop.name',visible:false, title: __('Manystoreshop.name'), operate: 'LIKE'}, + {field: 'manystoreshop.image',visible:false, title: __('Manystoreshop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'manystoreshop.address_city',visible:false, title: __('Manystoreshop.address_city'), operate: 'LIKE'}, + {field: 'manystoreshop.province',visible:false, title: __('Manystoreshop.province')}, + {field: 'manystoreshop.city',visible:false, title: __('Manystoreshop.city')}, + {field: 'manystoreshop.district',visible:false, title: __('Manystoreshop.district')}, + {field: 'manystoreshop.address',visible:false, title: __('Manystoreshop.address'), operate: 'LIKE'}, + {field: 'manystoreshop.address_detail',visible:false, title: __('Manystoreshop.address_detail'), operate: 'LIKE'}, + {field: 'schoolclasseslib.title',visible:false, title: __('Schoolclasseslib.title'), operate: 'LIKE'}, + {field: 'schoolclasseslib.headimage',visible:false, title: __('Schoolclasseslib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'admin.nickname', title: __('Admin.nickname'),visible:false, operate: 'LIKE'}, + {field: 'admin.avatar', title: __('Admin.avatar'),visible:false, 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} ] ] }); @@ -159,5 +260,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + + var order_detail_url = function (row,dom) { + return 'school/classes/order/order_detail/index?classes_order_id='+row.id; + } + + var order_log_url = function (row,dom) { + return 'school/classes/order/order_log/index?classes_order_id='+row.id; + } + + var order_url = function (row,dom) { + return 'school/classes/hourorder/order/index?classes_order_id='+row.id + '&classes_lib_id='+row.classes_lib_id; + } + + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/order/order_detail.js b/public/assets/js/manystore/school/classes/order/order_detail.js index f0b24d6..0a88f03 100644 --- a/public/assets/js/manystore/school/classes/order/order_detail.js +++ b/public/assets/js/manystore/school/classes/order/order_detail.js @@ -26,20 +26,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_order_id', title: __('Classes_order_id')}, - {field: 'manystore_id', title: __('Manystore_id')}, - {field: 'shop_id', title: __('Shop_id')}, - {field: 'user_id', title: __('User_id')}, - {field: 'classes_cate_ids', title: __('Classes_cate_ids'), operate: 'LIKE'}, - {field: 'classes_label_ids', title: __('Classes_label_ids'), operate: 'LIKE'}, + {field: 'classes_num', title: __('Classes_num')}, + {field: 'use_num', title: __('Use_num')}, + {field: 'sub_num', title: __('Sub_num')}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_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: 'classes_cate_ids',visible:false, title: __('Classes_cate_ids'), operate: 'LIKE'}, + {field: 'classes_label_ids',visible:false, title: __('Classes_label_ids'), operate: 'LIKE'}, {field: 'self_label_tag', title: __('Self_label_tag'), operate: 'LIKE'}, - {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',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: '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}, {field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal}, - {field: 'classes_num', title: __('Classes_num')}, + {field: 'price', title: __('Price'), operate:'BETWEEN'}, + + {field: 'unit_price', title: __('Unit_price'), operate:'BETWEEN'}, + {field: 'used_price', title: __('Used_price'), operate:'BETWEEN'}, + + {field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal}, {field: 'address_city', title: __('Address_city'), operate: 'LIKE'}, {field: 'province', title: __('Province')}, @@ -51,33 +59,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'latitude', title: __('Latitude'), operate: 'LIKE'}, {field: 'classes_date_text', title: __('Classes_date_text'), operate: 'LIKE'}, {field: 'classes_time_text', title: __('Classes_time_text'), operate: 'LIKE'}, - {field: 'virtual_num', title: __('Virtual_num')}, - {field: 'sale', title: __('Sale')}, - {field: 'price', title: __('Price'), operate:'BETWEEN'}, + {field: 'virtual_num',visible:false, title: __('Virtual_num')}, + // {field: 'sale', title: __('Sale')}, + {field: 'underline_price', title: __('Underline_price'), operate:'BETWEEN'}, - {field: 'virtual_collect', title: __('Virtual_collect')}, - {field: 'use_num', title: __('Use_num')}, - {field: 'sub_num', title: __('Sub_num')}, - {field: 'unit_price', title: __('Unit_price'), operate:'BETWEEN'}, - {field: 'used_price', title: __('Used_price'), operate:'BETWEEN'}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, - {field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, - {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, - {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, - {field: 'manystoreshop.image', title: __('Manystoreshop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'manystoreshop.address_city', title: __('Manystoreshop.address_city'), operate: 'LIKE'}, - {field: 'manystoreshop.province', title: __('Manystoreshop.province')}, - {field: 'manystoreshop.city', title: __('Manystoreshop.city')}, - {field: 'manystoreshop.district', title: __('Manystoreshop.district')}, - {field: 'manystoreshop.address', title: __('Manystoreshop.address'), operate: 'LIKE'}, - {field: 'manystoreshop.address_detail', title: __('Manystoreshop.address_detail'), 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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'virtual_collect',visible:false, title: __('Virtual_collect')}, + + {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: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, + // {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, + // {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, + // {field: 'manystoreshop.image', title: __('Manystoreshop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'manystoreshop.address_city', title: __('Manystoreshop.address_city'), operate: 'LIKE'}, + // {field: 'manystoreshop.province', title: __('Manystoreshop.province')}, + // {field: 'manystoreshop.city', title: __('Manystoreshop.city')}, + // {field: 'manystoreshop.district', title: __('Manystoreshop.district')}, + // {field: 'manystoreshop.address', title: __('Manystoreshop.address'), operate: 'LIKE'}, + // {field: 'manystoreshop.address_detail', title: __('Manystoreshop.address_detail'), 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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); diff --git a/public/assets/js/manystore/school/classes/order/order_log.js b/public/assets/js/manystore/school/classes/order/order_log.js index 3169122..b50e91f 100644 --- a/public/assets/js/manystore/school/classes/order/order_log.js +++ b/public/assets/js/manystore/school/classes/order/order_log.js @@ -26,15 +26,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'classes_order_id', title: __('Classes_order_id')}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'log_text', title: __('Log_text'), operate: 'LIKE'}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + + {field: 'classes_order_id', title: __('Classes_order_id')}, {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"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: 'result_status', title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, - {field: 'log_text', title: __('Log_text'), operate: 'LIKE'}, - {field: 'createtime', title: __('Createtime')}, - {field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_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/school/classes/teacher.js b/public/assets/js/manystore/school/classes/teacher.js index f0998f2..cc5641d 100644 --- a/public/assets/js/manystore/school/classes/teacher.js +++ b/public/assets/js/manystore/school/classes/teacher.js @@ -29,17 +29,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'manystore_id', title: __('Manystore_id'),visible:false}, {field: 'shop_id', title: __('Shop_id'),visible:false}, {field: 'user_id', title: __('User_id'),visible:false}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'user.nickname', title: __('User.nickname'),visible:false, operate: 'LIKE'}, + {field: 'user.realname', title: __('User.realname'),visible:false, operate: 'LIKE'}, + {field: 'user.avatar', title: __('User.avatar'),visible:false, operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'name', title: __('Name'), operate: 'LIKE'}, {field: 'head_image', title: __('Head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'expert_image', title: __('Expert_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, + {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: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE',visible:false}, // {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE',visible:false}, // {field: 'manystoreshop.image', title: __('Manystoreshop.image'),visible:false, operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, @@ -125,6 +125,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + Form.api.bindevent($("form[role=form]")); } } diff --git a/public/assets/js/manystore/school/classes/verification.js b/public/assets/js/manystore/school/classes/verification.js index cf55475..1c12212 100644 --- a/public/assets/js/manystore/school/classes/verification.js +++ b/public/assets/js/manystore/school/classes/verification.js @@ -42,8 +42,8 @@ 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: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, + {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: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, // {field: 'manystore.avatar', title: __('Manystore.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, // {field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'}, @@ -77,6 +77,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }); + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + + Form.api.bindevent($("form[role=form]")); } }