Commit c617a0bc by 汪睦雄

提交修改

parent 10189ca1
......@@ -18,6 +18,7 @@ class Project extends AuthBase
protected $city_model;
protected $catalog_model;
protected $project_model;
protected $appoint_model;
public function _initialize()
{
......@@ -25,6 +26,7 @@ class Project extends AuthBase
$this->tag_model = model("Tags");
$this->city_model = model("Citys");
$this->catalog_model = model("Catalogs");
$this->appoint_model = model("Reservations");
parent::_initialize();
}
......@@ -214,6 +216,7 @@ class Project extends AuthBase
$this->assign("tag_list", $tag_list);
return $this->fetch('');
}
//添加标签
public function addTag()
{
......@@ -241,6 +244,7 @@ class Project extends AuthBase
$this->assign('tag_info', $tag_info);
return $this->fetch();
}
//修改标签
public function updateTag()
{
......@@ -262,6 +266,7 @@ class Project extends AuthBase
}
}
}
//删除标签
public function deleteTag()
{
......@@ -278,7 +283,16 @@ class Project extends AuthBase
}
}
//城市管理
// 预约管理
public function appoint()
{
$title = input('get.name', '');
$items = $this->appoint_model->where('nickname', 'like', "%" . $title . "%")->order('id', 'desc')->paginate(15, false, ['query' => ['nickname' => $title]]);
$this->assign("items", $items);
return $this->fetch('');
}
// 城市管理
public function citys()
{
$title = input('get.name', '');
......@@ -286,6 +300,7 @@ class Project extends AuthBase
$this->assign("tag_list", $tag_list);
return $this->fetch('');
}
//添加城市
public function addCity()
{
......@@ -305,6 +320,7 @@ class Project extends AuthBase
}
}
}
public function editCity($id)
{
$this->assign('id', $id);
......@@ -312,6 +328,7 @@ class Project extends AuthBase
$this->assign('tag_info', $tag_info);
return $this->fetch();
}
//编辑城市
public function updateCity()
{
......@@ -333,6 +350,7 @@ class Project extends AuthBase
}
}
}
//删除城市
public function deleteCity()
{
......@@ -358,6 +376,7 @@ class Project extends AuthBase
$this->assign("tag_list", $tag_list);
return $this->fetch('');
}
//添加分类
public function addCatalogs()
{
......@@ -399,6 +418,7 @@ class Project extends AuthBase
$this->assign('tag_info', $tag_info);
return $this->fetch();
}
//编辑分类
public function updateCatalogs()
{
......@@ -430,6 +450,7 @@ class Project extends AuthBase
}
}
}
//删除分类
public function deleteCatalog()
{
......@@ -477,6 +498,7 @@ class Project extends AuthBase
);
}
}
//设置置顶排序
public function setHeat(){
$heat = input('post.heat');
......
......@@ -40,7 +40,7 @@
{volist name="$comment_list" id="vo" key="k" empty="暂时没有数据"}
<tr>
<td>{$vo.id}</td>
<td style="text-align: center">
<td>
{if condition="$vo.project"}
<a href="{$vo.project.poster}" target="_blank" data-fancybox="images">
<img src="{$vo.project.poster}" width='100'>
......@@ -57,9 +57,7 @@
</p>
</td>
<td>
{for start="0" end="$vo.grade"}
<span class="glyphicon glyphicon-star" style="color:goldenrod;font-size:16px;"></span>
{/for}
{$vo.grade}分
</td>
<td>
<div style="width:250px;">{$vo.content}</div>
......@@ -70,15 +68,8 @@
</span>
</td>
<td>
<a href="javascript:" class="btn btn-primary btn-xs check-btn" data-id="{$vo.id}">审核</a>
<!--{if condition="$vo.status == 1"}-->
<!--<a href="{:url('admin/order/commentStatus',['status'=>2,'id'=>$vo.id])}" class="btn btn-xs btn-primary">审核通过</a>-->
<!--<a href="{:url('admin/order/commentStatus',['status'=>3,'id'=>$vo.id])}" class="btn btn-xs btn-warning">审核不通过</a>-->
<!--{else/}-->
<!--<a href="{:url('admin/order/commentStatus',['status'=>1,'id'=>$vo.id])}" class="btn btn-xs btn-primary">退回重审</a>-->
<!--{/if}-->
<!--<a href="##" class="btn btn-xs btn-danger ">删除</a>-->
<a href="javascript:" class="btn btn-primary btn-xs check-btn" data-id="{$vo.id}" {if $vo[
'status']!=1}disabled="disabled"{/if}>审核</a>
</td>
</tr>
{/volist}
......
......@@ -49,8 +49,6 @@
<th>用户信息</th>
<th>订单总价</th>
<th>订单状态</th>
<th>微信pay_id</th>
<th>微信交易订单号</th>
<th>微信支付状态</th>
<th>退款状态</th>
<th>评论状态</th>
......@@ -64,12 +62,12 @@
<td>{$vo.title}</td>
<td>
{if condition="$vo.type == 1"}
活动报名订单
活动报名
{else/}
购买会员卡订单
购买会员卡
{/if}
</td>
<td style="text-align: center">
<td>
{if condition="$vo.project"}
<a href="{$vo.project.poster}" target="_blank" data-fancybox="images">
<img src="{$vo.project.poster}" width='100'>
......@@ -91,12 +89,6 @@
<span style="color:{$vo.status_name.color}">{$vo.StatusText}</span>
</td>
<td>
{$vo.prepay_id}
</td>
<td>
{$vo.out_trade_no}
</td>
<td>
{$vo.trade_status}
</td>
<td>
......
......@@ -37,8 +37,6 @@
<th>项目信息</th>
<th>用户信息</th>
<th>订单总价</th>
<th>微信pay_id</th>
<th>微信交易订单号</th>
<th>微信支付状态</th>
<th>退款状态</th>
<th width="150">审核</th>
......@@ -56,7 +54,7 @@
购买会员卡订单
{/if}
</td>
<td style="text-align: center">
<td>
{if condition="$vo.order.project"}
<a href="{$vo.order.project.poster}" target="_blank" data-fancybox="images">
<img src="{$vo.order.project.poster}" width='100'>
......@@ -77,12 +75,6 @@
<td>{$vo.order.total_fee}</td>
<!--订单状态-->
<td>
{$vo.order.prepay_id}
</td>
<td>
{$vo.order.out_trade_no}
</td>
<td>
{$vo.order.trade_status}
</td>
<td>
......
{layout name="public/layout_main"}
<section class="wrapper">
<h3><i class="fa fa-angle-right"></i> 预约管理</h3>
<!-- 分割线 -->
<hr>
<div class="row margin-bottom">
<div class="col-md-12">
<form class="form-inline pull-left" method="GET" action="{:url('admin/project/citys')}" >
<div class="form-group margin-right">
<input class="form-control" type="text" name="name" id="name" value="<?php echo input('title');?>" placeholder="用户名"/>
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>活动信息</th>
<th>用户信息</th>
<th>姓名</th>
<th>手机号</th>
<th>期望日期</th>
<th>备注</th>
<th>预约时间</th>
</tr>
</thead>
<tbody>
{volist name="items" id="vo" key="k" empty="暂时没有数据"}
<tr id="tr_{$vo.id}">
<td>{$k}</td>
<td>
{if condition="$vo.project"}
<a href="{$vo.project.poster}" target="_blank" data-fancybox="images">
<img src="{$vo.project.poster}" width='100'>
</a>
<p style="padding:0;margin:0;">{$vo.project.title}</p>
{/if}
</td>
<td>
<p style="padding:0;margin:0;text-align:center">{$vo.user_info.nickname}</p>
<p style="padding:0;margin:0;text-align:center">{$vo.user_info.phone}</p>
<p style="padding:0;margin:0;text-align:center;color:#f60">
{if condition="$vo.user_info.is_vip == 1"}
{/if}
</p>
</td>
<td>{$vo.nickname}</td>
<td>{$vo.phone}</td>
<td><?=explode(' ', $vo['expectation_time'])[0]?></td>
<td>{$vo.remark}</td>
<td>{$vo.created_at}</td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
{$items->render()}
</div>
</div>
</section>
<script type="text/javascript">
// 文档加载完毕之后,会进入该方法
$(function(){
$(".btn-delete").click(function(){
var _this = $(this);
var url = "{:url('admin/project/deleteCity')}";
var oid = _this.attr('oid');
showDialog("提示", "确定删除该城市吗?", function(){
// ajax post 方法
$.post(url, {id:oid}, function (res) {
// var res = JSON.parse(res);
if(res.code == 1){
// javascript 的默认弹出提示方法
_this.remove();
$("#tr_"+oid).fadeOut();
}else{
alert(res.msg);
}
});
});
});
});
</script>
......@@ -13,9 +13,9 @@
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>
<div class=" pull-left margin-left">
<!-- <div class=" pull-left margin-left">
<a href="{:url('admin/project/addCatalogs')}" class="btn btn-success">添加分类</a>
</div>
</div> -->
</div>
</div>
......@@ -23,21 +23,13 @@
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<!--<colgroup>-->
<!--<col style="width: 2%;">-->
<!--<col style="width: 80%;">-->
<!--<col style="width: 5%;">-->
<!--<col style="width: 5%;">-->
<!--<col style="width: 10%;">-->
<!--</colgroup>-->
<thead>
<tr>
<th>#</th>
<th>分类名称</th>
<th>分类图标</th>
<th>排序</th>
<th>发布时间</th>
<th>操作</th>
<!-- <th>操作</th> -->
</tr>
</thead>
<tbody>
......@@ -51,11 +43,10 @@
</a>
</td>
<td>{$vo.sort}</td>
<td>{$vo.created_at}</td>
<td>
<!-- <td>
<a href="{:url('admin/project/editCatalogs',['id'=>$vo.id])}" class="btn btn-xs btn-primary"><i class="fa fa-pencil"></i></a>
<a href="javascript:" oid="{$vo.id}" class="btn btn-xs btn-danger btn-delete"><i class="fa fa-trash"></i></a>
</td>
</td> -->
</tr>
{/volist}
</tbody>
......
......@@ -52,6 +52,16 @@
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label text-right">分类</label>
<div class="col-sm-10 col-md-8 col-lg-6">
<select class="form-control selectpicker" name='catalog_id' id="catalog_id" data-live-search="true">
{volist name="catalog_list" id="vo"}
<option value="{$vo.id}" {if condition="$vo.id==$project_info.catalog_id"}selected{/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label text-right">国内/国外</label>
<div class="col-sm-10 col-md-8 col-lg-6">
<select name="region_type" id="region_type" class="form-control">
......@@ -85,16 +95,6 @@
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label text-right">分类</label>
<div class="col-sm-10 col-md-8 col-lg-6">
<select class="form-control selectpicker" name='catalog_id' id="catalog_id" data-live-search="true">
{volist name="catalog_list" id="vo"}
<option value="{$vo.id}" {if condition="$vo.id==$project_info.catalog_id"}selected{/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label text-right">城市</label>
<div class="col-sm-10 col-md-8 col-lg-6">
<select class="form-control selectpicker" name='city' id="city" data-live-search="true">
......@@ -132,7 +132,7 @@
<span class="form-group-tip"> 经纬度在地图上搜索并复制粘贴过来即可, <a href="http://www.gpsspg.com/maps.htm" target="_blank">立即查看地图</a></span>
</div>
</div>
<div class="form-group type_toggle" {if condition="$project_info.type==2"} style="display:none"{/if}>
<div class="form-group" {if condition="$project_info.type==2"} style="display:none"{/if}>
<label for="title" class="col-sm-2 control-label text-right">价格</label>
<div class="col-sm-10 col-md-8 col-lg-6">
<input type="text" class="form-control validate[required,custom[number]]" name="" id="price" placeholder="价格" value="{$project_info.price}">
......@@ -211,7 +211,7 @@ $(function(){
if($(this).val() == 1){
$(".type_toggle").fadeIn();
$(".type_toggle_2").fadeOut();
$(".type_toggle").children('input').removeAttr('disabled');
$(".type_toggle").find('input').removeAttr('disabled');
}else{
$(".type_toggle").fadeOut();
$(".type_toggle").find('input').attr('disabled',true);
......
......@@ -33,6 +33,9 @@
<li <?php if(CONTROLLER_NAME == 'Project'&&(ACTION_NAME=='index'||ACTION_NAME=='create'||ACTION_NAME=='updateproject')){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Project/index")?>">活动/商家列表</a>
</li>
<li <?php if(CONTROLLER_NAME == 'Project'&&(ACTION_NAME=='appoint')){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Project/appoint")?>">预约列表</a>
</li>
<li <?php if(CONTROLLER_NAME == 'Project'&&(ACTION_NAME=='catalogs'||ACTION_NAME=='editcatalogs'||ACTION_NAME=='addcatalogs')){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Project/catalogs")?>">分类管理</a>
</li>
......@@ -63,24 +66,25 @@
</li>
<li class="sub-menu">
<a <?php if(in_array(CONTROLLER_NAME, array('Banner','Guide'))){echo 'class="active"';}?> href="javascript:void(0);" >
<a <?php if(in_array(CONTROLLER_NAME, array('Banner','Guide', 'Business'))){echo 'class="active"';}?> href="javascript:void(0);" >
<i class="fa fa-snowflake-o"></i>
<span>内容管理</span>
</a>
<ul class="sub">
<li <?php if(CONTROLLER_NAME == 'Banner'&&(ACTION_NAME=='index'||ACTION_NAME=='create'||ACTION_NAME=='update')){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Banner/index")?>">Banner广告位</a>
<a href="<?php echo url("@admin/Banner/index")?>">广告管理</a>
</li>
<li <?php if(CONTROLLER_NAME == 'Guide'&&(ACTION_NAME=='index'||ACTION_NAME=='create'||ACTION_NAME=='update')){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Guide/index")?>">美行攻略</a>
</li>
<li <?php if(CONTROLLER_NAME == 'Business'&&ACTION_NAME=='index'){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Business/index")?>">商家入住</a>
</li>
</ul>
</li>
<li class="sub-menu">
<a <?php if(in_array(CONTROLLER_NAME, array('Log', 'Post','Business'))){echo 'class="active"';}?> href="javascript:void(0);" >
<a <?php if(in_array(CONTROLLER_NAME, array('Log','Post'))){echo 'class="active"';}?> href="javascript:void(0);" >
<i class="fa fa-cog"></i>
<span>其他管理</span>
</a>
......@@ -88,10 +92,6 @@
<li <?php if(CONTROLLER_NAME == 'Log'&&ACTION_NAME=='index'){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Log/index", ['level'=>'info'])?>">日志信息</a>
</li>
<li <?php if(CONTROLLER_NAME == 'Business'&&ACTION_NAME=='index'){echo 'class="active"';}?>>
<a href="<?php echo url("@admin/Business/index")?>">商家入住</a>
</li>
</ul>
</li>
......
......@@ -8,8 +8,19 @@
namespace app\common\model;
class Reservations extends BaseModel
{
protected $table = 'mr_reservations';
//获取订单商品
public function project()
{
return $this->belongsTo('Project', 'pid', 'id');
}
//获取下单用户信息
public function userInfo()
{
return $this->belongsTo('User', 'uid', 'id');
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment