Explorar o código

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

lizhen_gitee hai 3 meses
pai
achega
95e4537dcb
Modificáronse 29 ficheiros con 538 adicións e 14 borrados
  1. 37 0
      application/admin/controller/Examine.php
  2. 1 0
      application/admin/controller/Hotel.php
  3. 14 0
      application/admin/lang/zh-cn/examine.php
  4. 3 0
      application/admin/lang/zh-cn/hotel.php
  5. 1 1
      application/admin/lang/zh-cn/hotel_room.php
  6. 81 0
      application/admin/model/Examine.php
  7. 14 0
      application/admin/model/Hotel.php
  8. 27 0
      application/admin/validate/Examine.php
  9. 51 0
      application/admin/view/examine/add.html
  10. 51 0
      application/admin/view/examine/edit.html
  11. 46 0
      application/admin/view/examine/index.html
  12. 12 0
      application/admin/view/hotel/add.html
  13. 12 0
      application/admin/view/hotel/edit.html
  14. 2 2
      application/admin/view/hotel_room/add.html
  15. 2 2
      application/admin/view/hotel_room/edit.html
  16. 12 0
      application/api/controller/Examine.php
  17. 5 0
      application/api/controller/Hotel.php
  18. 1 1
      application/api/controller/HotelCanteen.php
  19. 42 1
      application/api/controller/UniversityCourse.php
  20. 12 2
      application/api/controller/UniversityEvent.php
  21. 8 4
      application/api/controller/Vip.php
  22. 5 0
      application/common/model/ExamineApplyModel.php
  23. 10 0
      application/common/model/UniversityCourseApplyModel.php
  24. 26 0
      application/common/model/UniversityCourseChapterModel.php
  25. 5 0
      application/common/model/UniversityEventApplyModel.php
  26. 1 0
      application/extra/site.php
  27. 55 0
      public/assets/js/backend/examine.js
  28. 1 0
      public/assets/js/backend/hotel.js
  29. 1 1
      public/assets/js/backend/hotel_room.js

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

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

+ 1 - 0
application/admin/controller/Hotel.php

@@ -22,6 +22,7 @@ class Hotel extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\Hotel;
+        $this->view->assign("isHomeList", $this->model->getIsHomeList());
         $this->view->assign("statusList", $this->model->getStatusList());
     }
 

+ 14 - 0
application/admin/lang/zh-cn/examine.php

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

+ 3 - 0
application/admin/lang/zh-cn/hotel.php

@@ -1,6 +1,9 @@
 <?php
 
 return [
+    'Is_home'        => '首页',
+    'Is_home 1'      => '首页',
+    'Is_home 0'      => '默认',
     'Name'           => '名称',
     'Image'          => '列表图',
     'Images'         => '轮播图',

+ 1 - 1
application/admin/lang/zh-cn/hotel_room.php

@@ -26,7 +26,7 @@ return [
     'Facility'       => '客房设施',
     'Bathroom'       => '卫浴',
     'Tips'           => '特别提示',
-    'Cancel_explan'  => '限时取消',
+    'Cancel_explain'  => '限时取消',
     'Weigh'          => '排序值(越大越靠前)',
     'Status'         => '状态',
     'Status 1'       => '正常',

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

@@ -0,0 +1,81 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class Examine extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $table = 'examine';
+    
+    // 自动写入时间戳字段
+    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);
+    }
+
+
+}

+ 14 - 0
application/admin/model/Hotel.php

@@ -25,6 +25,7 @@ class Hotel extends Model
 
     // 追加属性
     protected $append = [
+        'is_home_text',
         'status_text',
         'create_time_text',
         'update_time_text'
@@ -40,12 +41,25 @@ class Hotel extends Model
     }
 
     
+    public function getIsHomeList()
+    {
+        return ['1' => __('Is_home 1'), '0' => __('Is_home 0')];
+    }
+
     public function getStatusList()
     {
         return ['1' => __('Status 1'), '0' => __('Status 0')];
     }
 
 
+    public function getIsHomeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['is_home']) ? $data['is_home'] : '');
+        $list = $this->getIsHomeList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
     public function getStatusTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');

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

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

+ 51 - 0
application/admin/view/examine/add.html

@@ -0,0 +1,51 @@
+<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">{:__('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>

+ 51 - 0
application/admin/view/examine/edit.html

@@ -0,0 +1,51 @@
+<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">{:__('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/examine/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('examine/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('examine/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('examine/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('examine/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('examine/edit')}"
+                           data-operate-del="{:$auth->check('examine/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 12 - 0
application/admin/view/hotel/add.html

@@ -1,6 +1,18 @@
 <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">{:__('Is_home')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_home" data-rule="required" class="form-control selectpicker" name="row[is_home]">
+                {foreach name="isHomeList" 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="">

+ 12 - 0
application/admin/view/hotel/edit.html

@@ -1,6 +1,18 @@
 <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">{:__('Is_home')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-is_home" data-rule="required" class="form-control selectpicker" name="row[is_home]">
+                {foreach name="isHomeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.is_home"}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}">

+ 2 - 2
application/admin/view/hotel_room/add.html

@@ -149,9 +149,9 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Cancel_explan')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Cancel_explain')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-cancel_explan" data-rule="required" class="form-control" name="row[cancel_explan]" type="text" value="">
+            <input id="c-cancel_explain" data-rule="required" class="form-control" name="row[cancel_explain]" type="text" value="">
         </div>
     </div>
     <div class="form-group">

+ 2 - 2
application/admin/view/hotel_room/edit.html

@@ -149,9 +149,9 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Cancel_explan')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Cancel_explain')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-cancel_explan" data-rule="required" class="form-control" name="row[cancel_explan]" type="text" value="{$row.cancel_explan|htmlentities}">
+            <input id="c-cancel_explain" data-rule="required" class="form-control" name="row[cancel_explain]" type="text" value="{$row.cancel_explan|htmlentities}">
         </div>
     </div>
     <div class="form-group">

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

@@ -4,6 +4,7 @@ namespace app\api\controller;
 
 use addons\epay\library\Service;
 use app\common\controller\Api;
+use app\common\model\ExamineApplyModel;
 use app\common\model\ExamineModel;
 use app\common\model\PayOrderModel;
 use app\common\model\UniversityEventModel;
@@ -89,4 +90,15 @@ class Examine extends Api
         return $this->success('报名成功');
     }
 
+    public function applyList()
+    {
+        $user_id = $this->auth->id;
+        $query = ExamineApplyModel::with([
+            'examine' => function ($query) {
+                $query->field(['id','name','content']);
+            }
+        ])->where('user_id',$user_id)->where('status',1)->order('id','desc')->autopage()->select();
+
+        $this->success('success', $query);
+    }
 }

+ 5 - 0
application/api/controller/Hotel.php

@@ -40,6 +40,10 @@ class Hotel extends Api
         }
         $query    = HotelModel::field($field);
 
+        if (!empty($params['is_home'])){
+            $query->where('is_home',$params['is_home']);
+        }
+
         if (!empty($params['lng']) && !empty($params['lng'])){
             if ($params['sort_distance'] == 1){
                 $query->order('distance asc');
@@ -96,6 +100,7 @@ class Hotel extends Api
     {
         $params = $this->request->param();
         $info = HotelRoomModel::where('id',$params['id'])->where('status',1)->find();
+        $info['business_license'] = cdnurl(config('site.business_license'));
         return $this->success('success', $info);
     }
 

+ 1 - 1
application/api/controller/HotelCanteen.php

@@ -30,7 +30,7 @@ class HotelCanteen extends Api
     {
         $params = $this->request->param();
         $params['sort_type'] = !empty($params['sort_type']) ? $params['sort_type'] : 1;
-        $field = ['id','name','image','price','original_price','tags','lat','lng'];
+        $field = ['id','name','image','price','original_price','tags','lat','lng','address'];
         if (!empty($params['lng']) && !empty($params['lng'])){
             $field[] = "(st_distance(point ({$params['lng']}, {$params['lat']}),point(lng,lat))*111195) as distance";
         }

+ 42 - 1
application/api/controller/UniversityCourse.php

@@ -5,10 +5,13 @@ namespace app\api\controller;
 use addons\epay\library\Service;
 use app\common\controller\Api;
 use app\common\model\PayOrderModel;
+use app\common\model\UniversityCourseApplyModel;
 use app\common\model\UniversityCourseModel;
+use app\common\model\UniversityEventApplyModel;
 use app\common\model\UniversityEventModel;
 use app\common\model\Wallet;
 use app\utils\CurlUtil;
+use app\utils\RedisUtil;
 use think\Db;
 
 /**
@@ -91,6 +94,27 @@ class UniversityCourse extends Api
         if (!empty($info['apply'])) {
             return $this->error('您已报过名了');
         }
+
+        $coupon = Db::name('vip_coupon_user')->where('user_id',$user_id)->where('id',$params['course_id'])->find();
+        if (!$coupon || $coupon['status'] != 1){
+            return $this->error('优惠券不存在或已使用');
+        }
+
+        if ($coupon['end_time'] < time()){
+            return $this->error('优惠券已过期');
+        }
+
+        if ($coupon['use_frequency_day'] > 0 && $coupon['use_frequency_times'] > 0){
+            $use_frequency_times = Db::name('vip_coupon_user')->where('user_id',$user_id)
+                ->where('coupon_id',$coupon['coupon_id'])
+                ->where('status',2)
+                ->whereBetween('use_time',[time() - (86400 * $coupon['use_frequency_day']),time()])
+                ->count();
+            if ($use_frequency_times >= $coupon['use_frequency_times']){
+                return $this->error("优惠券{$coupon['use_frequency_day']}天内仅可使用{$coupon['use_frequency_times']}次!");
+            }
+        }
+
         $nowTime = time();
         // 开始报名
         $data = [
@@ -107,10 +131,27 @@ class UniversityCourse extends Api
             Db::rollback();
             return $this->error('订单创建失败');
         }
-        // TODO 抵扣券
+        // 抵扣券
+        if (!Db::name('vip_coupon_user')->where('id',$params['course_id'])->update(['order_id'=>$apply_id,'status' => 2,'use_time' => time()])) {
+            Db::rollback();
+            return $this->error('订单创建失败');
+        }
         Db::commit();
 
         return $this->success('报名成功');
     }
 
+    public function applyList()
+    {
+        $user_id = $this->auth->id;
+        $query = UniversityCourseApplyModel::with([
+            'course' => function ($query) {
+                $query->field(['id','name','image']);
+            },
+            'chapters' => function ($query) {
+                $query->field(['id','course_id','name']);
+            }
+        ])->where('user_id',$user_id)->where('status',1)->order('id','desc')->autopage()->select();
+        $this->success('success', $query);
+    }
 }

+ 12 - 2
application/api/controller/UniversityEvent.php

@@ -5,6 +5,7 @@ namespace app\api\controller;
 use addons\epay\library\Service;
 use app\common\controller\Api;
 use app\common\model\PayOrderModel;
+use app\common\model\UniversityEventApplyModel;
 use app\common\model\UniversityEventModel;
 use app\common\model\Wallet;
 use app\utils\CurlUtil;
@@ -147,7 +148,7 @@ class UniversityEvent extends Api
                 'age'      => $v['age'],
             ];
         }
-        if (!Db::name('university_event_info')->insertAll($apply_info)) {
+        if (!Db::name('university_event_apply_info')->insertAll($apply_info)) {
             Db::rollback();
             return $this->error('订单创建失败');
         }
@@ -218,7 +219,16 @@ class UniversityEvent extends Api
     public function applyList()
     {
         $user_id = $this->auth->id;
-        $query = Db::name('university_event_apply')->where('user_id',$user_id);
+        $query = UniversityEventApplyModel::with([
+            'events' => function ($query) {
+                $query->field(['id','name','image','start_time']);
+            }
+        ])->where('user_id',$user_id)->where('status',1)->order('id','desc')->autopage()->select();
+
+        foreach ($query as $key=>$val){
+            $query[$key]['events']['start_time'] = date('Y-m-d H:i', $val['events']['start_time']);
+        }
 
+        $this->success('success', $query);
     }
 }

+ 8 - 4
application/api/controller/Vip.php

@@ -20,11 +20,15 @@ class Vip extends Api
     // VIP抵扣券
     public function coupon()
     {
+        $params = $this->request->param();
         $user_id = $this->auth->id;
-        $list = Db::name('vip_coupon_user')
+        $query = 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])
+            ->where('user_id',$user_id);
+        if (!empty($params['type'])){
+            $query->where('type',$params['type']);
+        }
+            $list = $query->whereIn('status',[1,2])
             ->order('id desc')
             ->autopage()
             ->select();
@@ -57,7 +61,7 @@ class Vip extends Api
         if ($info['status'] != 1){
             $this->error('券已使用');
         }
-        if (!Db::name('vip_coupon_user')->where(['id'=>$params['coupon_id'],'status'=>1])->update(['status'=>2])){
+        if (!Db::name('vip_coupon_user')->where(['id'=>$params['coupon_id'],'status'=>1])->update(['status'=>2,'use_time' => time()])){
             $this->error('操作失败');
         }
         $this->error('使用成功');

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

@@ -18,4 +18,9 @@ class ExamineApplyModel extends Model
     protected $createTime = false;
     protected $updateTime = false;
     protected $deleteTime = false;
+
+    public function examine()
+    {
+        return $this->hasOne(ExamineModel::class, 'id', 'examine_id');
+    }
 }

+ 10 - 0
application/common/model/UniversityCourseApplyModel.php

@@ -24,4 +24,14 @@ class UniversityCourseApplyModel extends Model
     {
         return $this->hasOne(UserModel::class, 'id', 'user_id');
     }
+
+    public function course()
+    {
+        return $this->hasOne(UniversityCourseModel::class, 'id', 'course_id');
+    }
+
+    public function chapters()
+    {
+        return $this->hasMany(UniversityCourseChapterModel::class, 'course_id', 'course_id');
+    }
 }

+ 26 - 0
application/common/model/UniversityCourseChapterModel.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace app\common\model;
+
+use think\Db;
+use think\Model;
+
+/**
+ * 群组
+ */
+class UniversityCourseChapterModel extends Model
+{
+    // 表名
+    protected $name = 'university_course_chapter';
+    // 开启自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    public function course()
+    {
+        return $this->hasOne(UniversityCourseModel::class, 'id', 'course_id');
+    }
+}

+ 5 - 0
application/common/model/UniversityEventApplyModel.php

@@ -24,4 +24,9 @@ class UniversityEventApplyModel extends Model
     {
         return $this->hasOne(UserModel::class, 'id', 'user_id');
     }
+
+    public function events()
+    {
+        return $this->hasOne(UniversityEventModel::class, 'id', 'event_id');
+    }
 }

+ 1 - 0
application/extra/site.php

@@ -64,4 +64,5 @@ return array (
   'recharge_explain' => '1.充值金额只能在小善·潘多港湾中使用。
 2.充值金额无法提现,无法找零。
 3.充值金额永久有效',
+  'business_license' => '/uploads/20241210/bdafdca4bd272fafc8072cb43be5f782.png',
 );

+ 55 - 0
public/assets/js/backend/examine.js

@@ -0,0 +1,55 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'examine/index' + location.search,
+                    add_url: 'examine/add',
+                    edit_url: 'examine/edit',
+                    del_url: 'examine/del',
+                    multi_url: 'examine/multi',
+                    import_url: 'examine/import',
+                    table: 'examine',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'weigh',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {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;
+});

+ 1 - 0
public/assets/js/backend/hotel.js

@@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
+                        {field: 'is_home', title: __('Is_home'), searchList: {"1":__('Is_home 1'),"0":__('Is_home 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: 'price', title: __('Price'), operate:'BETWEEN'},

+ 1 - 1
public/assets/js/backend/hotel_room.js

@@ -46,7 +46,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'facility', title: __('Facility'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'bathroom', title: __('Bathroom'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'tips', title: __('Tips'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        {field: 'cancel_explan', title: __('Cancel_explan'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'cancel_explain', title: __('Cancel_explain'), 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},