Bladeren bron

Merge branch 'master' of http://git.huxiukeji.com/lizhen/xiaoshan

lizhen_gitee 3 maanden geleden
bovenliggende
commit
17f9c8a2b2
59 gewijzigde bestanden met toevoegingen van 3302 en 258 verwijderingen
  1. 37 0
      application/admin/controller/UniversityCourse.php
  2. 83 0
      application/admin/controller/UniversityCourseChapter.php
  3. 38 0
      application/admin/controller/VipConfig.php
  4. 38 0
      application/admin/controller/VipCoupon.php
  5. 16 0
      application/admin/lang/zh-cn/university_course.php
  6. 16 0
      application/admin/lang/zh-cn/university_course_chapter.php
  7. 1 0
      application/admin/lang/zh-cn/university_event.php
  8. 20 0
      application/admin/lang/zh-cn/vip_config.php
  9. 21 0
      application/admin/lang/zh-cn/vip_coupon.php
  10. 81 0
      application/admin/model/UniversityCourse.php
  11. 81 0
      application/admin/model/UniversityCourseChapter.php
  12. 95 0
      application/admin/model/VipConfig.php
  13. 87 0
      application/admin/model/VipCoupon.php
  14. 27 0
      application/admin/validate/UniversityCourse.php
  15. 27 0
      application/admin/validate/UniversityCourseChapter.php
  16. 27 0
      application/admin/validate/VipConfig.php
  17. 27 0
      application/admin/validate/VipCoupon.php
  18. 79 0
      application/admin/view/university_course/add.html
  19. 79 0
      application/admin/view/university_course/edit.html
  20. 46 0
      application/admin/view/university_course/index.html
  21. 71 0
      application/admin/view/university_course_chapter/add.html
  22. 71 0
      application/admin/view/university_course_chapter/edit.html
  23. 46 0
      application/admin/view/university_course_chapter/index.html
  24. 6 0
      application/admin/view/university_event/add.html
  25. 6 0
      application/admin/view/university_event/edit.html
  26. 9 9
      application/admin/view/university_event_apply/index.html
  27. 89 0
      application/admin/view/vip_config/add.html
  28. 89 0
      application/admin/view/vip_config/edit.html
  29. 46 0
      application/admin/view/vip_config/index.html
  30. 95 0
      application/admin/view/vip_coupon/add.html
  31. 95 0
      application/admin/view/vip_coupon/edit.html
  32. 46 0
      application/admin/view/vip_coupon/index.html
  33. 92 0
      application/api/controller/Examine.php
  34. 143 56
      application/api/controller/Pay.php
  35. 30 123
      application/api/controller/UniversityCourse.php
  36. 64 62
      application/api/controller/UniversityEvent.php
  37. 65 0
      application/api/controller/Vip.php
  38. 21 0
      application/common/model/ExamineApplyModel.php
  39. 40 0
      application/common/model/ExamineModel.php
  40. 33 0
      application/common/model/PayOrderModel.php
  41. 1 1
      application/common/model/UniversityCourseApplyModel.php
  42. 2 2
      application/common/model/UniversityCourseModel.php
  43. 21 0
      application/common/model/VipConfigModel.php
  44. 21 0
      application/common/model/VipCouponModel.php
  45. 21 0
      application/common/model/VipCouponUserModel.php
  46. 21 0
      application/common/model/VipOrderModel.php
  47. 45 0
      application/utils/Hashids.php
  48. 422 0
      application/utils/Hashids/Hashids.php
  49. 19 0
      application/utils/Hashids/HashidsException.php
  50. 51 0
      application/utils/Hashids/HashidsInterface.php
  51. 116 0
      application/utils/Hashids/Math/Bc.php
  52. 116 0
      application/utils/Hashids/Math/Gmp.php
  53. 92 0
      application/utils/Hashids/Math/MathInterface.php
  54. 78 0
      public/assets/js/backend/university_course.js
  55. 60 0
      public/assets/js/backend/university_course_chapter.js
  56. 2 1
      public/assets/js/backend/university_event.js
  57. 4 4
      public/assets/js/backend/university_event_apply.js
  58. 63 0
      public/assets/js/backend/vip_config.js
  59. 64 0
      public/assets/js/backend/vip_coupon.js

+ 37 - 0
application/admin/controller/UniversityCourse.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 【老年大学】课程
+ *
+ * @icon fa fa-circle-o
+ */
+class UniversityCourse extends Backend
+{
+
+    /**
+     * UniversityCourse模型对象
+     * @var \app\admin\model\UniversityCourse
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\UniversityCourse;
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 83 - 0
application/admin/controller/UniversityCourseChapter.php

@@ -0,0 +1,83 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+use think\Db;
+use think\exception\PDOException;
+use think\exception\ValidateException;
+
+/**
+ * 【老年大学】课程章节
+ *
+ * @icon fa fa-circle-o
+ */
+class UniversityCourseChapter extends Backend
+{
+
+    /**
+     * UniversityCourseChapter模型对象
+     * @var \app\admin\model\UniversityCourseChapter
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $course_id = input('course_id');
+        $this->model = new \app\admin\model\UniversityCourseChapter;
+        $this->view->assign("statusList", $this->model->getStatusList());
+        $this->assignconfig("course_id", $course_id);
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    /**
+     * 添加
+     *
+     * @return string
+     * @throws \think\Exception
+     */
+    public function add()
+    {
+        if (false === $this->request->isPost()) {
+            $row = $this->request->param();
+            $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);
+
+        if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
+            $params[$this->dataLimitField] = $this->auth->id;
+        }
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            if ($this->modelValidate) {
+                $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
+                $this->model->validateFailException()->validate($validate);
+            }
+            $result = $this->model->allowField(true)->save($params);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if ($result === false) {
+            $this->error(__('No rows were inserted'));
+        }
+        $this->success();
+    }
+}

+ 38 - 0
application/admin/controller/VipConfig.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 【VIP】套餐
+ *
+ * @icon fa fa-circle-o
+ */
+class VipConfig extends Backend
+{
+
+    /**
+     * VipConfig模型对象
+     * @var \app\admin\model\VipConfig
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\VipConfig;
+        $this->view->assign("isTryList", $this->model->getIsTryList());
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 38 - 0
application/admin/controller/VipCoupon.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 【VIP】套餐券
+ *
+ * @icon fa fa-circle-o
+ */
+class VipCoupon extends Backend
+{
+
+    /**
+     * VipCoupon模型对象
+     * @var \app\admin\model\VipCoupon
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\VipCoupon;
+        $this->view->assign("typeList", $this->model->getTypeList());
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 16 - 0
application/admin/lang/zh-cn/university_course.php

@@ -0,0 +1,16 @@
+<?php
+
+return [
+    'Name'        => '课程名称',
+    'Image'       => '列表图',
+    'Images'      => '轮播图',
+    'Content'     => '内容',
+    'Weigh'       => '排序值(越大越靠前)',
+    'Status'      => '状态',
+    'Status 1'    => '正常',
+    'Set status to 1'=> '设为正常',
+    'Status 0'    => '禁用',
+    'Set status to 0'=> '设为禁用',
+    'Create_time' => '创建时间',
+    'Update_time' => '修改时间'
+];

+ 16 - 0
application/admin/lang/zh-cn/university_course_chapter.php

@@ -0,0 +1,16 @@
+<?php
+
+return [
+    'Course_id'   => '课程ID',
+    'Name'        => '章节名称',
+    'Duration'    => '时长',
+    'Video'       => '试看视频',
+    'Weigh'       => '排序',
+    'Status'      => '状态',
+    'Status 1'    => '正常',
+    'Set status to 1'=> '设为正常',
+    'Status 0'    => '禁用',
+    'Set status to 0'=> '设为禁用',
+    'Create_time' => '创建时间',
+    'Update_time' => '修改时间'
+];

+ 1 - 0
application/admin/lang/zh-cn/university_event.php

@@ -10,6 +10,7 @@ return [
     'Start_time'       => '活动开始时间',
     'Address'          => '活动地址',
     'Content'          => '内容',
+    'Weigh'       => '排序值(越大越靠前)',
     'Status'           => '状态',
     'Status 1'         => '正常',
     'Set status to 1'  => '设为正常',

+ 20 - 0
application/admin/lang/zh-cn/vip_config.php

@@ -0,0 +1,20 @@
+<?php
+
+return [
+    'Name'        => '套餐名称',
+    'Image'       => '图标',
+    'Price'       => '单价',
+    'Color'       => '颜色',
+    'Is_try'      => '试用开关',
+    'Is_try 1'    => '开启',
+    'Is_try 0'    => '关闭',
+    'Coupon_ids'  => '会员券',
+    'Weigh'       => '排序值(越大越靠前)',
+    'Status'      => '状态',
+    'Status 1'    => '正常',
+    'Set status to 1'=> '设为正常',
+    'Status 0'    => '禁用',
+    'Set status to 0'=> '设为禁用',
+    'Create_time' => '创建时间',
+    'Update_time' => '修改时间'
+];

+ 21 - 0
application/admin/lang/zh-cn/vip_coupon.php

@@ -0,0 +1,21 @@
+<?php
+
+return [
+    'Type'                => '分类',
+    'Type 1'              => '老年大学课程',
+    'Type 0'              => '线下使用',
+    'Name'                => '名称',
+    'Image'               => '图标',
+    'Info'                => '介绍',
+    'Num'                 => '发放数量',
+    'End_days'            => '有效期(天)',
+    'Use_frequency_day'   => '使用频率(单位:天,0不限制)',
+    'Use_frequency_times' => '使用频率(单位:次,0不限制)',
+    'Status'              => '状态',
+    'Status 1'            => '正常',
+    'Set status to 1'     => '设为正常',
+    'Status 0'            => '禁用',
+    'Set status to 0'     => '设为禁用',
+    'Create_time'         => '创建时间',
+    'Update_time'         => '修改时间'
+];

+ 81 - 0
application/admin/model/UniversityCourse.php

@@ -0,0 +1,81 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class UniversityCourse extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $table = 'university_course';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'status_text',
+        'create_time_text',
+        'update_time_text'
+    ];
+    
+
+    protected static function init()
+    {
+        self::afterInsert(function ($row) {
+            $pk = $row->getPk();
+            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+        });
+    }
+
+    
+    public function getStatusList()
+    {
+        return ['1' => __('Status 1'), '0' => __('Status 0')];
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getCreateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getUpdateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCreateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setUpdateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 81 - 0
application/admin/model/UniversityCourseChapter.php

@@ -0,0 +1,81 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class UniversityCourseChapter extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $table = 'university_course_chapter';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'status_text',
+        'create_time_text',
+        'update_time_text'
+    ];
+    
+
+    protected static function init()
+    {
+        self::afterInsert(function ($row) {
+            $pk = $row->getPk();
+            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+        });
+    }
+
+    
+    public function getStatusList()
+    {
+        return ['1' => __('Status 1'), '0' => __('Status 0')];
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getCreateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getUpdateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCreateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setUpdateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 95 - 0
application/admin/model/VipConfig.php

@@ -0,0 +1,95 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class VipConfig extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $table = 'vip_config';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'is_try_text',
+        'status_text',
+        'create_time_text',
+        'update_time_text'
+    ];
+    
+
+    protected static function init()
+    {
+        self::afterInsert(function ($row) {
+            $pk = $row->getPk();
+            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+        });
+    }
+
+    
+    public function getIsTryList()
+    {
+        return ['1' => __('Is_try 1'), '0' => __('Is_try 0')];
+    }
+
+    public function getStatusList()
+    {
+        return ['1' => __('Status 1'), '0' => __('Status 0')];
+    }
+
+
+    public function getIsTryTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['is_try']) ? $data['is_try'] : '');
+        $list = $this->getIsTryList();
+        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 getCreateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getUpdateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCreateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setUpdateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 87 - 0
application/admin/model/VipCoupon.php

@@ -0,0 +1,87 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class VipCoupon extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $table = 'vip_coupon';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'type_text',
+        'status_text',
+        'create_time_text',
+        'update_time_text'
+    ];
+    
+
+    
+    public function getTypeList()
+    {
+        return ['1' => __('Type 1'), '0' => __('Type 0')];
+    }
+
+    public function getStatusList()
+    {
+        return ['1' => __('Status 1'), '0' => __('Status 0')];
+    }
+
+
+    public function getTypeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
+        $list = $this->getTypeList();
+        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 getCreateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getUpdateTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCreateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setUpdateTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 27 - 0
application/admin/validate/UniversityCourse.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class UniversityCourse extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/UniversityCourseChapter.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class UniversityCourseChapter extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/VipConfig.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class VipConfig extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/VipCoupon.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class VipCoupon extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 79 - 0
application/admin/view/university_course/add.html

@@ -0,0 +1,79 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="textarea">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 79 - 0
application/admin/view/university_course/edit.html

@@ -0,0 +1,79 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="textarea" value="{$row.images|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 46 - 0
application/admin/view/university_course/index.html

@@ -0,0 +1,46 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('university_course/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('university_course/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('university_course/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
+                        
+
+<!--                        <div class="dropdown btn-group {:$auth->check('university_course/multi')?'':'hide'}">-->
+<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+<!--                            <ul class="dropdown-menu text-left" role="menu">-->
+<!--                                {foreach name="statusList" item="vo"}-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>-->
+<!--                                {/foreach}-->
+<!--                            </ul>-->
+<!--                        </div>-->
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('university_course/edit')}"
+                           data-operate-del="{:$auth->check('university_course/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 71 - 0
application/admin/view/university_course_chapter/add.html

@@ -0,0 +1,71 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Course_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-course_id" data-rule="required" data-source="university_course/index" class="form-control selectpage" name="row[course_id]" type="text" value="{$row.course_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Duration')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-duration" data-rule="required" class="form-control" name="row[duration]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-video" class="form-control" size="50" name="row[video]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="svga,mp4" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-video"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-video"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 71 - 0
application/admin/view/university_course_chapter/edit.html

@@ -0,0 +1,71 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Course_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-course_id" data-rule="required" data-source="university_course/index" class="form-control selectpage" name="row[course_id]" type="text" value="{$row.course_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Duration')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-duration" data-rule="required" class="form-control" name="row[duration]" type="text" value="{$row.duration|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-video" class="form-control" size="50" name="row[video]" type="text" value="{$row.video|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="svga,mp4" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-video"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-video"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 46 - 0
application/admin/view/university_course_chapter/index.html

@@ -0,0 +1,46 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('university_course_chapter/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('university_course_chapter/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('university_course_chapter/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
+                        
+
+<!--                        <div class="dropdown btn-group {:$auth->check('university_course_chapter/multi')?'':'hide'}">-->
+<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+<!--                            <ul class="dropdown-menu text-left" role="menu">-->
+<!--                                {foreach name="statusList" item="vo"}-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>-->
+<!--                                {/foreach}-->
+<!--                            </ul>-->
+<!--                        </div>-->
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('university_course_chapter/edit')}"
+                           data-operate-del="{:$auth->check('university_course_chapter/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 6 - 0
application/admin/view/university_event/add.html

@@ -71,6 +71,12 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">
             

+ 6 - 0
application/admin/view/university_event/edit.html

@@ -71,6 +71,12 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">
             

+ 9 - 9
application/admin/view/university_event_apply/index.html

@@ -1,14 +1,14 @@
 <div class="panel panel-default panel-intro">
     
-    <div class="panel-heading">
-        {:build_heading(null,FALSE)}
-        <ul class="nav nav-tabs" data-field="status">
-            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
-            {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
-            {/foreach}
-        </ul>
-    </div>
+<!--    <div class="panel-heading">-->
+<!--        {:build_heading(null,FALSE)}-->
+<!--        <ul class="nav nav-tabs" data-field="status">-->
+<!--            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>-->
+<!--            {foreach name="statusList" item="vo"}-->
+<!--            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>-->
+<!--            {/foreach}-->
+<!--        </ul>-->
+<!--    </div>-->
 
 
     <div class="panel-body">

+ 89 - 0
application/admin/view/vip_config/add.html

@@ -0,0 +1,89 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Color')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-color" data-rule="required" class="form-control" name="row[color]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_try')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_try" data-rule="required" class="form-control selectpicker" name="row[is_try]">
+                {foreach name="isTryList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_ids')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-coupon_ids" data-rule="required" data-source="vip_coupon/index" data-multiple="true" class="form-control selectpage" name="row[coupon_ids]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 89 - 0
application/admin/view/vip_config/edit.html

@@ -0,0 +1,89 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Color')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-color" data-rule="required" class="form-control" name="row[color]" type="text" value="{$row.color|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_try')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_try" data-rule="required" class="form-control selectpicker" name="row[is_try]">
+                {foreach name="isTryList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_try"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_ids')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-coupon_ids" data-rule="required" data-source="vip_coupon/index" data-multiple="true" class="form-control selectpage" name="row[coupon_ids]" type="text" value="{$row.coupon_ids|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 46 - 0
application/admin/view/vip_config/index.html

@@ -0,0 +1,46 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('vip_config/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('vip_config/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('vip_config/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
+                        
+
+<!--                        <div class="dropdown btn-group {:$auth->check('vip_config/multi')?'':'hide'}">-->
+<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+<!--                            <ul class="dropdown-menu text-left" role="menu">-->
+<!--                                {foreach name="statusList" item="vo"}-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>-->
+<!--                                {/foreach}-->
+<!--                            </ul>-->
+<!--                        </div>-->
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('vip_config/edit')}"
+                           data-operate-del="{:$auth->check('vip_config/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 95 - 0
application/admin/view/vip_coupon/add.html

@@ -0,0 +1,95 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
+                {foreach name="typeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-info" data-rule="required" class="form-control " rows="5" name="row[info]" cols="50"></textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-num" data-rule="required" class="form-control" name="row[num]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('End_days')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-end_days" data-rule="required" class="form-control" name="row[end_days]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Use_frequency_day')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-use_frequency_day" data-rule="required" class="form-control" name="row[use_frequency_day]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Use_frequency_times')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-use_frequency_times" data-rule="required" class="form-control" name="row[use_frequency_times]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 95 - 0
application/admin/view/vip_coupon/edit.html

@@ -0,0 +1,95 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
+                {foreach name="typeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-info" data-rule="required" class="form-control " rows="5" name="row[info]" cols="50">{$row.info|htmlentities}</textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-num" data-rule="required" class="form-control" name="row[num]" type="number" value="{$row.num|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('End_days')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-end_days" data-rule="required" class="form-control" name="row[end_days]" type="number" value="{$row.end_days|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Use_frequency_day')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-use_frequency_day" data-rule="required" class="form-control" name="row[use_frequency_day]" type="number" value="{$row.use_frequency_day|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Use_frequency_times')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-use_frequency_times" data-rule="required" class="form-control" name="row[use_frequency_times]" type="number" value="{$row.use_frequency_times|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 46 - 0
application/admin/view/vip_coupon/index.html

@@ -0,0 +1,46 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('vip_coupon/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('vip_coupon/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('vip_coupon/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
+                        
+
+<!--                        <div class="dropdown btn-group {:$auth->check('vip_coupon/multi')?'':'hide'}">-->
+<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+<!--                            <ul class="dropdown-menu text-left" role="menu">-->
+<!--                                {foreach name="statusList" item="vo"}-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>-->
+<!--                                {/foreach}-->
+<!--                            </ul>-->
+<!--                        </div>-->
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('vip_coupon/edit')}"
+                           data-operate-del="{:$auth->check('vip_coupon/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 92 - 0
application/api/controller/Examine.php

@@ -0,0 +1,92 @@
+<?php
+
+namespace app\api\controller;
+
+use addons\epay\library\Service;
+use app\common\controller\Api;
+use app\common\model\ExamineModel;
+use app\common\model\PayOrderModel;
+use app\common\model\UniversityEventModel;
+use app\common\model\Wallet;
+use app\utils\CurlUtil;
+use app\utils\Service\Tencent\TencentIm;
+use think\Db;
+
+/**
+ * 老年大学 活动板块
+ */
+class Examine extends Api
+{
+    protected $noNeedLogin = [''];
+    protected $noNeedRight = ['*'];
+
+    // 活动列表
+    public function list()
+    {
+        $user_id = $this->auth->id;
+        $list    = ExamineModel::with([
+            'apply' => function ($query) use ($user_id) {
+                $query->field('id,examine_id,user_id')->where('user_id', $user_id)->where('status', 1);
+            }
+        ])
+            ->field('id,name,content')
+            ->where('status', 1)
+            ->order('weigh desc,id desc')
+            ->autopage()
+            ->select();
+        foreach ($list as $k => $v) {
+            $list[$k]['apply'] = !empty($v['apply']) ? 1 : 0;
+        }
+        return $this->success('success', $list);
+    }
+
+    public function apply()
+    {
+        $params = $this->request->param();
+        if (empty($params['examine_id'])) {
+            return $this->error('参数缺失');
+        }
+        if (empty($params['name'])) {
+            return $this->error('报名信息姓名不能为空');
+        }
+        if (empty($params['phone'])) {
+            return $this->error('报名信息手机号不能为空');
+        }
+        $user_id = $this->auth->id;
+        $info    = ExamineModel::with([
+            'apply' => function ($query) use ($user_id) {
+                $query->field('id,examine_id,user_id')->where('user_id', $user_id)->where('status', 1);
+            }
+        ])
+            ->field('id,name,content')
+            ->where('id', $params['examine_id'])
+            ->where('status', 1)
+            ->find();
+        if (!$info) {
+            return $this->error('套餐不存在');
+        }
+        if (!empty($info['apply'])) {
+            return $this->error('您已报过名了');
+        }
+        $nowTime = time();
+        // 开始报名
+        $data = [
+            'user_id'     => $user_id,
+            'examine_id'  => $params['examine_id'],
+            'order_no'    => createUniqueNo('E', $user_id),
+            'name'        => $params['name'],
+            'phone'       => $params['phone'],
+            'status'      => 1,
+            'create_time' => $nowTime
+        ];
+        Db::startTrans();
+        $apply_id = Db::name('examine_apply')->insertGetId($data);
+        if (!$apply_id) {
+            Db::rollback();
+            return $this->error('订单创建失败');
+        }
+        Db::commit();
+        return $this->success('报名成功');
+    }
+
+}

+ 143 - 56
application/api/controller/Pay.php

@@ -3,6 +3,7 @@
 namespace app\api\controller;
 
 use app\common\controller\Api;
+use app\common\model\PayOrderModel;
 use app\common\model\Wallet;
 use app\utils\CurlUtil;
 use think\Db;
@@ -16,83 +17,169 @@ class Pay extends Api
     protected $noNeedLogin = [];
     protected $noNeedRight = ['*'];
 
-    //vip用的
+    // VIP套餐
     public function vip_config()
     {
-        $list                = Db::name('payvip_config')->order('weigh asc,id asc')->select();
-        $data['vipconfig']   = $list;
-        $data['vip_endtime'] = model('wallet')->getWallet($this->auth->id, 'vip_endtime');
-        $data['is_vip']      = $data['vip_endtime'] > time() ? 1 : 0;
-        $data['avatar']      = localpath_to_netpath($this->auth->avatar);
-        $this->success('success', $data);
+        $user_id = $this->auth->id;
+        $list = Db::name('vip_config')->field(['id','name','image','price','color','is_try','coupon_ids'])->where('status',1)->order('weigh desc,id asc')->select();
+
+        foreach ($list as $key => $val) {
+            $coupon_ids = explode(',',$val['coupon_ids']);
+            $list[$key]['image'] = cdnurl($val['image']);
+
+            // 如果是试用会员,则需要判断是否使用过了
+            if ($val['is_try'] == 1){
+                // 是否购买过,1已购买
+                $list[$key]['is_buy'] = Db::name('vip_order')->where(['user_id' => $user_id,'vip_id' => $val['id'],'status'=>1])->value('id') > 0 ? 1 : 0;
+            }
+
+            // 查询套餐信息
+            $coupon_list = Db::name('vip_coupon')->whereIn('id',$coupon_ids)->where('status',1)->select();
+            foreach ($coupon_list as $k => $v) {
+                $list[$key]['coupon_list'][$k] = [
+                    'id' => $v['id'],
+                    'image' => cdnurl($v['image']),
+                    'content' => "【{$v['name']}】【{$v['end_days']}日内使用有效】 \n {$v['info']}",
+                ];
+            }
+        }
+        $this->success('success', $list);
     }
 
     //vip用的,创建订单
     public function vip_recharge()
     {
+        $user_id = $this->auth->id;
+        $params = $this->request->param();
+        if (empty($params['vip_id'])) {
+            return $this->error('参数缺失');
+        }
+        if (empty($params['pay_type']) || empty($params['platform'])) {
+            return $this->error('请选择支付方式');
+        }
 
-        $rc_id    = input('rc_id', 0);
-        $pay_type = input('pay_type', 'wechat');
-        $platform = 'app';
-        $uid      = $this->auth->id;
+        if (!$vip_config = Db::name('vip_config')->where('id', $params['vip_id'])->where('status',1)->find()){
+            return $this->error('套餐不存在或已下架');
+        }
 
-        if (!$rc_id) {
-            $this->error('请选择会员套餐');
+        // 判断是否使用过
+        if ($vip_config['is_try'] == 1 && Db::name('vip_order')->where(['user_id' => $user_id,'vip_id' => $params['vip_id'],'status'=>1])->value('id') > 0){
+            return $this->error('您已经试用过了');
         }
 
-        if (!$this->user_auth_limit()) {
-            $this->error('请先完成实名认证');
+        if ($vip_config['is_try'] != 1 && $vip_config['price'] <= 0){
+            return $this->error('套餐价格不能为0');
         }
 
+        // 查询套餐信息
+        $coupon_ids = explode(',',$vip_config['coupon_ids']);
+        $coupon_list = Db::name('vip_coupon')->whereIn('id',$coupon_ids)->where('status',1)->select();
 
         //赋值money
-        $recharge_config = Db::name('payvip_config')->where('id', $rc_id)->find();
-        $money           = $recharge_config['money'];
-
-        if ($money <= 0) {
-            $this->error('支付金额必须大于0');
+        $pay_amount = $vip_config['is_try'] != 1 ? $vip_config['price'] : '0.00';
+        $nowTime    = time();
+        $data       = [
+            'user_id'     => $user_id,
+            'vip_id'      => $params['vip_id'],
+            'order_no'    => createUniqueNo('E', $user_id),
+            'pay_amount'  => $pay_amount,
+            'pay_time'    => $vip_config['is_try'] != 1 ? 0 : $nowTime,
+            'status'      => $vip_config['is_try'] != 1 ? 0 : 1,// 如果是试用会员 则无需支付
+            'create_time' => $nowTime
+        ];
+        Db::startTrans();
+        if (!$order_id = Db::name('vip_order')->insertGetId($data)) {
+            Db::rollback();
+            return $this->error('订单创建失败');
         }
-        if ($money > 10000) {
-            $this->error('支付金额太大');
+        $user_vip_coupon = [];
+        foreach ($coupon_list as $k => $v) {
+            for ($i = 0;$i < $v['num'];$i++){
+                $user_vip_coupon[] = [
+                    'coupon_id'           => $v['id'],
+                    'user_id'             => $user_id,
+                    'order_id'            => $order_id,
+                    'coupon_no'           => \app\utils\Common::createNo('C0',8),
+                    'type'                => $v['type'],
+                    'name'                => $v['name'],
+                    'info'                => $v['info'],
+                    'end_time'            => strtotime('+' . $v['end_days'] . ' day'),
+                    'use_frequency_day'   => $v['use_frequency_day'],
+                    'use_frequency_times' => $v['use_frequency_times'],
+                    'status' => $vip_config['is_try'] != 1 ? 0 : 1,
+                    'create_time' => $nowTime,
+                ];
+            }
         }
+        if (!Db::name('vip_coupon_user')->insertAll($user_vip_coupon)) {
+            Db::rollback();
+            return $this->error('订单创建失败');
+        }
+        Db::commit();
 
+        if ($vip_config['is_try'] != 1){
+            // 创建支付订单
+            $remark    = 'VIP套餐购买';
+            $orderData = [
+                'user_id'      => $user_id,
+                'out_trade_no' => $data['order_no'],
+                'order_amount' => $data['pay_amount'],
+                'pay_type'     => $params['pay_type'],
+                'platform'     => $params['platform'],
+                'table_name'   => 'university_event_apply',
+                'table_id'     => $order_id,
+                'createtime'   => time(),
+                'args'         => json_encode([
+                    'table_id' => $order_id,
+                    'remark'   => $remark
+                ], JSON_UNESCAPED_UNICODE),
+            ];
+            if (!Db::name('pay_order')->insert($orderData)) {
+                return $this->error('订单创建失败');
+            }
 
-        //创建订单
-        $data                 = [];
-        $data['user_id']      = $uid;
-        $data['out_trade_no'] = createUniqueNo('P', $uid); // 数据库订单号加密
-        $data['order_amount'] = $money;
-        $data['createtime']   = time();
-
-        $data['pay_type']     = $pay_type;
-        $data['platform']     = $platform;
-        $data['order_status'] = 0;
-        $data['table_name']   = 'vip_recharge';
-        $data['table_id']     = 0;
-        $data['args']         = json_encode(['days' => $recharge_config['days']]);
-
-        $orderid = Db::name('pay_order')->insertGetId($data);
-
-//        $openid = $this->auth->mini_openid;
-        //下单
-        $params = [
-            'type'      => $pay_type,
-            'orderid'   => $data['out_trade_no'],
-            'title'     => '支付订单',
-            'amount'    => $data['order_amount'],
-            'method'    => $platform,
-//            'openid'       => $openid,
-            'notifyurl' => config('pay_notify_url') . '/api/notify/vip_notify_base/paytype/' . $pay_type,
-            'returnurl' => '',
-        ];
+            // 拉起支付 余额支付
+            if ($params['pay_type'] == 'wallet') {
+                Db::startTrans();
+                //钱包更新
+                $walletService = new Wallet();
+                if (!$walletService->change($user_id, -$orderData['order_amount'], 'money', 20, $remark, $orderData['table_name'], $orderData['table_id'])) {
+                    Db::rollback();
+                    return $this->error($walletService->getMessage());
+                }
+                // 支付成功,更改支付金额
+                [$res,$msg] = PayOrderModel::vip($orderData['out_trade_no']);
+                if (!$res){
+                    Db::rollback();
+                    return $this->error($msg);
+                }
+                Db::commit();
+                return $this->success('支付成功');
+            }
 
-        $res = Service::submitOrder($params);
-
-        if ($pay_type == 'wechat') {
-            $this->success('success', json_decode($res, true));
-        } else {
-            $this->success('success', $res);
+            // 第三方支付下单
+            $params = [
+                'type'      => $orderData['pay_type'],
+                'orderid'   => $orderData['out_trade_no'],
+                'title'     => $remark,
+                'amount'    => $orderData['order_amount'],
+                'method'    => $orderData['platform'],
+                'notifyurl' => CurlUtil::getHttp("/api/notify/university_event_{$params['pay_type']}"),
+                'returnurl' => '',
+            ];
+            // 如果是小程序则需要添加 openid
+            if ($params['pay_type'] == 'wechat' && $params['platform'] == 'miniapp') {
+                $params['openid'] = $this->auth->mini_openid;
+            }
+            $res = Service::submitOrder($params);
+            if ($params['pay_type'] == 'wechat') {
+                $this->success('下单成功', json_decode($res, true));
+            } else {
+                $this->success('下单成功', $res);
+            }
         }
+
+        return $this->success('试用成功');
     }
 
     //人民币充值

+ 30 - 123
application/api/controller/UniversityCourse.php

@@ -9,7 +9,6 @@ use app\common\model\UniversityCourseModel;
 use app\common\model\UniversityEventModel;
 use app\common\model\Wallet;
 use app\utils\CurlUtil;
-use app\utils\Service\Tencent\TencentIm;
 use think\Db;
 
 /**
@@ -26,19 +25,16 @@ class UniversityCourse extends Api
         $user_id = $this->auth->id;
         $list    = UniversityCourseModel::with([
             'apply' => function ($query) use ($user_id) {
-                $query->field('id,event_id,user_id')->where('user_id', $user_id)->where('status', 1);
+                $query->field('id,course_id,user_id')->where('user_id', $user_id)->where('status', 1);
             }
         ])
-            ->field('id,name,price,image,start_apply_time,end_apply_time,start_time,address')
+            ->field('id,name,image')
             ->where('status', 1)
-            ->order('id desc')
+            ->order('weigh desc,id desc')
             ->autopage()
             ->select();
         foreach ($list as $k => $v) {
-            $list[$k]['start_apply_time'] = date('Y-m-d H:i', $v['start_apply_time']);
-            $list[$k]['end_apply_time']   = date('Y-m-d H:i', $v['end_apply_time']);
-            $list[$k]['start_time']       = date('Y-m-d H:i', $v['start_time']);
-            $list[$k]['apply']            = !empty($v['apply']) ? 1 : 0;
+            $list[$k]['apply'] = !empty($v['apply']) ? 1 : 0;
         }
         return $this->success('success', $list);
     }
@@ -47,163 +43,74 @@ class UniversityCourse extends Api
     public function info()
     {
         $params = $this->request->param();
-        if (empty($params['event_id'])) {
+        if (empty($params['course_id'])) {
             return $this->error('参数缺失');
         }
         $user_id = $this->auth->id;
 
-        $info                     = UniversityEventModel::with([
+        $info = UniversityCourseModel::with([
             'apply' => function ($query) use ($user_id) {
-                $query->field('id,event_id,user_id')->where('user_id', $user_id)->where('status', 1);
+                $query->field('id,course_id,user_id')->where('user_id', $user_id)->where('status', 1);
             }
         ])
-            ->field('id,name,price,image,images,start_apply_time,end_apply_time,start_time,address,content')
-            ->where('id', $params['event_id'])
+            ->field('id,name,image,images,content')
+            ->where('id', $params['course_id'])
             ->where('status', 1)
-            ->order('id desc')
             ->find();
-        $info['start_apply_time'] = date('Y-m-d', $info['start_apply_time']);
-        $info['end_apply_time']   = date('Y-m-d', $info['end_apply_time']);
-        $info['start_time']       = date('Y-m-d', $info['start_time']);
-        $info['apply']            = !empty($info['apply']) ? 1 : 0;
+
+        $info['apply'] = !empty($info['apply']) ? 1 : 0;
         return $this->success('success', $info);
     }
 
     public function apply()
     {
         $params = $this->request->param();
-        if (empty($params['event_id'])) {
+        if (empty($params['course_id'])) {
             return $this->error('参数缺失');
         }
-        if (empty($params['pay_type']) || empty($params['platform'])) {
-            return $this->error('请选择支付方式');
-        }
-        if (empty($params['apply_list'])) {
-            return $this->error('请提交报名信息');
+        if (empty($params['name'])) {
+            return $this->error('报名信息姓名不能为空');
         }
-        foreach ($params['apply_list'] as $k => $v) {
-            if (empty($v['name'])) {
-                return $this->error('报名信息姓名不能为空');
-            }
-            if (empty($v['phone'])) {
-                return $this->error('报名信息手机号不能为空');
-            }
+        if (empty($params['phone'])) {
+            return $this->error('报名信息手机号不能为空');
         }
         $user_id = $this->auth->id;
-        $info    = UniversityEventModel::with([
+
+        $info = UniversityCourseModel::with([
             'apply' => function ($query) use ($user_id) {
-                $query->field('id,event_id,user_id')->where('user_id', $user_id)->where('status', 1);
+                $query->field('id,course_id,user_id')->where('user_id', $user_id)->where('status', 1);
             }
         ])
-            ->field('id,name,price,image,images,start_apply_time,end_apply_time,start_time,address,content')
-            ->where('id', $params['event_id'])
+            ->field('id,name,image,images,content')
+            ->where('id', $params['course_id'])
             ->where('status', 1)
-            ->order('id desc')
             ->find();
         if (!$info) {
-            return $this->error('活动不存在');
+            return $this->error('课程不存在');
         }
         if (!empty($info['apply'])) {
             return $this->error('您已报过名了');
         }
         $nowTime = time();
-        if ($info['start_apply_time'] > $nowTime) {
-            return $this->error('报名未开始');
-        }
-        if ($info['end_apply_time'] < $nowTime) {
-            return $this->error('报名已结束');
-        }
         // 开始报名
-        $num  = count($params['apply_list']);
         $data = [
             'user_id'     => $user_id,
-            'event_id'    => $params['event_id'],
-            'order_no'    => createUniqueNo('E', $user_id),
-            'pay_amount'  => bcmul($info['price'], $num, 2),
+            'course_id'   => $params['course_id'],
+            'order_no'    => createUniqueNo('C', $user_id),
+            'name'        => $params['name'],
+            'phone'       => $params['phone'],
+            'status'      => 1,
             'create_time' => $nowTime
         ];
         Db::startTrans();
-        $apply_id = Db::name('university_event_apply')->insertGetId($data);
-        if (!$apply_id) {
-            Db::rollback();
-            return $this->error('订单创建失败');
-        }
-        $apply_info = [];
-        foreach ($params['apply_list'] as $k => $v) {
-            $apply_info[] = [
-                'user_id'  => $user_id,
-                'event_id' => $params['event_id'],
-                'order_id' => $apply_id,
-                'order_no' => $data['order_no'],
-                'name'     => $v['name'],
-                'phone'    => $v['phone']
-            ];
-        }
-        if (!Db::name('university_event_info')->insertAll($apply_info)) {
+        if (!$apply_id = Db::name('university_course_apply')->insertGetId($data)) {
             Db::rollback();
             return $this->error('订单创建失败');
         }
+        // TODO 抵扣券
         Db::commit();
 
-        // 创建支付订单
-        $remark    = '老年大学活动报名';
-        $orderData = [
-            'user_id'      => $user_id,
-            'out_trade_no' => $data['order_no'],
-            'order_amount' => $data['pay_amount'],
-            'pay_type'     => $params['pay_type'],
-            'platform'     => $params['platform'],
-            'table_name'   => 'university_event_apply',
-            'table_id'     => $apply_id,
-            'createtime'   => time(),
-            'args'         => json_encode([
-                'table_id' => $apply_id,
-                'remark'   => $remark
-            ], JSON_UNESCAPED_UNICODE),
-        ];
-        if (!Db::name('pay_order')->insert($orderData)) {
-            return $this->error('订单创建失败');
-        }
-
-        // 拉起支付 余额支付
-        if ($params['pay_type'] == 'wallet') {
-            Db::startTrans();
-            //钱包更新
-            $walletService = new Wallet();
-            if (!$walletService->change($user_id, -$orderData['order_amount'], 'money', 20, $remark, $orderData['table_name'], $orderData['table_id'])) {
-                Db::rollback();
-                return $this->error($walletService->getMessage());
-            }
-            // 支付成功,更改支付金额
-            [$res,$msg] = PayOrderModel::university_event($orderData['out_trade_no']);
-            if (!$res){
-                Db::rollback();
-                return $this->error($msg);
-            }
-            Db::commit();
-            return $this->success('支付成功');
-        }
-
-        // 第三方支付下单
-        $params = [
-            'type'      => $orderData['pay_type'],
-            'orderid'   => $orderData['out_trade_no'],
-            'title'     => $remark,
-            'amount'    => $orderData['order_amount'],
-            'method'    => $orderData['platform'],
-            'notifyurl' => CurlUtil::getHttp("/api/notify/university_event_{$params['pay_type']}"),
-            'returnurl' => '',
-        ];
-        // 如果是小程序则需要添加 openid
-        if ($params['pay_type'] == 'wechat' && $params['platform'] == 'miniapp') {
-            $params['openid'] = $this->auth->mini_openid;
-        }
-        $res = Service::submitOrder($params);
-        if ($params['pay_type'] == 'wechat') {
-            $this->success('success', json_decode($res, true));
-        } else {
-            $this->success('success', $res);
-        }
+        return $this->success('报名成功');
     }
 
 }

+ 64 - 62
application/api/controller/UniversityEvent.php

@@ -74,9 +74,9 @@ class UniversityEvent extends Api
         if (empty($params['event_id'])) {
             return $this->error('参数缺失');
         }
-        if (empty($params['pay_type']) || empty($params['platform'])) {
-            return $this->error('请选择支付方式');
-        }
+//        if (empty($params['pay_type']) || empty($params['platform'])) {
+//            return $this->error('请选择支付方式');
+//        }
         if (empty($params['apply_list'])) {
             return $this->error('请提交报名信息');
         }
@@ -125,6 +125,7 @@ class UniversityEvent extends Api
             'event_id'    => $params['event_id'],
             'order_no'    => createUniqueNo('E', $user_id),
             'pay_amount'  => bcmul($info['price'], $num, 2),
+            'status' => 1,
             'create_time' => $nowTime
         ];
         Db::startTrans();
@@ -151,66 +152,67 @@ class UniversityEvent extends Api
             return $this->error('订单创建失败');
         }
         Db::commit();
+        return $this->success('报名成功');
 
-        // 创建支付订单
-        $remark    = '老年大学活动报名';
-        $orderData = [
-            'user_id'      => $user_id,
-            'out_trade_no' => $data['order_no'],
-            'order_amount' => $data['pay_amount'],
-            'pay_type'     => $params['pay_type'],
-            'platform'     => $params['platform'],
-            'table_name'   => 'university_event_apply',
-            'table_id'     => $apply_id,
-            'createtime'   => time(),
-            'args'         => json_encode([
-                'table_id' => $apply_id,
-                'remark'   => $remark
-            ], JSON_UNESCAPED_UNICODE),
-        ];
-        if (!Db::name('pay_order')->insert($orderData)) {
-            return $this->error('订单创建失败');
-        }
-
-        // 拉起支付 余额支付
-        if ($params['pay_type'] == 'wallet') {
-            Db::startTrans();
-            //钱包更新
-            $walletService = new Wallet();
-            if (!$walletService->change($user_id, -$orderData['order_amount'], 'money', 20, $remark, $orderData['table_name'], $orderData['table_id'])) {
-                Db::rollback();
-                return $this->error($walletService->getMessage());
-            }
-            // 支付成功,更改支付金额
-            [$res,$msg] = PayOrderModel::university_event($orderData['out_trade_no']);
-            if (!$res){
-                Db::rollback();
-                return $this->error($msg);
-            }
-            Db::commit();
-            return $this->success('支付成功');
-        }
-
-        // 第三方支付下单
-        $params = [
-            'type'      => $orderData['pay_type'],
-            'orderid'   => $orderData['out_trade_no'],
-            'title'     => $remark,
-            'amount'    => $orderData['order_amount'],
-            'method'    => $orderData['platform'],
-            'notifyurl' => CurlUtil::getHttp("/api/notify/university_event_{$params['pay_type']}"),
-            'returnurl' => '',
-        ];
-        // 如果是小程序则需要添加 openid
-        if ($params['pay_type'] == 'wechat' && $params['platform'] == 'miniapp') {
-            $params['openid'] = $this->auth->mini_openid;
-        }
-        $res = Service::submitOrder($params);
-        if ($params['pay_type'] == 'wechat') {
-            $this->success('success', json_decode($res, true));
-        } else {
-            $this->success('success', $res);
-        }
+//        // 创建支付订单
+//        $remark    = '老年大学活动报名';
+//        $orderData = [
+//            'user_id'      => $user_id,
+//            'out_trade_no' => $data['order_no'],
+//            'order_amount' => $data['pay_amount'],
+//            'pay_type'     => $params['pay_type'],
+//            'platform'     => $params['platform'],
+//            'table_name'   => 'university_event_apply',
+//            'table_id'     => $apply_id,
+//            'createtime'   => time(),
+//            'args'         => json_encode([
+//                'table_id' => $apply_id,
+//                'remark'   => $remark
+//            ], JSON_UNESCAPED_UNICODE),
+//        ];
+//        if (!Db::name('pay_order')->insert($orderData)) {
+//            return $this->error('订单创建失败');
+//        }
+//
+//        // 拉起支付 余额支付
+//        if ($params['pay_type'] == 'wallet') {
+//            Db::startTrans();
+//            //钱包更新
+//            $walletService = new Wallet();
+//            if (!$walletService->change($user_id, -$orderData['order_amount'], 'money', 20, $remark, $orderData['table_name'], $orderData['table_id'])) {
+//                Db::rollback();
+//                return $this->error($walletService->getMessage());
+//            }
+//            // 支付成功,更改支付金额
+//            [$res,$msg] = PayOrderModel::university_event($orderData['out_trade_no']);
+//            if (!$res){
+//                Db::rollback();
+//                return $this->error($msg);
+//            }
+//            Db::commit();
+//            return $this->success('支付成功');
+//        }
+//
+//        // 第三方支付下单
+//        $params = [
+//            'type'      => $orderData['pay_type'],
+//            'orderid'   => $orderData['out_trade_no'],
+//            'title'     => $remark,
+//            'amount'    => $orderData['order_amount'],
+//            'method'    => $orderData['platform'],
+//            'notifyurl' => CurlUtil::getHttp("/api/notify/university_event_{$params['pay_type']}"),
+//            'returnurl' => '',
+//        ];
+//        // 如果是小程序则需要添加 openid
+//        if ($params['pay_type'] == 'wechat' && $params['platform'] == 'miniapp') {
+//            $params['openid'] = $this->auth->mini_openid;
+//        }
+//        $res = Service::submitOrder($params);
+//        if ($params['pay_type'] == 'wechat') {
+//            $this->success('success', json_decode($res, true));
+//        } else {
+//            $this->success('success', $res);
+//        }
     }
 
 }

+ 65 - 0
application/api/controller/Vip.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use app\common\model\PayOrderModel;
+use app\common\model\Wallet;
+use app\utils\CurlUtil;
+use think\Db;
+use addons\epay\library\Service;
+
+/**
+ * 充值配置与充值订单
+ */
+class Vip extends Api
+{
+    protected $noNeedLogin = [];
+    protected $noNeedRight = ['*'];
+
+    // VIP抵扣券
+    public function coupon()
+    {
+        $user_id = $this->auth->id;
+        $list = Db::name('vip_coupon_user')
+            ->field(['id','coupon_no','type','name','info','end_time','use_frequency_day','use_frequency_times','status','create_time'])
+            ->where('user_id',$user_id)
+            ->whereIn('status',[1,2])
+            ->order('id desc')
+            ->autopage()
+            ->select();
+
+        foreach ($list as $key=>$val){
+            $list[$key]['end_time_text'] = date('Y-m-d H:i',$val['end_time']);
+            $list[$key]['create_time_text'] = date('Y-m-d H:i',$val['create_time']);
+        }
+
+        $this->success('success', $list);
+    }
+
+    // 使用抵扣券
+    public function coupon_use()
+    {
+        $user_id = $this->auth->id;
+        $params = $this->request->param();
+        if (empty($params['coupon_id'])){
+            $this->error('请选择要使用的抵扣券');
+        }
+
+        $info = Db::name('vip_coupon_user')
+            ->where('id',$params['coupon_id'])
+            ->where('user_id',$user_id)
+            ->whereIn('status',[1,2])
+            ->find();
+        if (!$info){
+            $this->error('不存在的券');
+        }
+        if ($info['status'] != 1){
+            $this->error('券已使用');
+        }
+        if (!Db::name('vip_coupon_user')->where(['id'=>$params['coupon_id'],'status'=>1])->update(['status'=>2])){
+            $this->error('操作失败');
+        }
+        $this->error('使用成功');
+    }
+}

+ 21 - 0
application/common/model/ExamineApplyModel.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class ExamineApplyModel extends Model
+{
+    // 表名
+    protected $name = 'examine_apply';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+}

+ 40 - 0
application/common/model/ExamineModel.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class ExamineModel extends Model
+{
+    // 表名
+    protected $name = 'examine';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    public function getImageAttr($value, $data)
+    {
+        return cdnurl($value);
+    }
+
+    public function getImagesAttr($value, $data)
+    {
+        $value = explode(',',$value);
+        foreach ($value as &$v){
+            $v = cdnurl($v);
+        }
+        return $value;
+    }
+
+    public function apply()
+    {
+        return $this->hasOne(ExamineApplyModel::class, 'examine_id', 'id');
+    }
+}

+ 33 - 0
application/common/model/PayOrderModel.php

@@ -86,4 +86,37 @@ class PayOrderModel extends Model
         Db::commit();
         return [true,'操作成功'];
     }
+
+    /**
+     * 老年大学活动支付回调
+     * @param $out_trade_no
+     * @return array
+     */
+    public static function vip($out_trade_no)
+    {
+        Db::startTrans();
+        if (!$info = self::where('out_trade_no',$out_trade_no)->lock(true)->find()){
+            Db::rollback();
+            return [false,'未找到订单'];
+        }
+        if ($info['order_status'] == 1){
+            Db::rollback();
+            return [true,'订单已支付'];
+        }
+        //更新订单状态
+        if (!self::where(['id' => $info['id']])->update(['status' => 1])) {
+            Db::rollback();
+            return [false,'订单状态更新失败'];
+        }
+        if (!VipOrderModel::where('id',$info['table_id'])->update(['status' => 1,'pay_time' => time()])) {
+            Db::rollback();
+            return [false,'VIP订单状态更新失败'];
+        }
+        if (!VipCouponUserModel::where('order_id',$info['table_id'])->update(['status' => 1,'update_time' => time()])) {
+            Db::rollback();
+            return [false,'VIP订单状态更新失败'];
+        }
+        Db::commit();
+        return [true,'操作成功'];
+    }
 }

+ 1 - 1
application/common/model/UniversityCourseApplyModel.php

@@ -11,7 +11,7 @@ use think\Model;
 class UniversityCourseApplyModel extends Model
 {
     // 表名
-    protected $name = 'university_event_apply';
+    protected $name = 'university_course_apply';
     // 开启自动写入时间戳字段
     protected $autoWriteTimestamp = false;
     // 定义时间戳字段名

+ 2 - 2
application/common/model/UniversityCourseModel.php

@@ -11,7 +11,7 @@ use think\Model;
 class UniversityCourseModel extends Model
 {
     // 表名
-    protected $name = 'university_event';
+    protected $name = 'university_course';
     // 开启自动写入时间戳字段
     protected $autoWriteTimestamp = false;
     // 定义时间戳字段名
@@ -35,6 +35,6 @@ class UniversityCourseModel extends Model
 
     public function apply()
     {
-        return $this->hasOne(UniversityEventApplyModel::class, 'event_id', 'id');
+        return $this->hasOne(UniversityCourseApplyModel::class, 'course_id', 'id');
     }
 }

+ 21 - 0
application/common/model/VipConfigModel.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class VipConfigModel extends Model
+{
+    // 表名
+    protected $name = 'vip_config';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+}

+ 21 - 0
application/common/model/VipCouponModel.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class VipCouponModel extends Model
+{
+    // 表名
+    protected $name = 'vip_coupon';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+}

+ 21 - 0
application/common/model/VipCouponUserModel.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class VipCouponUserModel extends Model
+{
+    // 表名
+    protected $name = 'vip_coupon_user';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+}

+ 21 - 0
application/common/model/VipOrderModel.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class VipOrderModel extends Model
+{
+    // 表名
+    protected $name = 'vip_order';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+}

+ 45 - 0
application/utils/Hashids.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace app\utils;
+
+use app\utils\Hashids\Hashids as HashidsBase;
+use think\Env;
+use think\Config;
+
+class Hashids
+{
+    private static $hashids;
+
+    /**
+     * 单列模型实例化
+     * @param $salt
+     * @param $hashLength
+     * @return HashidsBase
+     */
+    public static function getInstanceHashids($salt, $hashLength)
+    {
+        if (!self::$hashids instanceof HashidsBase) {
+            self::$hashids =  new HashidsBase($salt, $hashLength, Env::get('hashids.alphabet', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'));
+        }
+        return self::$hashids;
+    }
+
+    public static function encodeHex($str, $hashLength = 8)
+    {
+        $salt = Env::get('hashids.salt', Config::get('token.key'));
+
+        $hashids = self::getInstanceHashids($salt, $hashLength);
+
+        return $hashids->encodeHex($str);
+    }
+
+    public static function decodeHex($str, $hashLength = 8)
+    {
+        $salt = Env::get('hashids.salt', Config::get('token.key'));
+
+        $hashids = self::getInstanceHashids($salt, $hashLength);
+
+        return $hashids->decodeHex($str);
+    }
+
+}

+ 422 - 0
application/utils/Hashids/Hashids.php

@@ -0,0 +1,422 @@
+<?php
+
+/**
+ * Copyright (c) Ivan Akimov.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @see https://github.com/vinkla/hashids
+ */
+
+namespace app\utils\Hashids;
+
+use app\utils\Hashids\Math\Bc;
+use app\utils\Hashids\Math\Gmp;
+use app\utils\Hashids\Math\MathInterface;
+use RuntimeException;
+
+class Hashids implements HashidsInterface
+{
+    /**
+     * The seps divider.
+     *
+     * @var float
+     */
+    public const SEP_DIV = 3.5;
+
+    /**
+     * The guard divider.
+     *
+     * @var float
+     */
+    public const GUARD_DIV = 12;
+
+    /**
+     * The alphabet string.
+     *
+     * @var string
+     */
+    protected $alphabet;
+
+    /**
+     * Shuffled alphabets, referenced by alphabet and salt.
+     *
+     * @var array
+     */
+    protected $shuffledAlphabets;
+
+    /**
+     * The seps string.
+     *
+     * @var string
+     */
+    protected $seps = 'cfhistuCFHISTU';
+
+    /**
+     * The guards string.
+     *
+     * @var string
+     */
+    protected $guards;
+
+    /**
+     * The minimum hash length.
+     *
+     * @var int
+     */
+    protected $minHashLength;
+
+    /**
+     * The salt string.
+     *
+     * @var string
+     */
+    protected $salt;
+
+    /**
+     * The math class.
+     *
+     * @var \Hashids\Math\MathInterface
+     */
+    protected $math;
+
+    /**
+     * Create a new hashids instance.
+     *
+     * @param string $salt
+     * @param int $minHashLength
+     * @param string $alphabet
+     *
+     * @throws \Hashids\HashidsException
+     */
+    public function __construct($salt = '', $minHashLength = 0, $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
+    {
+        $this->salt = \mb_convert_encoding($salt, 'UTF-8', \mb_detect_encoding($salt));
+        $this->minHashLength = $minHashLength;
+        $alphabet = \mb_convert_encoding($alphabet, 'UTF-8', \mb_detect_encoding($alphabet));
+        $this->alphabet = \implode('', \array_unique($this->multiByteSplit($alphabet)));
+        $this->math = $this->getMathExtension();
+
+        if (\mb_strlen($this->alphabet) < 16) {
+            throw new HashidsException('Alphabet must contain at least 16 unique characters.');
+        }
+
+        if (false !== \mb_strpos($this->alphabet, ' ')) {
+            throw new HashidsException('Alphabet can\'t contain spaces.');
+        }
+
+        $alphabetArray = $this->multiByteSplit($this->alphabet);
+        $sepsArray = $this->multiByteSplit($this->seps);
+        $this->seps = \implode('', \array_intersect($sepsArray, $alphabetArray));
+        $this->alphabet = \implode('', \array_diff($alphabetArray, $sepsArray));
+        $this->seps = $this->shuffle($this->seps, $this->salt);
+
+        if (!$this->seps || (\mb_strlen($this->alphabet) / \mb_strlen($this->seps)) > self::SEP_DIV) {
+            $sepsLength = (int) \ceil(\mb_strlen($this->alphabet) / self::SEP_DIV);
+
+            if ($sepsLength > \mb_strlen($this->seps)) {
+                $diff = $sepsLength - \mb_strlen($this->seps);
+                $this->seps .= \mb_substr($this->alphabet, 0, $diff);
+                $this->alphabet = \mb_substr($this->alphabet, $diff);
+            }
+        }
+
+        $this->alphabet = $this->shuffle($this->alphabet, $this->salt);
+        $guardCount = (int) \ceil(\mb_strlen($this->alphabet) / self::GUARD_DIV);
+
+        if (\mb_strlen($this->alphabet) < 3) {
+            $this->guards = \mb_substr($this->seps, 0, $guardCount);
+            $this->seps = \mb_substr($this->seps, $guardCount);
+        } else {
+            $this->guards = \mb_substr($this->alphabet, 0, $guardCount);
+            $this->alphabet = \mb_substr($this->alphabet, $guardCount);
+        }
+    }
+
+    /**
+     * Encode parameters to generate a hash.
+     *
+     * @param mixed $numbers
+     *
+     * @return string
+     */
+    public function encode(...$numbers): string
+    {
+        $ret = '';
+
+        if (1 === \count($numbers) && \is_array($numbers[0])) {
+            $numbers = $numbers[0];
+        }
+
+        if (!$numbers) {
+            return $ret;
+        }
+
+        foreach ($numbers as $number) {
+            $isNumber = \ctype_digit((string) $number);
+
+            if (!$isNumber) {
+                return $ret;
+            }
+        }
+
+        $alphabet = $this->alphabet;
+        $numbersSize = \count($numbers);
+        $numbersHashInt = 0;
+
+        foreach ($numbers as $i => $number) {
+            $numbersHashInt += $this->math->intval($this->math->mod($number, $i + 100));
+        }
+
+        $lottery = $ret = \mb_substr($alphabet, $numbersHashInt % \mb_strlen($alphabet), 1);
+        foreach ($numbers as $i => $number) {
+            $alphabet = $this->shuffle($alphabet, \mb_substr($lottery . $this->salt . $alphabet, 0, \mb_strlen($alphabet)));
+            $ret .= $last = $this->hash($number, $alphabet);
+
+            if ($i + 1 < $numbersSize) {
+                $number %= (\mb_ord($last, 'UTF-8') + $i);
+                $sepsIndex = $this->math->intval($this->math->mod($number, \mb_strlen($this->seps)));
+                $ret .= \mb_substr($this->seps, $sepsIndex, 1);
+            }
+        }
+
+        if (\mb_strlen($ret) < $this->minHashLength) {
+            $guardIndex = ($numbersHashInt + \mb_ord(\mb_substr($ret, 0, 1), 'UTF-8')) % \mb_strlen($this->guards);
+
+            $guard = \mb_substr($this->guards, $guardIndex, 1);
+            $ret = $guard . $ret;
+
+            if (\mb_strlen($ret) < $this->minHashLength) {
+                $guardIndex = ($numbersHashInt + \mb_ord(\mb_substr($ret, 2, 1), 'UTF-8')) % \mb_strlen($this->guards);
+                $guard = \mb_substr($this->guards, $guardIndex, 1);
+
+                $ret .= $guard;
+            }
+        }
+
+        $halfLength = (int) (\mb_strlen($alphabet) / 2);
+        while (\mb_strlen($ret) < $this->minHashLength) {
+            $alphabet = $this->shuffle($alphabet, $alphabet);
+            $ret = \mb_substr($alphabet, $halfLength) . $ret . \mb_substr($alphabet, 0, $halfLength);
+
+            $excess = \mb_strlen($ret) - $this->minHashLength;
+            if ($excess > 0) {
+                $ret = \mb_substr($ret, (int) ($excess / 2), $this->minHashLength);
+            }
+        }
+
+        return $ret;
+    }
+
+    /**
+     * Decode a hash to the original parameter values.
+     *
+     * @param string $hash
+     *
+     * @return array
+     */
+    public function decode($hash): array
+    {
+        $ret = [];
+
+        if (!\is_string($hash) || !($hash = \trim($hash))) {
+            return $ret;
+        }
+
+        $alphabet = $this->alphabet;
+
+        $hashBreakdown = \str_replace($this->multiByteSplit($this->guards), ' ', $hash);
+        $hashArray = \explode(' ', $hashBreakdown);
+
+        $i = 3 === \count($hashArray) || 2 === \count($hashArray) ? 1 : 0;
+
+        $hashBreakdown = $hashArray[$i];
+
+        if ('' !== $hashBreakdown) {
+            $lottery = \mb_substr($hashBreakdown, 0, 1);
+            $hashBreakdown = \mb_substr($hashBreakdown, 1);
+
+            $hashBreakdown = \str_replace($this->multiByteSplit($this->seps), ' ', $hashBreakdown);
+            $hashArray = \explode(' ', $hashBreakdown);
+
+            foreach ($hashArray as $subHash) {
+                $alphabet = $this->shuffle($alphabet, \mb_substr($lottery . $this->salt . $alphabet, 0, \mb_strlen($alphabet)));
+                $result = $this->unhash($subHash, $alphabet);
+                if ($this->math->greaterThan($result, PHP_INT_MAX)) {
+                    $ret[] = $this->math->strval($result);
+                } else {
+                    $ret[] = $this->math->intval($result);
+                }
+            }
+
+            if ($this->encode($ret) !== $hash) {
+                $ret = [];
+            }
+        }
+
+        return $ret;
+    }
+
+    /**
+     * Encode hexadecimal values and generate a hash string.
+     *
+     * @param string $str
+     *
+     * @return string
+     */
+    public function encodeHex($str): string
+    {
+        if (!\ctype_xdigit((string) $str)) {
+            return '';
+        }
+
+        $numbers = \trim(chunk_split($str, 12, ' '));
+        $numbers = \explode(' ', $numbers);
+
+        foreach ($numbers as $i => $number) {
+            $numbers[$i] = \hexdec('1' . $number);
+        }
+
+        return $this->encode(...$numbers);
+    }
+
+    /**
+     * Decode a hexadecimal hash.
+     *
+     * @param string $hash
+     *
+     * @return string
+     */
+    public function decodeHex($hash): string
+    {
+        $ret = '';
+        $numbers = $this->decode($hash);
+
+        foreach ($numbers as $i => $number) {
+            $ret .= \mb_substr(dechex($number), 1);
+        }
+
+        return $ret;
+    }
+
+    /**
+     * Shuffle alphabet by given salt.
+     *
+     * @param string $alphabet
+     * @param string $salt
+     *
+     * @return string
+     */
+    protected function shuffle($alphabet, $salt): string
+    {
+        $key = $alphabet . ' ' . $salt;
+
+        if (isset($this->shuffledAlphabets[$key])) {
+            return $this->shuffledAlphabets[$key];
+        }
+
+        $saltLength = \mb_strlen($salt);
+        $saltArray = $this->multiByteSplit($salt);
+        if (!$saltLength) {
+            return $alphabet;
+        }
+        $alphabetArray = $this->multiByteSplit($alphabet);
+        for ($i = \mb_strlen($alphabet) - 1, $v = 0, $p = 0; $i > 0; $i--, $v++) {
+            $v %= $saltLength;
+            $p += $int = \mb_ord($saltArray[$v], 'UTF-8');
+            $j = ($int + $v + $p) % $i;
+
+            $temp = $alphabetArray[$j];
+            $alphabetArray[$j] = $alphabetArray[$i];
+            $alphabetArray[$i] = $temp;
+        }
+        $alphabet = \implode('', $alphabetArray);
+        $this->shuffledAlphabets[$key] = $alphabet;
+
+        return $alphabet;
+    }
+
+    /**
+     * Hash given input value.
+     *
+     * @param string $input
+     * @param string $alphabet
+     *
+     * @return string
+     */
+    protected function hash($input, $alphabet): string
+    {
+        $hash = '';
+        $alphabetLength = \mb_strlen($alphabet);
+
+        do {
+            $hash = \mb_substr($alphabet, $this->math->intval($this->math->mod($input, $alphabetLength)), 1) . $hash;
+
+            $input = $this->math->divide($input, $alphabetLength);
+        } while ($this->math->greaterThan($input, 0));
+
+        return $hash;
+    }
+
+    /**
+     * Unhash given input value.
+     *
+     * @param string $input
+     * @param string $alphabet
+     *
+     * @return int
+     */
+    protected function unhash($input, $alphabet)
+    {
+        $number = 0;
+        $inputLength = \mb_strlen($input);
+
+        if ($inputLength && $alphabet) {
+            $alphabetLength = \mb_strlen($alphabet);
+            $inputChars = $this->multiByteSplit($input);
+
+            foreach ($inputChars as $char) {
+                $position = \mb_strpos($alphabet, $char);
+                $number = $this->math->multiply($number, $alphabetLength);
+                $number = $this->math->add($number, $position);
+            }
+        }
+
+        return $number;
+    }
+
+    /**
+     * Get BC Math or GMP extension.
+     *
+     * @codeCoverageIgnore
+     *
+     * @throws \RuntimeException
+     *
+     * @return \Hashids\Math\MathInterface
+     */
+    protected function getMathExtension(): MathInterface
+    {
+        if (\extension_loaded('gmp')) {
+            return new Gmp();
+        }
+
+        if (\extension_loaded('bcmath')) {
+            return new Bc();
+        }
+
+        throw new RuntimeException('Missing BC Math or GMP extension.');
+    }
+
+    /**
+     * Replace simple use of $this->multiByteSplit with multi byte string.
+     *
+     * @param string $string
+     *
+     * @return array<int, string>
+     */
+    protected function multiByteSplit($string): array
+    {
+        return \preg_split('/(?!^)(?=.)/u', $string) ?: [];
+    }
+}

+ 19 - 0
application/utils/Hashids/HashidsException.php

@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Copyright (c) Ivan Akimov.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @see https://github.com/vinkla/hashids
+ */
+
+namespace app\utils\Hashids;
+
+use InvalidArgumentException;
+
+class HashidsException extends InvalidArgumentException
+{
+    //
+}

+ 51 - 0
application/utils/Hashids/HashidsInterface.php

@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * Copyright (c) Ivan Akimov.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @see https://github.com/vinkla/hashids
+ */
+
+namespace app\utils\Hashids;
+
+interface HashidsInterface
+{
+    /**
+     * Encode parameters to generate a hash.
+     *
+     * @param mixed $numbers
+     *
+     * @return string
+     */
+    public function encode(...$numbers);
+
+    /**
+     * Decode a hash to the original parameter values.
+     *
+     * @param string $hash
+     *
+     * @return array
+     */
+    public function decode($hash);
+
+    /**
+     * Encode hexadecimal values and generate a hash string.
+     *
+     * @param string $str
+     *
+     * @return string
+     */
+    public function encodeHex($str);
+
+    /**
+     * Decode a hexadecimal hash.
+     *
+     * @param string $hash
+     *
+     * @return string
+     */
+    public function decodeHex($hash);
+}

+ 116 - 0
application/utils/Hashids/Math/Bc.php

@@ -0,0 +1,116 @@
+<?php
+
+/**
+ * Copyright (c) Ivan Akimov.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @see https://github.com/vinkla/hashids
+ */
+
+namespace app\utils\Hashids\Math;
+
+class Bc implements MathInterface
+{
+    /**
+     * Add two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function add($a, $b)
+    {
+        return \bcadd($a, $b, 0);
+    }
+
+    /**
+     * Multiply two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function multiply($a, $b)
+    {
+        return \bcmul($a, $b, 0);
+    }
+
+    /**
+     * Divide two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function divide($a, $b)
+    {
+        return \bcdiv($a, $b, 0);
+    }
+
+    /**
+     * Compute arbitrary-length integer modulo.
+     *
+     * @param string $n
+     * @param string $d
+     *
+     * @return string
+     */
+    public function mod($n, $d)
+    {
+        return \bcmod($n, $d);
+    }
+
+    /**
+     * Compares two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return bool
+     */
+    public function greaterThan($a, $b)
+    {
+        return \bccomp($a, $b, 0) > 0;
+    }
+
+    /**
+     * Converts arbitrary-length integer to PHP integer.
+     *
+     * @param string $a
+     *
+     * @return int
+     */
+    public function intval($a)
+    {
+        return \intval($a);
+    }
+
+    /**
+     * Converts arbitrary-length integer to PHP string.
+     *
+     * @param string $a
+     *
+     * @return string
+     */
+    public function strval($a)
+    {
+        return $a;
+    }
+
+    /**
+     * Converts PHP integer to arbitrary-length integer.
+     *
+     * @param int $a
+     *
+     * @return string
+     */
+    public function get($a)
+    {
+        return $a;
+    }
+}

+ 116 - 0
application/utils/Hashids/Math/Gmp.php

@@ -0,0 +1,116 @@
+<?php
+
+/**
+ * Copyright (c) Ivan Akimov.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @see https://github.com/vinkla/hashids
+ */
+
+namespace app\utils\Hashids\Math;
+
+class Gmp implements MathInterface
+{
+    /**
+     * Add two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function add($a, $b)
+    {
+        return \gmp_add($a, $b);
+    }
+
+    /**
+     * Multiply two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function multiply($a, $b)
+    {
+        return \gmp_mul($a, $b);
+    }
+
+    /**
+     * Divide two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function divide($a, $b)
+    {
+        return \gmp_div_q($a, $b);
+    }
+
+    /**
+     * Compute arbitrary-length integer modulo.
+     *
+     * @param string $n
+     * @param string $d
+     *
+     * @return string
+     */
+    public function mod($n, $d)
+    {
+        return \gmp_mod($n, $d);
+    }
+
+    /**
+     * Compares two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return bool
+     */
+    public function greaterThan($a, $b)
+    {
+        return \gmp_cmp($a, $b) > 0;
+    }
+
+    /**
+     * Converts arbitrary-length integer to PHP integer.
+     *
+     * @param string $a
+     *
+     * @return int
+     */
+    public function intval($a)
+    {
+        return \gmp_intval($a);
+    }
+
+    /**
+     * Converts arbitrary-length integer to PHP string.
+     *
+     * @param string $a
+     *
+     * @return string
+     */
+    public function strval($a)
+    {
+        return \gmp_strval($a);
+    }
+
+    /**
+     * Converts PHP integer to arbitrary-length integer.
+     *
+     * @param int $a
+     *
+     * @return string
+     */
+    public function get($a)
+    {
+        return \gmp_init($a);
+    }
+}

+ 92 - 0
application/utils/Hashids/Math/MathInterface.php

@@ -0,0 +1,92 @@
+<?php
+
+/**
+ * Copyright (c) Ivan Akimov.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @see https://github.com/vinkla/hashids
+ */
+
+namespace app\utils\Hashids\Math;
+
+interface MathInterface
+{
+    /**
+     * Add two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function add($a, $b);
+
+    /**
+     * Multiply two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function multiply($a, $b);
+
+    /**
+     * Divide two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return string
+     */
+    public function divide($a, $b);
+
+    /**
+     * Compute arbitrary-length integer modulo.
+     *
+     * @param string $n
+     * @param string $d
+     *
+     * @return string
+     */
+    public function mod($n, $d);
+
+    /**
+     * Compares two arbitrary-length integers.
+     *
+     * @param string $a
+     * @param string $b
+     *
+     * @return bool
+     */
+    public function greaterThan($a, $b);
+
+    /**
+     * Converts arbitrary-length integer to PHP integer.
+     *
+     * @param string $a
+     *
+     * @return int
+     */
+    public function intval($a);
+
+    /**
+     * Converts arbitrary-length integer to PHP string.
+     *
+     * @param string $a
+     *
+     * @return string
+     */
+    public function strval($a);
+
+    /**
+     * Converts PHP integer to arbitrary-length integer.
+     *
+     * @param int $a
+     *
+     * @return string
+     */
+    public function get($a);
+}

+ 78 - 0
public/assets/js/backend/university_course.js

@@ -0,0 +1,78 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'university_course/index' + location.search,
+                    add_url: 'university_course/add',
+                    edit_url: 'university_course/edit',
+                    del_url: 'university_course/del',
+                    multi_url: 'university_course/multi',
+                    import_url: 'university_course/import',
+                    table: 'university_course',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'weigh',
+                showToggle: false,// 禁用视图切换
+                search:false,// 禁用默认搜索框
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'weigh', title: __('Weigh'), operate: false},
+                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},
+                        {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'update_time', title: __('Update_time'), 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,
+                            buttons: [
+                                {
+                                    name: 'chapter',
+                                    text: '章节信息',
+                                    title: '章节信息',
+                                    originalTitle:'章节信息',
+                                    classname: 'btn btn-xs btn-success btn-dialog btn-selectuser',
+                                    // icon: 'fa fa-jpy',
+                                    url: 'university_course_chapter/index/course_id/{id}?dialog=1',
+                                    callback: function (data) {
+                                        Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
+                                    }
+                                }
+                            ]
+                        }
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 60 - 0
public/assets/js/backend/university_course_chapter.js

@@ -0,0 +1,60 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'university_course_chapter/index' + location.search,
+                    add_url: 'university_course_chapter/add?course_id=' + Config.course_id,
+                    edit_url: 'university_course_chapter/edit',
+                    del_url: 'university_course_chapter/del',
+                    multi_url: 'university_course_chapter/multi',
+                    import_url: 'university_course_chapter/import',
+                    table: 'university_course_chapter',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'weigh',
+                showToggle: false,// 禁用视图切换
+                search:false,// 禁用默认搜索框
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'course_id', title: __('Course_id')},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {field: 'duration', title: __('Duration')},
+                        {field: 'video', title: __('Video'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'weigh', title: __('Weigh'), operate: false},
+                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},
+                        {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 2 - 1
public/assets/js/backend/university_event.js

@@ -21,7 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
-                sortName: 'id',
+                sortName: 'weigh',
                 showToggle: false,// 禁用视图切换
                 search:false,// 禁用默认搜索框
                 fixedColumns: true,
@@ -37,6 +37,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'end_apply_time', title: __('End_apply_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'weigh', title: __('Weigh'), operate: false},
                         {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

+ 4 - 4
public/assets/js/backend/university_event_apply.js

@@ -36,12 +36,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
                         {field: 'events.name', title: __('Events.name'), operate: 'LIKE'},
                         {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
-                        {field: 'pay_amount', title: __('Pay_amount'), operate:'BETWEEN'},
+                        {field: 'pay_amount', title: __('报名费用'), operate:'BETWEEN'},
                         {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
                         {field: 'num', title: __('Num')},
-                        {field: 'is_pay', title: __('Is_pay'), searchList: {"1":__('Is_pay 1'),"0":__('Is_pay 0')}, formatter: Table.api.formatter.normal},
-                        {field: 'pay_time', title: __('Pay_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: 'is_pay', title: __('Is_pay'), searchList: {"1":__('Is_pay 1'),"0":__('Is_pay 0')}, formatter: Table.api.formatter.normal},
+                        // {field: 'pay_time', title: __('Pay_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: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 

+ 63 - 0
public/assets/js/backend/vip_config.js

@@ -0,0 +1,63 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'vip_config/index' + location.search,
+                    add_url: 'vip_config/add',
+                    edit_url: 'vip_config/edit',
+                    del_url: 'vip_config/del',
+                    multi_url: 'vip_config/multi',
+                    import_url: 'vip_config/import',
+                    table: 'vip_config',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'weigh',
+                showToggle: false,// 禁用视图切换
+                search:false,// 禁用默认搜索框
+                fixedColumns: true,
+                fixedRightNumber: 1,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'price', title: __('Price'), operate:'BETWEEN'},
+                        {field: 'color', title: __('Color'), operate: 'LIKE'},
+                        {field: 'is_try', title: __('Is_try'), searchList: {"1":__('Is_try 1'),"0":__('Is_try 0')}, formatter: Table.api.formatter.normal},
+                        {field: 'weigh', title: __('Weigh'), operate: false},
+                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},
+                        {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 64 - 0
public/assets/js/backend/vip_coupon.js

@@ -0,0 +1,64 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'vip_coupon/index' + location.search,
+                    add_url: 'vip_coupon/add',
+                    edit_url: 'vip_coupon/edit',
+                    del_url: 'vip_coupon/del',
+                    multi_url: 'vip_coupon/multi',
+                    import_url: 'vip_coupon/import',
+                    table: 'vip_coupon',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                showToggle: false,// 禁用视图切换
+                search:false,// 禁用默认搜索框
+                fixedColumns: true,
+                fixedRightNumber: 1,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"0":__('Type 0')}, formatter: Table.api.formatter.normal},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'num', title: __('Num')},
+                        {field: 'end_days', title: __('End_days')},
+                        {field: 'use_frequency_day', title: __('Use_frequency_day')},
+                        {field: 'use_frequency_times', title: __('Use_frequency_times')},
+                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},
+                        {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        // {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});