100 changed files with 20623 additions and 0 deletions
@ -0,0 +1,35 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Fullreduce{ |
|||
|
|||
/** |
|||
* 根据订单金额返回满减金额 |
|||
* @access static |
|||
* @name initSingleGoods |
|||
* @param $price 订单金额 |
|||
* @param $id 满减活动id |
|||
* @return $money 返回减少金额 |
|||
*/ |
|||
static function getFullreduceMoney($price,$id){ |
|||
global $_W; |
|||
$full = pdo_get('wlmerchant_fullreduce_list',array('id' => $id),array('rules','status')); |
|||
if($full['status']>0){ |
|||
$rules = unserialize($full['rules']); |
|||
if(!empty($rules)){ |
|||
foreach ($rules as $ru){ |
|||
if($price >= $ru['full_money']){ |
|||
$money = $ru['cut_money']; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if($money<0 || empty($money)){ |
|||
$money = 0; |
|||
} |
|||
return $money; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[满减活动]]></name> |
|||
<identifie><![CDATA[fullreduce]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[interact]]></type> |
|||
<description><![CDATA[满额减免活动,适用于抢购,团购,拼团,砍价,卡券,同城配送,在线买单]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="活动列表" ac="fullreduce" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="活动列表" ac="fullreduce" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,119 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Fullreduce_WeliamController { |
|||
/** |
|||
* Comment: 满减活动列表页 |
|||
*/ |
|||
public function activelist() { |
|||
global $_W, $_GPC; |
|||
//参数获取 |
|||
$pindex = max(1 , intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$name = trim($_GPC['name']); |
|||
//条件生成 |
|||
$where = ['uniacid' => $_W['uniacid'],'aid'=>$_W['aid']]; |
|||
if ($name) $where['title LIKE'] = "%".$name."%"; |
|||
//信息获取 |
|||
$lists = pdo_getslice(PDO_NAME.'fullreduce_list' , $where , [$pindex , $psize] , $total , [] , '' , "sort DESC,id DESC"); |
|||
foreach ($lists as &$act){ |
|||
$act['createtime'] = date('Y-m-d H:i:s',$act['createtime']); |
|||
$act['rules'] = unserialize($act['rules']); |
|||
} |
|||
$pager = wl_pagination($total , $pindex , $psize); |
|||
include wl_template('fullreduce/activelist'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 满减活动编辑页 |
|||
*/ |
|||
public function activeedit(){ |
|||
global $_W, $_GPC; |
|||
$id = intval($_GPC['id']); |
|||
if(!empty($id)){ |
|||
$item = pdo_get(PDO_NAME . 'fullreduce_list',array('id' => $id)); |
|||
$item['rules'] = unserialize($item['rules']); |
|||
} |
|||
if ($_W['ispost']) { |
|||
$active = $_GPC['item']; |
|||
$full_money = $_GPC['full_money']; |
|||
$cut_money = $_GPC['cut_money']; |
|||
if(empty($full_money) || empty($cut_money)){ |
|||
wl_message('规则设置错误,请重试' , referer(),'error'); |
|||
} |
|||
$len = count($full_money); |
|||
$rule = []; |
|||
for ($k = 0 ; $k < $len ; $k++) { |
|||
$rule[$k]['full_money'] = sprintf("%.2f",$full_money[$k]); |
|||
$rule[$k]['cut_money'] = sprintf("%.2f",$cut_money[$k]); |
|||
} |
|||
$timeKey = array_column($rule, 'full_money'); |
|||
array_multisort($timeKey,SORT_DESC,$rule); |
|||
$rule = serialize($rule); |
|||
$active['rules'] = $rule; |
|||
if(empty($id)){ |
|||
$active['uniacid'] = $_W['uniacid']; |
|||
$active['aid'] = $_W['aid']; |
|||
$active['createtime'] = time(); |
|||
$res = pdo_insert(PDO_NAME . 'fullreduce_list', $active); |
|||
if($res){ |
|||
wl_message('新建满减活动成功' , web_url('fullreduce/fullreduce/activelist' , ['id' => $id]) , 'success'); |
|||
}else{ |
|||
wl_message('新建满减活动失败,请重试' , referer(),'error'); |
|||
} |
|||
}else{ |
|||
$res = pdo_update(PDO_NAME . 'fullreduce_list',$active,array('id' => $id)); |
|||
if($res){ |
|||
wl_message('更新满减活动成功' , web_url('fullreduce/fullreduce/activelist' , ['id' => $id]) , 'success'); |
|||
}else{ |
|||
wl_message('更新满减活动失败,请重试' , referer(),'error'); |
|||
} |
|||
} |
|||
} |
|||
include wl_template('fullreduce/activeedit'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 满减活动规则页 |
|||
*/ |
|||
public function rules(){ |
|||
include wl_template('fullreduce/rules'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 满减活动启用禁用操作 |
|||
* Author: wlf |
|||
* Date: 2020/06/29 19:30 |
|||
*/ |
|||
public function changeStatus(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$id = intval($_GPC['id']); |
|||
$status = intval($_GPC['status']); |
|||
#2、改变状态 0=禁用;1=启用 |
|||
if($status == 1) $data['status'] = 0; |
|||
else $data['status'] = 1; |
|||
#3、信息修改 |
|||
if(pdo_update(PDO_NAME."fullreduce_list",$data,['id'=>$id])) show_json(1); |
|||
else show_json(0,'请刷新重试!'); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 删除满减活动 |
|||
*/ |
|||
public function delete(){ |
|||
global $_W,$_GPC; |
|||
$id = intval($_GPC['id']); |
|||
$res = pdo_delete(PDO_NAME."fullreduce_list",array('id'=>$id)); |
|||
if($res){ |
|||
show_json(1); |
|||
}else{ |
|||
show_json(0,'删除失败,请刷新重试!'); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">编辑活动</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="form-group-title">活动信息</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="item[sort]" class="form-control" value="{$item['sort']}" placeholder="排序" > |
|||
<div class="help-block">排序由大到小,数值越大,顺序越靠前</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>活动名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="item[title]" maxlength="16" class="form-control" value="{$item['title']}" placeholder="请输入活动名称" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>满减规则</label> |
|||
<div class="col-sm-9"> |
|||
<div class="alert alert-warning"> |
|||
<b>金额设置最多保留两位小数。</b><br/> |
|||
<b>规则示例:设置的两条规则为:100,20和50,5。当订单金额大于等于100元时,订单会减免20元;当订单金额大于等于50元时,订单会减免5元。</b> |
|||
</div> |
|||
<div id="datas" class="sms-template-1" style="display:block;"> |
|||
{if !empty($item['rules'])} |
|||
{loop $item['rules'] $data} |
|||
{php include wl_template('fullreduce/rules');} |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
<div class="form-group sms-template-1" style="display:block;"> |
|||
<div style="margin-top: 10px;"> |
|||
<a class="btn btn-default btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一条规则</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span class="form-must">*</span>活动状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[status]" value="1" {if !empty($item['status'])}checked{/if}> 启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" name="item[status]" value="0" {if empty($item['status'])} checked{/if}> 禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="id" value="{$item['id']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//添加与删除规则 |
|||
var kw = 1; |
|||
function addType() { |
|||
$.ajax({ |
|||
url: "{php echo web_url('fullreduce/fullreduce/rules')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
$(document).on('click', '.data-item-delete', function () { |
|||
$(this).closest('.data-item').remove(); |
|||
}); |
|||
</script> |
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,76 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">满减活动</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('fullreduce/fullreduce/activeedit')}" class="btn btn-primary">添加活动</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="{php echo web_url('fullreduce/fullreduce/activelist')}" method="post"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">活动标题</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$_GPC['name']}" placeholder="请输入活动标题"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" type="submit">搜索</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
{if !empty($lists)} |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center">活动ID</th> |
|||
<th class="text-center">活动名称</th> |
|||
<th class="text-center">活动规则</th> |
|||
<th class="text-center">创建时间</th> |
|||
<th class="text-center">状态</th> |
|||
<th class="text-center">排序</th> |
|||
<th class="text-center">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $lists $list} |
|||
<tr class="text-center"> |
|||
<td>{$list['id']}</td> |
|||
<td>{$list['title']}</td> |
|||
<td> |
|||
{loop $list['rules'] $ru} |
|||
满<span style="color: orangered;margin-left: 2px;margin-right:2px;">{$ru['full_money']}</span>元减<span style="color: darkorange;margin-left: 2px;margin-right:2px;">{$ru['cut_money']}</span>元</br> |
|||
{/loop} |
|||
</td> |
|||
<td>{$list['createtime']}</td> |
|||
<td> |
|||
<a data-toggle="ajaxPost" href="{php echo web_url('fullreduce/fullreduce/changeStatus', ['id' => $list['id'],'status'=>$list['status']])}" class='btn btn-sm {if $list['status']==1}btn-primary{else}btn-danger{/if}'> |
|||
{if $list['status']==1}启用{else}禁用{/if} |
|||
</a> |
|||
</td> |
|||
<td>{$list['sort']}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-primary" href="{php echo web_url('fullreduce/fullreduce/activeedit', array('id' => $list['id']))}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('fullreduce/fullreduce/delete', array('id' => $list['id']))}" data-confirm="删除活动后所有选择此活动的商品满减活动都不会生效,确定删除?">删除</a> |
|||
</td> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
{else} |
|||
<div class="no-result"> |
|||
<p>还没有相关数据</p> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,8 @@ |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">满</span> |
|||
<input type="number" class="form-control" name="full_money[]" value="{$data['full_money']}" min="0" required> |
|||
<span class="input-group-addon">元,减</span> |
|||
<input type="number" class="form-control" name="cut_money[]" value="{$data['cut_money']}" min="0" required > |
|||
<span class="input-group-addon">元</span> |
|||
<span class="input-group-addon btn btn-default data-item-delete"><i class="fa fa-remove"></i> 删除</span> |
|||
</div> |
|||
File diff suppressed because it is too large
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[团购活动]]></name> |
|||
<identifie><![CDATA[groupon]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[market]]></type> |
|||
<description><![CDATA[让每一个人都能找到更优惠的团购商品,共同享受物美价廉的服务。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<store embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<storemenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="团购列表" ac="active" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
</menu> |
|||
</storemenu> |
|||
<agentmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="团购列表" ac="active" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
<entry title="团购分类" ac="category" do="index" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基础设置" ac="set" do="base" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="活动" font="fa-inbox"> |
|||
<entry title="团购列表" ac="active" do="activelist" actions='["do",["activelist","createactive"]]' iscover="true" /> |
|||
<entry title="团购分类" ac="category" do="index" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基础设置" ac="set" do="base" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,131 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class GrouponModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 获取团购商品信息列表 |
|||
* Author: zzw |
|||
* Date: 2019/8/7 14:00 |
|||
*/ |
|||
public function homeList(){ |
|||
global $_W,$_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1; |
|||
$page_index = $_GPC['page_index'] ? $_GPC['page_index'] : 10; |
|||
$page_start = $page * $page_index - $page_index; |
|||
$lng = $_GPC['lng'] ? $_GPC['lng'] : 0;//用户当前所在经度 |
|||
$lat = $_GPC['lat'] ? $_GPC['lat'] : 0;//用户当前所在纬度 |
|||
$status = $_GPC['status'] ? $_GPC['status'] : 0; |
|||
$is_total = $_GPC['is_total'] ? : 0;//0=不获取总页数;1=获取总页数 |
|||
$cate_id = $_GPC['cate_id'] ? : 0;//商品分类id |
|||
$is_vip = $_GPC['is_vip'] ? : 0;//是否获取专属商品 |
|||
|
|||
$time = $_GPC['time'] ?: time();//时间筛选 |
|||
$week = date("w", $time);//当前时间的星期 |
|||
if ($week == 0) $week = 7;//星期天时值的转换 |
|||
$toDay = date("j", $time);//当前时间的日期 |
|||
|
|||
$set = Setting::agentsetting_read("pluginlist"); |
|||
$sort = $_GPC['sort'] ? : $set['tgsort']; |
|||
#2、生成基本查询条件 |
|||
$where = " a.aid = {$_W['aid']} AND a.uniacid = {$_W['uniacid']} "; |
|||
|
|||
$where .= " AND CASE a.usedatestatus |
|||
WHEN 1 THEN a.`week` LIKE '%\"{$week}\"%' |
|||
WHEN 2 THEN a.`day` LIKE '%\"{$toDay}\"%' |
|||
WHEN 0 THEN a.id > 0 |
|||
END "; |
|||
|
|||
if ($status > 0) { |
|||
$ids = explode(',' , $status); |
|||
if (count($ids) > 1) { |
|||
$where .= " AND a.status IN ({$status}) "; |
|||
} else { |
|||
$where .= " AND a.status = {$status} "; |
|||
} |
|||
} else { |
|||
$where .= " AND a.status IN (1,2) "; |
|||
} |
|||
if ($cate_id > 0) { |
|||
$where .= " AND a.cateid = {$cate_id} "; |
|||
} |
|||
if ($is_vip == 1) $where .= " AND a.vipstatus IN (1,2) "; |
|||
#4、生成排序条件 |
|||
switch ($sort) { |
|||
case 1:$order = " ORDER BY a.createtime DESC ";break;//创建时间 |
|||
case 2:break;//店铺距离 |
|||
case 3:$order = " ORDER BY a.sort DESC ";break;//默认排序 |
|||
case 4:$order = " ORDER BY a.pv DESC ";break;//浏览人气 |
|||
case 5:$order = " ORDER BY buy_num DESC ";break;//商品销量 |
|||
case 6:$order = " ORDER BY a.sort DESC,buy_num DESC ";break;//精选 推荐、销量排序 |
|||
case 7:$order = " ORDER BY a.pv DESC,buy_num DESC ";break;//最热 浏览量、销量排序 |
|||
} |
|||
#5、获取商品列表 |
|||
if($sort != 2){ |
|||
//普通查询 |
|||
$sql = "SELECT a.id,a.id as goods_id,(IFNULL(sum(b.num),0) + a.falsesalenum)as buy_num FROM " |
|||
. tablename(PDO_NAME . "groupon_activity") |
|||
. " as a LEFT JOIN ".tablename(PDO_NAME."order") |
|||
. " as b ON a.id = b.fkid AND b.plugin = 'groupon' AND b.uniacid = {$_W['uniacid']} AND b.status IN (0,1,2,3,6,7,9,4,8) AND b.aid = {$_W['aid']} " |
|||
."WHERE {$where} GROUP BY a.id {$order}"." LIMIT {$page_start},{$page_index} "; |
|||
$info = pdo_fetchall($sql); |
|||
}else{ |
|||
//关联店铺查询 |
|||
$info = pdo_fetchall("SELECT a.id as goods_id,b.id,b.location FROM " |
|||
. tablename(PDO_NAME."groupon_activity") |
|||
." as a LEFT JOIN " |
|||
.tablename(PDO_NAME."merchantdata") |
|||
." as b ON a.sid = b.id WHERE {$where} "); |
|||
$info = Store::getstores($info, $lng, $lat, 2); |
|||
$info = array_slice($info,$page_start,$page_index); |
|||
} |
|||
#6、循环处理信息 |
|||
foreach ($info as $key => &$val) { |
|||
//获取最新的商品信息 |
|||
$val = WeliamWeChat::getHomeGoods(2, $val['goods_id']); |
|||
$val['url'] = h5_url('pages/subPages/goods/index',['type'=>2,'id'=>$val['id']]); |
|||
//添加店铺链接 |
|||
if ($val['sid'] > 0) { |
|||
$val['shop_url'] = h5_url('pages/mainPages/store/index', ['sid' => $val['sid']]); |
|||
$val['distance'] = Store::shopLocation($val['sid'], $lng, $lat); |
|||
}else{ |
|||
$val['storename'] = '平台商品'; |
|||
} |
|||
if($is_vip > 0){ |
|||
$val['price'] = sprintf("%.2f",$val['price'] - $val['discount_price']); |
|||
} |
|||
//删除多余的信息 |
|||
unset($val['user_list']); |
|||
unset($val['address']); |
|||
unset($val['user_num']); |
|||
unset($val['totalnum']); |
|||
unset($val['allsalenum']); |
|||
unset($val['sid']); |
|||
} |
|||
#7、获取总页数 |
|||
if($is_total == 1){ |
|||
$total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename(PDO_NAME . "groupon_activity") . " as a WHERE {$where}"); |
|||
$data['total'] = ceil($total / $page_index); |
|||
$data['list'] = $info; |
|||
|
|||
$this->renderSuccess('团购商品信息列表',$data); |
|||
} |
|||
|
|||
$this->renderSuccess('团购商品信息列表',$info); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 获取团购分类列表 |
|||
* Author: wlf |
|||
* Date: 2020/09/21 14:30 |
|||
*/ |
|||
public function cateList(){ |
|||
global $_W , $_GPC; |
|||
$list = pdo_getall('wlmerchant_groupon_category',array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'is_show' => 0),array('id','name'), '' , 'sort DESC'); |
|||
$this->renderSuccess('团购分类',$list); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,329 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Active_WeliamController { |
|||
/* |
|||
* 入口函数 |
|||
*/ |
|||
function activelist() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$data = array(); |
|||
if ($_GPC['status'] == 4) { |
|||
$data['status#'] = "(0,4)"; |
|||
} else if (!empty($_GPC['status'])) { |
|||
$data['status'] = intval($_GPC['status']); |
|||
} |
|||
$data['aid'] = $_W['aid']; |
|||
if (is_store()) { |
|||
$data['sid'] = $_W['storeid']; |
|||
} |
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1: |
|||
$data['@name@'] = $_GPC['keyword']; |
|||
break; |
|||
case 2: |
|||
$data['@id@'] = $_GPC['keyword']; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
if ($_GPC['keywordtype'] == 3) { |
|||
$keyword = $_GPC['keyword']; |
|||
$params[':storename'] = "%{$keyword}%"; |
|||
$merchants = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_merchantdata') . "WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND storename LIKE :storename", $params); |
|||
if ($merchants) { |
|||
$sids = "("; |
|||
foreach ($merchants as $key => $v) { |
|||
if ($key == 0) { |
|||
$sids .= $v['id']; |
|||
} else { |
|||
$sids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$sids .= ")"; |
|||
$data['sid#'] = $sids; |
|||
} else { |
|||
$data['sid#'] = "(0)"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
$activity = Groupon::getNumActive('*', $data, 'sort DESC,ID DESC', $pindex, $psize, 1); |
|||
$pager = $activity[1]; |
|||
$activity = $activity[0]; |
|||
foreach ($activity as $key => &$value) { |
|||
if($value['sid'] > 0){ |
|||
$value['storename'] = pdo_getcolumn(PDO_NAME . 'merchantdata', array('id' => $value['sid']), 'storename'); |
|||
}else if(empty($value['threestatus'])){ |
|||
$value['storename'] = '票付通平台商品'; |
|||
}else if($value['threestatus'] == 1){ |
|||
$value['storename'] = '亿奇达平台商品'; |
|||
} |
|||
Groupon::changeActivestatus($value); |
|||
$value['placeorder'] = WeliamWeChat::getSalesNum(2,$value['id'],0,1,0,0,0,$value['pftid']); //已下单 |
|||
if (empty($value['placeorder'])) { |
|||
$value['placeorder'] = 0; |
|||
} |
|||
$value['alreadypay'] = WeliamWeChat::getSalesNum(2,$value['id'],0,2,0,0,0,$value['pftid']); //已支付 |
|||
if (empty($value['alreadypay'])) { |
|||
$value['alreadypay'] = 0; |
|||
} |
|||
$value['alreadyuse'] = WeliamWeChat::getSalesNum(2,$value['id'],0,3,0,0,0,$value['pftid']); //已使用 |
|||
if (empty($value['alreadyuse'])) { |
|||
$value['alreadyuse'] = 0; |
|||
} |
|||
} |
|||
include wl_template('grouponactive/active_list'); |
|||
} |
|||
|
|||
function ajax() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$da = Groupon::getSingleGoods($id, '*'); |
|||
die(json_encode($da)); |
|||
} |
|||
|
|||
function delete() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$status = $_GPC['status']; |
|||
if ($status == 4) { |
|||
$group = pdo_get('wlmerchant_groupon_activity',array('id' => $id),array('starttime','endtime','sid','status')); |
|||
if(is_store()){ |
|||
$examine = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$group['sid']),'audits'); |
|||
if(empty($examine)){ |
|||
$changestatus = 5; |
|||
} |
|||
} |
|||
if(empty($changestatus)){ |
|||
if ($group['starttime'] > time()) { |
|||
$changestatus = 1; |
|||
} |
|||
else if ($group['starttime'] < time() && time() < $group['endtime']) { |
|||
$changestatus = 2; |
|||
} |
|||
else if ($group['endtime'] < time()) { |
|||
$changestatus = 3; |
|||
} |
|||
} |
|||
$res = Groupon::updateActive(array('status' => $changestatus), array('id' => $id)); |
|||
} else { |
|||
$res = Groupon::updateActive(array('status' => 4), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
function delall() { |
|||
global $_W, $_GPC; |
|||
$res = Groupon::deleteActive(array('id' => intval($_GPC['id']), 'uniacid' => $_W['uniacid'])); |
|||
if ($res) { |
|||
show_json(1, '团购删除成功'); |
|||
} else { |
|||
show_json(0, '团购删除失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 批量修改商品信息 |
|||
* Author: wlf |
|||
* Date: 2020/06/01 15:07 |
|||
*/ |
|||
public function changestatus(){ |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC['ids']; |
|||
$type = $_GPC['type']; |
|||
foreach ($ids as $k => $v){ |
|||
$groupon = pdo_get('wlmerchant_groupon_activity',array('id' => $v),array('starttime','endtime','status','sid')); |
|||
if($type == 1){ |
|||
$status = 0; |
|||
if(is_store()){ |
|||
$examine = pdo_getcolumn(PDO_NAME.'merchantdata',array('id'=>$groupon['sid']),'audits'); |
|||
if(empty($examine)){ |
|||
$status = 5; |
|||
} |
|||
} |
|||
if(empty($status)){ |
|||
if ($groupon['starttime'] > time()) { |
|||
$status = 1; |
|||
} |
|||
else if ($groupon['starttime'] < time() && time() < $groupon['endtime']) { |
|||
$status = 2; |
|||
} |
|||
else if ($groupon['endtime'] < time()) { |
|||
$status = 3; |
|||
} |
|||
} |
|||
pdo_update('wlmerchant_groupon_activity', array('status' => $status), array('id' => $v)); |
|||
}else if($type == 8 && $groupon['status'] == 8){ |
|||
Groupon::deleteActive(array('id' => $v, 'uniacid' => $_W['uniacid'])); |
|||
}else{ |
|||
pdo_update('wlmerchant_groupon_activity', array('status' => $type), array('id' => $v)); |
|||
} |
|||
} |
|||
show_json(1, '操作成功'); |
|||
} |
|||
|
|||
function cutoff() { |
|||
global $_W, $_GPC; |
|||
$res = pdo_update('wlmerchant_groupon_activity', array('status' => 8), array('id' => intval($_GPC['id']))); |
|||
if ($res) { |
|||
show_json(1, '删除成功'); |
|||
} else { |
|||
show_json(0, '删除失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
function examine() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$flag = $_GPC['flag']; |
|||
if ($flag == 1) { |
|||
$res = Groupon::updateActive(array('status' => 1), array('id' => $id)); |
|||
News::goodsToExamine($id,'groupon'); |
|||
} else { |
|||
$res = Groupon::updateActive(array('status' => 6), array('id' => $id)); |
|||
News::goodsToExamine($id,'groupon','未通过'); |
|||
} |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
function tag() { |
|||
include wl_template('grouponactive/listtag'); |
|||
} |
|||
|
|||
function copygood() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$da = Groupon::getSingleActive($id, '*'); |
|||
unset($da['id']); |
|||
unset($da['a']); |
|||
unset($da['plugin']); |
|||
$da['levelnum'] = $da['num']; |
|||
$da['status'] = 4; |
|||
$res = pdo_insert('wlmerchant_groupon_activity', $da); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0))); |
|||
} else { |
|||
die(json_encode(array('errno' => 1))); |
|||
} |
|||
} |
|||
|
|||
function changepv() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
$newvalue = trim($_GPC['value']); |
|||
if ($type == 1) { |
|||
$res = pdo_update('wlmerchant_groupon_activity', array('pv' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 2) { |
|||
$res = pdo_update('wlmerchant_groupon_activity', array('sort' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 3) { |
|||
$res = pdo_update('wlmerchant_groupon_activity', array('num' => $newvalue), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(0, '修改失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 根据条件获取团购商品 |
|||
* Author: zzw |
|||
* Date: 2019/7/11 13:50 |
|||
*/ |
|||
public function groupList() { |
|||
global $_W, $_GPC; |
|||
#1、条件生成 |
|||
$where = " a.aid = {$_W['aid']} AND a.uniacid = {$_W['uniacid']}";//默认条件 |
|||
!empty($_GPC['name']) && $where .= " AND a.name LIKE '%{$_GPC['name']}%' ";//商品名称 |
|||
$_GPC['status'] > -1 && $where .= " AND a.status = {$_GPC['status']} ";//商品名称 |
|||
!empty($_GPC['goods_id']) && $where .= " AND a.id = {$_GPC['goods_id']} ";//商品id |
|||
!empty($_GPC['shop_name']) && $where .= " AND m.storename LIKE '%{$_GPC['shop_name']}%' ";//商户名称 |
|||
$_GPC['cate_id'] > -1 && $where .= " AND a.cateid = {$_GPC['cate_id']} ";//商户名称 |
|||
!empty($_GPC['shop_id']) && $where .= " AND a.sid = {$_GPC['shop_id']} ";//商户id |
|||
#2、排序操作 |
|||
$order = " a.sort DESC ,a.id DESC "; |
|||
#3、分页操作 |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1;//当前页 |
|||
$index = $_GPC['index'] ? $_GPC['index'] : 10;//每页的数量 |
|||
$start = $page * $index - $index;//开始查询的点 = 当前页 * 每页的数量 - 每页的数量 |
|||
$limit = " LIMIT {$start},{$index}"; |
|||
#4、查询信息内容 |
|||
$field = 'a.id,a.thumb,a.name,a.starttime,a.endtime,a.status,a.pv,a.sort,a.num,a.recommend,m.storename,b.name as cate_name'; |
|||
$sql = "SELECT {$field} FROM " . tablename(PDO_NAME . 'groupon_activity') |
|||
. " a LEFT JOIN " . tablename(PDO_NAME . "groupon_category") |
|||
. " b ON a.cateid = b.id LEFT JOIN " . tablename(PDO_NAME . "merchantdata") |
|||
. " m ON a.sid = m.id"; |
|||
!empty($where) && $sql .= " WHERE {$where} "; |
|||
$sql .= ' GROUP BY a.id '; |
|||
!empty($order) && $sql .= " ORDER BY {$order} "; |
|||
$total = count(pdo_fetchall(str_replace($field, "a.id", $sql)));//获取符合条件的总数量 |
|||
$data['page_num'] = ceil($total / $index);//获取一共有多少页 |
|||
!empty($limit) && $sql .= $limit; |
|||
$data['list'] = pdo_fetchall($sql);//获取要查询的列表数据 |
|||
#5、处理相关信息 |
|||
$orderModel = new Order(); |
|||
foreach ($data['list'] as $k => &$v) { |
|||
//图片信息转换 |
|||
$v['thumb'] = tomedia($v['thumb']); |
|||
//获取销量信息 |
|||
$orderW = " fkid = {$v['id']} AND plugin = 'groupon' AND status in "; |
|||
$v['order_purchase'] = $orderModel->getPurchaseQuantity($orderW . " (0,1,2,3,4,6,8,9) ") ?: 0;//已下单 |
|||
$v['order_payment'] = $orderModel->getPurchaseQuantity($orderW . " (1,2,3,4,6,8,9) ") ?: 0;//已支付 |
|||
$v['order_used'] = $orderModel->getPurchaseQuantity($orderW . " (2,3) ") ?: 0;//已完成 |
|||
//时间戳转时间 |
|||
$v['starttime'] = date("Y-m-d H:i:s", $v['starttime']); |
|||
$v['endtime'] = date("Y-m-d H:i:s", $v['endtime']); |
|||
} |
|||
|
|||
wl_json(1, '团购商品列表', $data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取团购分类列表 |
|||
* Author: zzw |
|||
* Date: 2019/7/11 13:57 |
|||
*/ |
|||
public function getClassList() { |
|||
global $_W, $_GPC; |
|||
$where = " uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
$list = pdo_fetchall("SELECT id,name FROM " . tablename(PDO_NAME . 'groupon_category') . " WHERE {$where} ORDER BY sort DESC"); |
|||
|
|||
wl_json(1, '团购分类列表', $list); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 修改团购商品的某个单项数据信息 |
|||
* Author: zzw |
|||
* Date: 2019/7/12 15:20 |
|||
*/ |
|||
public function updateInfo() { |
|||
global $_W, $_GPC; |
|||
#1、参数接收 |
|||
if (empty($_GPC['field'])) show_json(0, "缺少参数:修改的字段名称"); |
|||
#2、修改内容 |
|||
$data[$_GPC['field']] = $_GPC['value']; |
|||
$res = pdo_update(PDO_NAME . 'groupon_activity', $data, array('id' => $_GPC['id'])); |
|||
if ($res) { |
|||
show_json(1, "修改成功"); |
|||
} else { |
|||
show_json(0, "修改失败"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Category_WeliamController { |
|||
/** |
|||
* Comment: 团购分类列表 |
|||
* Author: zzw |
|||
* Date: 2019/12/20 11:53 |
|||
*/ |
|||
public function index() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = 10; |
|||
$keyword = $_GPC['keyword'] ? : ''; |
|||
#1、条件生成 |
|||
$where = ['aid'=>$_W['aid'],'uniacid'=>$_W['uniacid']]; |
|||
if(!empty($keyword)) $where['name LIKE'] = '%' . $keyword . '%'; |
|||
#1、列表获取 |
|||
$list = pdo_getslice(PDO_NAME . 'groupon_category',$where,[$page, $pageIndex],$total,['id','name','sort','thumb'],'','sort DESC'); |
|||
$pager = wl_pagination($total, $page, $pageIndex); |
|||
|
|||
|
|||
include wl_template('goodshouse/cate_list'); |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Set_WeliamController { |
|||
|
|||
public function base() { |
|||
global $_W, $_GPC; |
|||
|
|||
if (checksubmit('submit')) { |
|||
$base = $_GPC['base']; |
|||
Setting::agentsetting_save($base, 'groupon'); |
|||
wl_message('保存设置成功!', referer(), 'success'); |
|||
} |
|||
$base = Setting::agentsetting_read('groupon'); |
|||
$communitylist = pdo_getall('wlmerchant_community', array('uniacid' => $_W['uniacid'], 'aid' => $_W['aid']), array('id', 'communname')); |
|||
|
|||
include wl_template('grouponset/base'); |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,293 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.order-rank img{width:16px; height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative; padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; } |
|||
.goods-info span {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="#">团购商品</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('goodshouse/goodshouse/createactive',array('plugin'=>'groupon'))}" class="btn btn-primary">添加团购</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="groupon" /> |
|||
<input type="hidden" name="ac" value="active" /> |
|||
<input type="hidden" name="do" value="activelist" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">待开始</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">进行中</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">已结束</a> |
|||
<a href="{php echo wl_filter_url('status:5');}" class="btn {if $_GPC['status'] == 5}btn-primary{else}btn-default{/if}">审核中</a> |
|||
<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == 6}btn-primary{else}btn-default{/if}">被驳回</a> |
|||
<a href="{php echo wl_filter_url('status:7');}" class="btn {if $_GPC['status'] == 7}btn-primary{else}btn-default{/if}">已售完</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">已下架</a> |
|||
<a href="{php echo wl_filter_url('status:8');}" class="btn {if $_GPC['status'] == 8}btn-primary{else}btn-default{/if}">回收站</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control" style="width:180px;"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>活动商品名称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>活动商品ID</option> |
|||
{if !is_store()} |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>商家名称</option> |
|||
{/if} |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered order-list"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th class="text-center" width="30px"><input type="checkbox" name="checkall" value="" id="checkall" class="checkboxall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/></th> |
|||
<th style="width:30px;text-align:center;">ID</th> |
|||
<th style="width:120px;">商品</th> |
|||
<th style="width:100px; text-align:center;">活动时间</th> |
|||
<th style="width:60px; text-align:center;">活动状态</th> |
|||
<th style="width:60px; text-align:center;">属性</th> |
|||
<th style="width:70px; text-align:center;">库存/下单</th> |
|||
<th style="width:70px; text-align:center;">数据统计</th> |
|||
<!--<th style="width:120px; text-align:center;">核销截止时间</th>--> |
|||
<th style="width:100px; text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $activity $item} |
|||
<tr> |
|||
<td><center><input type="checkbox" name="items[]" value="{$item['id']}" class="checkbox" /></center></td> |
|||
<td class="text-center">{$item['id']}</td> |
|||
<td class="goods-info line-feed"> |
|||
<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['thumb'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div> |
|||
<div class="title" style="padding-left: 60px;"> |
|||
<span>{$item['name']}</span> |
|||
<span>商家:{$item['storename']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="line-feed" style="width:150px;padding-left: 5px;"> |
|||
<div class="title" style="text-align: center;"> |
|||
<span>从:{php echo date('m-d H:i',$item['starttime'])}</span><br /> |
|||
<span>到:{php echo date('m-d H:i',$item['endtime'])}</span> |
|||
{if $item['cutoffstatus'] == 1} |
|||
<span style="display: inline-block;">购买后{$item['cutoffday']}天有效</span> |
|||
{else} |
|||
<span style="display: inline-block;">截止:{php echo date('m-d H:i',$item['cutofftime'])}</span> |
|||
{/if} |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:60px;"> |
|||
{if $item['status'] == 0 }<span class="label label-default">下架中</span>{/if} |
|||
{if $item['status'] == 1 }<span class="label label-warning">未开始</span>{/if} |
|||
{if $item['status'] == 2 }<span class="label label-success">进行中</span>{/if} |
|||
{if $item['status'] == 5 }<span class="label label-warning">审核中</span>{/if} |
|||
{if $item['status'] == 6 }<span class="label label-danger">被驳回</span>{/if} |
|||
{if $item['status'] == 8 }<span class="label label-default">回收站</span>{/if} |
|||
{if $item['status'] == 3 }<span class="label label-danger">已结束</span>{/if} |
|||
{if $item['status'] == 4 }<span class="label label-default">下架中</span>{/if} |
|||
{if $item['status'] == 7 }<span class="label label-default">已售完</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:60px;"> |
|||
{if is_store()} |
|||
<p>人气:{$item['pv']}</p> |
|||
<p>排序:{$item['sort']}</p> |
|||
{else} |
|||
<p>人气:<a style="color: #428bca;" data-href="{php echo web_url('groupon/active/changepv',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改人气" data-toggle="ajaxEdit" >{$item['pv']}</a></p> |
|||
<p>排序:<a style="color: #428bca;" data-href="{php echo web_url('groupon/active/changepv',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$item['sort']}</a></p> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:70px;"> |
|||
<p>提供:<a style="color: #428bca;" data-href="{php echo web_url('groupon/active/changepv',array('id' => $item['id'],'type'=>3))}" href="javascript:;" title="修改库存" data-toggle="ajaxEdit" >{$item['num']}</a></p> |
|||
<p style="color: #428bca;"><a href="{php echo web_url('order/wlOrder/checkcodeList',array('plugin'=>'groupon','status'=>1,'id' => $item['id']))}">已下单:{$item['placeorder']}</a></p> |
|||
</td> |
|||
<td class="text-center" style="width:70px;"> |
|||
<p style="color: #428bca;"><a href="{php echo web_url('order/wlOrder/checkcodeList',array('plugin'=>'groupon','status'=>2,'id' => $item['id']))}">已支付:{$item['alreadypay']}</a></p> |
|||
<p style="color: #428bca;"><a href="{php echo web_url('order/wlOrder/checkcodeList',array('plugin'=>'groupon','status'=>3,'id' => $item['id']))}">已完成:{$item['alreadyuse']}</a></p> |
|||
</td> |
|||
<td class="text-center" style="position: relative;"> |
|||
{if p('wxplatform')} |
|||
<a href="javascript:;" data-url="{php echo h5_url('pages/subPages/goods/index',['type'=>2,'id'=>$item['id']])}" class="js-clip">复制链接</a> |
|||
{/if} |
|||
{if p('wxapp')} |
|||
<a href="javascript:;" data-url="pages/subPages/goods/index?type=2&goodsType=2&id={$item['id']}" class="js-clip">复制路径</a> |
|||
{/if} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('goodshouse/goodshouse/createactive', array('plugin'=>'groupon','id' => $item['id'],'page'=>$pindex))}">编辑</a> </p> |
|||
<br /> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-copy" order-id="{$item['id']}">复制商品</a></p> |
|||
{if ($item['status'] == 1 || $item['status'] == 2 || $item['status'] == 3)} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-remove" order-id="{$item['id']}" order-status="{$item['status']}">下架</a></p> |
|||
{/if} |
|||
{if $item['status'] ==4 || $item['status'] == 8} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-remove" order-id="{$item['id']}" order-status="{$item['status']}">上架</a></p> |
|||
{/if} |
|||
{if $item['status']==5 && !is_store()} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-pass" order-id="{$item['id']}" flag = '1' order-status="{$item['status']}">通过</a> </p> |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-pass" order-id="{$item['id']}" flag = '0' order-status="{$item['status']}">不通过</a></p> |
|||
{/if} |
|||
{if $item['status']==6 && !is_store()} |
|||
<p style="color: #428bca;display: inline-block;"><a href="javascript:;" class="js-pass" order-id="{$item['id']}" flag = '1' order-status="{$item['status']}">通过</a></p> |
|||
{/if} |
|||
{if $item['status'] == 8} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('groupon/active/delall', array('id'=>$item['id']))}" data-toggle="ajaxRemove" data-confirm="此操作会删除团购活动,同时导致订单商品数据缺失或其他问题,确定要删除吗?">删除</a></p> |
|||
{else} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('groupon/active/cutoff', array('id'=>$item['id']))}" data-toggle="ajaxRemove" data-confirm="确认把商品放入回收站吗?">删除</a></p> |
|||
{/if} |
|||
{if empty($item['pftid']) && Customized::init('pft147') > 0} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('goodshouse/goodshouse/checklist', array('id' => $item['id'],'plugin'=>'groupon'))}">核销码</a> </p> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<button class="btn btn-default btn-sm" type="button" onclick="location.reload();"><i class="fa fa-refresh"></i></button> |
|||
<div class="btn-group btn-group-sm"> |
|||
<button class="btn btn-default" disabled="disabled" id="checkYse" onclick="checkOrDelete(1);">批量上架</button> |
|||
<button class="btn btn-default" disabled="disabled" id="checkNo" onclick="checkOrDelete(4);">批量下架</button> |
|||
</div> |
|||
<button class="btn btn-default btn-sm" type="button" disabled="disabled" id="delete" onclick="checkOrDelete(8);"><i class="fa fa-trash"></i> 回收站</button> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
function checkOrDelete(check){ |
|||
var content = ''; |
|||
if(check==1) content = '确认上架选中商品?'; |
|||
if(check==4) content = '确认下架选中商品?'; |
|||
if(check==8) content = '确认把选中商品放入回收站?如果商品已在回收站将会被彻底删除。'; |
|||
layer.open({ |
|||
title: [ |
|||
'提示', |
|||
'background-color:#23c6c8; color:#fff;' |
|||
] |
|||
,anim: 'up' |
|||
,content: content |
|||
,btn: ['确认', '取消'] |
|||
,yes:function(index){ |
|||
$('.layer-anim').remove(); |
|||
var ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
ids.push(this.value); |
|||
}; |
|||
}); |
|||
//处理 |
|||
$.post("{php echo web_url('groupon/active/changestatus')}", { ids : ids ,type:check}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("操作成功!"); |
|||
location.reload(); |
|||
}else{ |
|||
util.tips(data.message); |
|||
}; |
|||
}, 'json'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
|
|||
$(function(){ |
|||
$('.order-list').delegate('.js-remove', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var status = $this.attr('order-status'); |
|||
var statushtml = (status == 4) ? "上架" : "下架"; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('groupon/active/delete')}",{id:id,status:status}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips(statushtml+"成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认'+statushtml+"?"}); |
|||
}); |
|||
$('.order-list').delegate('.js-pass', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var flag = $this.attr('flag'); |
|||
var statushtml = (flag == 1) ? "通过" : "不通过"; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('groupon/active/examine')}", {id:id,flag:flag}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips(statushtml+"成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认'+statushtml+"审核?"}); |
|||
}); |
|||
|
|||
$('.order-list').delegate('.js-copy', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('groupon/active/copygood')}", {id:id}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("复制成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认复制该活动?被复制的活动会在已下架中显示'}); |
|||
}); |
|||
|
|||
$('.checkbox,.checkboxall').click(function(){ |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$('#check').attr('disabled',''); |
|||
if($checks.length>0) { |
|||
$('#checkYse').attr('disabled',false); |
|||
$('#checkNo').attr('disabled',false); |
|||
$('#delete').attr('disabled',false); |
|||
}else{ |
|||
$('#checkYse').attr('disabled',true); |
|||
$('#checkNo').attr('disabled',true); |
|||
$('#delete').attr('disabled',true); |
|||
} |
|||
}); |
|||
|
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,110 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基本设置</a></li> |
|||
<li><a href="#tab_share">列表分享</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal" id="setting-form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">模块设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">首页社群</label> |
|||
<div class="col-sm-9"> |
|||
<select name="base[communityid]" class="form-control chosen-select"> |
|||
<option value="0" >不显示社群</option> |
|||
{loop $communitylist $key $val} |
|||
<option value="{$val['id']}" {if $val['id'] == $base['communityid']}selected{/if}>{$val['communname']}</option> |
|||
{/loop} |
|||
</select> |
|||
<span class="help-block">请选择首页是否显示社群</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hide"> |
|||
<label class="col-sm-2 control-label">选项卡分类是否显示图片</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadioo2" name="base[img_switch]" value="0" {if $base['img_switch'] != 1}checked="checked"{/if}> |
|||
<label for="inlineRadioo2">关闭 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadioo1" name="base[img_switch]" value="1" {if $base['img_switch'] == 1}checked="checked"{/if}> |
|||
<label for="inlineRadioo1">开启 </label> |
|||
</div> |
|||
<span class="help-block">开启后,所有团购选项卡下面的分类都会显示图片</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称]</b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[share_title]" class="form-control" value="{$base['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('base[share_image]', $base['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="base[share_desc]" class="form-control" value="{$base['share_desc']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function() { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function(e) { |
|||
e.preventDefault(); //阻止a链接的跳转行为 |
|||
$(this).tab('show'); //显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
//监听搜索框是否启用 |
|||
$("[name='base[search]']").change(function () { |
|||
var val = $(this).val(); |
|||
if(val == 1){ |
|||
$(".form-group.search_float").hide(); |
|||
$(".form-group.search_bgColor").hide(); |
|||
}else{ |
|||
$(".form-group.search_float").show(); |
|||
if($("[name='base[search_float]']:checked").val() == 1){ |
|||
$(".form-group.search_bgColor").show(); |
|||
}else{ |
|||
$(".form-group.search_bgColor").hide(); |
|||
} |
|||
} |
|||
}); |
|||
//监听搜索框是否浮动 |
|||
$("[name='base[search_float]']").change(function () { |
|||
var val = $(this).val(); |
|||
if(val == 1){ |
|||
$(".form-group.search_bgColor").show(); |
|||
}else{ |
|||
$(".form-group.search_bgColor").hide(); |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,470 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Halfcard |
|||
{ |
|||
|
|||
static function checkFollow($cardid) |
|||
{ |
|||
global $_W; |
|||
if ($_W['fans']['follow'] != 1) { |
|||
$showurl = !empty($_W['wlsetting']['share']['gz_image']) ? $_W['wlsetting']['share']['gz_image'] : 'qrcode_' . $_W['acid'] . '.jpg'; |
|||
pdo_insert('wlmerchant_halfcard_qrscan', array('uniacid' => $_W['uniacid'], 'openid' => $_W['openid'], 'scantime' => time(), 'cardid' => $cardid)); |
|||
include wl_template('newcard/qrcode'); |
|||
exit; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 保存特权内容 |
|||
* |
|||
* @access static |
|||
* @name saveHalfcard |
|||
* @param mixed 参数一的说明 |
|||
* @return array |
|||
*/ |
|||
static function saveHalfcard($halfcard, $param = array()) |
|||
{ |
|||
global $_W; |
|||
if (!is_array($halfcard)) return FALSE; |
|||
$halfcard['uniacid'] = $_W['uniacid']; |
|||
$halfcard['aid'] = $_W['aid']; |
|||
if (empty($param)) { |
|||
pdo_insert(PDO_NAME . 'halfcardlist', $halfcard); |
|||
return pdo_insertid(); |
|||
} |
|||
return FALSE; |
|||
} |
|||
|
|||
/** |
|||
* 删除特权券 |
|||
* |
|||
* @access static |
|||
* @name deleteOrder |
|||
* @param $params 修改参数 |
|||
* @param $where 修改条件 |
|||
* @return array |
|||
*/ |
|||
static function deleteHalfcard($where) |
|||
{ |
|||
$res = pdo_delete(PDO_NAME . 'halfcardlist', $where); |
|||
if ($res) { |
|||
return 1; |
|||
} else { |
|||
return 0; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* //TODO:删除特权券用户记录删除特权券用户记录 |
|||
* |
|||
* @access static |
|||
* @name deleteOrder |
|||
* @param $params 修改参数 |
|||
* @param $where 修改条件 |
|||
* @return array |
|||
*/ |
|||
static function deleteHalfcardRecord($where) |
|||
{ |
|||
$res = pdo_delete(PDO_NAME . 'timecardrecord', $where); |
|||
if ($res) { |
|||
return 1; |
|||
} else { |
|||
return 0; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取单条特权券内容 |
|||
* |
|||
* @access static |
|||
* @name getSingleOrder |
|||
* @param $where 查询条件 |
|||
* @param $select 查询参数 |
|||
* @return array |
|||
*/ |
|||
static function getSingleHalfcard($id, $select, $where = array()) |
|||
{ |
|||
$where['id'] = $id; |
|||
return Util::getSingelData($select, PDO_NAME . 'halfcardlist', $where); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条用户记录 |
|||
* |
|||
* @access static |
|||
* @name getSingleOrder |
|||
* @param $where 查询条件 |
|||
* @param $select 查询参数 |
|||
* @return array |
|||
*/ |
|||
static function getSingleMember($id, $select, $where = array()) |
|||
{ |
|||
$where['mid'] = $id; |
|||
return Util::getSingelData($select, PDO_NAME . 'halfcardmember', $where); |
|||
} |
|||
|
|||
/** |
|||
* 更新特权券母类 |
|||
* |
|||
* @access static |
|||
* @name updateCoupons |
|||
* @param $params 修改参数 |
|||
* @param $where 修改条件 |
|||
* @return array |
|||
*/ |
|||
static function updateHalfcard($params, $where) |
|||
{ |
|||
$res = pdo_update(PDO_NAME . 'halfcardlist', $params, $where); |
|||
if ($res) { |
|||
return 1; |
|||
} else { |
|||
return 0; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取多条特权优惠记录 |
|||
* |
|||
* @access static |
|||
* @name getNumRecord |
|||
* @param $where 查询条件 |
|||
* @param $select 查询参数 |
|||
* @return array |
|||
*/ |
|||
static function getNumRecord($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$goodsInfo = Util::getNumData($select, PDO_NAME . 'halfcardrecord', $where, $order, $pindex, $psize, $ifpage); |
|||
$newGoodInfo = $newGoodInfo ? $newGoodInfo : array(); |
|||
return array($newGoodInfo, $goodsInfo[1], $goodsInfo[2]) ? array($newGoodInfo, $goodsInfo[1], $goodsInfo[2]) : array(); |
|||
} |
|||
|
|||
//判断会员等级是否有权限购买商品 |
|||
static function checklevel($mid, $levels) |
|||
{ |
|||
global $_W; |
|||
$now = time(); |
|||
if ($_W['wlsetting']['halfcard']['halfcardtype'] == 2) { |
|||
$cards = pdo_fetchall("SELECT levelid FROM " . tablename('wlmerchant_halfcardmember') . "WHERE uniacid = {$_W['uniacid']} AND mid = {$mid} AND aid = {$_W['aid']} AND expiretime > {$now} AND disable != 1"); |
|||
} else { |
|||
$cards = pdo_fetchall("SELECT levelid FROM " . tablename('wlmerchant_halfcardmember') . "WHERE uniacid = {$_W['uniacid']} AND mid = {$mid} AND expiretime > {$now} AND disable != 1"); |
|||
} |
|||
$flag = 0; |
|||
if ($cards) { |
|||
foreach ($cards as $key => $cs) { |
|||
if (in_array($cs['levelid'], $levels)) { |
|||
$flag = 1; |
|||
} |
|||
} |
|||
} |
|||
return $flag; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取多条店铺记录 |
|||
* |
|||
* @access static |
|||
* @name getNumCouponOrder |
|||
* @param $where 查询条件 |
|||
* @param $select 查询参数 |
|||
* @return array |
|||
*/ |
|||
static function getNumstore($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$goodsInfo = Util::getNumData($select, PDO_NAME . 'merchantdata', $where, $order, $pindex, $psize, $ifpage); |
|||
return $goodsInfo; |
|||
} |
|||
|
|||
static function getstores($locations, $lng, $lat) |
|||
{ |
|||
global $_W; |
|||
if (empty($lat) || empty($lng)) return false; |
|||
foreach ($locations as $key => $val) { |
|||
$loca = unserialize($val['location']); |
|||
$locations[$key]['distance'] = Store::getdistance($loca['lng'], $loca['lat'], $lng, $lat); |
|||
} |
|||
//排序 |
|||
for ($i = 0; $i < count($locations) - 1; $i++) { |
|||
for ($j = 0; $j < count($locations) - 1 - $i; $j++) { |
|||
if ($locations[$j]['distance'] > $locations[$j + 1]['distance']) { |
|||
$temp = $locations[$j + 1]; |
|||
$locations[$j + 1] = $locations[$j]; |
|||
$locations[$j] = $temp; |
|||
} |
|||
} |
|||
} |
|||
foreach ($locations as $key => $value) { |
|||
if ($value['distance'] > 1000) { |
|||
$locations[$key]['distance'] = (floor(($value['distance'] / 1000) * 10) / 10) . "km"; |
|||
} else { |
|||
$locations[$key]['distance'] = round($value['distance']) . "m"; |
|||
} |
|||
} |
|||
return $locations; |
|||
} |
|||
|
|||
/** |
|||
* 异步支付结果回调 ,处理业务逻辑 |
|||
* |
|||
* @access public |
|||
* @name |
|||
* @param mixed 参数一的说明 |
|||
* @return array |
|||
*/ |
|||
static function payHalfcardNotify($params) |
|||
{ |
|||
global $_W; |
|||
Util::wl_log('vip_notify', PATH_DATA . "merchant/data/", $params); //写入异步日志记录 |
|||
$data = self::getVipPayData($params); //得到支付参数,处理代付 |
|||
pdo_update(PDO_NAME . 'halfcard_record', $data, array('orderno' => $params['tid'])); //更新订单状态 |
|||
|
|||
$order_out = pdo_get(PDO_NAME . 'halfcard_record', array('orderno' => $params['tid'])); |
|||
$memberData = array( |
|||
'halfcardstatus' => 1, |
|||
'lasthalfcardtime' => $order_out['limittime'], |
|||
'areaid' => $order_out['areaid'], |
|||
'aid' => $order_out['aid'] |
|||
); |
|||
pdo_update(PDO_NAME . 'member', $memberData, array('id' => $order_out['mid'])); |
|||
} |
|||
|
|||
/** |
|||
* 函数的含义说明 |
|||
* |
|||
* @access public |
|||
* @name 方法名称 |
|||
* @param mixed 参数一的说明 |
|||
* @return array |
|||
*/ |
|||
static function payHalfcardReturn($params) |
|||
{ |
|||
global $_W; |
|||
Util::wl_log('Vip_return', PATH_DATA . "merchant/data/", $params);//写入日志记录 |
|||
$order_out = pdo_get(PDO_NAME . 'halfcard_record', array('orderno' => $params['tid']), array('id')); |
|||
header("location:" . h5_url('pages/mainPages/memberCard/getMembership/getMembership')); |
|||
} |
|||
|
|||
/** |
|||
* 获取多条活动数据 |
|||
* |
|||
* @access static |
|||
* @name getNumActive |
|||
* @param $where 查询条件 |
|||
* @param $select 查询参数 |
|||
* @return array |
|||
*/ |
|||
static function getNumActive($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$activeInfo = Util::getNumData($select, PDO_NAME . 'halfcardlist', $where, $order, $pindex, $psize, $ifpage); |
|||
return $activeInfo; |
|||
} |
|||
|
|||
|
|||
static function getNumPackActive($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$activeInfo = Util::getNumData($select, PDO_NAME . 'package', $where, $order, $pindex, $psize, $ifpage); |
|||
return $activeInfo; |
|||
} |
|||
|
|||
/** |
|||
* 获取多条活动数据1 |
|||
* |
|||
* @access static |
|||
* @name getNumActive |
|||
* @param $where 查询条件 |
|||
* @param $select 查询参数 |
|||
* @return array |
|||
*/ |
|||
static function getNumActive1($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$activeInfo = Util::getNumData($select, PDO_NAME . 'halfcardrecord', $where, $order, $pindex, $psize, $ifpage); |
|||
return $activeInfo; |
|||
} |
|||
|
|||
static function getNumActive2($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$activeInfo = Util::getNumData($select, PDO_NAME . 'timecardrecord', $where, $order, $pindex, $psize, $ifpage); |
|||
return $activeInfo; |
|||
} |
|||
|
|||
static function getNumhalfcardmember($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$activeInfo = Util::getNumData($select, PDO_NAME . 'halfcardmember', $where, $order, $pindex, $psize, $ifpage); |
|||
return $activeInfo; |
|||
} |
|||
|
|||
static function getNumhalfcardpay($select, $where, $order, $pindex, $psize, $ifpage) |
|||
{ |
|||
$activeInfo = Util::getNumData($select, PDO_NAME . 'halfcard_record', $where, $order, $pindex, $psize, $ifpage); |
|||
return $activeInfo; |
|||
} |
|||
|
|||
static function doTask() |
|||
{ |
|||
global $_W, $_GPC; |
|||
//自动过期礼包特权 |
|||
$nowtime = time(); |
|||
pdo_update('wlmerchant_package', array('status' => 0), array('status' => 1, 'packtimestatus' => 1, 'dateendtime <' => $nowtime)); |
|||
pdo_update('wlmerchant_package', array('status' => 0), array('status' => 1, 'packtimestatus' => 1, 'datestarttime >' => $nowtime)); |
|||
pdo_update('wlmerchant_halfcardlist', array('status' => 0), array('status' => 1, 'timingstatus' => 1, 'endtime <' => $nowtime)); |
|||
pdo_update('wlmerchant_halfcardlist', array('status' => 0), array('status' => 1, 'timingstatus' => 1, 'starttime >' => $nowtime)); |
|||
//自动上架礼包 |
|||
pdo_update('wlmerchant_package', array('status' => 1), array('status' => 0, 'packtimestatus' => 1, 'datestarttime <' => $nowtime, 'dateendtime >' => $nowtime)); |
|||
pdo_update('wlmerchant_halfcardlist', array('status' => 1), array('status' => 0, 'timingstatus' => 1, 'starttime <' => $nowtime, 'endtime >' => $nowtime)); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 获取用户正在使用的一张会员卡信息 |
|||
* Author: zzw |
|||
* Date: 2019/8/19 15:15 |
|||
* @return array|bool |
|||
*/ |
|||
public static function getUserMemberCardInfo() |
|||
{ |
|||
global $_W; |
|||
$time = time(); |
|||
$set = $_W['wlsetting']['halfcard']; |
|||
$defaultlevel = $_W['wlsetting']['halflevel']; |
|||
$isVip = WeliamWeChat::VipVerification($_W['mid'], true); |
|||
$settings = Setting::wlsetting_read('halfcard'); |
|||
if ($set['halfcardtype'] == 2) { |
|||
$info = pdo_fetch("SELECT id,expiretime,username,levelid FROM " . tablename(PDO_NAME . "halfcardmember") . "WHERE aid = {$_W['aid']} AND uniacid = {$_W['uniacid']} AND mid = {$_W['mid']} AND expiretime > {$time} AND disable != 1 "); |
|||
} else { |
|||
$info = pdo_fetch("SELECT id,expiretime,username,levelid FROM " . tablename(PDO_NAME . "halfcardmember") . "WHERE uniacid = {$_W['uniacid']} AND mid = {$_W['mid']} AND expiretime > {$time} AND disable != 1 "); |
|||
} |
|||
$info['isVip'] = $isVip; |
|||
//默认面 |
|||
$defaultCardImg = tomedia('/addons/{MODULE_NAME}/h5/resource/image/defaulthalfimg.png'); |
|||
if ($info['levelid'] > 0 && $isVip) { |
|||
//会员并且会员等级不是最低级 |
|||
$level = pdo_get(PDO_NAME . "halflevel", array('id' => $info['levelid']), array('name', 'cardimg','army')); |
|||
$info['name'] = $level['name']; |
|||
$info['levelarmy'] = $level['army']; |
|||
$info['cardimg'] = !empty($level['cardimg']) ? tomedia($level['cardimg']) : tomedia($settings['cardimg']); |
|||
} else if ($isVip) { |
|||
//会员 但是会员等级为默认等级 |
|||
$info['name'] = $defaultlevel['name']; |
|||
$info['levelarmy'] = 0; |
|||
$info['cardimg'] = !empty($defaultlevel['cardimg']) ? tomedia($defaultlevel['cardimg']) : tomedia($settings['cardimg']); |
|||
} else { |
|||
//不是会员 |
|||
$info['name'] = ''; |
|||
$info['levelarmy'] = 0; |
|||
$info['cardimg'] = tomedia($settings['cardimg']) ?: $defaultCardImg; |
|||
} |
|||
|
|||
$info['cardimg'] = $info['cardimg'] ? tomedia($info['cardimg']) : $defaultCardImg; |
|||
$info['endtime'] = date('Y-m-d', $info['expiretime']); |
|||
$info['cardimg'] = $info['cardimg'] ? tomedia($info['cardimg']) : tomedia($set['cardimg']); |
|||
$info['avatar'] = $_W['wlmember']['avatar']; |
|||
//获取已节省的信息 |
|||
$base = Setting::wlsetting_read('halfcard'); |
|||
//$info['is_statistics'] = $info['id'] > 0 ? $base['statisticsdiv'] : 0 ;//0=隐藏;1=显示 |
|||
if ($info['id'] > 0 && $base['statisticsdiv']) { |
|||
$where['mid'] = $_W['mid']; |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
$totalPrice = pdo_getcolumn(PDO_NAME . 'timecardrecord', $where, array("SUM(ordermoney)")); |
|||
$price = pdo_getcolumn(PDO_NAME . 'timecardrecord', $where, array("SUM(realmoney)")); |
|||
$savePrice = $totalPrice - $price; |
|||
$info['total_price'] = sprintf("%.2f", $totalPrice) ?: 0.00;//消费金额 |
|||
$info['price'] = sprintf("%.2f", $savePrice) ?: 0.00;//节省金额 |
|||
} |
|||
//获取实卡编号 |
|||
$info['cardsn'] = pdo_getcolumn(PDO_NAME . 'halfcard_realcard', array('cardid' => $info['id']), 'cardsn'); |
|||
if (!$info['cardsn']) { |
|||
$info['cardsn'] = 0; |
|||
} |
|||
//N814定制项目 |
|||
if (file_exists(PATH_MODULE . 'N814.log')) { |
|||
$info['banknum'] = $_W['wlmember']['card_number']; |
|||
} |
|||
return is_array($info) ? $info : []; |
|||
} |
|||
|
|||
/** |
|||
* Comment: 电商联盟定制 同步会员卡到另一个模块 |
|||
* Author: wlf |
|||
* Date: 2020/04/16 16:46 |
|||
* @return array|bool |
|||
*/ |
|||
static function toHccardMode($mid, $username, $mobile) |
|||
{ |
|||
global $_W; |
|||
$member = pdo_get('wlmerchant_member', array('id' => $mid), array('nickname', 'uid', 'uniacid', 'avatar', 'realname', 'mobile', 'openid')); |
|||
if (!empty($member['openid'])) { |
|||
$hcmember = pdo_get('hccard_user', array('openid' => $member['openid']), array('id', 'username', 'tel')); |
|||
if (!empty($hcmember['id'])) { |
|||
$update = ['is_pay' => 1]; |
|||
if (empty($hcmember['username'])) { |
|||
$update['username'] = $username; |
|||
} |
|||
if (empty($hcmember['tel'])) { |
|||
$update['tel'] = $mobile; |
|||
} |
|||
pdo_update('hccard_user', $update, array('id' => $hcmember['id'])); |
|||
} else { |
|||
$gender = pdo_getcolumn('mc_members', array('uid' => $member['uid']), 'gender'); |
|||
$data = [ |
|||
'uniacid' => $member['uniacid'], |
|||
'openid' => $member['openid'], |
|||
'nickname' => $member['nickname'], |
|||
'headimgurl' => tomedia($member['avatar']), |
|||
'username' => $username, |
|||
'tel' => $mobile, |
|||
'createtime' => time(), |
|||
'level' => 2, |
|||
'gender' => $gender, |
|||
'is_pay' => 1 |
|||
]; |
|||
pdo_insert('hccard_user', $data); |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 获取激活码根据关键字分组后的信息 |
|||
* Author: zzw |
|||
* Date: 2020/9/14 15:56 |
|||
* @return array|bool|mixed |
|||
*/ |
|||
public static function getGroupList(){ |
|||
global $_W,$_GPC; |
|||
//条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} AND remark <> '' AND status = 0 "; |
|||
//信息获取 |
|||
$field = "remark,count(*) as total"; |
|||
$sql = "SELECT {$field} FROM ".tablename(PDO_NAME."token"); |
|||
$order = " ORDER BY id DESC "; |
|||
$group = " GROUP BY remark "; |
|||
$list = pdo_fetchall($sql.$where.$group.$order); |
|||
|
|||
return $list; |
|||
} |
|||
/** |
|||
* Comment: 根据关键字获取某个激活码序列中的一个激活码 |
|||
* Author: zzw |
|||
* Date: 2020/9/21 14:42 |
|||
* @param $keyword |
|||
* @return array |
|||
*/ |
|||
public static function getActivationCode($keyword){ |
|||
global $_W; |
|||
//判断是否存在关键字信息 |
|||
if (!$keyword) return error(0 , '不存在的激活码序列'); |
|||
//判断是否存在激活码 |
|||
$sql = "SELECT id,`number` FROM " . tablename(PDO_NAME . "token") |
|||
. " WHERE remark = '{$keyword}' AND status = 0 AND uniacid = {$_W['uniacid']} " |
|||
. " ORDER BY createtime ASC,id ASC "; |
|||
$codeInfo = pdo_fetch($sql); |
|||
if (!$codeInfo) return error(0 , '不存在的激活码序列'); |
|||
//锁定当前激活码 |
|||
$res = pdo_update(PDO_NAME . "token" , ['status' => 2] , ['id' => $codeInfo['id']]); |
|||
if (!$res) return error(0 , '不存在的激活码序列'); |
|||
//返回激活码信息 |
|||
return $codeInfo; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[一卡通]]></name> |
|||
<identifie><![CDATA[halfcard]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[market]]></type> |
|||
<description><![CDATA[一张集吃喝玩乐为一体的电子虚拟卡,一卡在手,优惠我有。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<store embed="true" /> |
|||
<task embed="true" /> |
|||
</setting> |
|||
<storemenu> |
|||
<menu title="特权礼包" font="fa-inbox"> |
|||
<entry title="商家特权" ac="halfcard_web" do="editHalfcard" actions='["do",["halfcardList","createHalfcard","editHalfcard"]]' iscover="true" /> |
|||
<entry title="商家大礼包" ac="halfcard_web" do="packagelist" actions='["do",["packagelist","createpackage"]]' /> |
|||
</menu> |
|||
<menu title="用户记录" font="fa-inbox"> |
|||
<entry title="使用记录" ac="halfcard_web" do="userhalfcardlist" /> |
|||
</menu> |
|||
</storemenu> |
|||
<agentmenu> |
|||
<menu title="特权礼包" font="fa-inbox"> |
|||
<entry title="商家特权" ac="halfcard_web" do="halfcardList" actions='["do",["halfcardList","createHalfcard","editHalfcard"]]' iscover="true" /> |
|||
<entry title="商家大礼包" ac="halfcard_web" do="packagelist" actions='["do",["packagelist","createpackage"]]' /> |
|||
</menu> |
|||
<menu title="用户记录" font="fa-inbox"> |
|||
<entry title="用户列表" ac="halfcard_web" do="memberlist" /> |
|||
<entry title="使用记录" ac="halfcard_web" do="userhalfcardlist" /> |
|||
<entry title="开通记录" ac="halfcard_web" do="payhalfcardlist" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="说明设置" ac="halfcard_web" do="explainSet" /> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="用户记录" font="fa-inbox"> |
|||
<entry title="用户列表" ac="halftype" do="memberlist" iscover="true" /> |
|||
<entry title="使用记录" ac="halftype" do="uselists" /> |
|||
<entry title="开通记录" ac="halfcard_web" do="payhalfcardlist" /> |
|||
</menu> |
|||
<menu title="一卡通" font="fa-inbox"> |
|||
<entry title="类型列表" ac="halftype" do="lists" actions='["ac","halftype","do","lists"]' /> |
|||
<entry title="实卡管理" ac="realcard" do="cardlist" actions='["ac","realcard"]' /> |
|||
<entry title="激活码管理" do="lists" ac="halfcode" actions='["ac","halfcode"]' /> |
|||
</menu> |
|||
<menu title="特权礼包" font="fa-inbox"> |
|||
<entry title="商家特权" ac="halfcard_web" do="halfcardList" actions='["do",["halfcardList","createHalfcard","editHalfcard"]]' /> |
|||
<entry title="商家大礼包" ac="halfcard_web" do="packagelist" actions='["do",["packagelist","createpackage"]]' /> |
|||
<entry title="外链礼包" ac="externallink" do="lists" /> |
|||
<entry title="外链特权" ac="externallink" do="halflists" /> |
|||
<entry title="外链卡券" ac="externallink" do="couponlists" /> |
|||
</menu> |
|||
<menu title="设置" font="fa-inbox"> |
|||
<entry title="基础设置" ac="halfset" do="base" /> |
|||
<entry title="会员权益" ac="halfset" do="userright" /> |
|||
<entry title="会员等级" ac="halftype" do="halflevel" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,341 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Externallink_WeliamController { |
|||
//外链礼包列表 |
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array('uniacid' => $_W['uniacid'], 'type' => 1); |
|||
if ($_GPC['keyword']) { |
|||
$keyword = trim($_GPC['keyword']); |
|||
$where['title@'] = $keyword; |
|||
} |
|||
if ($_GPC['status']) { |
|||
if ($_GPC['status'] == 4) { |
|||
$where['status'] = 0; |
|||
} else { |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
} |
|||
$packagelist = Halfcard::getNumPackActive('*', $where, 'sort DESC', $pindex, $psize, 1); |
|||
$pager = $packagelist[1]; |
|||
$packagelist = $packagelist[0]; |
|||
foreach ($packagelist as $key => &$package) { |
|||
$merchant = unserialize($package['extinfo']); |
|||
$package['storename'] = $merchant['storename']; |
|||
$package['logo'] = $merchant['storelogo']; |
|||
if ($package['packtimestatus']) { |
|||
$package['datestarttime'] = date('Y-m-d H:i', $package['datestarttime']); |
|||
$package['dateendtime'] = date('Y-m-d H:i', $package['dateendtime']); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/extlinklist'); |
|||
} |
|||
|
|||
//外链礼包编辑 |
|||
public function createpackage() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
if ($id) { |
|||
$package = pdo_get('wlmerchant_package', array('id' => $id)); |
|||
$extinfo = unserialize($package['extinfo']); |
|||
$package['storename'] = $extinfo['storename']; |
|||
$package['storelogo'] = $extinfo['storelogo']; |
|||
$package['level'] = unserialize($package['level']); |
|||
$datestarttime = $package['datestarttime']; |
|||
$dateendtime = $package['dateendtime']; |
|||
} |
|||
|
|||
if (empty($datestarttime) || empty($dateendtime)) { |
|||
$datestarttime = time(); |
|||
$dateendtime = strtotime('+1 month'); |
|||
} |
|||
|
|||
if (checksubmit('submit')) { |
|||
$package = $_GPC['package']; |
|||
$extinfo = $_GPC['extinfo']; |
|||
if (empty($package['title'])) wl_message('请填写活动名称'); |
|||
if (empty($package['price'])) wl_message('请填写礼包价值'); |
|||
if (empty($package['extlink'])) wl_message('请填写礼包外链地址'); |
|||
if ($package['status'] == 'on') { |
|||
$package['status'] = 1; |
|||
} else { |
|||
$package['status'] = 0; |
|||
} |
|||
$package['describe'] = htmlspecialchars_decode($package['describe']); |
|||
$package['extinfo'] = serialize($extinfo); |
|||
$package['level'] = serialize($package['level']); |
|||
$datetime = $_GPC['datetime']; |
|||
$package['datestarttime'] = strtotime($datetime['start']); |
|||
$package['dateendtime'] = strtotime($datetime['end']); |
|||
if (empty($id)) { |
|||
$package['uniacid'] = $_W['uniacid']; |
|||
$package['type'] = 1; |
|||
$package['createtime'] = time(); |
|||
$res = pdo_insert(PDO_NAME . 'package', $package); |
|||
} else { |
|||
$res = pdo_update(PDO_NAME . 'package', $package, array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
wl_message('操作成功', web_url('halfcard/externallink/lists'), 'success'); |
|||
} else { |
|||
wl_message('操作失败', referer(), 'error'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/createpackage'); |
|||
} |
|||
|
|||
//外链礼包列表修改函数 |
|||
function changeinfo() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
$newvalue = trim($_GPC['value']); |
|||
if ($type == 1) { |
|||
$res = pdo_update('wlmerchant_package', array('title' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 2) { |
|||
$res = pdo_update('wlmerchant_package', array('pv' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 3) { |
|||
$res = pdo_update('wlmerchant_package', array('sort' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 4) { |
|||
$res = pdo_delete('wlmerchant_package', array('id' => $id)); |
|||
} elseif ($type == 5) { |
|||
$res = pdo_update('wlmerchant_package', array('limit' => $newvalue), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(0, '修改失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
//外链特权列表 |
|||
public function halflists() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array('uniacid' => $_W['uniacid'], 'type' => 1); |
|||
if ($_GPC['keyword']) { |
|||
$keyword = trim($_GPC['keyword']); |
|||
$where['title@'] = $keyword; |
|||
} |
|||
if ($_GPC['status']) { |
|||
if ($_GPC['status'] == 4) { |
|||
$where['status'] = 0; |
|||
} else { |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
} |
|||
$halflist = Halfcard::getNumActive('*', $where, 'sort DESC', $pindex, $psize, 1); |
|||
$pager = $halflist[1]; |
|||
$halflist = $halflist[0]; |
|||
foreach ($halflist as $key => &$half) { |
|||
$merchant = unserialize($half['extinfo']); |
|||
$half['storename'] = $merchant['storename']; |
|||
$half['logo'] = $merchant['storelogo']; |
|||
if ($half['timingstatus']) { |
|||
$half['starttime'] = date('Y-m-d H:i', $half['starttime']); |
|||
$half['endtime'] = date('Y-m-d H:i', $half['endtime']); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/exthalflist'); |
|||
} |
|||
|
|||
//外链特权编辑 |
|||
public function createhalfcard() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
if ($id) { |
|||
$halfcard = pdo_get('wlmerchant_halfcardlist', array('id' => $id)); |
|||
$extinfo = unserialize($halfcard['extinfo']); |
|||
$halfcard['storename'] = $extinfo['storename']; |
|||
$halfcard['storelogo'] = $extinfo['storelogo']; |
|||
$halfcard['level'] = unserialize($halfcard['level']); |
|||
$datestarttime = $halfcard['starttime']; |
|||
$dateendtime = $halfcard['endtime']; |
|||
} |
|||
|
|||
if (empty($datestarttime) || empty($dateendtime)) { |
|||
$datestarttime = time(); |
|||
$dateendtime = strtotime('+1 month'); |
|||
} |
|||
|
|||
if (checksubmit('submit')) { |
|||
$halfcard = $_GPC['halfcard']; |
|||
$extinfo = $_GPC['extinfo']; |
|||
if (empty($halfcard['title'])) wl_message('请填写活动名称'); |
|||
if (empty($halfcard['activediscount'])) wl_message('请填写活动折扣'); |
|||
if (empty($halfcard['extlink'])) wl_message('请填写活动外链地址'); |
|||
if ($halfcard['status'] == 'on') { |
|||
$halfcard['status'] = 1; |
|||
} else { |
|||
$halfcard['status'] = 0; |
|||
} |
|||
$halfcard['activediscount'] = sprintf("%.1f", $halfcard['activediscount']); |
|||
$halfcard['describe'] = htmlspecialchars_decode($halfcard['describe']); |
|||
$halfcard['extinfo'] = serialize($extinfo); |
|||
$halfcard['level'] = serialize($halfcard['level']); |
|||
$datetime = $_GPC['datetime']; |
|||
$halfcard['starttime'] = strtotime($datetime['start']); |
|||
$halfcard['endtime'] = strtotime($datetime['end']); |
|||
if (empty($id)) { |
|||
$halfcard['uniacid'] = $_W['uniacid']; |
|||
$halfcard['type'] = 1; |
|||
$halfcard['aid'] = 0; |
|||
$halfcard['createtime'] = time(); |
|||
$res = pdo_insert(PDO_NAME . 'halfcardlist', $halfcard); |
|||
} else { |
|||
$res = pdo_update(PDO_NAME . 'halfcardlist', $halfcard, array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
wl_message('操作成功', web_url('halfcard/externallink/halflists'), 'success'); |
|||
} else { |
|||
wl_message('操作失败', referer(), 'error'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/createhalfcard'); |
|||
} |
|||
|
|||
//外链特权列表修改函数 |
|||
function changehalf() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
$newvalue = trim($_GPC['value']); |
|||
if ($type == 1) { |
|||
$res = pdo_update('wlmerchant_halfcardlist', array('title' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 2) { |
|||
$res = pdo_update('wlmerchant_halfcardlist', array('pv' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 3) { |
|||
$res = pdo_update('wlmerchant_halfcardlist', array('sort' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 4) { |
|||
$res = pdo_delete('wlmerchant_halfcardlist', array('id' => $id)); |
|||
} elseif ($type == 5) { |
|||
$res = pdo_update('wlmerchant_halfcardlist', array('limit' => $newvalue), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(0, '修改失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
//外链卡券列表 |
|||
public function couponlists() { |
|||
global $_W, $_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = array('uniacid' => $_W['uniacid'], 'extflag' => 1); |
|||
if ($_GPC['keyword']) { |
|||
$keyword = trim($_GPC['keyword']); |
|||
$where['title@'] = $keyword; |
|||
} |
|||
if ($_GPC['status']) { |
|||
if ($_GPC['status'] == 4) { |
|||
$where['status'] = 0; |
|||
} else { |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
} |
|||
$couponlist = wlCoupon::getNumCoupons('*', $where, 'indexorder DESC', $pindex, $psize, 1); |
|||
|
|||
$pager = $couponlist[1]; |
|||
$couponlist = $couponlist[0]; |
|||
foreach ($couponlist as $key => &$cou) { |
|||
$merchant = unserialize($cou['extinfo']); |
|||
$cou['storename'] = $merchant['storename']; |
|||
$cou['timingstatus'] = 1; |
|||
$cou['starttime'] = date('Y-m-d H:i', $cou['starttime']); |
|||
$cou['endtime'] = date('Y-m-d H:i', $cou['endtime']); |
|||
} |
|||
include wl_template('halfcardsys/extcoulist'); |
|||
} |
|||
|
|||
//外链卡券编辑 |
|||
public function createcoupon() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
if ($id) { |
|||
$coupon = pdo_get('wlmerchant_couponlist', array('id' => $id)); |
|||
$extinfo = unserialize($coupon['extinfo']); |
|||
$coupon['storename'] = $extinfo['storename']; |
|||
$coupon['storelogo'] = $extinfo['storelogo']; |
|||
$coupon['level'] = unserialize($coupon['level']); |
|||
$datestarttime = $coupon['starttime']; |
|||
$dateendtime = $coupon['endtime']; |
|||
} |
|||
|
|||
if (empty($datestarttime) || empty($dateendtime)) { |
|||
$datestarttime = time(); |
|||
$dateendtime = strtotime('+1 month'); |
|||
} |
|||
|
|||
if (checksubmit('submit')) { |
|||
$coupon = $_GPC['coupon']; |
|||
$extinfo = $_GPC['extinfo']; |
|||
if (empty($coupon['title'])) wl_message('请填写卡券名称'); |
|||
if (empty($coupon['price']) && !empty($coupon['is_charge']) ) wl_message('请填写卡券价值'); |
|||
if (empty($coupon['extlink'])) wl_message('请填写卡券外链地址'); |
|||
if ($coupon['status'] == 'on') { |
|||
$coupon['status'] = 2; |
|||
} else { |
|||
$coupon['status'] = 0; |
|||
} |
|||
$coupon['description'] = htmlspecialchars_decode($coupon['description']); |
|||
$coupon['extinfo'] = serialize($extinfo); |
|||
$coupon['level'] = serialize($coupon['level']); |
|||
$datetime = $_GPC['datetime']; |
|||
$coupon['starttime'] = strtotime($datetime['start']); |
|||
$coupon['endtime'] = strtotime($datetime['end']); |
|||
if (empty($id)) { |
|||
$coupon['uniacid'] = $_W['uniacid']; |
|||
$coupon['extflag'] = 1; |
|||
$coupon['vipstatus'] = 1; |
|||
$coupon['aid'] = 0; |
|||
$coupon['createtime'] = time(); |
|||
$res = pdo_insert(PDO_NAME . 'couponlist', $coupon); |
|||
} else { |
|||
$res = pdo_update(PDO_NAME . 'couponlist', $coupon, array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
wl_message('操作成功', web_url('halfcard/externallink/couponlists'), 'success'); |
|||
} else { |
|||
wl_message('操作失败', referer(), 'error'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/createcoupon'); |
|||
} |
|||
|
|||
//外链卡券列表修改函数 |
|||
function changecou() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
$newvalue = trim($_GPC['value']); |
|||
if ($type == 1) { |
|||
$res = pdo_update('wlmerchant_couponlist', array('title' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 2) { |
|||
$res = pdo_update('wlmerchant_couponlist', array('pv' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 3) { |
|||
$res = pdo_update('wlmerchant_couponlist', array('indexorder' => $newvalue), array('id' => $id)); |
|||
} elseif ($type == 4) { |
|||
$res = pdo_delete('wlmerchant_couponlist', array('id' => $id)); |
|||
} elseif ($type == 5) { |
|||
$res = pdo_update('wlmerchant_couponlist', array('sub_title' => $newvalue), array('id' => $id)); |
|||
} |
|||
if ($res) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(0, '修改失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
?> |
|||
@ -0,0 +1,310 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Halfcode_WeliamController { |
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$where = array('uniacid' => $_W['uniacid']); |
|||
if ($_GPC['status']) { |
|||
if ($_GPC['status'] == 1) |
|||
$where['status'] = 1; |
|||
if ($_GPC['status'] == 2) |
|||
$where['status'] = 0; |
|||
} |
|||
if (!empty($_GPC['keyword'])) { |
|||
if (!empty($_GPC['keywordtype'])) { |
|||
switch ($_GPC['keywordtype']) { |
|||
case 1 : |
|||
$where['days'] = $_GPC['keyword']; |
|||
break; |
|||
case 2 : |
|||
$member = pdo_fetchall("SELECT id,nickname FROM ".tablename(PDO_NAME."member") |
|||
." WHERE nickname LIKE '%{$_GPC['keyword']}%' "); |
|||
$ids = array_column($member,'id'); |
|||
if(is_array($ids) && count($ids) > 1){ |
|||
$idStr = implode(',',$ids); |
|||
$where['#mid'] = "({$idStr})"; |
|||
}else{ |
|||
$where['mid'] = $ids[0]; |
|||
} |
|||
break; |
|||
case 3 : |
|||
$where['@remark@'] = $_GPC['keyword']; |
|||
break; |
|||
case 4 : |
|||
$where['@number@'] = $_GPC['keyword']; |
|||
break; |
|||
default : |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
//时间 |
|||
if (!empty($_GPC['time_limit'])) { |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime; |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
if ($_GPC['export']) { |
|||
$this->output($where); |
|||
} |
|||
|
|||
$pindex = max(1, $_GPC['page']); |
|||
$listData = Util::getNumData("*", PDO_NAME . 'token', $where, 'createtime desc', $pindex, 10, 1); |
|||
$list = $listData[0]; |
|||
$pager = $listData[1]; |
|||
|
|||
foreach ($list as $key => &$value) { |
|||
if (!empty($value['aid'])) { |
|||
$value['agentname'] = pdo_getcolumn(PDO_NAME . 'agentusers', array('uniacid' => $_W['uniacid'], 'id' => $value['aid']), 'agentname'); |
|||
} else { |
|||
$value['agentname'] = '总平台'; |
|||
} |
|||
if (!empty($value['mid'])) { |
|||
$value['member'] = Member::wl_member_get($value['mid']); |
|||
} |
|||
if ($value['levelid']) { |
|||
$value['levelname'] = pdo_getcolumn(PDO_NAME . 'halflevel', array('id' => $value['levelid']), 'name'); |
|||
} else { |
|||
$value['levelname'] = $_W['wlsetting']['halflevel']['name']; |
|||
} |
|||
|
|||
//电商联盟定制 |
|||
if (file_exists(PATH_MODULE . 'lsh.log')) { |
|||
$value['caragentname'] = !empty($value['caraid']) ? pdo_getcolumn('weliam_shiftcar_agentusers', array('id' => $value['caraid']), 'agentname') : '总平台'; |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/codelist'); |
|||
} |
|||
|
|||
public function add() { |
|||
global $_W, $_GPC; |
|||
$delevel = Setting::wlsetting_read('halflevel'); |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
$agents = pdo_getall('wlmerchant_agentusers', array('uniacid' => $_W['uniacid']), array('id', 'agentname')); |
|||
|
|||
//电商联盟定制 |
|||
if (file_exists(PATH_MODULE . 'lsh.log')) { |
|||
$caragents = pdo_getall('weliam_shiftcar_agentusers', array('uniacid' => $_W['uniacid']), array('id', 'agentname')); |
|||
} |
|||
|
|||
if (checksubmit()) { |
|||
$num = !empty($_GPC['num']) ? intval($_GPC['num']) : 1; |
|||
if ($num > 0) { |
|||
for ($k = 0; $k < $num; $k++) { |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['caraid'] = intval($_GPC['caraid']); |
|||
$data['aid'] = intval($_GPC['aid']); |
|||
$data['days'] = intval($_GPC['days']) ? : 1; |
|||
$data['number'] = $_GPC['prefix'] . Util::createConcode(3); |
|||
$data['remark'] = $_GPC['remark']; |
|||
$data['levelid'] = $_GPC['levelid']; |
|||
$data['give_price'] = $_GPC['give_price']; |
|||
$data['createtime'] = TIMESTAMP; |
|||
pdo_insert(PDO_NAME . 'token', $data); |
|||
} |
|||
wl_message("创建成功!需要创建" . $num . "个,成功创建" . $k . "个。", web_url('halfcard/halfcode/lists'), 'success'); |
|||
} else { |
|||
wl_message("数量填写不正确!", web_url('halfcard/halfcode/add'), 'error'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/codeadd'); |
|||
} |
|||
|
|||
public function editcode() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$code = pdo_get('wlmerchant_token', array('id' => $id)); |
|||
$levels = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halflevel') . "WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
$agents = pdo_getall('wlmerchant_agentusers', array('uniacid' => $_W['uniacid']), array('id', 'agentname')); |
|||
|
|||
//电商联盟定制 |
|||
if (file_exists(PATH_MODULE . 'lsh.log')) { |
|||
$caragents = pdo_getall('weliam_shiftcar_agentusers', array('uniacid' => $_W['uniacid']), array('id', 'agentname')); |
|||
} |
|||
|
|||
if ($_W['ispost']) { |
|||
if ($id) { |
|||
$data = array( |
|||
'days' => intval($_GPC['days']), |
|||
'levelid' => intval($_GPC['levelid']), |
|||
'remark' => trim($_GPC['remark']), |
|||
'caraid' => intval($_GPC['caraid']), |
|||
'aid' => intval($_GPC['aid']), |
|||
'give_price' => trim($_GPC['give_price']) |
|||
); |
|||
if ($_GPC['range']) { |
|||
$res = pdo_update('wlmerchant_token', $data, array('remark' => $code['remark'])); |
|||
} else { |
|||
$res = pdo_update('wlmerchant_token', $data, array('id' => $id)); |
|||
} |
|||
} |
|||
if ($res) { |
|||
show_json(1, '操作成功'); |
|||
} else { |
|||
show_json(0, '操作失败,请重试'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/codemodel'); |
|||
} |
|||
|
|||
public function remark() { |
|||
global $_W, $_GPC; |
|||
if ($_W['ispost']) { |
|||
$remark = $_GPC['remark']; |
|||
$id_num = $_GPC['id_num']; |
|||
$id_nums = explode(',', $id_num); |
|||
if ($id_nums[0] > $id_nums[1] || empty($id_nums[1])) { |
|||
show_json(0, '激活码范围错误请重新填写'); |
|||
} |
|||
|
|||
for ($i = $id_nums[0]; $i <= $id_nums[1]; $i++) { |
|||
pdo_update(PDO_NAME . 'token', array('remark' => $remark), array('uniacid' => $_W['uniacid'], 'id' => $i)); |
|||
} |
|||
|
|||
show_json(1, '操作成功'); |
|||
} |
|||
include wl_template('halfcardsys/coderemark'); |
|||
} |
|||
|
|||
public function delcode() { |
|||
global $_W, $_GPC; |
|||
$res = pdo_delete(PDO_NAME . 'token', array('id' => $_GPC['id'])); |
|||
if($res){ |
|||
show_json(1,'操作成功'); |
|||
}else { |
|||
show_json(0,'网络错误,请刷新重试!'); |
|||
} |
|||
} |
|||
|
|||
public function output($where) { |
|||
global $_W, $_GPC; |
|||
$listData = Util::getNumData("*", PDO_NAME . 'token', $where, 'createtime desc', 1, 40000, 1); |
|||
$list = $listData[0]; |
|||
foreach ($list as $key => &$value) { |
|||
if (!empty($value['mid'])) { |
|||
$member = Member::wl_member_get($value['mid']); |
|||
$value['nickname'] = $member['nickname']; |
|||
} else { |
|||
$value['nickname'] = ''; |
|||
} |
|||
if (!empty($value['aid'])) { |
|||
$value['agentname'] = pdo_getcolumn(PDO_NAME . 'agentusers', array('uniacid' => $_W['uniacid'], 'id' => $value['aid']), 'agentname'); |
|||
} else { |
|||
$value['agentname'] = '总平台'; |
|||
} |
|||
if ($value['levelid']) { |
|||
$value['levelname'] = pdo_getcolumn(PDO_NAME . 'halflevel', array('id' => $value['levelid']), 'name'); |
|||
} else { |
|||
$value['levelname'] = $_W['wlsetting']['halflevel']['name']; |
|||
} |
|||
} |
|||
|
|||
/* 输出表头 */ |
|||
$filter = array( |
|||
'id' => '激活码ID', |
|||
'agentname' => '所属代理', |
|||
'number' => '激活码', |
|||
'days' => '时长(天)', |
|||
'levelname' => '激活等级', |
|||
'remark' => '备注', |
|||
'nickname' => '使用人昵称', |
|||
'createtime' => '生成时间', |
|||
); |
|||
|
|||
$data = array(); |
|||
for ($i = 0; $i < count($list); $i++) { |
|||
foreach ($filter as $key => $title) { |
|||
if ($key == 'createtime') { |
|||
$data[$i][$key] = date('Y-m-d H:i:s', $list[$i][$key]); |
|||
} else { |
|||
$data[$i][$key] = $list[$i][$key]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
util_csv::export_csv_2($data, $filter, '激活码列表.csv'); |
|||
exit(); |
|||
} |
|||
|
|||
//删除 |
|||
function deletejihuoqr() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$ids = $_GPC['ids']; |
|||
if ($id) { |
|||
$res = pdo_delete('wlmerchant_token', array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => $res, 'id' => $id))); |
|||
} |
|||
} |
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
pdo_delete('wlmerchant_token', array('id' => $id)); |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => ''))); |
|||
} |
|||
} |
|||
|
|||
|
|||
//导入一卡通 |
|||
public function csv_add() { |
|||
global $_W; |
|||
//1. |
|||
$filename = $_FILES['csv_file']['name']; |
|||
$filename = substr($filename, -4, 4); |
|||
if (empty ($filename)) { |
|||
wl_message("请选择要导入的CSV文件", web_url('halfcard/halfcode/add'), 'success'); |
|||
exit; |
|||
} |
|||
if ($filename !== '.csv') { |
|||
wl_message("请选择CSV文件", web_url('halfcard/halfcode/add'), 'success'); |
|||
exit; |
|||
} |
|||
//2. |
|||
$file_path = $_FILES['csv_file']['tmp_name']; |
|||
$handle = fopen($file_path, 'r'); |
|||
$file_size = filesize($file_path); //文件大小 |
|||
if ($file_size == 0) { |
|||
wl_message("没有任何数据", web_url('halfcard/halfcode/add'), 'success'); |
|||
exit; |
|||
} |
|||
$sql = 'INSERT INTO ' . tablename('wlmerchant_token') . ' (id,number,uniacid,aid,days, |
|||
price,type,tokentype,typename,status,remark,openid,mid,createtime,levelid,give_price,caraid) values'; |
|||
$result = fgetcsv($handle); //解析csv 获取一行作为数组 指针指向下一行 第一行是头 |
|||
while ($result = fgetcsv($handle)) { |
|||
$sql .= '(' . '\'\'' //id |
|||
. ',\'' . $result[1] . '\',' //激活码 |
|||
. '\'' . $_W['uniacid'] . '\',' //uniacid |
|||
. '\'' . $_W['aid'] . '\',' //aid |
|||
. '\'' . $result[2] . '\',' //days |
|||
. '\'' . null . '\',' //price |
|||
. '\'' . null . '\',' //type |
|||
. '\'' . null . '\',' //tokentype |
|||
. '\'' . null . '\',' //typename |
|||
. '\'' . null . '\',' //status |
|||
. '\'' . iconv('gb2312', 'utf-8', $result[4]) . '\',' //remark |
|||
. '\'' . null . '\',' //openid |
|||
. '\'' . null . '\',' //mid |
|||
. '\'' . time() . '\',' //createtime |
|||
. '\'' . $result[3] . '\',' //levelid |
|||
. '\'' . null . '\',' //give_price |
|||
. '\'' . null . '\' ),'; //caraid |
|||
} |
|||
fclose($handle); |
|||
pdo_query(substr($sql, 0, strlen($sql) - 1)) or die('导入失败'); |
|||
wl_message("导入csv成功", web_url('halfcard/halfcode/add'), 'success'); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,155 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Halfset_WeliamController { |
|||
public function base() { |
|||
global $_W, $_GPC; |
|||
$listData = Util::getNumData("*", PDO_NAME . 'halfcard_type', array('aid' => 0, 'status' => 1)); |
|||
$types = $listData[0]; |
|||
$settings = Setting::wlsetting_read('halfcard'); |
|||
$plugin = unserialize($settings['plugin']); |
|||
$text = $settings['text']; |
|||
$formWhere = ['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'sid' => 0]; |
|||
$diyFormList = pdo_getall(PDO_NAME."diyform",$formWhere,['id','title'],'','create_time DESC,id DESC'); |
|||
if (checksubmit('submit')) { |
|||
if(floatval(trim($_GPC['carddeduct'])) < 0) wl_message('请填写正确的特权折扣赠送积分!', referer(), 'error'); |
|||
if(floatval(trim($_GPC['packdeduct'])) < 0) wl_message('请填写正确的大礼包赠送积分!', referer(), 'error'); |
|||
$base = array( |
|||
'status' => intval($_GPC['status']), |
|||
'is_openvip' => intval($_GPC['is_openvip']), |
|||
'urlstatus' => intval($_GPC['urlstatus']), |
|||
'levelstatus' => intval($_GPC['levelstatus']), |
|||
'renewstatus' => intval($_GPC['renewstatus']), |
|||
'daily' => intval($_GPC['daily']), |
|||
'dailyshow' => intval($_GPC['dailyshow']), |
|||
'daytimes' => intval($_GPC['daytimes']), |
|||
'halfcardtype' => intval($_GPC['halfcardtype']), |
|||
'playtype' => intval($_GPC['playtype']), |
|||
'cardimg' => $_GPC['cardimg'], |
|||
'use_space' => intval($_GPC['use_space']), |
|||
'use_space_times' => intval($_GPC['use_space_times']), |
|||
'use_space_days' => intval($_GPC['use_space_days']), |
|||
'statisticsdiv' => $_GPC['statisticsdiv'], |
|||
'packagecate' => $_GPC['packagecate'], |
|||
'describe' => htmlspecialchars_decode($_GPC['describe']), |
|||
'nodescribe' => htmlspecialchars_decode($_GPC['nodescribe']), |
|||
'unshowtab' => $_GPC['unshowtab'], |
|||
'noticestatus' => intval($_GPC['noticestatus']), |
|||
'carddeduct' => sprintf("%.2f", trim($_GPC['carddeduct'])), |
|||
'packdeduct' => sprintf("%.2f", trim($_GPC['packdeduct'])), |
|||
'monthprice' => Util::currency_format($_GPC['monthprice']), |
|||
'seasonprice' => Util::currency_format($_GPC['seasonprice']), |
|||
'halfyearprice' => Util::currency_format($_GPC['halfyearprice']), |
|||
'yearprice' => Util::currency_format($_GPC['yearprice']), |
|||
'halfcardtypeids' => $_GPC['type'], |
|||
'share_title' => $_GPC['share_title'], |
|||
'share_image' => $_GPC['share_image'], |
|||
'share_desc' => $_GPC['share_desc'], |
|||
'halfstatus' => intval($_GPC['halfstatus']), |
|||
'OpenHalfcard' => $_GPC['OpenHalfcard'], |
|||
'OpenSwitch' => intval($_GPC['OpenSwitch']), |
|||
'UseHalfcard' => $_GPC['UseHalfcard'], |
|||
'UseSwitch' => intval($_GPC['UseSwitch']), |
|||
'hideact' => $_GPC['hideact'], |
|||
'halfcate' => $_GPC['halfcate'], |
|||
'limit' => trim($_GPC['limit']), |
|||
'diyformid' => $_GPC['diyformid'], |
|||
'cardTextColor' => $_GPC['cardTextColor'] |
|||
); |
|||
$plugin = $_GPC['plugin']; |
|||
$base['plugin'] = serialize($plugin); |
|||
Setting::wlsetting_save($base, 'halfcard'); |
|||
wl_message('更新设置成功!', web_url('halfcard/halfset/base')); |
|||
} |
|||
|
|||
|
|||
include wl_template('halfcardsys/baseset'); |
|||
} |
|||
|
|||
public function halfcardqa() { |
|||
global $_W, $_GPC; |
|||
include wl_template('halfcardsys/halfcardqa'); |
|||
} |
|||
|
|||
public function userright() { |
|||
global $_W, $_GPC; |
|||
$_W['aid'] = -1; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$naves = Dashboard::getAllNav($pindex - 1, $psize); |
|||
$navs = $naves['data']; |
|||
$pager = wl_pagination($naves['count'], $pindex, $psize); |
|||
include wl_template('halfcardsys/userrightlist'); |
|||
} |
|||
|
|||
public function userrightedit() { |
|||
global $_W, $_GPC; |
|||
$_W['aid'] = -1; |
|||
if (checksubmit('submit')) { |
|||
$nav = $_GPC['nav']; |
|||
$nav['name'] = trim($nav['name']); |
|||
$nav['displayorder'] = intval($nav['displayorder']); |
|||
$nav['enabled'] = intval($_GPC['enabled']); |
|||
$nav['type'] = 2; |
|||
$nav['link'] = $_GPC['link']; |
|||
if (!empty($_GPC['id'])) { |
|||
if (Dashboard::editNav($nav, $_GPC['id'])) wl_message('保存成功', web_url('halfcard/halfset/userright'), 'success'); |
|||
} else { |
|||
if (Dashboard::editNav($nav)) wl_message('保存成功', web_url('halfcard/halfset/userright'), 'success'); |
|||
} |
|||
wl_message('保存失败', referer(), 'error'); |
|||
} |
|||
if (!empty($_GPC['id'])) $nav = Dashboard::getSingleNav($_GPC['id']); |
|||
include wl_template('halfcardsys/userrightedit'); |
|||
} |
|||
|
|||
public function importdefault() { |
|||
global $_W, $_GPC; |
|||
$default = array(); |
|||
$default[] = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => -1, |
|||
'name' => '消费多返金币', |
|||
'displayorder' => 1, |
|||
'enabled' => 1, |
|||
'color' => '#000000', |
|||
'link' => h5_url('pages/mainPages/memberCard/interests'), |
|||
'thumb' => URL_APP_IMAGE . 'jifen.png', |
|||
'type' => 2 |
|||
); |
|||
$default[] = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => -1, |
|||
'name' => '专属超级券', |
|||
'displayorder' => 1, |
|||
'enabled' => 1, |
|||
'color' => '#000000', |
|||
'link' => h5_url('pages/mainPages/memberCard/interests'), |
|||
'thumb' => URL_APP_IMAGE . 'jifen.png', |
|||
'type' => 2 |
|||
); |
|||
$default[] = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => -1, |
|||
'name' => '抢购特权优惠', |
|||
'displayorder' => 1, |
|||
'enabled' => 1, |
|||
'color' => '#000000', |
|||
'link' => h5_url('pages/mainPages/memberCard/interests'), |
|||
'thumb' => URL_APP_IMAGE . 'jifen.png', |
|||
'type' => 2 |
|||
); |
|||
foreach ($default as $key => $im) { |
|||
pdo_insert(PDO_NAME . 'nav', $im); |
|||
} |
|||
show_json(1); |
|||
} |
|||
|
|||
function rightdelete() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_delete('wlmerchant_nav', array('id' => $id)); |
|||
show_json(1); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,727 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Halftype_WeliamController { |
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$delevel = Setting::wlsetting_read('halflevel'); |
|||
$pindex = max(1, $_GPC['page']); |
|||
$listData = Util::getNumData("*", PDO_NAME . 'halfcard_type', array(), 'sort desc,id desc', $pindex, 10, 1); |
|||
$list = $listData[0]; |
|||
$pager = $listData[1]; |
|||
foreach ($list as $key => &$va) { |
|||
if($va['levelid']){ |
|||
$va['levelname'] = pdo_getcolumn(PDO_NAME.'halflevel',array('id'=>$va['levelid']),'name'); |
|||
}else { |
|||
$va['levelname'] = $delevel['name']; |
|||
} |
|||
} |
|||
|
|||
include wl_template('halfcardsys/typelist'); |
|||
} |
|||
|
|||
function memberlist() { |
|||
global $_W, $_GPC; |
|||
$delevel = Setting::wlsetting_read('halflevel'); |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$keywordtype = $_GPC['keywordtype']; |
|||
$keyword = trim($_GPC['keyword']); |
|||
$ac = 'halftype'; |
|||
if ($keywordtype == 1) { |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$member = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_member') . "WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :nickname", $params); |
|||
$ids = array_column($member,'id'); |
|||
if(is_array($ids) && count($ids) > 1){ |
|||
$idStr = implode(',',$ids); |
|||
$where['#mid'] = "({$idStr})"; |
|||
}else if($ids[0] > 0){ |
|||
$where['mid'] = $ids[0]; |
|||
} |
|||
} else if ($keywordtype == 2) { |
|||
$params[':mobile'] = "%{$keyword}%"; |
|||
$member = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_member') . "WHERE uniacid = {$_W['uniacid']} AND mobile LIKE :mobile", $params); |
|||
if ($member) { |
|||
$mids = "("; |
|||
foreach ($member as $key => $v) { |
|||
if ($key == 0) { |
|||
$mids .= $v['id']; |
|||
} else { |
|||
$mids .= "," . $v['id']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$where['mid#'] = $mids; |
|||
} else { |
|||
$where['mid#'] = "(0)"; |
|||
} |
|||
}else if($keywordtype == 3){ |
|||
$where['username@'] = $keyword; |
|||
}else if($keywordtype == 4){ |
|||
$params[':cardsn'] = "%{$keyword}%"; |
|||
$member = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halfcard_realcard') . "WHERE uniacid = {$_W['uniacid']} AND cardsn LIKE :cardsn", $params); |
|||
if ($member) { |
|||
$mids = "("; |
|||
foreach ($member as $key => $v) { |
|||
if ($key == 0) { |
|||
$mids .= $v['cardid']; |
|||
} else { |
|||
$mids .= "," . $v['cardid']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$where['id#'] = $mids; |
|||
} else { |
|||
$where['id#'] = "(0)"; |
|||
} |
|||
} |
|||
// wl_debug($keywordtype); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
|
|||
$usetype = $_GPC['usetype']; |
|||
if ($usetype == 1) { |
|||
$where['expiretime>'] = time(); |
|||
} else if($usetype == 2){ |
|||
$where['expiretime<'] = time(); |
|||
} |
|||
//时间筛选 |
|||
if (!empty($_GPC['time_limit']) && $_GPC['timetype'] ) { |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
if($_GPC['timetype'] == 1){ //开通时间 |
|||
$where['createtime>'] = $starttime; |
|||
$where['createtime<'] = $endtime; |
|||
}else{ |
|||
if($usetype == 1){ |
|||
$Cstarttime = max([time(),$starttime]); |
|||
$Cendtime = $endtime; |
|||
}else if($usetype == 2){ |
|||
$Cstarttime = $starttime; |
|||
$Cendtime = min([time(),$endtime]); |
|||
}else{ |
|||
$Cstarttime = $starttime; |
|||
$Cendtime = $endtime; |
|||
} |
|||
$where['expiretime>'] = $Cstarttime; |
|||
$where['expiretime<'] = $Cendtime; |
|||
} |
|||
} |
|||
|
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
if($_GPC['outflag']){ |
|||
$this -> outmemberlist($where); |
|||
} |
|||
|
|||
$member = Halfcard::getNumhalfcardmember('*', $where, 'ID DESC', $pindex, $psize, 1); |
|||
$pager = $member[1]; |
|||
$member = $member[0]; |
|||
foreach ($member as $key => &$v) { |
|||
$user = pdo_get('wlmerchant_member', array('id' => $v['mid'])); |
|||
if(empty($v['username'])){ |
|||
$v['username'] = $user['nickname']; |
|||
} |
|||
$v['avatar'] = $user['avatar']; |
|||
$v['mobile'] = $user['mobile']; |
|||
$v['nickname'] = $user['nickname']; |
|||
if ($v['expiretime'] > time()) { |
|||
if($v['disable']){ |
|||
$v['status'] = 3; |
|||
}else{ |
|||
$v['status'] = 1; |
|||
} |
|||
} else { |
|||
$v['status'] = 2; |
|||
} |
|||
$v['cardsn'] = pdo_getcolumn(PDO_NAME.'halfcard_realcard',array('cardid'=>$v['id']),'cardsn'); |
|||
if($v['levelid']){ |
|||
$v['levelname'] = pdo_getcolumn(PDO_NAME.'halflevel',array('id'=>$v['levelid']),'name'); |
|||
}else { |
|||
$v['levelname'] = $delevel['name']; |
|||
} |
|||
$v['banknum'] = $user['card_number']; |
|||
$v['agentuser'] = pdo_getcolumn(PDO_NAME.'agentusers',array('id'=>$v['aid']),'agentname'); |
|||
if(empty($v['agentuser'])){ |
|||
$v['agentuser'] = '总后台'; |
|||
} |
|||
//查询更多数据 |
|||
// $moinfoarray = pdo_getall('wlmerchant_halfcard_record',array('mid'=>$v['mid'],'uniacid'=>$_W['uniacid']),array('id','moinfo'),'','id DESC','limit 1'); |
|||
// $moinfo = $moinfoarray[0]['moinfo']; |
|||
// if(!empty($moinfo)){ |
|||
// $v['moinfoflag'] = 1; |
|||
// $v['orderid'] = $moinfoarray[0]['id']; |
|||
// } |
|||
} |
|||
include wl_template('halfcardsys/halfcardmemberlist'); |
|||
} |
|||
|
|||
//删除用户记录 |
|||
function deleteHalfcardRecord() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$ids = $_GPC['ids']; |
|||
if ($id) { |
|||
$res = Halfcard::deleteHalfcardRecord(array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => $res, 'id' => $id))); |
|||
} |
|||
} |
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
Halfcard::deleteHalfcardRecord(array('id' => $id)); |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => $ids))); |
|||
} |
|||
} |
|||
|
|||
public function editmember(){ |
|||
global $_W, $_GPC; |
|||
$delevel = Setting::wlsetting_read('halflevel'); |
|||
$ac = 1; |
|||
$id = $_GPC['id']; |
|||
$halfmember = pdo_get('wlmerchant_halfcardmember',array('id' => $id)); |
|||
$levels = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halflevel')."WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
if($_W['ispost']){ |
|||
if($id){ |
|||
$data = array( |
|||
'disable' => trim($_GPC['disable']), |
|||
'levelid' => trim($_GPC['levelid']), |
|||
'expiretime'=> strtotime($_GPC['expiretime']) |
|||
); |
|||
$res = pdo_update('wlmerchant_halfcardmember',$data,array('id' => $id)); |
|||
} |
|||
if($res){ |
|||
show_json(1,'操作成功'); |
|||
}else { |
|||
show_json(0,'操作失败,请重试'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/editmembermodel'); |
|||
} |
|||
|
|||
public function uselists(){ |
|||
global $_W, $_GPC; |
|||
$ac = 'halftype'; |
|||
$keyword = trim($_GPC['keyword']); |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$data = array(); |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
if(!empty($_GPC['reid'])){ |
|||
$data['id'] = $_GPC['reid']; |
|||
} |
|||
$type = $_GPC['type']?$_GPC['type']:1; |
|||
$data['type'] = $type; |
|||
if($type == 2){ |
|||
if($_GPC['alflag']){ |
|||
$data['usetime >'] = 0; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 1) { |
|||
$where = " AND title LIKE :title"; |
|||
$params[':title'] = "%{$keyword}%"; |
|||
if($type == 2){ |
|||
$halfcard = pdo_fetch("SELECT * FROM " . tablename('wlmerchant_package') . " where uniacid= {$_W['uniacid']} $where", $params); |
|||
}else { |
|||
$halfcard = pdo_fetch("SELECT * FROM " . tablename('wlmerchant_halfcardlist') . " where uniacid= {$_W['uniacid']} $where", $params); |
|||
} |
|||
$data['activeid'] = $halfcard['id']; |
|||
} |
|||
if ($_GPC['keywordtype'] == 2) { |
|||
$where = " AND storename LIKE :storename"; |
|||
$params[':storename'] = "%{$keyword}%"; |
|||
$halfcard = pdo_fetch("SELECT * FROM " . tablename('wlmerchant_merchantdata') . " where uniacid= {$_W['uniacid']} $where", $params); |
|||
$data['merchantid'] = $halfcard['id']; |
|||
} |
|||
if ($_GPC['keywordtype'] == 3) { |
|||
$where = " AND username LIKE :username"; |
|||
$params[':username'] = "%{$keyword}%"; |
|||
$halfcard = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_halfcardmember') . " where uniacid= {$_W['uniacid']} $where", $params); |
|||
if ($halfcard) { |
|||
$mids = "("; |
|||
foreach ($halfcard as $key => $mer) { |
|||
if ($key == 0) { |
|||
$mids .= $mer['id']; |
|||
} else { |
|||
$mids .= "," . $mer['id']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$data['cardid#'] = $mids; |
|||
} else { |
|||
$data['cardid#'] = "(0)"; |
|||
} |
|||
} |
|||
if ($_GPC['keywordtype'] == 4) { |
|||
$where = " AND mobile LIKE :mobile"; |
|||
$params[':mobile'] = "%{$keyword}%"; |
|||
$halfcard = pdo_fetchall("SELECT * FROM " . tablename('wlmerchant_member') . " where uniacid= {$_W['uniacid']} $where", $params); |
|||
if ($halfcard) { |
|||
$mids = "("; |
|||
foreach ($halfcard as $key => $mer) { |
|||
if ($key == 0) { |
|||
$mids .= $mer['id']; |
|||
} else { |
|||
$mids .= "," . $mer['id']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$data['mid#'] = $mids; |
|||
} else { |
|||
$data['mid#'] = "(0)"; |
|||
} |
|||
} |
|||
|
|||
if ($_GPC['keywordtype'] == 5) { |
|||
$params[':nickname'] = "%{$keyword}%"; |
|||
$member = pdo_fetchall("SELECT mid,storeid FROM " . tablename('wlmerchant_merchantuser') . "WHERE uniacid = {$_W['uniacid']} AND name LIKE :nickname",$params); |
|||
if ($member) { |
|||
$mids = "("; |
|||
$storeids = "("; |
|||
foreach ($member as $key => $mer) { |
|||
if ($key == 0) { |
|||
$mids .= $mer['mid']; |
|||
$storeids .= $mer['storeid']; |
|||
} else { |
|||
$mids .= "," . $mer['mid']; |
|||
$storeids .= "," . $mer['storeid']; |
|||
} |
|||
} |
|||
$mids .= ")"; |
|||
$storeids .= ")"; |
|||
$data['verfmid#'] = $mids; |
|||
$data['merchantid#'] = $storeids; |
|||
} else { |
|||
$data['verfmid#'] = "(0)"; |
|||
$data['merchantid#'] = "(0)"; |
|||
} |
|||
} |
|||
if (!empty($_GPC['time_limit'])){ |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']) ; |
|||
if(!empty($_GPC['timetype'])){ |
|||
$data['createtime>'] = $starttime; |
|||
$data['createtime<'] = $endtime+86400; |
|||
} |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
if (!empty($_GPC['id'])) { |
|||
$data['activeid'] = $_GPC['id']; |
|||
} |
|||
|
|||
if($_GPC['export']){ |
|||
$this->export($data); |
|||
} |
|||
$halfcard = Halfcard::getNumActive2('*', $data, 'ID DESC', $pindex, $psize, 1); |
|||
$pager = $halfcard[1]; |
|||
$halfcard = $halfcard[0]; |
|||
foreach ($halfcard as $key => &$v) { |
|||
if($type !=2 ){ |
|||
$active = pdo_get('wlmerchant_halfcardlist', array('id' => $v['activeid'])); |
|||
}else{ |
|||
$active = pdo_get('wlmerchant_package', array('id' => $v['activeid'])); |
|||
} |
|||
$v['title'] = $active['title']; |
|||
$merchant = pdo_get('wlmerchant_merchantdata', array('id' => $v['merchantid'])); |
|||
$v['storename'] = $merchant['storename']; |
|||
$v['logo'] = $merchant['logo']; |
|||
$member = pdo_get('wlmerchant_member', array('id' => $v['mid'], 'uniacid' => $_W['uniacid'])); |
|||
$v['avatar'] = $member['avatar']; |
|||
$v['mobile'] = $member['mobile']; |
|||
$v['username'] = pdo_getcolumn(PDO_NAME.'halfcardmember',array('id'=>$v['cardid']),'username'); |
|||
if(empty($v['username'])){ |
|||
$v['username'] = $member['nickname']; |
|||
} |
|||
$v['vername'] = pdo_getcolumn(PDO_NAME.'merchantuser',array('mid'=>$v['verfmid'],'storeid'=>$v['merchantid']),'name'); |
|||
if(empty($v['vername'])){ |
|||
$v['vername'] = pdo_getcolumn(PDO_NAME.'member',array('id'=>$v['verfmid']),'nickname'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/userHalfcardList'); |
|||
} |
|||
|
|||
|
|||
function export($where){ |
|||
global $_W, $_GPC; |
|||
set_time_limit(0); |
|||
$halfcard = Halfcard::getNumActive2('*',$where,'ID DESC',0,0,1); |
|||
$halfcard = $halfcard[0]; |
|||
foreach ($halfcard as $key => &$v) { |
|||
if($where['type'] !=2 ){ |
|||
$active = pdo_get('wlmerchant_halfcardlist', array('id' => $v['activeid'])); |
|||
}else{ |
|||
$active = pdo_get('wlmerchant_package', array('id' => $v['activeid'])); |
|||
} |
|||
|
|||
$v['title'] = $active['title']; |
|||
$merchant = pdo_get('wlmerchant_merchantdata', array('id' => $v['merchantid']),array('storename')); |
|||
$v['storename'] = $merchant['storename']; |
|||
$member = pdo_get('wlmerchant_member', array('id' => $v['mid'], 'uniacid' => $_W['uniacid']),array('mobile','nickname')); |
|||
$v['mobile'] = $member['mobile']; |
|||
$v['username'] = pdo_getcolumn(PDO_NAME.'halfcardmember',array('id'=>$v['cardid']),'username'); |
|||
if(empty($v['username'])){ |
|||
$v['username'] = $member['nickname']; |
|||
} |
|||
$v['varname'] = pdo_getcolumn(PDO_NAME.'merchantuser',array('mid'=>$v['verfmid'],'storeid'=>$v['merchantid']),'name'); |
|||
$v['aidname'] = pdo_getcolumn(PDO_NAME.'agentusers',array('id'=>$v['aid']),'agentname'); |
|||
$v['creatcardtime'] = pdo_getcolumn(PDO_NAME.'halfcardmember',array('id'=>$v['cardid']),'createtime'); |
|||
|
|||
} |
|||
|
|||
if($where['type'] == 1){ |
|||
$filter = array( |
|||
'id' => '记录id', |
|||
'aidname' => '所属代理', |
|||
'title' => '特权名称', |
|||
'storename' => '所属商家', |
|||
'username' => '买家昵称', |
|||
'mobile' => '买家电话', |
|||
'ordermoney' => '订单金额', |
|||
'realmoney' => '支付金额', |
|||
'varname' => '核销人', |
|||
'usetime' => '使用时间', |
|||
'creatcardtime' => '开卡时间' |
|||
); |
|||
|
|||
$data = array(); |
|||
foreach ($halfcard as $k => $v) { |
|||
foreach ($filter as $key => $title) { |
|||
if($key == 'usetime' || $key == 'creatcardtime') { |
|||
$data[$k][$key] = date('Y-m-d H:i:s', $v[$key]); |
|||
}else { |
|||
$data[$k][$key] = $v[$key]; |
|||
} |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data,$filter, '一卡通特权使用记录.csv'); |
|||
exit; |
|||
}else { |
|||
$filter = array( |
|||
'id' => '记录id', |
|||
'title' => '特权名称', |
|||
'aidname' => '所属代理', |
|||
'storename' => '所属商家', |
|||
'username' => '买家昵称', |
|||
'mobile' => '买家电话', |
|||
'ordermoney' => '礼包价值', |
|||
'varname' => '核销人', |
|||
'usetime' => '使用时间', |
|||
'creatcardtime' => '开卡时间' |
|||
); |
|||
|
|||
$data = array(); |
|||
foreach ($halfcard as $k => $v) { |
|||
foreach ($filter as $key => $title) { |
|||
if($key == 'usetime' || $key == 'creatcardtime') { |
|||
$data[$k][$key] = date('Y-m-d H:i:s', $v[$key]); |
|||
}else { |
|||
$data[$k][$key] = $v[$key]; |
|||
} |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data,$filter, '一卡通大礼包使用记录.csv'); |
|||
exit; |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
public function outmemberlist($where){ |
|||
global $_W, $_GPC; |
|||
$delevel = Setting::wlsetting_read('halflevel'); |
|||
$set = Setting::wlsetting_read('halfcard'); |
|||
$member = Halfcard::getNumhalfcardmember('*', $where, 'ID DESC', 0, 0, 1); |
|||
$member = $member[0]; |
|||
foreach ($member as $key => &$v) { |
|||
$user = pdo_get('wlmerchant_member', array('id' => $v['mid'])); |
|||
$v['nickname'] = $user['nickname']; |
|||
if(empty($v['username'])){ |
|||
$v['username'] = $user['nickname']; |
|||
} |
|||
$v['realname'] = $user['realname']; |
|||
$v['mobile'] = $user['mobile']; |
|||
if ($v['expiretime'] > time()) { |
|||
if($v['disable']){ |
|||
$v['status'] = 3; |
|||
}else{ |
|||
$v['status'] = 1; |
|||
} |
|||
|
|||
} else { |
|||
$v['status'] = 2; |
|||
} |
|||
$v['cardsn'] = pdo_getcolumn(PDO_NAME.'halfcard_realcard',array('cardid'=>$v['id']),'cardsn'); |
|||
if (file_exists(PATH_MODULE . 'N814.log')) { |
|||
$v['banknum'] = intval($user['card_number']); |
|||
} |
|||
$v['agentuser'] = pdo_getcolumn(PDO_NAME.'agentusers',array('id'=>$v['aid']),'agentname'); |
|||
if(empty($v['agentuser'])){ |
|||
$v['agentuser'] = '总后台'; |
|||
} |
|||
//会员等级 |
|||
if($v['levelid']){ |
|||
$v['levelname'] = pdo_getcolumn(PDO_NAME.'halflevel',array('id'=>$v['levelid']),'name'); |
|||
}else { |
|||
$v['levelname'] = $delevel['name']; |
|||
} |
|||
//获取开卡额外记录 |
|||
$moreinfo = pdo_fetchall("SELECT moinfo FROM ".tablename('wlmerchant_halfcard_record')."WHERE uniacid = {$_W['uniacid']} AND mid = {$v['mid']} AND status = 1 ORDER BY id DESC limit 1"); |
|||
$v['moinfo'] = unserialize($moreinfo[0]['moinfo']); |
|||
foreach ($v['moinfo'] as $zzw => $in){ |
|||
if($in['id'] == 'checkbox' || $in['id'] == 'img'){ |
|||
$v['zzw'.$zzw] = implode(",", $in['data']); |
|||
}else if($in['id'] == 'datetime' || $in['id'] == 'city'){ |
|||
$v['zzw'.$zzw] = implode("-", $in['data']); |
|||
} else{ |
|||
$v['zzw'.$zzw] = $in['data']; |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* 输出表头 */ |
|||
$filter = array( |
|||
'id' => '一卡通id', |
|||
'agentuser' => '所属代理', |
|||
'nickname' => '用户昵称', |
|||
'username' => '持有人姓名', |
|||
'realname' => '真实姓名', |
|||
'mobile' => '持有人手机', |
|||
'levelname' => '会员等级', |
|||
'status' => '使用状态', |
|||
'createtime' => '生成时间', |
|||
'expiretime' => '过期时间', |
|||
'cardsn' => '实卡编号', |
|||
); |
|||
|
|||
if (file_exists(PATH_MODULE . 'N814.log')) { |
|||
$filter['banknum'] = '银行卡号'; |
|||
} |
|||
|
|||
if($set['diyformid'] > 0){ |
|||
$diyforminfo = pdo_get('wlmerchant_diyform',array('id' => $set['diyformid']),array('info')); |
|||
$moinfo = json_decode(base64_decode($diyforminfo['info']) , true); |
|||
$list = $moinfo['list']; |
|||
$list = array_values($list); |
|||
foreach ($list as $wlf => $li){ |
|||
$filter['zzw'.$wlf] = $li['data']['title']; |
|||
} |
|||
} |
|||
$data = array(); |
|||
for ($i=0; $i < count($member) ; $i++) { |
|||
foreach ($filter as $key => $title) { |
|||
if($key == 'status'){ |
|||
switch ($member[$i][$key]) { |
|||
case '1': |
|||
$data[$i][$key] = '使用中'; |
|||
break; |
|||
case '2': |
|||
$data[$i][$key] = '已过期'; |
|||
break; |
|||
default: |
|||
$data[$i][$key] = '被禁用'; |
|||
break; |
|||
} |
|||
}else if($key == 'createtime') { |
|||
$data[$i][$key] = date('Y-m-d H:i:s', $member[$i][$key]); |
|||
}else if($key == 'expiretime'){ |
|||
$data[$i][$key] = date('Y-m-d H:i:s', $member[$i][$key]); |
|||
}else { |
|||
$data[$i][$key] = $member[$i][$key]; |
|||
} |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data,$filter, '一卡通用户列表.csv'); |
|||
exit; |
|||
|
|||
} |
|||
|
|||
public function add() { |
|||
global $_W, $_GPC; |
|||
$delevel = Setting::wlsetting_read('halflevel'); |
|||
$levels = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halflevel')."WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
$halfset = Setting::wlsetting_read('halfcard'); |
|||
if($halfset['halfcardtype'] == 2){ |
|||
$agents = pdo_getall('wlmerchant_agentusers', array('uniacid' => $_W['uniacid']), array('id', 'agentname')); |
|||
} |
|||
//支付有礼 |
|||
if(p('paidpromotion')){ |
|||
$paidlist = pdo_getall('wlmerchant_payactive',array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'status' => 1),array('id','title')); |
|||
} |
|||
$memberType = $_GPC['data']; |
|||
if ($_GPC['id']) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'halfcard_type', array('id' => $_GPC['id'])); |
|||
} |
|||
if ($_GPC['data']) { |
|||
$memberType['uniacid'] = $_W['uniacid']; |
|||
if($halfset['halfcardtype'] == 1){ |
|||
$memberType['aid'] = 0; |
|||
} |
|||
if ($_GPC['id']) { |
|||
pdo_update(PDO_NAME . 'halfcard_type', $memberType, array('id' => $_GPC['id'])); |
|||
} else { |
|||
pdo_insert(PDO_NAME . 'halfcard_type', $memberType); |
|||
} |
|||
wl_message('操作成功!', web_url('halfcard/halftype/lists'), 'success'); |
|||
} |
|||
|
|||
include wl_template('halfcardsys/typeadd'); |
|||
} |
|||
|
|||
public function delType() { |
|||
global $_W, $_GPC; |
|||
$res = pdo_delete(PDO_NAME . 'halfcard_type', array('id' => $_GPC['id'])); |
|||
if($res){ |
|||
show_json(1,'操作成功'); |
|||
}else { |
|||
show_json(0,'网络错误,请刷新重试!'); |
|||
} |
|||
} |
|||
|
|||
//禁用用户 |
|||
function disablemember(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$flag = $_GPC['flag']; |
|||
if($flag == 1){ |
|||
$res = pdo_update('wlmerchant_halfcardmember',array('disable' => 1),array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => $res, 'id' => $id))); |
|||
} |
|||
} |
|||
if($flag == 2){ |
|||
$res = pdo_update('wlmerchant_halfcardmember',array('disable' => 0),array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => $res, 'id' => $id))); |
|||
} |
|||
} |
|||
} |
|||
|
|||
//删除用户 |
|||
function deletemember(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$res = pdo_delete('wlmerchant_halfcardmember',array('id' => $id)); |
|||
if ($res) { |
|||
die(json_encode(array('errno' => 0, 'message' => $res, 'id' => $id))); |
|||
} else { |
|||
die(json_encode(array('errno' => 2, 'message' => $res, 'id' => $id))); |
|||
} |
|||
} |
|||
|
|||
function halflevel(){ |
|||
global $_W, $_GPC; |
|||
$base = Setting::wlsetting_read('halflevel'); |
|||
if(empty($base)){ |
|||
$base['name'] = '默认等级'; |
|||
Setting::wlsetting_save($base,'halflevel'); |
|||
} |
|||
$levels = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halflevel')."WHERE uniacid = {$_W['uniacid']} ORDER BY sort DESC"); |
|||
|
|||
include wl_template('halfcardsys/halflevel'); |
|||
} |
|||
|
|||
public function editlevel(){ |
|||
global $_W, $_GPC; |
|||
$base = Setting::wlsetting_read('halflevel'); |
|||
$id = $_GPC['id']; |
|||
if($id == 'default'){ |
|||
$level['name'] = $base['name']?$base['name']:'默认等级'; |
|||
$level['id'] = 'default'; |
|||
$level['cardimg'] = tomedia($base['cardimg']); |
|||
}else if($id){ |
|||
$level=pdo_get('wlmerchant_halflevel',array('id' => $id)); |
|||
$level['cardimg'] = tomedia($level['cardimg']); |
|||
} |
|||
if($_W['ispost']){ |
|||
if($id == 'default'){ |
|||
$data['name'] = trim($_GPC['name']); |
|||
$data['cardimg'] = $_GPC['cardimg']; |
|||
$res = Setting::wlsetting_save($data,'halflevel'); |
|||
}else if($id){ |
|||
$data = array( |
|||
'name' => trim($_GPC['name']), |
|||
'sort' => trim($_GPC['sort']), |
|||
'cardimg'=> $_GPC['cardimg'], |
|||
'status' => $_GPC['status'], |
|||
'army' => $_GPC['army'], |
|||
); |
|||
$res = pdo_update('wlmerchant_halflevel',$data,array('id' => $id)); |
|||
}else { |
|||
$data=array( |
|||
'uniacid'=> $_W['uniacid'], |
|||
'name' => trim($_GPC['name']), |
|||
'sort' => trim($_GPC['sort']), |
|||
'status' => $_GPC['status'], |
|||
'cardimg'=> $_GPC['cardimg'], |
|||
'createtime'=>time(), |
|||
'army' => $_GPC['army'], |
|||
); |
|||
$res = pdo_insert('wlmerchant_halflevel',$data); |
|||
} |
|||
if($res){ |
|||
show_json(1, '操作成功!'); |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/halflevelmodel'); |
|||
} |
|||
|
|||
function changelevel(){ |
|||
global $_W,$_GPC; |
|||
$id = $_GPC['id']; |
|||
$type = $_GPC['type']; |
|||
$newvalue = trim($_GPC['value']); |
|||
if($id == 'default'){ |
|||
$data['name'] = trim($_GPC['name']); |
|||
$res = Setting::wlsetting_save($data,'halflevel'); |
|||
}else { |
|||
if($type == 1){ |
|||
$res = pdo_update('wlmerchant_halflevel',array('name'=>$newvalue),array('id' => $id)); |
|||
}elseif ($type == 2) { |
|||
$res = pdo_update('wlmerchant_halflevel',array('sort'=>$newvalue),array('id' => $id)); |
|||
}else if ($type == 3) { |
|||
$res = pdo_update('wlmerchant_halflevel',array('status'=>$newvalue),array('id' => $id)); |
|||
}else if ($type == 4) { |
|||
$res = pdo_delete('wlmerchant_halflevel',array('id'=>$id)); |
|||
} |
|||
} |
|||
if($res){ |
|||
show_json(1,'修改成功'); |
|||
}else { |
|||
show_json(0,'修改失败,请重试'); |
|||
} |
|||
} |
|||
|
|||
function moreinfo(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$info = pdo_getcolumn(PDO_NAME.'halfcard_record',array('id'=>$id),'moinfo'); |
|||
$info = unserialize($info); |
|||
foreach ($info as &$ll) { |
|||
if(!empty($ll['type'])){ |
|||
if($ll['type'] == 'pics'){ |
|||
$ll['value'] = unserialize($ll['value']); |
|||
foreach($ll['value'] as &$pic){ |
|||
$pic = tomedia($pic); |
|||
} |
|||
}else if($ll['type'] == 'pic'){ |
|||
$ll['value'] = tomedia($ll['value']); |
|||
} |
|||
} |
|||
} |
|||
include wl_template('halfcardsys/moreinfo'); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,239 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Realcard_WeliamController { |
|||
|
|||
public function cardlist() { |
|||
global $_W, $_GPC; |
|||
$wheresql = " WHERE uniacid = :uniacid "; |
|||
$param = array(':uniacid' => $_W['uniacid']); |
|||
$keyword = trim($_GPC['keyword']); |
|||
if(!empty($keyword)) { |
|||
$wheresql .= " AND (cardsn LIKE '%{$keyword}%' or remark LIKE '%{$keyword}%') "; |
|||
} |
|||
if($_GPC['startkeyword']){ |
|||
$startword = trim($_GPC['startkeyword']); |
|||
$wheresql .= " AND cardsn >= '{$startword}'"; |
|||
} |
|||
if($_GPC['endkeyword']){ |
|||
$endword = trim($_GPC['endkeyword']); |
|||
$wheresql .= " AND cardsn <= '{$endword}'"; |
|||
} |
|||
$starttime = empty($_GPC['time']['start']) ? TIMESTAMP - 86399 * 30 : strtotime($_GPC['time']['start']); |
|||
$endtime = empty($_GPC['time']['end']) ? TIMESTAMP: strtotime($_GPC['time']['end']); |
|||
if(!empty($_GPC['time']['start'])) { |
|||
$wheresql .= " AND createtime >= '{$starttime}' AND createtime <= '{$endtime}'"; |
|||
} |
|||
if (!empty($_GPC['status'])) { |
|||
$wheresql .= " AND status = {$_GPC['status']}"; |
|||
} |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 15; |
|||
$list = pdo_fetchall("SELECT * FROM ".tablename(PDO_NAME.'halfcard_realcard'). $wheresql . ' ORDER BY `id` DESC LIMIT '.($pindex - 1) * $psize.','. $psize, $param); |
|||
if (!empty($list)) { |
|||
foreach ($list as $index => &$qrcode) { |
|||
$path = h5_url('pages/mainPages/realCard/realCard',['cardsn' => $qrcode['cardsn'],'salt' => $qrcode['salt']]); |
|||
$qrcode['showurl'] = web_url('halfcard/realcard/qrcodeimg', array('url' => $path)); |
|||
if($qrcode['levelid']){ |
|||
$qrcode['levelname'] = pdo_getcolumn(PDO_NAME.'halflevel',array('id'=>$qrcode['levelid']),'name'); |
|||
}else { |
|||
$qrcode['levelname'] = $_W['wlsetting']['halflevel']['name']; |
|||
} |
|||
} |
|||
} |
|||
$total = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename(PDO_NAME.'halfcard_realcard') . $wheresql, $param); |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
|
|||
if($_GPC['export'] != ''){ |
|||
$this->export($wheresql, $param); |
|||
} |
|||
include wl_template('realcard/qr-list'); |
|||
} |
|||
|
|||
public function addcard() { |
|||
global $_W, $_GPC; |
|||
$levels = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halflevel')."WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
if(checksubmit('submit')){ |
|||
$days = intval($_GPC['days']); |
|||
$allnum = intval($_GPC['qr_num']); |
|||
$levelid = intval($_GPC['levelid']); |
|||
include wl_template('realcard/qr-process'); |
|||
exit; |
|||
} |
|||
include wl_template('realcard/qr-post'); |
|||
} |
|||
|
|||
public function deletemodal(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$realcard = pdo_get('wlmerchant_halfcard_realcard',array('id' => $id)); |
|||
|
|||
if($_W['ispost']){ |
|||
if($id){ |
|||
if($_GPC['range']){ |
|||
$res = pdo_delete('wlmerchant_halfcard_realcard',array('remark'=>$realcard['remark'])); |
|||
}else { |
|||
$res = pdo_delete('wlmerchant_halfcard_realcard',array('id'=>$id)); |
|||
} |
|||
} |
|||
if($res){ |
|||
show_json(1,'删除成功'); |
|||
}else { |
|||
show_json(0,'删除失败,请重试'); |
|||
} |
|||
} |
|||
include wl_template('realcard/deletemodel'); |
|||
} |
|||
|
|||
public function icerealcard(){ |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$realcard = pdo_get('wlmerchant_halfcard_realcard',array('id' => $id)); |
|||
if($_W['ispost']){ |
|||
if($id){ |
|||
$data = array( |
|||
'icestatus'=> trim($_GPC['icestatus']), |
|||
); |
|||
if($_GPC['range']){ |
|||
$res = pdo_update('wlmerchant_halfcard_realcard',$data,array('remark' => $realcard['remark'])); |
|||
}else { |
|||
$res = pdo_update('wlmerchant_halfcard_realcard',$data,array('id' => $id)); |
|||
} |
|||
} |
|||
if($res){ |
|||
show_json(1,'操作成功'); |
|||
}else { |
|||
show_json(0,'操作失败,请重试'); |
|||
} |
|||
} |
|||
include wl_template('realcard/icemodel'); |
|||
} |
|||
|
|||
//删除实卡 |
|||
public function deletecard(){ |
|||
global $_W, $_GPC; |
|||
$ids = $_GPC['ids']; |
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
pdo_delete('wlmerchant_halfcard_realcard',array('id'=>$id)); |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => $ids))); |
|||
} |
|||
} |
|||
|
|||
public function editrealcard() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$realcard = pdo_get('wlmerchant_halfcard_realcard',array('id' => $id)); |
|||
$levels = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halflevel')."WHERE uniacid = {$_W['uniacid']} AND status = 1 ORDER BY sort DESC"); |
|||
if($_W['ispost']){ |
|||
if($id){ |
|||
$data = array( |
|||
'days' => trim($_GPC['days']), |
|||
'levelid' => trim($_GPC['levelid']), |
|||
'remark'=> trim($_GPC['remark']) |
|||
); |
|||
if($_GPC['range']){ |
|||
$res = pdo_update('wlmerchant_halfcard_realcard',$data,array('remark' => $realcard['remark'])); |
|||
}else { |
|||
$res = pdo_update('wlmerchant_halfcard_realcard',$data,array('id' => $id)); |
|||
} |
|||
} |
|||
if($res){ |
|||
show_json(1,'操作成功'); |
|||
}else { |
|||
show_json(0,'操作失败,请重试'); |
|||
} |
|||
} |
|||
include wl_template('realcard/qr-model'); |
|||
} |
|||
|
|||
public function get(){ |
|||
global $_W,$_GPC; |
|||
$settings = Setting::wlsetting_read('halfcard'); |
|||
$numbers = pdo_getcolumn(PDO_NAME.'halfcard_realcard', array('uniacid' => $_W['uniacid']), array('COUNT(id)')); |
|||
$firstnum = 80000000; |
|||
$qrinsert = array( |
|||
'uniacid' => $_W['uniacid'], |
|||
'days' => intval($_GPC['days']), |
|||
'cardsn' => empty($numbers) ? $firstnum + 1 : $firstnum + 1 + $numbers, |
|||
'salt' => random(8), |
|||
'createtime' => TIMESTAMP, |
|||
'status' => '1', |
|||
'levelid'=> $_GPC['levelid'], |
|||
'remark' => trim($_GPC['remark']) |
|||
); |
|||
$result = Util::long2short(h5_url('pages/mainPages/realCard/realCard', array('cardsn' => $qrinsert['cardsn'], 'salt' => $qrinsert['salt']))); |
|||
if (!is_error($result) && $result['short_url'] != 'h') { |
|||
$qrinsert['url'] = $result['short_url']; |
|||
} |
|||
pdo_insert(PDO_NAME.'halfcard_realcard', $qrinsert); |
|||
die(json_encode(array('result' => 1))); |
|||
} |
|||
|
|||
public function export($wheresql, $param) { |
|||
global $_W,$_GPC; |
|||
if (empty($wheresql) || empty($param)) { |
|||
return FALSE; |
|||
} |
|||
$settings = Setting::wlsetting_read('halfcard'); |
|||
$list = pdo_fetchall("SELECT * FROM ".tablename(PDO_NAME.'halfcard_realcard'). $wheresql . ' ORDER BY `id` DESC', $param); |
|||
/* 输出表头 */ |
|||
$filter = array( |
|||
'showurl' => '二维码', |
|||
'cardsn' => '实卡编号', |
|||
'days' => '包含时长', |
|||
'status' => '使用状态', |
|||
'createtime' => '生成时间', |
|||
'bindtime' => '绑定时间', |
|||
); |
|||
$data = array(); |
|||
foreach ($list as $k => $v) { |
|||
$v['showurl'] = $v['url'] ? $v['url'] : h5_url('pages/mainPages/realCard/realCard',array('cardsn' => $v['cardsn'],'salt' => $v['salt'])) ; |
|||
foreach ($filter as $key => $title) { |
|||
if ($key == 'createtime') { |
|||
$data[$k][$key] = date('Y-m-d H:i:s', $v[$key]); |
|||
}elseif($key == 'status'){ |
|||
switch ($v[$key]) { |
|||
case '1': |
|||
$data[$k][$key] = '未绑定'; |
|||
break; |
|||
case '2': |
|||
$data[$k][$key] = '已绑定'; |
|||
break; |
|||
default: |
|||
$data[$k][$key] = '已失效'; |
|||
break; |
|||
} |
|||
}elseif($key == 'days'){ |
|||
$data[$k][$key] = $v[$key] . '天'; |
|||
}elseif($key == 'bindtime'){ |
|||
$data[$k][$key] = !empty($v[$key]) ? date('Y-m-d H:i:s', $v[$key]) : '未绑定'; |
|||
}else { |
|||
$data[$k][$key] = $v[$key]; |
|||
} |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data, $filter, '全部数据.csv'); |
|||
exit; |
|||
} |
|||
|
|||
public function qrcodeimg() { |
|||
global $_W, $_GPC; |
|||
$url = $_GPC['url']; |
|||
m('qrcode/QRcode') -> png($url, false, QR_ECLEVEL_H, 5); |
|||
} |
|||
|
|||
public function longToshort(){ |
|||
global $_W, $_GPC; |
|||
$list = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_halfcard_realcard')."WHERE uniacid = {$_W['uniacid']} AND url = '' ORDER BY id DESC"); |
|||
foreach ($list as $li){ |
|||
$result = Util::long2short(h5_url('pages/mainPages/realCard/realCard',['cardsn' => $li['cardsn'],'salt' => $li['salt']])); |
|||
if (!is_error($result) && $result['short_url'] != 'h') { |
|||
pdo_update('wlmerchant_halfcard_realcard',array('url' => $result['short_url']),array('id' => $li['id'])); |
|||
} |
|||
} |
|||
show_json(1); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,92 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="#">代理申请列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:120px;">vip类型</th> |
|||
<th class="text-center" style="width:60px;">时长</th> |
|||
<th class="text-center" style="width:60px;">申请数量</th> |
|||
<th class="text-center" style="width:60px;">申请状态</th> |
|||
<th class="text-center" style="width:120px;">申请时间</th> |
|||
<th class="text-center" style="width:120px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $applys $item} |
|||
<tr class="text-center" > |
|||
<td> |
|||
<span class="label label-info"> |
|||
{$item['token']['name']} |
|||
</span> |
|||
{if !empty($item['aid'])} |
|||
|
|||
<span class="label label-primary"> |
|||
{$item['aName']} |
|||
</span> |
|||
{else} |
|||
<span class="label label-danger"> |
|||
系统 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{$item['token']['days']}天 |
|||
</td> |
|||
<td>{$item['num']}</td> |
|||
<td> |
|||
{if $item['status']==1} |
|||
<span id="" class="label label-danger"> |
|||
申请中 |
|||
</span> |
|||
{else} |
|||
<span id="" class="label label-primary"> |
|||
已生成 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i:s',$item['createtime'])}</td> |
|||
<td> |
|||
{if $item['status']==1} |
|||
<a href="{php echo web_url('halfcard/halfcode/add',array('applyid'=>$item['id']))}" title="生成" class="btn btn-danger btn-sm">生成</a> |
|||
{else} |
|||
<a href="#" title="已生成" class="btn btn-primary btn-sm">已完成</a> |
|||
{/if} |
|||
- <a href="javascript:;" title="删除" id="{$item['id']}" class="btn btn-danger remove">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('.remove').click(function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('id'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcode/deapply')}", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
$this.parent().parent().remove(); |
|||
util.tips("删除成功!"); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,513 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基础设置</a></li> |
|||
<li><a href="#tab_vip">会员设置</a></li> |
|||
<li><a href="#tab_jifen">积分设置</a></li> |
|||
<li><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<style type="text/css"> |
|||
.page-heading { |
|||
padding: 5px 0; |
|||
border-bottom: 1px solid #ccc; |
|||
margin-bottom: 20px; |
|||
position: relative; |
|||
margin-left: 15px; |
|||
} |
|||
.select2{width: 100%;} |
|||
.select2-container .select2-choice .select2-arrow b{background-color: #eeeeee} |
|||
.w200{width: 200px;} |
|||
.w60{width: 60px;text-align: right;} |
|||
.form-horizontal .form-group{margin-left: 0;margin-right: 0;} |
|||
.table> thead> tr> th{border: none;} |
|||
.is_default{display: table-block;} |
|||
.is_advanced{display: none;} |
|||
#openids_selector .input-group{width: 100%;} |
|||
.is_sms{display: table-block;} |
|||
.layui-anim-upbit{-webkit-animation-name: layui-upbit;animation-name: layui-upbit;} |
|||
.layui-anim{-webkit-animation-duration: .3s;animation-duration: .3s;-webkit-animation-fill-mode: both;animation-fill-mode: both;} |
|||
.layui-form-selected ul{display: block;} |
|||
.form-control-block, .form-control-inline{position: relative;} |
|||
.layui-form-select ul{display: none;position: absolute;left: 0;top: 37px;margin-bottom: 50px;padding: 0;z-index: 999;width: 100%;border: 1px solid #d2d2d2;max-height: 300px;overflow-y: auto;background-color: #fff;border-radius: 2px;box-shadow: 0 2px 4px rgba(0, 0, 0, .12);box-sizing: border-box;} |
|||
.layui-form-select{position: absolute;margin-top: -18px;display: none;} |
|||
</style> |
|||
<div class="app-form"> |
|||
<form action="" method="post" id="setting-form" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">一卡通设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否开启一卡通</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inline1" name="status" value="1" {if intval($settings['status']) == 1}checked{/if}> |
|||
<label for="inline1">开启 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inline2" name="status" value="0" {if intval($settings['status']) == 0 || empty($settings['status'])}checked{/if}> |
|||
<label for="inline2">关闭 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">下单开通会员</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="is_openvip2" name="is_openvip" value="0" {if intval($settings['is_openvip']) != 1}checked{/if}> |
|||
<label for="is_openvip2">关闭 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="is_openvip1" name="is_openvip" value="1" {if intval($settings['is_openvip']) == 1}checked{/if}> |
|||
<label for="is_openvip1">开启 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码兑换</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlinee2" name="hideact" value="0" {if intval($settings['hideact']) == 0 || empty($settings['hideact'])}checked="checked"{/if}> |
|||
<label for="inlinee2"> 启用</label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlinee1" name="hideact" value="1" {if intval($settings['hideact']) == 1}checked="checked"{/if}> |
|||
<label for="inlinee1"> 禁用 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">首页统计框</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio9" name="statisticsdiv" value="0" {if intval($settings['statisticsdiv']) == 0 || empty($settings['statisticsdiv'])}checked="checked"{/if}> |
|||
<label for="inlineRadio9"> 隐藏 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio10" name="statisticsdiv" value="1" {if intval($settings['statisticsdiv']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio10"> 显示</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">平日折扣分类栏</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineT2" name="halfcate" value="0" {if intval($settings['halfcate']) == 0 || empty($settings['halfcate'])}checked="checked"{/if}> |
|||
<label for="inlineT2"> 隐藏</label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineT1" name="halfcate" value="1" {if intval($settings['halfcate']) == 1}checked="checked"{/if}> |
|||
<label for="inlineT1"> 显示 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包分类栏</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineR1" name="packagecate" value="0" {if intval($settings['packagecate']) == 1 || empty($settings['packagecate'])}checked="checked"{/if}> |
|||
<label for="inlineR1"> 隐藏 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineR2" name="packagecate" value="1" {if intval($settings['packagecate']) == 1 }checked="checked"{/if}> |
|||
<label for="inlineR2"> 显示</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">锁定续费类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio11" name="renewstatus" value="1" {if intval($settings['renewstatus']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio11"> 开启 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio12" name="renewstatus" value="0" {if intval($settings['renewstatus']) == 0 || empty($settings['renewstatus'])}checked="checked"{/if}> |
|||
<label for="inlineRadio12"> 关闭</label> |
|||
</div> |
|||
<span class="help-block">开启后,续费一卡通的用户只能选择当前一卡通种类</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开卡弹幕</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="notice3" name="noticestatus" value="0" {if intval($settings['noticestatus']) == 0 || empty($settings['noticestatus'])}checked{/if}> |
|||
<label for="notice3">关闭 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="notice1" name="noticestatus" value="1" {if intval($settings['noticestatus']) == 1}checked{/if}> |
|||
<label for="notice1">启用</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开通表单</label> |
|||
<div class="col-sm-6"> |
|||
<select name="diyformid" class="form-control chosen-select"> |
|||
<option value="" >请选择开通表单</option> |
|||
{loop $diyFormList $form} |
|||
<option value="{$form['id']}" {if $settings['diyformid'] == $form['id']}selected="selected"{/if}>{$form['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">买单不优惠金额默认提示</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="limit" placeholder="请询问服务员输入不参与优惠金额" class="form-control" value="{$settings['limit']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">首页卡面文本颜色</label> |
|||
<div class="col-sm-9"> |
|||
<input type="color" style="width: 20%;" name="cardTextColor" class="form-control" value="{$settings['cardTextColor']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_vip"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一卡通模式</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" onclick="$('#show').show();"> |
|||
<input type="radio" id="inlineRadio1" name="halfcardtype" value="1" {if intval($settings['halfcardtype']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio1"> 联盟模式 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" onclick="$('#show').hide();"> |
|||
<input type="radio" id="inlineRadio2" name="halfcardtype" value="2" {if intval($settings['halfcardtype']) == 2}checked="checked"{/if}> |
|||
<label for="inlineRadio2"> 地区模式 </label> |
|||
</div> |
|||
<span class="help-block">联盟模式:所有代理区域通用。地区模式:每个地区单独收费,互不影响。默认地区模式</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一卡通卡面</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('cardimg', $settings['cardimg']);} |
|||
</div> |
|||
</div> |
|||
{if is_file(PATH_MODULE.'TnSrtWDJ.log')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权使用间隔</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">每</span> |
|||
<input type="text" name="use_space" class="form-control" value="{$settings['use_space']}" /> |
|||
<span class="input-group-addon">天,限使用</span> |
|||
<input type="text" name="use_space_times" class="form-control" value="{$settings['use_space_times']}" /> |
|||
<span class="input-group-addon">次,每次间隔最少</span> |
|||
<input type="text" name="use_space_days" class="form-control" value="{$settings['use_space_days']}" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
<span class="help-block">特权折扣、礼包使用间隔时间,不填或留空则不限制用户使用间隔 </span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户会员等级</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inline7" name="levelstatus" value="0" {if intval($settings['levelstatus']) == 0 || empty($settings['levelstatus'])}checked{/if}> |
|||
<label for="inline7">隐藏</label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inline8" name="levelstatus" value="1" {if intval($settings['levelstatus']) == 1}checked{/if}> |
|||
<label for="inline8">显示</label> |
|||
</div> |
|||
<span class="help-block">设置是否在用户会员卡上显示用户的会员等级</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员权益说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('describe',$settings['describe']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">非会员说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('nodescribe',$settings['nodescribe']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权项目对非会员展示</label> |
|||
<div class="col-sm-9"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inline17" name="unshowtab" value="1" {if intval($settings['unshowtab']) == 1}checked{/if}> |
|||
<label for="inline17">隐藏</label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inline18" name="unshowtab" value="0" {if intval($settings['unshowtab']) == 0 || empty($settings['unshowtab'])}checked{/if}> |
|||
<label for="inline18">显示</label> |
|||
</div> |
|||
<span class="help-block">一卡通页面特权是否对非会员显示</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选项卡设置</label> |
|||
<div class="col-sm-9"> |
|||
<table class="table table-hover"> |
|||
<thead class="bannerbar-inner"> |
|||
<tr> |
|||
<th style="width:20%;text-align: center;">选项名称</th> |
|||
<th style="width:20%;text-align: center;">修改名称</th> |
|||
<th style="width:15%;text-align: center;">排序(数字越大越靠前)</th> |
|||
<th style="width:25%;text-align: center;">列表排序方式</th> |
|||
<th style="width:20%;text-align: center;">开关</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<td style="text-align: center;">特权折扣</td> |
|||
<td style="text-align: center;"><input type="text" class="form-control" placeholder="特权折扣" name="plugin[zkname]" value="{$plugin['zkname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[zkorder]" value="{$plugin['zkorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[zksort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['zksort'] == 2 || empty($plugin['zksort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['zksort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['zksort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['zksort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[zkstatus]" value="1" {if $plugin['zkstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="text-align: center;">平日折扣</td> |
|||
<td style="text-align: center;"><input type="text" class="form-control" placeholder="平日折扣" name="plugin[przkname]" value="{$plugin['przkname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[przkorder]" value="{$plugin['przkorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[przksort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['przksort'] == 2 || empty($plugin['przksort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['przksort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['przksort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['przksort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[przkstatus]" value="1" {if $plugin['przkstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="text-align: center;">免费礼包</td> |
|||
<td style="text-align: center;"><input class="form-control" placeholder="免费礼包" type="text" name="plugin[lbname]" value="{$plugin['lbname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[lborder]" value="{$plugin['lborder']}"/></td> |
|||
<td> |
|||
<select name="plugin[lbsort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['lbsort'] == 2 || empty($plugin['lbsort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['lbsort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['lbsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['lbsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[lbstatus]" value="1" {if $plugin['lbstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{if p('rush')} |
|||
<tr> |
|||
<td style="text-align: center;">尊享抢购</td> |
|||
<td style="text-align: center;"><input class="form-control" type="text" placeholder="尊享抢购" name="plugin[qgname]" value="{$plugin['qgname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[qgorder]" value="{$plugin['qgorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[qgsort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['qgsort'] == 2 || empty($plugin['qgsort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['qgsort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['qgsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['qgsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[qgstatus]" value="1" {if $plugin['qgstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{/if} |
|||
{if p('groupon')} |
|||
<tr> |
|||
<td style="text-align: center;">特惠团购</td> |
|||
<td style="text-align: center;"><input class="form-control" type="text" placeholder="特惠团购" name="plugin[tgname]" value="{$plugin['tgname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[tgorder]" value="{$plugin['tgorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[tgsort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['tgsort'] == 2 || empty($plugin['tgsort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['tgsort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['tgsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['tgsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[tgstatus]" value="1" {if $plugin['tgstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{/if} |
|||
{if p('wlcoupon')} |
|||
<tr> |
|||
<td style="text-align: center;">专属卡券</td> |
|||
<td style="text-align: center;"><input class="form-control" type="text" placeholder="专属卡券" name="plugin[kqname]" value="{$plugin['kqname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[kqorder]" value="{$plugin['kqorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[kqsort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['kqsort'] == 2 || empty($plugin['kqsort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['kqsort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['kqsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['kqsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[kqstatus]" value="1" {if $plugin['kqstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{/if} |
|||
{if p('consumption')} |
|||
<tr> |
|||
<td style="text-align: center;">积分商品</td> |
|||
<td style="text-align: center;"><input class="form-control" type="text" placeholder="积分商品" name="plugin[jfname]" value="{$plugin['jfname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[jforder]" value="{$plugin['jforder']}"/></td> |
|||
<td> |
|||
<select name="plugin[jfsort]" style="width: 100%;"> |
|||
<option value="3" {if $plugin['jfsort'] == 3 || empty($plugin['jfsort'])} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['jfsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['jfsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[jfstatus]" value="1" {if $plugin['jfstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{/if} |
|||
{if p('wlfightgroup')} |
|||
<tr> |
|||
<td style="text-align: center;">拼团活动</td> |
|||
<td style="text-align: center;"><input class="form-control" type="text" placeholder="拼团活动" name="plugin[ptname]" value="{$plugin['ptname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[ptorder]" value="{$plugin['ptorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[ptsort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['ptsort'] == 2 || empty($plugin['ptsort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['ptsort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['ptsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['ptsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[ptstatus]" value="1" {if $plugin['ptstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{/if} |
|||
|
|||
{if p('bargain')} |
|||
<tr> |
|||
<td style="text-align: center;">砍价活动</td> |
|||
<td style="text-align: center;"><input class="form-control" type="text" placeholder="砍价活动" name="plugin[kjname]" value="{$plugin['kjname']}"/></td> |
|||
<td style="text-align: center;"><input class="form-control" type="number" name="plugin[kjorder]" value="{$plugin['kjorder']}"/></td> |
|||
<td> |
|||
<select name="plugin[kjsort]" style="width: 100%;"> |
|||
<option value="2" {if $plugin['kjsort'] == 2 || empty($plugin['kjsort'])} selected="selected" {/if}>店铺距离</option> |
|||
<option value="3" {if $plugin['kjsort'] == 3} selected="selected" {/if}>推荐设置</option> |
|||
<option value="1" {if $plugin['kjsort'] == 1} selected="selected" {/if}>创建时间</option> |
|||
<option value="4" {if $plugin['kjsort'] == 4} selected="selected" {/if}>浏览人气</option> |
|||
</select> |
|||
</td> |
|||
<td style="text-align: center;"> |
|||
<input type="checkbox" class="js-switch" name="plugin[kjstatus]" value="1" {if $plugin['kjstatus']}checked="checked" {/if}> |
|||
</td> |
|||
</tr> |
|||
{/if} |
|||
</tbody> |
|||
</table> |
|||
<span class="help-block">不推荐开启平日折扣,平日折扣关闭时,特权折扣列表会显示特权折扣 + 平日折扣商家</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_jifen"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权折扣赠送积分</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">订单价格每</span> |
|||
<input type="text" name="carddeduct" min="0" value="{$settings['carddeduct']}" class="form-control"> |
|||
<span class="input-group-addon">元赠送1积分</span> |
|||
</div> |
|||
<span class="help-block">如果不填或设置0,则核销不赠送积分</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">大礼包赠送积分</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">礼包价格每</span> |
|||
<input type="text" name="packdeduct" min="0" value="{$settings['packdeduct']}" class="form-control"> |
|||
<span class="input-group-addon">元赠送1积分</span> |
|||
</div> |
|||
<span class="help-block">如果不填或设置0,则核销不赠送积分</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称]</b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="share_title" class="form-control" value="{$settings['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('share_image', $settings['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="share_desc" class="form-control" value="{$settings['share_desc']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
var kw = 1; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('halfcard/halfset/halfcardqa')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
function showdaily(flag){ |
|||
if(flag){ |
|||
$('#showdaily').show(); |
|||
}else{ |
|||
$('#showdaily').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,140 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"> |
|||
<a href="#tab_basic">添加激活码</a> |
|||
</li> |
|||
<li> |
|||
<a href="#tab_notice">导入激活码</a> |
|||
</li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<form action="#" method="post" class="form-horizontal form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">基本信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码时长</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="days" class="form-control" placeholder="请输入时长" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if file_exists(IA_ROOT . '/addons/'.MODULE_NAME.'/pTLjC21GjCGj.log')} |
|||
<!--某个用户定制的开通一卡通时赠送金额功能--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">赠送金额</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="give_price" class="form-control" placeholder="请输入赠送金额" /> |
|||
<span class="input-group-addon">¥</span> |
|||
</div> |
|||
<span class="help-block">用户使用当前激活码所赠送的金额</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">创建个数</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="num" class="form-control" placeholder="创建个数" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用代理</label> |
|||
<div class="col-sm-9"> |
|||
<select name="aid" style="width: 100%;" class="select2"> |
|||
<option value="0" >总后台</option> |
|||
{loop $agents $agent} |
|||
<option value="{$agent['id']}">{$agent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if file_exists(PATH_MODULE . 'lsh.log')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">所属挪车代理</label> |
|||
<div class="col-sm-9"> |
|||
<select name="caraid" style="width: 100%;"> |
|||
<option value="0" selected="selected">总平台</option> |
|||
{loop $caragents $caragent} |
|||
<option value="{$caragent['id']}">{$caragent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">匹配等级</label> |
|||
<div class="col-sm-9"> |
|||
<select name="levelid" style="width: 100%;"> |
|||
<option value="0" >{$delevel['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}">{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码前缀</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="prefix" class="form-control" placeholder="激活码前缀" /> |
|||
<span class="help-block">可以用于区分不同商家的激活码</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码备注</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="remark" class="form-control" placeholder="请输入激活码备注" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="tab-pane active" id="tab_notice" style="display: none;"> |
|||
<form action="{php echo web_url('halfcard/halfcode/csv_add')}" enctype="multipart/form-data" method="post" class="form-horizontal form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">基本信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group uploade"> |
|||
<label class="col-sm-2 control-label">上传文件:</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" name="csv_file" type="file" value=""> |
|||
<span class="help-block">请<a href="{URL_MODULE}web/resource/download/activationcode.csv" target="_blank">点此下载样例文件</a></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input name="submit" type="submit" class="btn btn-primary min-width" value="上传"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function() { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function(e) { |
|||
e.preventDefault(); //阻止a链接的跳转行为 |
|||
$(this).tab('show'); //显示当前选中的链接及关联的content |
|||
$("#tab_notice").show(); |
|||
}) |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,181 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">激活码列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/halfcode/add');}" class="btn btn-primary">添加激活码</a> |
|||
<a href="{php echo web_url('halfcard/halfcode/remark')}" data-toggle='ajaxModal' class="btn btn-success">批量修改备注</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="halfcode" /> |
|||
<input type="hidden" name="do" value="lists"/> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}"/> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0 || empty($_GPC['status'])}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo filter_url('status:1');}" class="btn {if intval($_GPC['status']) == 1}btn-primary{else}btn-default{/if}">已使用</a> |
|||
<a href="{php echo filter_url('status:2');}" class="btn {if intval($_GPC['status']) == 2}btn-primary{else}btn-default{/if}">未使用</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control" style="width:180px;"> |
|||
<option value="">关键字类型</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>激活码</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>时长</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>激活人昵称</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>备注</option> |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">生成时间</label> |
|||
<div class="col-md-9"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
<button class="btn btn-default" id="output">导出</button> |
|||
<input type="hidden" id="outflag" name="export" value="0" > |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#outflag').val(0); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
$('#output').click(function(){ |
|||
$('#outflag').val(1); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:40px;" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" style="margin-top: 0;"/> ID</th> |
|||
<th class="text-center" style="width:90px;">所属代理</th> |
|||
<!--电商联盟定制内容--> |
|||
{if file_exists(PATH_MODULE . 'lsh.log')} |
|||
<th class="text-center" style="width:90px;">挪车代理</th> |
|||
{/if} |
|||
<th class="text-center" style="width:90px;">激活码</th> |
|||
<th class="text-center" style="width:50px;">时长</th> |
|||
<th class="text-center" style="width:50px;">状态</th> |
|||
<th class="text-center" style="width:80px;">激活等级</th> |
|||
<th class="text-center" style="width:80px;">备注</th> |
|||
<th class="text-center" style="width:100px;">使用详情</th> |
|||
<th class="text-center" style="width:120px;">生成时间</th> |
|||
<th class="text-center" style="width:80px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center" > |
|||
<td class="text-center" style="width:40px; height: auto;"> |
|||
<input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" style="position: absolute;margin-top: 0;" /> {$item['id']} |
|||
<td>{$item['agentname']}</td> |
|||
{if file_exists(PATH_MODULE . 'lsh.log')} |
|||
<td>{$item['caragentname']}</td> |
|||
{/if} |
|||
<td>{$item['number']}</td> |
|||
<td> |
|||
{$item['days']}天 |
|||
</td> |
|||
<td> |
|||
{if $item['status']==1} |
|||
<span id="" class="label label-default"> |
|||
已使用 |
|||
</span> |
|||
{else if $item['status']==2} |
|||
<span id="" class="label label-danger"> |
|||
已锁定 |
|||
{else} |
|||
<span id="" class="label label-success"> |
|||
未使用 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{$item['levelname']} |
|||
</td> |
|||
<td> |
|||
{$item['remark']} |
|||
</td> |
|||
<td> |
|||
{if !empty($item['member'])} |
|||
<div class="img" style="text-align: left;"> |
|||
<img style="height: 3rem;width: 3rem;" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['member']['avatar'])}"> |
|||
<span>{$item['member']['nickname']}</span> |
|||
</div> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
<td> |
|||
<a href="{php echo web_url('halfcard/halfcode/editcode',array('id'=>$item['id']))}" data-toggle="ajaxModal"> |
|||
<button type="button" class="btn btn-primary btn-sm" title="编辑">编辑</button> |
|||
</a> |
|||
<a data-toggle='ajaxPost' href="{php echo web_url('halfcard/halfcode/delcode',array('id'=>$item['id']))}" data-confirm="确认删除该类型?" class="btn btn-danger btn-sm">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div id="de1" class="pull-left"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete">删除选中记录</a> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcode/deletejihuoqr')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
</script> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,114 @@ |
|||
<form action="{php echo web_url('halfcard/halfcode/editcode')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">编辑激活码</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活时长</label> |
|||
<div class="col-sm-7 col-xs-12"> |
|||
<div class="input-group"> |
|||
<input type="text" name="days" class="form-control" value="{$code['days']}" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if file_exists(IA_ROOT . '/addons/'.MODULE_NAME.'/pTLjC21GjCGj.log')} |
|||
<!--某个用户定制的开通一卡通时赠送金额功能--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">赠送金额</label> |
|||
<div class="col-sm-7 col-xs-12"> |
|||
<div class="input-group"> |
|||
<input type="text" name="give_price" class="form-control" value="{$code['give_price']}" /> |
|||
<span class="input-group-addon">¥</span> |
|||
</div> |
|||
<span class="help-block">用户使用当前激活码所赠送的金额</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用代理</label> |
|||
<div class="col-md-7"> |
|||
<select name="aid" style="width: 100%;"> |
|||
<option value="0" {if $code['aid'] == 0 || empty($code['aid'])} selected="selected" {/if} >全部代理</option> |
|||
{loop $agents $agent} |
|||
<option value="{$agent['id']}" {if $code['aid'] == $agent['id']} selected="selected" {/if} >{$agent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{if file_exists(PATH_MODULE . 'lsh.log')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">所属挪车代理</label> |
|||
<div class="col-md-7"> |
|||
<select name="caraid" style="width: 100%;"> |
|||
<option value="0" {if $code['caraid'] == 0 || empty($code['caraid'])} selected="selected" {/if} >总平台</option> |
|||
{loop $caragents $caragent} |
|||
<option value="{$caragent['id']}" {if $code['caraid'] == $caragent['id']} selected="selected" {/if} >{$caragent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员等级</label> |
|||
<div class="col-md-7"> |
|||
<select name="levelid" style="width: 100%;"> |
|||
<option value="0" {if $code['levelid'] == 0 || empty($code['levelid'])} selected="selected" {/if} >{$_W['wlsetting']['halflevel']['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}" {if $code['levelid'] == $level['id']} selected="selected" {/if} >{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">修改备注</label> |
|||
<div class="col-sm-7 col-xs-12"> |
|||
<div class="input-group" style="width: 100%;"> |
|||
<input type="text" name="remark" value="{$code['remark']}" class="form-control"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">更新范围</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="range" checked="checked"> 仅此条 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="range" > 同备注 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$code['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<script> |
|||
$(document).on('show.bs.modal', '.modal', function(event) { |
|||
$(this).appendTo($('body')); |
|||
}).on('shown.bs.modal', '.modal.in', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}).on('hidden.bs.modal', '.modal', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}); |
|||
|
|||
|
|||
function setModalsAndBackdropsOrder() { |
|||
var modalZIndex = 1040; |
|||
$('.modal.in').each(function(index) { |
|||
var $modal = $(this); |
|||
modalZIndex++; |
|||
$modal.css('zIndex', modalZIndex); |
|||
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1); |
|||
}); |
|||
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden'); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,30 @@ |
|||
<form action="{php echo web_url('halfcard/halfcode/remark')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">编辑激活码备注</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码范围</label> |
|||
<div class="col-sm-6 col-xs-12"> |
|||
<input type="text" class="form-control" placeholder="" name="id_num" value="" /> |
|||
<span class="help-block">请输入激活码ID,参考形式:100,400</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">新的备注</label> |
|||
<div class="col-sm-6 col-xs-12"> |
|||
<input type="text" class="form-control" placeholder="" name="remark" value="" /> |
|||
<span class="help-block">用于区分激活码不同场景</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,156 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">添加卡券</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="commentForm"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_rush"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">卡券信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">卡券标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="coupon[title]" class="form-control" value="{$coupon['title']}" placeholder="填写活动名称,默认与商户名称相同" id="storetitle" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否收费</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#couprice').hide();" > |
|||
<input type="radio" value="0" name="coupon[is_charge]" {if $coupon['is_charge'] == 0 || empty($coupon) } checked {/if}>免费 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#couprice').show();" > |
|||
<input type="radio" value="1" name="coupon[is_charge]" {if $coupon['is_charge'] == 1 } checked {/if}>收费 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="couprice" {if $coupon['is_charge'] == 0 || empty($coupon) } style="display: none;" {else} style="display: block;" {/if} > |
|||
<label class="col-sm-2 control-label">卡券价格</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="coupon[price]" class="form-control" value="{$coupon['price']}" placeholder="用于展示卡券价值,请填入正整数" id="price" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">外链地址</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="coupon[extlink]" class="form-control" value="{$coupon['extlink']}" placeholder="卡券要跳转的外部链接" id="extlink" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">卡券logo</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('coupon[logo]', $coupon['logo']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">卡券提供方名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="extinfo[storename]" class="form-control" value="{$coupon['storename']}" placeholder="卡券提供方名称"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">简要说明</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="coupon[sub_title]" class="form-control" value="{$coupon['sub_title']}" id="use_limit" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用等级</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control-block"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$coupon['level'])} checked {/if} name="coupon[level][]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$coupon['level'])} checked {/if} name="coupon[level][]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
</div> |
|||
<span class="help-block">如果全都不勾选则默认全等级可用</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('datetime',array('starttime'=>date('Y-m-d H:i:s',$datestarttime),'endtime'=>date('Y-m-d H:i:s',$dateendtime)));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">卡券排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" class="form-control" name="coupon[indexorder]" value="{$coupon[indexorder]}"/> |
|||
<span class="help-block">请输入整数数字,序号越大,排序靠前</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('coupon[description]', $coupon['description']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">列表显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="coupon[is_indexshow]" {if $coupon['is_indexshow'] == 0 || empty($coupon) } checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="coupon[is_indexshow]" {if $coupon['is_indexshow'] == 1 } checked {/if}>禁用 |
|||
</label> |
|||
<div class="help-block">关闭后,在首页和一卡通列表页面不会显示该卡券</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="coupon[status]" {if $coupon['status'] == 2 || empty($coupon) } checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
}); |
|||
</script> |
|||
<script language='javascript'> |
|||
$('#commentForm').submit(function(){ |
|||
if($('#storetitle').val() == '') { |
|||
util.tips("请填写卡券名称"); |
|||
$('#storetitle').focus(); |
|||
return false; |
|||
} |
|||
if($('#extlink').val() == '') { |
|||
util.tips("请填写外部链接地址"); |
|||
$('#extlink').focus(); |
|||
return false; |
|||
} |
|||
return true; |
|||
}); |
|||
|
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,148 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">添加特权</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="commentForm"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_rush"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">特权信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">特权标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="halfcard[title]" class="form-control" value="{$halfcard['title']}" placeholder="填写活动名称,默认与商户名称相同" id="storetitle" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">特权折扣</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="halfcard[activediscount]" class="form-control" value="{$halfcard['activediscount']}" placeholder="特权的折扣,保留一位小数" id="discount" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">外链地址</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="halfcard[extlink]" class="form-control" value="{$halfcard['extlink']}" placeholder="礼包要跳转的外部链接" id="extlink" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">特权提供方名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="extinfo[storename]" class="form-control" value="{$halfcard['storename']}" placeholder="礼包提供方名称"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权提供方logo</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('extinfo[storelogo]', $halfcard['storelogo']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">简要说明</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="halfcard[limit]" class="form-control" value="{$halfcard['limit']}" id="use_limit" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用等级</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control-block"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$halfcard['level'])} checked {/if} name="halfcard[level][]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$halfcard['level'])} checked {/if} name="halfcard[level][]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
</div> |
|||
<span class="help-block">如果全都不勾选则默认全等级可用</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">定时活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#timingstatus').show()"> |
|||
<input type="radio" value="1" name="halfcard[timingstatus]" {if $halfcard['timingstatus'] == 1 } checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#timingstatus').hide()"> |
|||
<input type="radio" value="0" name="halfcard[timingstatus]" {if $halfcard['timingstatus'] == 0 || empty($halfcard) } checked {/if}>禁用 |
|||
</label> |
|||
<div class="help-block">在限定时间之外的活动会被自动下架</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="timingstatus" {if $halfcard['timingstatus'] == 0 || empty($halfcard)} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('datetime',array('starttime'=>date('Y-m-d H:i:s',$datestarttime),'endtime'=>date('Y-m-d H:i:s',$dateendtime)));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">特权排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" class="form-control" name="halfcard[sort]" value="{$halfcard[sort]}"/> |
|||
<span class="help-block">请输入整数数字,序号越大,排序靠前</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('halfcard[describe]', $halfcard['describe']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="halfcard[status]" {if $halfcard['status'] == 1 || empty($halfcard) } checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
}); |
|||
</script> |
|||
<script language='javascript'> |
|||
$('#commentForm').submit(function(){ |
|||
if($('#storetitle').val() == '') { |
|||
util.tips("请填写特权名称"); |
|||
$('#storetitle').focus(); |
|||
return false; |
|||
} |
|||
if($('#discount').val() == '') { |
|||
util.tips("请填写特权折扣"); |
|||
$('#discount').focus(); |
|||
return false; |
|||
} |
|||
if($('#extlink').val() == '') { |
|||
util.tips("请填写外部链接地址"); |
|||
$('#extlink').focus(); |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,160 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">添加礼包</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="commentForm"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_rush"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">礼包信息</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[title]" class="form-control" value="{$package['title']}" placeholder="填写活动名称,默认与商户名称相同" id="storetitle" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包价值</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[price]" class="form-control" value="{$package['price']}" placeholder="用于展示礼包价值,请填入正整数" id="price" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">外链地址</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[extlink]" class="form-control" value="{$package['extlink']}" placeholder="礼包要跳转的外部链接" id="extlink" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包提供方名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="extinfo[storename]" class="form-control" value="{$package['storename']}" placeholder="礼包提供方名称"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包提供方logo</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('extinfo[storelogo]', $package['storelogo']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">简要说明</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[limit]" class="form-control" value="{$package['limit']}" id="use_limit" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用等级</label> |
|||
<div class="col-sm-9"> |
|||
<div class="form-control-block"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$package['level'])} checked {/if} name="package[level][]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$package['level'])} checked {/if} name="package[level][]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
</div> |
|||
<span class="help-block">如果全都不勾选则默认全等级可用</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">定时活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#packtimestatus').show()"> |
|||
<input type="radio" value="1" name="package[packtimestatus]" {if $package['packtimestatus'] == 1 } checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#packtimestatus').hide()"> |
|||
<input type="radio" value="0" name="package[packtimestatus]" {if $package['packtimestatus'] == 0 || empty($package) } checked {/if}>禁用 |
|||
</label> |
|||
<div class="help-block">在限定时间之外的活动会被自动下架</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="packtimestatus" {if $package['packtimestatus'] == 0 || empty($package)} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('datetime',array('starttime'=>date('Y-m-d H:i:s',$datestarttime),'endtime'=>date('Y-m-d H:i:s',$dateendtime)));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" class="form-control" name="package[sort]" value="{$package[sort]}"/> |
|||
<span class="help-block">请输入整数数字,序号越大,排序靠前</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('package[describe]', $package['describe']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">列表显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="package[listshow]" {if $package['listshow'] == 0 || empty($package) } checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="package[listshow]" {if $package['listshow'] == 1 } checked {/if}>禁用 |
|||
</label> |
|||
<div class="help-block">关闭后,在首页和一卡通列表页面不会显示该礼包</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="package[status]" {if $package['status'] == 1 || empty($package) } checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
}); |
|||
</script> |
|||
<script language='javascript'> |
|||
$('#commentForm').submit(function(){ |
|||
if($('#storetitle').val() == '') { |
|||
util.tips("请填写礼包名称"); |
|||
$('#storetitle').focus(); |
|||
return false; |
|||
} |
|||
if($('#price').val() == '') { |
|||
util.tips("请填写礼包价值"); |
|||
$('#price').focus(); |
|||
return false; |
|||
} |
|||
if($('#extlink').val() == '') { |
|||
util.tips("请填写外部链接地址"); |
|||
$('#extlink').focus(); |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,68 @@ |
|||
<div class="app-form"> |
|||
<form {if $ac} action="{php echo web_url('halfcard/halftype/editmember')}" {else} action="{php echo web_url('halfcard/halfcard_web/editmember')}" {/if} method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">编辑会员</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">过期时间</label> |
|||
<div class="col-md-7"> |
|||
{php echo tpl_form_field_date('expiretime',date('Y-m-d H:i:s',$halfmember['expiretime']),true);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员等级</label> |
|||
<div class="col-md-7"> |
|||
<select name="levelid" style="width: 100%;"> |
|||
<option value="0" {if $halfmember['levelid'] == 0 || empty($halfmember['levelid'])} selected="selected" {/if} >{$delevel['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}" {if $halfmember['levelid'] == $level['id']} selected="selected" {/if} >{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="disable" {if $halfmember['disable'] == 0 || empty($halfmember['disable'])} checked="checked" {/if} > 启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="disable" {if $halfmember['disable'] == 1 } checked="checked" {/if} > 禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$halfmember['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<script> |
|||
$(document).on('show.bs.modal', '.modal', function(event) { |
|||
$(this).appendTo($('body')); |
|||
}).on('shown.bs.modal', '.modal.in', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}).on('hidden.bs.modal', '.modal', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}); |
|||
|
|||
|
|||
function setModalsAndBackdropsOrder() { |
|||
var modalZIndex = 1040; |
|||
$('.modal.in').each(function(index) { |
|||
var $modal = $(this); |
|||
modalZIndex++; |
|||
$modal.css('zIndex', modalZIndex); |
|||
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1); |
|||
}); |
|||
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden'); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,114 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING}) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.goods-info .all-tips{margin-left: 65px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">外链卡券</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/externallink/createcoupon')}" class="btn btn-primary">添加卡券</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="externallink" /> |
|||
<input type="hidden" name="do" value="couponlists" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">卡券状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">启用中</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">未启用</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">卡券标题</label> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:190px;text-align:center;">卡券信息</th> |
|||
<th style="width:150px; text-align:center;">简要说明</th> |
|||
<th style="width:120px; text-align: center;">属性</th> |
|||
<th style="width:150px;text-align:center;">活动时间</th> |
|||
<th style="width:90px; text-align: center;">状态</th> |
|||
<th style="width:150px; text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $couponlist $y $item} |
|||
<tr> |
|||
<td class="goods-info line-feed" style="width:190px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changecou',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改活动名" data-toggle="ajaxEdit" >{$item['title']}</a> |
|||
<p style="margin: 0;">{$item['storename']}</p> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changecou',array('id' => $item['id'],'type'=>5))}" href="javascript:;" title="修改简介" data-toggle="ajaxEdit" >{$item['sub_title']}</a> |
|||
</td> |
|||
<td class="text-center" style="width:120px;"> |
|||
<p style="margin: 0;">人气:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changecou',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改人气" data-toggle="ajaxEdit" >{$item['pv']}</a></p> |
|||
<p style="margin: 0;">排序:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changecou',array('id' => $item['id'],'type'=>3))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$item['indexorder']}</a></p> |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
<span>开始:{$item['starttime']}</span><br/> |
|||
<span>结束:{$item['endtime']}</span> |
|||
</td> |
|||
<td class="text-center" style="width:90px;"> |
|||
{if $item['status']==2}<span class="label label-success">已启用</span>{/if} |
|||
{if $item['status']!=2}<span class="label label-default">已禁用</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
<a href="{php echo web_url('halfcard/externallink/createcoupon', array('id' => $item['id']))}" class="js-edit" order-id="{$item['id']}"> 编辑 -</a> |
|||
<a data-toggle="ajaxRemove" href="{php echo web_url('halfcard/externallink/changecou',array('id' => $item['id'],'type'=>4))}" data-confirm="确认删除此卡券?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,122 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING}) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.goods-info .all-tips{margin-left: 65px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">外链特权</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/externallink/createhalfcard')}" class="btn btn-primary">添加特权</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="externallink" /> |
|||
<input type="hidden" name="do" value="halflists" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">启用中</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">未启用</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权标题</label> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:190px;text-align:center;">特权信息</th> |
|||
<th style="width:150px; text-align:center;">限制简介</th> |
|||
<th style="width:120px; text-align: center;">属性</th> |
|||
<th style="width:90px; text-align: center;">折扣</th> |
|||
<th style="width:150px;text-align:center;">活动时间</th> |
|||
<th style="width:90px; text-align: center;">状态</th> |
|||
<th style="width:150px; text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $halflist $y $item} |
|||
<tr> |
|||
<td class="goods-info line-feed" style="width:190px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changehalf',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改活动名" data-toggle="ajaxEdit" >{$item['title']}</a> |
|||
<p style="margin: 0;">{$item['storename']}</p> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changehalf',array('id' => $item['id'],'type'=>5))}" href="javascript:;" title="修改简介" data-toggle="ajaxEdit" >{$item['limit']}</a> |
|||
</td> |
|||
<td class="text-center" style="width:120px;"> |
|||
<p style="margin: 0;">人气:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changehalf',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改人气" data-toggle="ajaxEdit" >{$item['pv']}</a></p> |
|||
<p style="margin: 0;">排序:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changehalf',array('id' => $item['id'],'type'=>3))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$item['sort']}</a></p> |
|||
</td> |
|||
<td class="text-center" style="width:90px;"> |
|||
<span class="label label-info">{$item['activediscount']}折</span> |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
{if $item['timingstatus']} |
|||
<span>开始:{$item['starttime']}</span><br/> |
|||
<span>结束:{$item['endtime']}</span> |
|||
{else} |
|||
<p>无期限</p> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:90px;"> |
|||
{if $item['status']==1}<span class="label label-success">已启用</span>{/if} |
|||
{if $item['status']==0}<span class="label label-default">已禁用</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
<a href="{php echo web_url('halfcard/externallink/createhalfcard', array('id' => $item['id']))}" class="js-edit" order-id="{$item['id']}"> 编辑 -</a> |
|||
<a data-toggle="ajaxRemove" href="{php echo web_url('halfcard/externallink/changehalf',array('id' => $item['id'],'type'=>4))}" data-confirm="确认删除此活动?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,118 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING}) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.goods-info .all-tips{margin-left: 65px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">外链礼包</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/externallink/createpackage')}" class="btn btn-primary">添加礼包</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="externallink" /> |
|||
<input type="hidden" name="do" value="lists" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">启用中</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">未启用</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包标题</label> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:190px;text-align:center;">礼包信息</th> |
|||
<th style="width:150px; text-align:center;">限制简介</th> |
|||
<th style="width:120px; text-align: center;">属性</th> |
|||
<th style="width:150px;text-align:center;">活动时间</th> |
|||
<th style="width:90px; text-align: center;">状态</th> |
|||
<th style="width:150px; text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $packagelist $y $item} |
|||
<tr> |
|||
<td class="goods-info line-feed" style="width:190px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changeinfo',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改活动名" data-toggle="ajaxEdit" >{$item['title']}</a> |
|||
<p style="margin: 0;">{$item['storename']}</p> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changeinfo',array('id' => $item['id'],'type'=>5))}" href="javascript:;" title="修改简介" data-toggle="ajaxEdit" >{$item['limit']}</a> |
|||
</td> |
|||
<td class="text-center" style="width:120px;"> |
|||
<p style="margin: 0;">人气:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changeinfo',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改人气" data-toggle="ajaxEdit" >{$item['pv']}</a></p> |
|||
<p style="margin: 0;">排序:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/externallink/changeinfo',array('id' => $item['id'],'type'=>3))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$item['sort']}</a></p> |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
{if $item['packtimestatus']} |
|||
<span>开始:{$item['datestarttime']}</span><br/> |
|||
<span>结束:{$item['dateendtime']}</span> |
|||
{else} |
|||
<p>无期限</p> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:90px;"> |
|||
{if $item['status']==1}<span class="label label-success">已启用</span>{/if} |
|||
{if $item['status']==0}<span class="label label-default">已禁用</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
<a href="{php echo web_url('halfcard/externallink/createpackage', array('id' => $item['id']))}" class="js-edit" order-id="{$item['id']}"> 编辑 -</a> |
|||
<a data-toggle="ajaxRemove" href="{php echo web_url('halfcard/externallink/changeinfo',array('id' => $item['id'],'type'=>4))}" data-confirm="确认删除此活动?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,411 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">用户列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<style type='text/css'> |
|||
.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.all-tips{margin-left: 65px;} |
|||
</style> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" {if $ac} value="{$ac}"{else} value="halfcard_web" {/if} /> |
|||
<input type="hidden" name="do" value="memberlist" /> |
|||
<input type="hidden" name="usetype" value="{$_GPC['usetype']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('usetype:0');}" class="btn {if $_GPC['usetype'] == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('usetype:1');}" class="btn {if $_GPC['usetype'] == 1}btn-primary{else}btn-default{/if}">使用中</a> |
|||
<a href="{php echo wl_filter_url('usetype:2');}" class="btn {if $_GPC['usetype'] == 2}btn-primary{else}btn-default{/if}">已过期</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>持卡人名称</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>用户昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>用户电话</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>实卡编号</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间筛选</label> |
|||
<div class="col-md-3"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="">请选择时间类型</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>开通时间</option> |
|||
<option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>过期时间</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
<button class="btn btn-default" id="output">导出</button> |
|||
<input type="hidden" value="0" name="outflag" id="outflag" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#outflag').val(0); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
$("#output").click(function(){ |
|||
$('#outflag').val(1); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
function sandh(asd){ |
|||
if ($(asd).val() == 3) { |
|||
$('#keyword').hide(); |
|||
$('#usetype').show(); |
|||
}else{ |
|||
$('#keyword').show(); |
|||
$('#usetype').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width: 30px;"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th style="width:130px;text-align:center;">持卡人信息</th> |
|||
<th style="width:50px;text-align: center;">用户电话</th> |
|||
<th style="width:50px;text-align: center;">用户昵称</th> |
|||
<th style="width:50px;text-align: center;">所属代理</th> |
|||
{if is_file(PATH_MODULE.'TnSrtWDJ.log')} |
|||
<th style="width:80px;text-align: center;">用户车型</th> |
|||
<th style="width:80px;text-align: center;">用户车牌号</th> |
|||
{/if} |
|||
{if is_file(PATH_MODULE.'N814.log')} |
|||
<th style="width:80px;text-align: center;">银行卡号</th> |
|||
{/if} |
|||
<th style="width:100px; text-align:center;">开通时间</th> |
|||
<th style="width:50px; text-align:center;">用户状态</th> |
|||
<th style="width:60px; text-align:center;">用户等级</th> |
|||
<th style="width:100px; text-align: center;">失效时间</th> |
|||
<th style="width:170px; text-align: center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $member $y $item} |
|||
<tr> |
|||
<td><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></td> |
|||
<!--用户昵称--> |
|||
<td class="goods-info line-feed" style="width:150px;padding-left: 10px;height: 60px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<p class="" style="margin-bottom: 3px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">{$item['username']}</p> |
|||
{if $item['cardsn']}<p class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">实卡编号:{$item['cardsn']}</p>{/if} |
|||
</div> |
|||
</td> |
|||
<!--用户电话--> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['mobile']} |
|||
</td> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['nickname']} |
|||
</td> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['agentuser']} |
|||
</td> |
|||
{if is_file(PATH_MODULE.'TnSrtWDJ.log')} |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['mototype']} |
|||
</td> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['platenumber']} |
|||
</td> |
|||
{/if} |
|||
{if is_file(PATH_MODULE.'N814.log')} |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['banknum']} |
|||
</td> |
|||
{/if} |
|||
<!--开通时间--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
<!--用户状态--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;" > |
|||
{if $item['status'] == 1} |
|||
<span class="label label-primary">使用中</span> |
|||
{/if} |
|||
{if $item['status'] == 2} |
|||
<span class="label label-danger">已失效</span> |
|||
{/if} |
|||
{if $item['status'] == 3} |
|||
<span class="label label-warning">被禁用</span> |
|||
{/if} |
|||
</td> |
|||
<!--用户等级--> |
|||
<td class="text-center" style="width: 110px;"> |
|||
{$item['levelname']} |
|||
</td> |
|||
<!--失效时间--> |
|||
<td class="text-center" style="width: 110px;"> |
|||
{php echo date('Y-m-d H:i:s',$item['expiretime'])} |
|||
</td> |
|||
<!--操作--> |
|||
<td class="text-center wsmne" style="width: 110px;"> |
|||
{if $ac} |
|||
<a href="{php echo web_url('halfcard/halftype/editmember',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑 -</a> |
|||
{else} |
|||
<a href="{php echo web_url('halfcard/halfcard_web/editmember',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑 -</a> |
|||
{/if} |
|||
{if $item['disable'] == 1} |
|||
<a class="nodisablemember" merid = {$item['id']} href="javascript:;">解除禁用 -</a> |
|||
{else} |
|||
<a class="disablemember" merid = {$item['id']} href="javascript:;">禁用 -</a> |
|||
{/if} |
|||
<a class="deletemember" merid = {$item['id']} href="javascript:;">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<div id="de1" class="pull-left"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete pass">批量删除</a> |
|||
</div> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="modal-module-gift" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content" style="overflow: auto;"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h2>更多信息</h2> |
|||
</div> |
|||
<div class="modal-body"> |
|||
<div id="detail" class="modal-body" style="padding:0;"></div> |
|||
</div> |
|||
<div class="modal-footer" style="padding: 5px 15px;"> |
|||
<a class="btn btn-primary js-order-remark-post" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
{if $ac} |
|||
$('.wsmne').delegate('.disablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/disablemember')}", { id : id , flag : 1}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("禁用成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.nodisablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/disablemember')}", { id : id,flag : 2 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("解除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认解除禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.deletemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/deletemember')}", {id : id}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除用户可能导致记录信息错误或不全,确定要删除吗?'}); |
|||
}); |
|||
{else} |
|||
$('.wsmne').delegate('.disablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/disablemember')}", { id : id , flag : 1}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("禁用成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.nodisablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/disablemember')}", { id : id,flag : 2 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("解除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认解除禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.deletemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deletemember')}", {id : id}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除用户可能导致记录信息错误或不全,确定要删除吗?'}); |
|||
}); |
|||
{/if} |
|||
</script> |
|||
|
|||
<script type="text/javascript"> |
|||
$(function(){ |
|||
$('[name="rank_all"]').click(function() { |
|||
var checked = this.checked; |
|||
$('.js-rank').find('input:checkbox').each(function() { |
|||
this.checked = checked; |
|||
}); |
|||
}); |
|||
$('#export').click(function() { |
|||
if ($('[name="selecttime[start]"]').val() == '') { |
|||
alert('请选择下单时间'); |
|||
$(this).focus(); |
|||
return false; |
|||
}; |
|||
$(this).attr('type', 'submit').submit(); |
|||
}); |
|||
|
|||
$('.order-rank').each(function(){ |
|||
o.rank(this); |
|||
}); |
|||
|
|||
//批量删除会员 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mem_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
mem_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = mem_ids; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deletemember')}",{id:ids}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除完成!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除用户可能导致记录信息错误或不全,确定要删除吗?',placement:'right'}); |
|||
}); |
|||
|
|||
}); |
|||
|
|||
//转换日期 |
|||
var dt=$('.date1').text().replace(/^\s+|\s+$/g, ""); |
|||
var yy=dt.slice(0,4); |
|||
var mm=dt.slice(4,6); |
|||
var dd=dt.slice(6,8); |
|||
var str=(yy+'-'+mm+'-'+dd).toString(); |
|||
$('.date1').text(str); |
|||
|
|||
//二级联动切换 |
|||
$('#sel_parent').click(function(){ |
|||
|
|||
if(this.value!=0){ |
|||
$('.daterange-date').hide(); |
|||
$('#sel_child').hide(); |
|||
$(".nickname").removeAttr("style"); |
|||
$('.nickname').show(); |
|||
} |
|||
else{ |
|||
$('.daterange-date').hide(); |
|||
$('.nickname').hide(); |
|||
$('#sel_child').hide(); |
|||
$('#sel_child').attr("display","block"); |
|||
} |
|||
//alert(this.value); |
|||
//if(this.value==0) |
|||
// $('#sel_child').hide(); |
|||
}) |
|||
|
|||
$('.todetail').click(function(){ |
|||
$("#detail").html(''); |
|||
popwin = $('#modal-module-gift').modal(); |
|||
var id = $(this).attr('orderid'); |
|||
$.ajax({ |
|||
url: "{php echo web_url('halfcard/halftype/moreinfo')}&id="+id, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$("#detail").html(html); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
</script> |
|||
|
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,19 @@ |
|||
<div class="form-group sms-template-1 data-item"> |
|||
<label class="col-sm-2 control-label">Q:</label> |
|||
<div class="col-sm-9 col-xs-12"> |
|||
<div class="col-sm-3" style="margin: 0px;padding-left: 0;"> |
|||
<input type="text" name="question[]" class="form-control" value="{$data['question']}" /> |
|||
</div> |
|||
<!--<input type="text" name="data_temp[]" class="form-control valid" value="{$data['data_temp']}">--> |
|||
<div class="input-group form-group col-sm-9" style="margin: 0px;padding-right: 0;"> |
|||
<span class="input-group-addon" >A:</span> |
|||
<input type="text" name="answer[]" class="form-control valid" value="{$data['answer']}"> |
|||
<span class="input-group-addon btn btn-default data-item-delete"><i class="fa fa-remove"></i> 删除</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$(document).on('click', '.data-item-delete', function () { |
|||
$(this).closest('.data-item').remove(); |
|||
}); |
|||
</script> |
|||
@ -0,0 +1,107 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">类型列表</a></li> |
|||
</ul> |
|||
<style type="text/css"> |
|||
.page-heading { |
|||
padding: 5px 0; |
|||
border-bottom: 1px solid #ccc; |
|||
margin-bottom: 20px; |
|||
position: relative; |
|||
margin-left: 15px; |
|||
} |
|||
#material-Modal { |
|||
z-index: 2051; |
|||
} |
|||
</style> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a class="btn btn-primary" href="{php echo web_url('halfcard/halftype/editlevel')}" data-toggle="ajaxModal">增加等级</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:30px;">ID</th> |
|||
<th class="text-center" style="width:100px;">等级名称(点击修改)</th> |
|||
<th class="text-center" style="width:100px;">状态(点击修改)</th> |
|||
<th class="text-center" style="width:100px;">排序(点击修改)</th> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr class="text-center" > |
|||
<td> |
|||
0 |
|||
</td> |
|||
<td> |
|||
<a data-href="{php echo web_url('halfcard/halftype/changelevel',array('id' => 'default','type'=>1))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit" > |
|||
{$base['name']} |
|||
</a> |
|||
</td> |
|||
<td> |
|||
<span class='label label-success'>总是显示</span> |
|||
</td> |
|||
<td> |
|||
<span class='label label-success'>置顶</span> |
|||
</td> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('halfcard/halftype/editlevel',array('id'=>'default'))}" data-toggle="ajaxModal">编辑 </a> |
|||
</td> |
|||
</tr> |
|||
{loop $levels $item} |
|||
<tr class="text-center" > |
|||
<td> |
|||
{$item['id']} |
|||
</td> |
|||
<td> |
|||
<a data-href="{php echo web_url('halfcard/halftype/changelevel',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit" > |
|||
{$item['name']} |
|||
</a> |
|||
</td> |
|||
<td> |
|||
<span class="change"> |
|||
<span class='label {if $item['status']==1}label label-primary {else}label-default{/if}' |
|||
data-toggle='ajaxSwitch' |
|||
data-switch-value='{$item['status']}' |
|||
data-switch-value0='0|关闭|label label-default|{php echo web_url('halfcard/halftype/changelevel',array('type'=>3,'value'=>1,'id'=>$item['id']))}' |
|||
data-switch-value1='1|开启|label label-primary|{php echo web_url('halfcard/halftype/changelevel',array('type'=>3,'value'=>0,'id'=>$item['id']))}'> |
|||
{if $item['status']==1}开启{else}关闭{/if} |
|||
</span> |
|||
</span> |
|||
</td> |
|||
<td> |
|||
<a data-href="{php echo web_url('halfcard/halftype/changelevel',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit" > |
|||
{$item['sort']} |
|||
</a> |
|||
</td> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('halfcard/halftype/editlevel',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑 </a> |
|||
<a data-toggle="ajaxRemove" href="{php echo web_url('halfcard/halftype/changelevel',array('type'=>4,'id'=>$item['id']));}" data-confirm='确认删除此等级?'> - 删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<style> |
|||
.change:hover{ |
|||
cursor:pointer; |
|||
} |
|||
</style> |
|||
</div> |
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,62 @@ |
|||
<form action="{php echo web_url('halfcard/halftype/editlevel')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">会员等级</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级名称</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" placeholder="等级名称" name="name" id="name" class="form-control" value="{$level['name']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级卡面</label> |
|||
<div class="col-xs-12 col-sm-8 col-md-8 "> |
|||
{php echo attachment_select('cardimg',$level['cardimg'])} |
|||
<span class="help-block">不上传即用默认卡面</span> |
|||
</div> |
|||
</div> |
|||
{if $id != 'default'} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-md-7"> |
|||
<input type="text" placeholder="填入正整数,数字越大,排序靠前" name="sort" id="sort" class="form-control" value="{$level['sort']}"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="status" {if $level['status'] == 0 || empty($level['status'])} checked="checked" {/if} > 隐藏 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="status" {if $level['status'] == 1 } checked="checked" {/if} > 显示 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
{if Customized::init('integral074') > 0 } |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">拥军卡</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="army" {if $level['army'] == 0 || empty($level['army'])} checked="checked" {/if} > 否 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="army" {if $level['army'] == 1 } checked="checked" {/if} > 是 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{/if} |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$level['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,49 @@ |
|||
<div> |
|||
{if !empty($cardpic)} |
|||
<h4>{if $attest['type'] == 1}身份证{else}营业执照{/if}:</h4> |
|||
{loop $cardpic $cpi} |
|||
<img class="newmater" data-url="{$cpi}" style="width:150px;height:150px;" src="{$cpi}" /> |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
{loop $info $key $in} |
|||
<div> |
|||
{if $in['type'] == 'text' || $in['type'] == 'number'} |
|||
<h4>{$key}:{$in['value']}</h4> |
|||
{else if $in['type'] == 'pic'} |
|||
<h4>{$key}:</h4> |
|||
<img class="newmater" data-url="{$in['value']}" style="width:150px;height:150px;" src="{$in['value']}" /> |
|||
{else if $in['type'] == 'pics'} |
|||
<h4>{$key}:</h4> |
|||
{loop $in['value'] $pi} |
|||
<img class="newmater" data-url="{$pi}" style="width:150px;height:150px;" src="{$pi}" /> |
|||
{/loop} |
|||
{/if} |
|||
|
|||
{if $in['id'] == 'img'} |
|||
<h4>{$in['title']}{if $in['att_show']>0}(隐藏){/if}:</h4> |
|||
{loop $in['data'] $pi} |
|||
<img class="newmater" data-url="{$pi}" style="width:150px;height:150px;" src="{$pi}" /> |
|||
{/loop} |
|||
{else if $in['id'] == 'datetime'} |
|||
<h4>{$in['title']}{if $in['att_show']>0}(隐藏){/if}:{$in['data'][0]} - {$in['data'][1]}</h4> |
|||
{else if $in['id'] == 'city'} |
|||
<h4>{$in['title']}{if $in['att_show']>0}(隐藏){/if}:{$in['data'][0]} - {$in['data'][1]} - {$in['data'][2]}</h4> |
|||
{else if $in['id'] == 'checkbox'} |
|||
<h4>{$in['title']}{if $in['att_show']>0}(隐藏){/if}:</h4> |
|||
{loop $in['data'] $pi} |
|||
<span class="label label-danger">{$pi}</span> |
|||
{/loop} |
|||
{else} |
|||
<h4>{$in['title']}{if $in['att_show']>0}(隐藏){/if}:{$in['data']}</h4> |
|||
{/if} |
|||
</div> |
|||
{/loop} |
|||
|
|||
<script> |
|||
$(".newmater").on('click',function () { |
|||
let _this = $(this), |
|||
link = _this.data("url"); |
|||
window.open(link,"_blank"); |
|||
}); |
|||
</script> |
|||
@ -0,0 +1,239 @@ |
|||
{php include wl_template('common/header');} |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">增加类别</a></li> |
|||
</ul> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form" id="form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">一卡通类别</div> |
|||
<div class="panel-body"> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">类别名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[name]" id="name" class="form-control" value="{$data['name']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">详细信息</label> |
|||
<div class="col-sm-9"> |
|||
<textarea name="data[detail]" placeholder="请输入该卡的详细信息..." class="form-control" role="1" style="resize:none;" rows="5">{$data['detail']}</textarea> |
|||
</div> |
|||
</div> |
|||
{if $halfset['halfcardtype'] == 2} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">适用代理</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[aid]" class="form-control"> |
|||
<option value="0" {if $data['aid'] == 0}selected="selected"{/if}>通用</option> |
|||
{loop $agents $agent} |
|||
<option value="{$agent['id']}" {if $data['aid'] == $agent['id'] }selected="selected"{/if}>{$agent['agentname']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时长</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[days]" class="form-control" value="{$data['days']}" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >价格</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">现价</span> |
|||
<input type="text" name="data[price]" class="form-control" value="{$data['price']}" /> |
|||
<span class="input-group-addon">¥,原价</span> |
|||
<input type="text" name="data[old_price]" class="form-control" value="{$data['old_price']}" /> |
|||
<span class="input-group-addon">¥</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if file_exists(IA_ROOT . '/addons/'.MODULE_NAME.'/pTLjC21GjCGj.log')} |
|||
<!--某个用户定制的开通一卡通时赠送金额功能--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >赠送金额</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[give_price]" class="form-control" value="{$data['give_price']}" /> |
|||
</div> |
|||
<span class="help-block">用户开通当前一卡通所赠送的金额</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">匹配等级</label> |
|||
<div class="col-md-9"> |
|||
<select name="data[levelid]" style="width: 100%;"> |
|||
<option value="0" {if $data['levelid'] == 0 || empty($data['levelid'])} selected="selected" {/if} >{$delevel['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}" {if $data['levelid'] == $level['id']} selected="selected" {/if} >{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >可开通次数</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[num]" class="form-control" value="{$data['num']}" /> |
|||
<span class="input-group-addon">次</span> |
|||
</div> |
|||
<span class="help-block">不填或则填0表示不限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-md-9"> |
|||
<input type="number" min="0" name="data[sort]" class="form-control" value="{$data['sort']}" /> |
|||
<span class="help-block">数字越大越靠前</span> |
|||
</div> |
|||
</div> |
|||
{if $_W['wlsetting']['distribution']['switch']} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否参与分销</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline" onclick="distri(1)"> |
|||
<input type="radio" id="inlineRadio5" name="data[isdistri]" value="0" {if intval($data['isdistri']) != 1}checked="checked"{/if} > |
|||
<label for="inlineRadio5"> 参与 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" onclick="distri(2)"> |
|||
<input type="radio" id="inlineRadio6" name="data[isdistri]" value="1" {if intval($data['isdistri']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio6"> 不参与 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="distridiv" {if $data['isdistri']} style="display: none;" {/if} > |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >一级分销结算金额</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[onedismoney]" class="form-control" value="{$data['onedismoney']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if $_W['wlsetting']['distribution']['ranknum'] > 1} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >二级分销结算金额</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[twodismoney]" class="form-control" value="{$data['twodismoney']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $_W['wlsetting']['distribution']['ranknum'] > 2} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >三级分销结算金额</label> |
|||
<div class="col-md-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[threedismoney]" class="form-control" value="{$data['threedismoney']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
{/if} |
|||
{if !empty($paidlist)} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">支付有礼</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[paidid]" class="form-control chosen-select"> |
|||
<option value="" {if empty($data['paidid'])}selected="selected"{/if}>请选择支付有礼</option> |
|||
{loop $paidlist $pai2} |
|||
<option value="{$pai2['id']}" {if $data['paidid'] == $pai2['id']}selected="selected"{/if}>{$pai2['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否可用于续费</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[renew]" value="0" {if intval($data['renew']) == 0}checked="checked"{/if}>是 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[renew]" value="1" {if intval($data['renew']) == 1}checked="checked"{/if}>否 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[renew]" value="2" {if intval($data['renew']) == 2}checked="checked"{/if}>只能用于续费 |
|||
</label> |
|||
<span class="help-block">已开通的一卡通会员是否可以使用此类型进行续费延期</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否推荐</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio1" name="data[is_hot]" value="1" {if intval($data['is_hot']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio1"> 是 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio2" name="data[is_hot]" value="0" {if intval($data['is_hot']) != 1}checked="checked"{/if} > |
|||
<label for="inlineRadio2"> 否 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否启用</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio3" name="data[status]" value="1" {if intval($data['status']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio3"> 是 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio4" name="data[status]" value="2" {if intval($data['status']) != 1}checked="checked"{/if} > |
|||
<label for="inlineRadio4"> 否 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if is_file(PATH_MODULE.'TnSrtWDJ.log')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">仅限扫码显示</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[qrshow]" value="0" {if intval($data['qrshow']) == 0}checked="checked"{/if}>否 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[qrshow]" value="1" {if intval($data['qrshow']) == 1}checked="checked"{/if}>是 |
|||
</label> |
|||
<span class="help-block">仅限扫描推广会员海报进入显示</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="id" value="{$data['id']}" /> |
|||
<input type="hidden" name="postType" value="{$_GPC['postType']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
function distri(flag){ |
|||
if (flag == 1) { |
|||
$('#distridiv').show(); |
|||
} else{ |
|||
$('#distridiv').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,75 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type="text/css"> |
|||
.page-heading { |
|||
padding: 5px 0; |
|||
border-bottom: 1px solid #ccc; |
|||
margin-bottom: 20px; |
|||
position: relative; |
|||
margin-left: 15px; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">类型列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/halftype/add')}" class="btn btn-primary">增加类别</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:120px;">类型名称</th> |
|||
<th class="text-center" style="width:60px;">时长</th> |
|||
<th class="text-center" style="width:100px;">价格</th> |
|||
<th class="text-center" style="width:100px;">匹配等级</th> |
|||
<th class="text-center" style="width:40px;">排序</th> |
|||
<th class="text-center" style="width:80px;">是否启用</th> |
|||
<th class="text-center" style="width:80px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center" > |
|||
<td> |
|||
{$item['name']} |
|||
</td> |
|||
<td> |
|||
{$item['days']}天 |
|||
</td> |
|||
<td>{$item['price']}</td> |
|||
<td>{$item['levelname']}</td> |
|||
<td>{$item['sort']}</td> |
|||
<td>{if $item['status']==1}<label class="label label-primary">启用</label>{else}<label class="label label-default">禁用</label>{/if}</td> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('halfcard/halftype/add',array('id'=>$item['id']))}">编辑 </a> |
|||
-<a data-toggle='ajaxPost' href="{php echo web_url('halfcard/halftype/delType',['id' => $item['id']])}" data-confirm="确认删除该类型?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,281 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.trbody td{text-align: center;vertical-align:top;border-left:1px solid #ccc;border-bottom: 1px solid #ddd;} |
|||
.order-rank img{width:16px;height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all;overflow:hidden;background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
.col-md-1{padding-right: 0px;} |
|||
.all-tips{margin-left: 65px;} |
|||
span.effect-time{font-size: 12px;display: block;font-weight: 500;} |
|||
.row.row-fix, .form-group.form-group-fix{margin-left: -15px;margin-right: -15px;width: 500px;} |
|||
button.btn.btn-default.daterange.daterange-date{float: left;position: absolute;z-index: 100;} |
|||
#sel_child{z-index: 10;width: 200px;position: absolute;display: none;} |
|||
.show1{display: block;} |
|||
.hide1{display: none;} |
|||
.sty{display: block;width: 100%;font-size: 13px;height: 46px;overflow: hidden;white-space: nowrap;line-height: 46px;text-overflow: ellipsis;text-align: center;} |
|||
.spe{display: inline-block;text-align: center;display: block;height: 33px;margin-left: -12px;padding-top: 0px;line-height: 33px;} |
|||
.table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{white-space: normal;} |
|||
span.ppp{text-align: center;display: inline-block;font-size: 14px;width: 100%;overflow: hidden;text-overflow: ellipsis;color: #e43;} |
|||
select#sel_parent{z-index: 1000;} |
|||
.nickname{margin-left: 94px;height: 34px;width: 200px;display: block;} |
|||
.col-xs-12.col-sm-6.col-sm-9.col-lg-6{z-index: 9999;} |
|||
.start-time{font-size: 12px;} |
|||
.end-time{font-size: 12px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active" ><a href="javascript:;">使用记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" {if $ac} value="{$ac}" {else} value="halfcard_web" {/if} /> |
|||
<input type="hidden" name="do" {if $ac} value="uselists" {else} value="userhalfcardlist" {/if} /> |
|||
<input type="hidden" name="type" value="{$type}" /> |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('type:1');}" class="btn {if $type == 1}btn-primary{else}btn-default{/if}">特权</a> |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if $type == 2}btn-primary{else}btn-default{/if}">礼包</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>活动信息</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>商户信息</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>持卡人姓名</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>持卡人电话</option> |
|||
<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>核销员姓名</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用时间</label> |
|||
<div class="col-md-2"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="">关闭</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>开启</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-3"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" id="export" value="0" name="export" /> |
|||
<button class="btn btn-default" id="search"><i class="fa fa-search"></i> 搜索</button> |
|||
<button class="btn btn-default btn-w-m" id="search2"><i class="fa fa-download"></i> 导出记录</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#export').val(0); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
$("#search2").click(function(){ |
|||
$('#export').val(1); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:30px;" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th style="width:150px;text-align:center;">活动信息</th> |
|||
<th style="width:120px ;text-align: center;">商户信息</th> |
|||
<th style="width:150px;text-align: center;">用户信息</th> |
|||
{if $type != 2} |
|||
<th style="width:80px; text-align:center;">订单金额</th> |
|||
<th style="width:80px; text-align: center;">支付金额</th> |
|||
{else} |
|||
<th style="width:100px; text-align:center;">领取时间</th> |
|||
{/if} |
|||
<th style="width:80px; text-align:center;">核销员</th> |
|||
<th style="width:100px; text-align:center;">使用时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $halfcard $y $item} |
|||
<tr> |
|||
<td class="text-center" style="width:40px; height: auto;"> |
|||
<center><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></center> |
|||
</td> |
|||
<!--一卡通内容--> |
|||
<td class="goods-info line-feed" style="width:180px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<p class="" style="margin: 0;overflow : hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp:2;-webkit-box-orient: vertical;">{$item['title']}</p> |
|||
</div> |
|||
</td> |
|||
<!--商户信息--> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<p style="margin: 0;">{$item['storename']}</p> |
|||
</td> |
|||
<!--用户信息--> |
|||
<td class="goods-info line-feed" style="width:150px; padding-left: 10px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$item['username']}</span> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$item['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
{if $type != 2} |
|||
<td class="text-center" style="width:80px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
¥{$item['ordermoney']} |
|||
</td> |
|||
<td class="text-center" style="width:80px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<p style="margin-bottom: 5px;">¥{$item['realmoney']}</p>{if $item['freeflag']} <span class="label label-success">特权日</span>{/if} |
|||
</td> |
|||
{else} |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
{/if} |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['vername']} |
|||
</td> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['usetime']} |
|||
{php echo date('Y-m-d H:i:s',$item['usetime'])} |
|||
{else} |
|||
<span class="label label-warning">未使用</span> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div id="de1" class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete">删除选中记录</a> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
$('#output').click(function(){ |
|||
var orderType = '{$_GPC['orderType']}'; |
|||
var status = '{$_GPC['status']}'; |
|||
var paytype = '{$_GPC['pay_type']}'; |
|||
var keywordtype = '{$_GPC['keywordtype']}'; |
|||
var keyword = '{$_GPC['keyword']}'; |
|||
var timetype = '{$_GPC['timetype']}'; |
|||
var times = "{$_GPC['time']['start']}"; |
|||
var timee = "{$_GPC['time']['end']}"; |
|||
location.href = "{php echo web_url('halfcard/order/output')}&orderType="+orderType+"&status="+status+"&paytype="+paytype+"&keywordtype="+keywordtype+"&keyword="+keyword+"&timetype="+timetype+"×="+times+"&timee="+timee; |
|||
}); |
|||
{if $ac} |
|||
$(function(){ |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/deleteHalfcardRecord')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
{else} |
|||
$(function(){ |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deleteHalfcardRecord')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
{/if} |
|||
|
|||
|
|||
//转换日期 |
|||
var dt=$('.date1').text().replace(/^\s+|\s+$/g, ""); |
|||
var yy=dt.slice(0,4); |
|||
var mm=dt.slice(4,6); |
|||
var dd=dt.slice(6,8); |
|||
var str=(yy+'-'+mm+'-'+dd).toString(); |
|||
$('.date1').text(str); |
|||
|
|||
//二级联动切换 |
|||
$('#sel_parent').click(function(){ |
|||
if(this.value!=0){ |
|||
$('#sel_child').hide(); |
|||
$(".nickname").removeAttr("style"); |
|||
$('.nickname').show(); |
|||
}else{ |
|||
$('.nickname').hide(); |
|||
$('#sel_child').hide(); |
|||
$('#sel_child').attr("display","block"); |
|||
} |
|||
}) |
|||
|
|||
|
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,82 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li ><a href="javascript:;">添加权益</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data"> |
|||
<input type="hidden" name="id" value="{$nav['id']}" /> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading"> |
|||
会员权益设置 |
|||
</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="nav[displayorder]" placeholder="默认排序为0" class="form-control" value="{$nav['displayorder']}" > |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">权益标题<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="nav[name]" required class="form-control" value="{$nav['name']}" > |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">标题颜色</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="color" name="nav[color]" required id="color" value="{$nav['color']}" class="form-control"> |
|||
<span id="reset" class="input-group-addon btn btn-default">重置</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">权益缩略图<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('nav[thumb]', $nav['thumb'])} |
|||
<span class="help-block">建议图片大小80*80</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">权益连接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" value="{$nav['link']}" readonly="readonly" class="form-control valid" name="link" placeholder="" id="advlink"> |
|||
<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
</div> |
|||
<span class="help-block">不填则跳转到用户权益说明页面</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="enabled" {if $nav['enabled']==1}checked{/if}>是 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="enabled" {if $nav['enabled']==0}checked{/if}>否 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('input[name="nav[thumb]"]').attr('required','required'); |
|||
|
|||
$("#reset").on('click',function(){ |
|||
$("#color").val('#333').trigger('propertychange'); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,56 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
.page-heading {padding: 5px 0;border-bottom: 1px solid #ccc;margin-bottom: 20px;position: relative;margin-left: 15px;} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="#">会员权益</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/halfset/userrightedit')}" class="btn btn-primary">添加权益</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:10%;">图片</th> |
|||
<th style="width:10%;">显示顺序</th> |
|||
<th style="width:25%;">标题</th> |
|||
<th style="width:30%;">连接</th> |
|||
<th style="width:10%;">状态</th> |
|||
<th class="text-right" style="width:15%;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $navs $nav} |
|||
<tr> |
|||
<td><img class="scrollLoading" src="{php echo tomedia($nav['thumb'])}" data-url="{php echo tomedia($nav['thumb'])}" onerror="this.src='{php echo tomedia($nav['thumb'])}'" height="50" width="50"/></td> |
|||
<td>{$nav['displayorder']}</td> |
|||
<td><span {if $nav['color']} style="color: {$nav['color']};" {/if}>{$nav['name']}</span></td> |
|||
<td class="text-lue">{$nav['link']}</td> |
|||
<td>{if $nav['enabled'] == 0}<span class="label label-default">隐藏</span>{/if} |
|||
{if $nav['enabled'] == 1}<span class="label label-success">显示</span>{/if}</td> |
|||
<td class="text-right"> |
|||
<a href="{php echo web_url('halfcard/halfset/userrightedit',array('id'=>$nav['id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="修改"><i class="fa fa-edit"></i></a> |
|||
<a href="{php echo web_url('halfcard/halfset/rightdelete',array('id'=>$nav['id']))}"class="btn btn-default btn-sm" data-toggle="ajaxRemove" data-confirm="确认删除此权益项目?" title="删除"><i class="fa fa-times"></i></a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,28 @@ |
|||
<form action="{php echo web_url('halfcard/realcard/deletemodal')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">删除实卡</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">删除范围</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="range" checked="checked"> 仅此条 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="range" > 同备注 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$realcard['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">删除实卡</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,29 @@ |
|||
<form action="{php echo web_url('halfcard/realcard/icerealcard')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">{if $_GPC['type']}冻结{else}解冻{/if}实卡</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">{if $_GPC['type']}冻结{else}解冻{/if}范围</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="range" checked="checked"> 仅此条 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="range" > 同备注 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="icestatus" id="icestatus" value="{$_GPC['type']}" /> |
|||
<input type="hidden" name="id" id="id" value="{$realcard['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">{if $_GPC['type']}冻结{else}解冻{/if}实卡</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,166 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('halfcard/realcard/cardlist');}">实体卡列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="{php echo web_url('halfcard/realcard/addcard')}" class="btn btn-primary">生成实体卡</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="realcard" /> |
|||
<input type="hidden" name="do" value="cardlist" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-md-2 control-label">实体卡状态</label> |
|||
<div class="col-sm-8 col-xs-12"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo web_url('halfcard/realcard/cardlist');}" class="btn {if $_GPC['status'] == -1 || $_GPC['status'] == ''}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo web_url('halfcard/realcard/cardlist',array('status'=>1));}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">待激活</a> |
|||
<a href="{php echo web_url('halfcard/realcard/cardlist',array('status'=>2));}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">已激活</a> |
|||
<a href="{php echo web_url('halfcard/realcard/cardlist',array('status'=>3));}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">已失效</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">实体卡信息</label> |
|||
<div class="col-sm-6 col-lg-8 col-xs-12"> |
|||
<input type="text" name="keyword" class="form-control" value="{$keyword}" placeholder="请输入实体卡编号或场景备注"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">编号范围</label> |
|||
<div class="col-sm-3 col-lg-3 col-xs-3"> |
|||
<input type="text" name="startkeyword" class="form-control" value="{$startword}" placeholder="搜索起始编号"> |
|||
</div> |
|||
<div class="col-sm-3 col-lg-3 col-xs-3"> |
|||
<input type="text" name="endkeyword" class="form-control" value="{$endword}" placeholder="搜索结束编号"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">生成时间</label> |
|||
<div class="col-sm-3 col-lg-3 col-xs-12"> |
|||
{php echo tpl_select_time_info('time', array('starttime'=>date('Y-m-d H:i:s', $starttime),'endtime'=>date('Y-m-d H:i:s', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary min-width"><i class="fa fa-search"></i> 搜索</button> |
|||
<button class="btn btn-default min-width" name="export" type="submit" value="export"><i class="fa fa-download"></i> 导出实体卡</button> |
|||
<a href="javascript:;" id="long2short" class="btn btn-default min-width"><i class="fa fa-refresh"></i> 长链转短链</a> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:30px;"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th style="width:70px;">实体卡编号</th> |
|||
<th style="width:40px;">包含时长</th> |
|||
<th style="width:40px;">使用状态</th> |
|||
<th style="width:90px;">场景备注</th> |
|||
<th style="width:60px;">二维码</th> |
|||
<th style="width:80px;">会员等级</th> |
|||
<th style="width:100px;">生成时间</th> |
|||
<th style="width:100px;">绑定时间</th> |
|||
<th style="width:40px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $row} |
|||
<tr> |
|||
<td class="text-center" style="width:30px; height: auto;"> |
|||
<input type="checkbox" name="checkbox[]" class="checkbox" value="{$row['id']}" /> |
|||
</td> |
|||
<td>{php echo $row['cardsn']}</td> |
|||
<td>{$row['days']}天</td> |
|||
<td>{if $row['icestatus']}<span class="label label-danger">已冻结</span>{else if $row['cardid']}<span class="label label-success">已绑定</span>{else}{if $row['status'] == 3}<span class="label label-default">已失效</span>{else}<span class="label label-warning">未绑定</span>{/if}{/if}</td> |
|||
<td>{$row['remark']}</td> |
|||
<td><a href="javascript:void(0);" onclick="javascript:layer.open({type: 2,title: '实体卡二维码',shadeClose: true,shade: 0.8,area: ['385px', '420px'],content: '{$row['showurl']}'});">查看</a></td> |
|||
<td>{$row['levelname']}</td> |
|||
<td style="font-size:12px; color:#666;"> |
|||
{php echo date('Y-m-d H:i:s', $row['createtime']);} |
|||
</td> |
|||
<td style="font-size:12px; color:#666;"> |
|||
{if $row['bindtime']}{php echo date('Y-m-d H:i:s', $row['bindtime']);}{else}待绑定{/if} |
|||
</td> |
|||
<td> |
|||
<a href="{php echo web_url('halfcard/realcard/editrealcard',array('id'=>$row['id']))}" data-toggle="ajaxModal">编辑</a> - |
|||
{if empty($row['icestatus'])} |
|||
<a href="{php echo web_url('halfcard/realcard/icerealcard',array('id'=>$row['id'],'type'=>'1'))}" data-toggle="ajaxModal">冻结</a> - |
|||
{else} |
|||
<a href="{php echo web_url('halfcard/realcard/icerealcard',array('id'=>$row['id'],'type'=>'0'))}" data-toggle="ajaxModal">解冻</a> - |
|||
{/if} |
|||
<a href="{php echo web_url('halfcard/realcard/deletemodal',array('id'=>$row['id']))}" data-toggle="ajaxModal">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div id="de1" class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete">删除选中实卡</a> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function(){ |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/realcard/deletecard')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
//长链转短链 |
|||
$('.filter-list').delegate('#long2short','click',function(e){ |
|||
e.stopPropagation(); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
var obj = $('#long2short'); |
|||
console.log(obj); |
|||
obj.html('<i class="fa fa-spinner fa-spin"></i> 处理中'); |
|||
$.post("{php echo web_url('halfcard/realcard/longToshort')}", {}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("转换成功!"); |
|||
obj.html('<i class="fa fa-refresh"></i>长链转短链'); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认把所有实卡长链转短链吗?'}); |
|||
}); |
|||
}); |
|||
</script> |
|||
|
|||
|
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,56 @@ |
|||
<form action="{php echo web_url('halfcard/realcard/editrealcard')}" method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">编辑实卡</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">实体卡时长</label> |
|||
<div class="col-sm-7 col-xs-12"> |
|||
<div class="input-group"> |
|||
<input type="text" name="days" class="form-control" value="{$realcard['days']}" /> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员等级</label> |
|||
<div class="col-md-7"> |
|||
<select name="levelid" style="width: 100%;"> |
|||
<option value="0" {if $realcard['levelid'] == 0 || empty($realcard['levelid'])} selected="selected" {/if} >{$_W['wlsetting']['halflevel']['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}" {if $realcard['levelid'] == $level['id']} selected="selected" {/if} >{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">修改备注</label> |
|||
<div class="col-sm-7 col-xs-12"> |
|||
<div class="input-group" style="width: 100%;"> |
|||
<input type="text" name="remark" value="{$realcard['remark']}" class="form-control"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">更新范围</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="range" checked="checked"> 仅此条 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="range" > 同备注 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$realcard['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,80 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('halfcard/realcard/cardlist');}">所有实体卡</a></li> |
|||
<li class="active"><a href="{php echo web_url('halfcard/realcard/addcard');}">生成实体卡</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form class="form-horizontal form" action="" method="post" id="form1"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading"> |
|||
生成实体卡 |
|||
</div> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">实体卡时长</label> |
|||
<div class="col-sm-5 col-xs-12"> |
|||
<div class="input-group"> |
|||
<input type="text" name="days" class="form-control"/> |
|||
<span class="input-group-addon">天</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">生成数量</label> |
|||
<div class="col-sm-5 col-xs-12"> |
|||
<input type="text" class="form-control" placeholder="" name="qr_num" /> |
|||
<span class="help-block">单次生成数量最大为1万个</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">匹配等级</label> |
|||
<div class="col-md-5"> |
|||
<select name="levelid" style="width: 100%;"> |
|||
<option value="0" >{$_W['wlsetting']['halflevel']['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}">{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">场景备注</label> |
|||
<div class="col-sm-5 col-xs-12"> |
|||
<input type="text" class="form-control" placeholder="" name="remark" /> |
|||
<span class="help-block">用于区分实体卡不同场景或不同所属</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#form1").submit(function(){ |
|||
if($(":text[name='qr_num']").val() == '') { |
|||
layer.alert('请填写实体卡生成数量!', {icon: 5}); |
|||
return false; |
|||
} |
|||
if($(":text[name='remark']").val() == '') { |
|||
layer.alert('请填写场景备注!', {icon: 5}); |
|||
return false; |
|||
} |
|||
if($(":text[name='qr_num']").val() <= 0) { |
|||
layer.alert('实体卡生成数量必须大于0!', {icon: 5}); |
|||
return false; |
|||
} |
|||
if($(":text[name='qr_num']").val() > 10000) { |
|||
layer.alert('实体卡单次生成数量最大1万个!', {icon: 5}); |
|||
return false; |
|||
} |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,58 @@ |
|||
{php include wl_template('common/header');} |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="#">实体卡生成</a></li> |
|||
</ul> |
|||
<div class="panel" style="padding: 20px 20px 0 20px;"> |
|||
<div class="alert alert-warning"> |
|||
正在生成实体卡, 请不要关闭窗口. |
|||
</div> |
|||
<div class="form-horizontal ng-cloak" ng-controller="processor"> |
|||
<dl class="dl-horizontal"> |
|||
<dt>实体卡数量</dt> |
|||
<dd>{{pragress}}</dd> |
|||
<dt>整体进度条</dt> |
|||
<dd> |
|||
<div class="progress"> |
|||
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="{{file}}" aria-valuemin="0" aria-valuemax="100" style="width: {{file}}%"> |
|||
<span class="sr-only">{{file}}% Complete (success)</span> |
|||
</div> |
|||
</div> |
|||
</dd> |
|||
</dl> |
|||
</div> |
|||
<script> |
|||
require(['angular'], function(angular){ |
|||
angular.module('app', []).controller('processor', function($scope, $http){ |
|||
var total = {$allnum}; |
|||
var i = 0; |
|||
var proc = function() { |
|||
if(i == total && i != 0){ |
|||
layer.open({ |
|||
content: '恭喜您,实体卡生成完成!', |
|||
yes: function(index, layero){ |
|||
location.href = '{php echo web_url("halfcard/realcard/cardlist");}'; |
|||
layer.close(index); //如果设定了yes回调,需进行手工关闭 |
|||
} |
|||
}); |
|||
return; |
|||
} |
|||
$http.post('{php echo web_url("halfcard/realcard/get",array("days" => $days,"remark" => $_GPC["remark"],"levelid" => $levelid ));}').success(function(dat){ |
|||
if(dat.result == 1){ |
|||
i++; |
|||
$scope.file = (i/total)*100; |
|||
$scope.pragress = i + '/' + total; |
|||
} |
|||
proc(); |
|||
}).error(function(){ |
|||
proc(); |
|||
}); |
|||
} |
|||
proc(); |
|||
}); |
|||
angular.bootstrap(document, ['app']); |
|||
}); |
|||
</script> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,19 @@ |
|||
<div class="form-group sms-template-1 data-item"> |
|||
<label class="col-sm-2 control-label">Q:</label> |
|||
<div class="col-sm-9 col-xs-12"> |
|||
<div class="col-sm-3" style="margin: 0px;padding-left: 0;"> |
|||
<input type="text" name="question[]" class="form-control" value="{$data['question']}" /> |
|||
</div> |
|||
<!--<input type="text" name="data_temp[]" class="form-control valid" value="{$data['data_temp']}">--> |
|||
<div class="input-group form-group col-sm-9" style="margin: 0px;padding-right: 0;"> |
|||
<span class="input-group-addon" >A:</span> |
|||
<input type="text" name="answer[]" class="form-control valid" value="{$data['answer']}"> |
|||
<span class="input-group-addon btn btn-default data-item-delete"><i class="fa fa-remove"></i> 删除</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$(document).on('click', '.data-item-delete', function () { |
|||
$(this).closest('.data-item').remove(); |
|||
}); |
|||
</script> |
|||
@ -0,0 +1,772 @@ |
|||
{php include wl_template('common/header');} |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs"> |
|||
<li {if $_GPC['postType']=='setting'}class="active"{/if} ><a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'setting'))}">一卡通设置</a></li> |
|||
{if $_W['wlsetting']['halfcard']['halfcardtype'] != 1} |
|||
<li {if $_GPC['postType']=='type'}class="active"{/if} ><a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'type'))}">一卡通类型</a></li> |
|||
{/if} |
|||
<li {if $_GPC['postType']=='list'}class="active"{/if} ><a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'list'))}">激活码列表</a></li> |
|||
<li {if $_GPC['postType']=='apply'}class="active"{/if} ><a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'apply'))}">代理申请</a></li> |
|||
<li {if $_GPC['postType']=='add'}class="active"{/if}><a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'add'))}">增加激活码</a></li> |
|||
{if $_GPC['postType']=='addType'} |
|||
<li {if $_GPC['postType']=='addType'}class="active"{/if}><a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'addType'))}">增加类型</a></li> |
|||
{/if} |
|||
</ul> |
|||
{if $_GPC['postType']=='setting'} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基本设置</a></li> |
|||
<li><a href="#tab_share">列表分享</a></li> |
|||
{if $_W['wlsetting']['halfcard']['halfcardtype'] != 1} |
|||
<li><a href="#tab_QA">常见问题</a></li> |
|||
{/if} |
|||
{if $distri['switch']}<li><a href="#tab_distri">分销设置</a></li>{/if} |
|||
</ul> |
|||
<div class="app-form"> |
|||
<div class="main"> |
|||
<form action="" method="post" class="form-horizontal" id="setting-form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">模块设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否开启一卡通</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio1" name="base[status]" value="1" {if intval($base['status']) == 1}checked{/if}> |
|||
<label for="inlineRadio1">开启 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio2" name="base[status]" value="0" {if intval($base['status']) == 0 || empty($base['status'])}checked{/if}> |
|||
<label for="inlineRadio2">关闭 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否开启平时折扣</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline" onclick="showdaily(1)" > |
|||
<input type="radio" id="inlineRadio11" name="base[daily]" value="1" {if intval($base['daily']) == 1}checked{/if}> |
|||
<label for="inlineRadio11">开启 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" onclick="showdaily(0)"> |
|||
<input type="radio" id="inlineRadio12" name="base[daily]" value="0" {if intval($base['daily']) == 0 || empty($base['daily'])}checked{/if}> |
|||
<label for="inlineRadio12">关闭 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="showdaily" {if intval($base['daily']) == 0 || empty($base['daily'])} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">特权页面显示平时折扣</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio13" name="base[dailyshow]" value="1" {if intval($base['dailyshow']) == 1}checked{/if}> |
|||
<label for="inlineRadio13">开启 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline" > |
|||
<input type="radio" id="inlineRadio14" name="base[dailyshow]" value="0" {if intval($base['dailyshow']) == 0 || empty($base['dailyshow'])}checked{/if}> |
|||
<label for="inlineRadio14">关闭 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一卡通每天使用次数</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="base[daytimes]" class="form-control" value="{$base['daytimes']}" /> |
|||
<span class="input-group-addon">次/天</span> |
|||
</div> |
|||
<span class="help-block">特权特权每天使用次数,不填则无限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">文字</label> |
|||
<div class="col-sm-8 col-xs-12"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">一卡通=</span> |
|||
<input type="text" name="base[halfcardtext]" class="form-control" value="{$base['halfcardtext']}"> |
|||
<span class="input-group-addon">特权=</span> |
|||
<input type="text" name="base[halftext]" class="form-control" value="{$base['halftext']}"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一卡通背景</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('base[halfcard_image]', $base['halfcard_image']);} |
|||
<span class="help-block">不上传为默认图片,图片尺寸750X205</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">介绍头部图</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('base[halfcard_header]', $base['halfcard_header']);} |
|||
<span class="help-block">不上传为默认图片,图片尺寸750X375</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">介绍图</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('base[halfcard_introduce]', $base['halfcard_introduce']);} |
|||
<span class="help-block">不上传为默认图片,图片尺寸750X1631</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">详情流程图</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('base[halfcard_flow]', $base['halfcard_flow']);} |
|||
<span class="help-block">不上传为默认图片,图片尺寸750X143</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-8"> |
|||
<input type="text" name="base[share_title]" class="form-control" value="{$base['share_title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享图片</label> |
|||
<div class="col-sm-8"> |
|||
{php echo attachment_select('base[share_image]', $base['share_image']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-8"> |
|||
<input type="text" name="base[share_desc]" class="form-control" value="{$base['share_desc']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{if $_W['wlsetting']['halfcard']['halfcardtype'] != 1} |
|||
<div class="tab-pane" id="tab_QA"> |
|||
<label class="col-sm-2 control-label">常见问题设置</label> |
|||
<div class="col-md-12"> |
|||
<div id="datas" class="sms-template-1" style="display:block;"> |
|||
{if !empty($base['qa'])} |
|||
{loop $base['qa'] $data} |
|||
{php include wl_template('halfcard/QandA');} |
|||
{/loop} |
|||
{/if} |
|||
</div> |
|||
<div class="form-group sms-template-1" style="display:block;"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-8 col-xs-12"> |
|||
<a class="btn btn-default btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一条常见问题</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="tab-pane" id="tab_distri"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">一级佣金比例</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="base[onecommission]" class="form-control" value="{$base['onecommission']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">买家上级所获佣金</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">二级佣金比例</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="base[twocommission]" class="form-control" value="{$base['twocommission']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">买家上级的上级所获佣金</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">三级佣金比例</label> |
|||
<div class="col-xs-12 col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="base[threecommission]" class="form-control" value="{$base['threecommission']}" /> |
|||
<span class="input-group-addon">%</span> |
|||
</div> |
|||
<span class="help-block">买家最高上级所获佣金</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group col-sm-12"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $_GPC['postType']=='type'} |
|||
<div class="page-heading"> |
|||
<span class="pull-right" style=" margin-top: -10px;"> |
|||
<a class="btn btn-primary btn-sm" href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'addType'));}"><i class="fa fa-add"></i> 增加</a> |
|||
</span> |
|||
<h4>类型列表</h4> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:90px;">LOGO</th> |
|||
<th class="text-center" style="width:120px;">类型名称</th> |
|||
<th class="text-center" style="width:60px;">时长</th> |
|||
<th class="text-center" style="width:100px;">价格</th> |
|||
<th class="text-center" style="width:100px;">显示</th> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center" > |
|||
<td> |
|||
<div class="img"> |
|||
<img width="50" height="50" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" > |
|||
</div> |
|||
</td> |
|||
<td> |
|||
{$item['name']} |
|||
</td> |
|||
<td> |
|||
{$item['days']}天 |
|||
</td> |
|||
<td>{$item['price']}</td> |
|||
<td>{if $item['status']==1}<label class="btn btn-primary">显示</label>{else}<label class="btn btn-default">隐藏</label>{/if}</td> |
|||
<td style="position:relative;"> |
|||
{if $_W['wlsetting']['halfcard']['halfcardtype'] != 1} |
|||
<a href="{php echo web_url('halfcard/halfcard_web/base',array('id'=>$item['id'],'postType'=>'addType'))}">编辑 </a> |
|||
- <a href="{php echo web_url('halfcard/halfcard_web/base',array('id'=>$item['id'],'postType'=>'delType'))}">删除 </a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{$pager} |
|||
{/if} |
|||
{if $_GPC['postType']=='addType'} |
|||
<div class="app-form"> |
|||
<div class="main"> |
|||
<form action="" method="post" class="form-horizontal form" id="form"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">一卡通类别</div> |
|||
<div class="panel-body"> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">LOGO</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[logo]', $data['logo']);} |
|||
<span class="help-block">图片建议为640X300</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">类别名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[name]" id="name" class="form-control" value="{$data['name']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时长</label> |
|||
<div class="col-md-4"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">天</span> |
|||
<input type="text" name="data[days]" class="form-control" value="{$data['days']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >价格</label> |
|||
<div class="col-md-4"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">¥</span> |
|||
<input type="text" name="data[price]" class="form-control" value="{$data['price']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label" >可开通次数</label> |
|||
<div class="col-md-4"> |
|||
<div class="input-group"> |
|||
<input type="text" name="data[num]" class="form-control" value="{$data['num']}" /> |
|||
<span class="help-block">不填或则填0表示不限制</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否显示</label> |
|||
<div class="col-xs-12 col-sm-8"> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio1" name="data[status]" value="1" {if intval($data['status']) == 1}checked="checked"{/if}> |
|||
<label for="inlineRadio1"> 显示 </label> |
|||
</div> |
|||
<div class="radio radio-success radio-inline"> |
|||
<input type="radio" id="inlineRadio2" name="data[status]" value="2" {if intval($data['status']) != 1}checked="checked"{/if} > |
|||
<label for="inlineRadio2"> 隐藏 </label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group col-sm-12"> |
|||
<input type="hidden" name="id" value="{$data['id']}" /> |
|||
<input type="hidden" name="postType" value="{$_GPC['postType']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
{if $_GPC['postType']=='list'} |
|||
<div class="app-form"> |
|||
<div class="panel"> |
|||
<div class="panel-body"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="weliam_smartcity" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="halfcard_web" /> |
|||
<input type="hidden" name="do" value="base"/> |
|||
<input type="hidden" name="postType" value="list"/> |
|||
<div class="form-group"> |
|||
<div class="col-md-2"> |
|||
<select name="vipType" class="form-control"> |
|||
<option value="">一卡通类型</option> |
|||
{loop $types $row} |
|||
<option {if $_GPC['vipType']==$row['id']}selected="selected"{/if} value="{$row['id']}">{$row['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<select name="status" class="form-control"> |
|||
<option value="">状态</option> |
|||
<option value="1" {if $_GPC['status']==1}selected="selected"{/if}>使用中</option> |
|||
<option value="2" {if $_GPC['status']==2}selected="selected"{/if}>空闲</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>时长</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>激活人昵称</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>备注</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
<span class="input-group-addon" id="search">搜索</span><span class="input-group-addon" id="output">导出</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}) |
|||
$('#output').click(function(){ |
|||
var vipType = "{$_GPC['vipType']}"; |
|||
var status = "{$_GPC['status']}"; |
|||
var keywordtype = "{$_GPC['keywordtype']}"; |
|||
var keyword = "{$_GPC['keyword']}"; |
|||
location.href = "{php echo web_url('halfcard/halfcard_web/base')}&postType=output&vipType="+vipType+"&status="+status+"&keywordtype="+keywordtype+"&keyword="+keyword; |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}) |
|||
$('#output').click(function(){ |
|||
var vipType = "{$_GPC['vipType']}"; |
|||
var status = "{$_GPC['status']}"; |
|||
var keywordtype = "{$_GPC['keywordtype']}"; |
|||
var keyword = "{$_GPC['keyword']}"; |
|||
location.href = "{php echo web_url('halfcard/halfcard_web/base')}&postType=output&vipType="+vipType+"&status="+status+"&keywordtype="+keywordtype+"&keyword="+keyword; |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="panel panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:40px;" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th class="text-center" style="width:90px;">一卡通类型</th> |
|||
<th class="text-center" style="width:110px;">使用详情</th> |
|||
<th class="text-center" style="width:70px;">激活码</th> |
|||
<th class="text-center" style="width:60px;">时长</th> |
|||
<th class="text-center" style="width:60px;">状态</th> |
|||
<th class="text-center" style="width:100px;">备注</th> |
|||
<th class="text-center" style="width:140px;">生成时间</th> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center" > |
|||
<td class="text-center" style="width:40px; height: auto;"> |
|||
<center><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></center> |
|||
</td> |
|||
<td> |
|||
<span class="label label-info"> |
|||
{$item['typename']} |
|||
</span> |
|||
</td> |
|||
<td> |
|||
{if !empty($item['member'])} |
|||
<div class="img" style="text-align: left;"> |
|||
<img width="35" height="35" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['member']['avatar'])}"> |
|||
<span>{$item['member']['nickname']}</span> |
|||
</div> |
|||
{/if} |
|||
</td> |
|||
<td>{$item['number']}</td> |
|||
<td> |
|||
{$item['days']}天 |
|||
</td> |
|||
<td> |
|||
{if $item['status']==1} |
|||
<span id="" class="label label-success"> |
|||
使用中 |
|||
</span> |
|||
{else} |
|||
<span id="" class="label label-default"> |
|||
空闲 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
<input style="width: 100%;" type="text" name="remark" id="{$item['id']}" class="form-control" value="{$item['remark']}" /> |
|||
</td> |
|||
<td> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
<td> |
|||
<button type="button" class="btn btn-primary" title="提交备注" onclick="set_remark('{$item['id']}');"><i class="fa fa-check"></i></button> |
|||
<a href="{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'del','id'=>$item['id']))}" title="删除" class="btn btn-danger"><i class="fa fa-trash-o"></i></a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{$pager} |
|||
<div id="de1" style="margin-top: 15px;"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete">删除选中记录</a> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
function set_remark(id){ |
|||
var remark = $('#'+id).val(); |
|||
$.post("{php echo web_url('halfcard/halfcard_web/base',array('postType'=>'remark'))}" |
|||
,{id:id,remark:remark} |
|||
,function(d){ |
|||
layer.alert(d.message); |
|||
} |
|||
,"json" |
|||
); |
|||
} |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deletejihuoqr')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
</script> |
|||
{/if} |
|||
{if $_GPC['postType']=='apply'} |
|||
<div class="app-table-list"> |
|||
<div class="panel panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:120px;">vip类型</th> |
|||
<th class="text-center" style="width:60px;">时长</th> |
|||
<th class="text-center" style="width:60px;">申请数量</th> |
|||
<th class="text-center" style="width:60px;">申请状态</th> |
|||
<th class="text-center" style="width:120px;">申请时间</th> |
|||
<th class="text-center" style="width:120px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $applys $item} |
|||
<tr class="text-center" > |
|||
<td> |
|||
<span class="label label-info"> |
|||
{$item['token']['name']} |
|||
</span> |
|||
{if !empty($item['aid'])} |
|||
|
|||
<span class="label label-primary"> |
|||
{$item['aName']} |
|||
</span> |
|||
{else} |
|||
<span class="label label-danger"> |
|||
系统 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{$item['token']['days']}天 |
|||
</td> |
|||
<td>{$item['num']}</td> |
|||
<td> |
|||
{if $item['status']==1} |
|||
<span id="" class="label label-success"> |
|||
申请中 |
|||
</span> |
|||
{else} |
|||
<span id="" class="label label-default"> |
|||
已生成 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i:s',$item['createtime'])}</td> |
|||
<td> |
|||
{if $item['status']==1} |
|||
<a href="#" title="已生成" class="btn btn-warning">申请中</a> |
|||
{else} |
|||
<a href="#" title="已生成" class="btn btn-primary">完成</a> |
|||
{/if} |
|||
- <a href="javascript:;" title="删除" id="{$item['id']}" class="btn btn-danger remove">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('.remove').click(function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('id'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/base')}&postType=delete", { id : id }, function(data){ |
|||
if(!data.errno){ |
|||
$this.parent().parent().remove(); |
|||
util.tips("删除成功!"); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
</script> |
|||
{$pager} |
|||
{/if} |
|||
{if $_GPC['postType']=='add'} |
|||
<div class="app-form"> |
|||
<div class="main"> |
|||
<form action="" method="post" class="form-horizontal form" id="form"> |
|||
<div class="tab-content"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">基本信息</div> |
|||
<div class="panel-body"> |
|||
<div class="panel-body"> |
|||
{if $apply} |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:120px;">一卡通类型</th> |
|||
<th class="text-center" style="width:60px;">时长</th> |
|||
<th class="text-center" style="width:60px;">申请数量</th> |
|||
<th class="text-center" style="width:60px;">申请状态</th> |
|||
<th class="text-center" style="width:120px;">申请时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr class="text-center" > |
|||
<td> |
|||
<span class="label label-danger"> |
|||
{$apply['token']['name']} |
|||
</span> |
|||
</td> |
|||
<td> |
|||
{$apply['token']['days']}天 |
|||
</td> |
|||
<td>{$apply['num']}</td> |
|||
<td> |
|||
{if $apply['status']==1} |
|||
<span id="" class="label label-success"> |
|||
申请中 |
|||
</span> |
|||
{else} |
|||
<span id="" class="label label-default"> |
|||
已生成 |
|||
</span> |
|||
{/if} |
|||
</td> |
|||
<td>{php echo date('Y-m-d H:i:s',$apply['createtime'])}</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<input type="hidden" name="secretkey_type" id="secretkey_type" value="{$apply['token']['id']}" /> |
|||
<input type="hidden" name="applyid" id="applyid" value="{$apply['id']}" /> |
|||
{else} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span style='color:red'>*</span>可生成一卡通激活码</label> |
|||
<div class="col-sm-9"> |
|||
{loop $types $row} |
|||
{if empty($allow)} |
|||
{else} |
|||
{if in_array($row['id'],$settings['halfcardtypeids'])} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input type="checkbox" id="{$row['id']}" name="type[]" value="{$row['id']}" checked="checked" disabled="true"> |
|||
<label for="{$row['id']}"> {$row['name']} </label> |
|||
</div> |
|||
{/if} |
|||
{/if} |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span style='color:red'>*</span>可申请一卡通激活码</label> |
|||
<div class="col-sm-9"> |
|||
{loop $types $row} |
|||
{if empty($allow)} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input type="checkbox" id="{$row['id']}" name="type[]" value="{$row['id']}" checked="checked" disabled="true"> |
|||
<label for="{$row['id']}"> {$row['name']} </label> |
|||
</div> |
|||
{else} |
|||
{if !in_array($row['id'],$settings['halfcardtypeids'])} |
|||
<div class="checkbox checkbox-success checkbox-inline"> |
|||
<input type="checkbox" id="{$row['id']}" name="type[]" value="{$row['id']}" checked="checked" disabled="true"> |
|||
<label for="{$row['id']}"> {$row['name']} </label> |
|||
</div> |
|||
{/if} |
|||
{/if} |
|||
{/loop} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"><span style='color:red'>*</span>激活码类型</label> |
|||
<div class="col-sm-9"> |
|||
<select name="secretkey_type" class="form-control"> |
|||
{loop $types $row} |
|||
<option value="{$row['id']}">{$row['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">创建个数</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="num" class="form-control" placeholder="创建个数" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">激活码备注</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="remark" class="form-control" placeholder="请输入激活码备注" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group col-sm-12"> |
|||
<input type="submit" name="submit" value="确定" class="btn btn-primary col-lg-1" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
<input type="hidden" name="postType" value="{$_GPC['postType']}" /> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
<script> |
|||
$(function() { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function(e) { |
|||
e.preventDefault(); //阻止a链接的跳转行为 |
|||
$(this).tab('show'); //显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
var kw = 1;var kw2 = 1; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('halfcard/halfcard_web/QandA')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
function addType2() { |
|||
$(".btn-add-type2").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('halfcard/halfcard_web/halfcardprice')}&kw="+kw2, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type2").button("reset"); |
|||
$("#datas2").append(html); |
|||
}); |
|||
kw2++; |
|||
} |
|||
function showdaily(flag){ |
|||
if(flag){ |
|||
$('#showdaily').show(); |
|||
}else{ |
|||
$('#showdaily').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
function set_remark(id){ |
|||
var remark = $('#'+id).val(); |
|||
$.post("{php echo web_url('secretkey/secretkey/remark')}" |
|||
,{id:id,remark:remark} |
|||
,function(d){ |
|||
layer.alert(d.message); |
|||
} |
|||
,"json" |
|||
); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,469 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">添加商家</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="commentForm"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">活动信息</div> |
|||
<div class="panel-body"> |
|||
{if !is_store()} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商户</label> |
|||
<div class="col-sm-9"> |
|||
<div class='input-group'> |
|||
<div class="input-group "> |
|||
<input type="text" class="form-control col-sm-9" id="namemerchant" name="" value="{$halfcard['storename']}" style="width: 460px;" disabled> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" onclick="popwin = $('#modal-module-merchant').modal();">选择商家</button></span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<input type="hidden" value="{$halfcard['merchantid']}" name="halfcard[merchantid]" id="sidmerchant" > |
|||
<img src="{if empty($halfcard['logo'])}../web/resource/images/nopic.jpg{else}{php echo tomedia($halfcard['logo'])}{/if}" class="img-responsive img-thumbnail" width="150" id="imgmerchant" /> |
|||
<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除" onclick="remove_merchant(this)">×</em> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">活动名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="halfcard[title]" class="form-control" value="{$halfcard['title']}" id="storetitle" /> |
|||
<span class="help-block">填写活动名称,默认与商户名称相同</span> |
|||
</div> |
|||
</div> |
|||
<!--一卡通--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">折扣方式</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('.les1').show();$('.les2').hide();$('#levellimit').show();"> |
|||
<input type="radio" value="0" name="halfcard[levelstatus]" {if $halfcard['levelstatus'] == 0 || empty($halfcard) } checked {/if}>通用折扣 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('.les1').hide();$('.les2').show();$('#levellimit').hide();"> |
|||
<input type="radio" value="1" name="halfcard[levelstatus]" {if $halfcard['levelstatus']==1} checked {/if}>分级折扣 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权折扣时间类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" id="wk" name="datestatus" {if $halfcard['datestatus'] == 1 || empty($halfcard) } checked {/if}>按星期 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" id="dd" name="datestatus" {if $halfcard['datestatus']==2} checked {/if}>按日期 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="3" id="cc" name="datestatus" {if $halfcard['datestatus']==3} checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('#wk').click(function(){ |
|||
$('#weeke').show(); |
|||
$('#activediscount').show(); |
|||
$('#daily').hide(); |
|||
}); |
|||
$('#dd').click(function(){ |
|||
$('#weeke').hide(); |
|||
$('#activediscount').show(); |
|||
$('#daily').show(); |
|||
}); |
|||
$('#cc').click(function(){ |
|||
$('#weeke').hide(); |
|||
$('#activediscount').hide(); |
|||
$('#daily').hide(); |
|||
}); |
|||
</script> |
|||
<div class="form-group" {if $halfcard['datestatus'] == 2 || $halfcard['datestatus'] == 3} style="display: none;"{/if} id="weeke"> |
|||
<label class="col-sm-2 control-label">按星期</label> |
|||
<div class="col-sm-9"> |
|||
{if $halfcard} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="1" name="halfcard[week][]" id="wk1" /> 星期一 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="2" name="halfcard[week][]" id="wk2" /> 星期二 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="3" name="halfcard[week][]" id="wk3" /> 星期三 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="4" name="halfcard[week][]" id="wk4" /> 星期四 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="5" name="halfcard[week][]" id="wk5" /> 星期五 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="6" name="halfcard[week][]" id="wk6" /> 星期六 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="7" name="halfcard[week][]" id="wk7" /> 星期日 |
|||
</label> |
|||
{loop $halfcard['week'] $week} |
|||
<script type="text/javascript"> |
|||
if({php echo $week}==1){ |
|||
$('#wk1').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==2){ |
|||
$('#wk2').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==3){ |
|||
$('#wk3').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==4){ |
|||
$('#wk4').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==5){ |
|||
$('#wk5').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==6){ |
|||
$('#wk6').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==7){ |
|||
$('#wk7').attr('checked','true'); |
|||
} |
|||
|
|||
</script> |
|||
{/loop} |
|||
{else} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="1" name="halfcard[week][]" /> 星期一 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="2" name="halfcard[week][]" /> 星期二 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="3" name="halfcard[week][]" /> 星期三 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="4" name="halfcard[week][]" /> 星期四 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="5" name="halfcard[week][]" /> 星期五 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="6" name="halfcard[week][]" /> 星期六 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="7" name="halfcard[week][]" /> 星期日 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" {if $halfcard['datestatus'] == 1 || empty($halfcard) || $halfcard['datestatus'] == 3 } style="display: none;"{/if} id="daily"> |
|||
<label class="col-sm-2 control-label">按天数</label> |
|||
<div class="col-sm-9"> |
|||
{if $halfcard['datestatus'] == 2} |
|||
<?php |
|||
for ($i=1;$i<32;$i++ ) { |
|||
if(in_array($i,$halfcard['day'])){ |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" checked name="halfcard[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
}else{ |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" name="halfcard[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
}} |
|||
?> |
|||
{else} |
|||
<?php |
|||
for ($i=1;$i<32;$i++ ) { |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" name="halfcard[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
} |
|||
?> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div {if $halfcard['datestatus'] == 3} style="display: none;" {/if} id="activediscount"> |
|||
<div class="form-group les1" {if $halfcard['levelstatus'] == 1} style="display:none;" {/if} > |
|||
<label class="col-sm-2 control-label">活动折扣</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0.1" max="10" class="form-control" name="halfcard[activediscount]" value="{$halfcard[activediscount]}"/> |
|||
<span class="input-group-addon">折</span> |
|||
</div> |
|||
<span class="help-block">请输入数字,保留一位小数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group les2" {if $halfcard['levelstatus'] != 1} style="display:none;" {/if}> |
|||
<label class="col-sm-2 control-label">活动折扣</label> |
|||
<div class="col-sm-9"> |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$_W['wlsetting']['halflevel']['name']}]</span> |
|||
<input type="hidden" name="le_ac_id[]" class="form-control" value="0"> |
|||
<input type="number" min="0.1" max="10" name="le_ac_pr[]" class="form-control" value="{$le_ac_array[0]}"> |
|||
<span class="input-group-addon">折</span> |
|||
</div> |
|||
</div> |
|||
{loop $levels $level} |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$level['name']}]</span> |
|||
<input type="hidden" name="le_ac_id[]" class="form-control" value="{$level['id']}"> |
|||
<input type="number" min="0.1" max="10" name="le_ac_pr[]" class="form-control" value="{$le_ac_array[$level['id']]}"> |
|||
<span class="input-group-addon">折</span> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<span class="help-block">请输入数字,保留一位小数</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">平日折扣</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="halfcard[daily]" onclick="asd()" {if $halfcard['daily'] == 1} checked="checked" {/if}> |
|||
<input type="hidden" id="dailyflag" {if $halfcard['daily'] == 1 } value="1" {else} value="0" {/if} /> |
|||
</div> |
|||
</div> |
|||
<div id="discount" style="display: block;" > |
|||
<div class="form-group les1" {if $halfcard['levelstatus'] == 1} style="display:none;" {/if}> |
|||
<label class="col-sm-2 control-label">折扣额度</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="number" min="0.1" max="10" class="form-control" name="halfcard[discount]" value="{$halfcard[discount]}"/> |
|||
<span class="input-group-addon">折</span> |
|||
</div> |
|||
<span class="help-block">请输入数字,保留一位小数</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group les2" {if $halfcard['levelstatus'] != 1} style="display:none;" {/if}> |
|||
<label class="col-sm-2 control-label">折扣额度</label> |
|||
<div class="col-sm-9"> |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$_W['wlsetting']['halflevel']['name']}]</span> |
|||
<input type="hidden" name="le_day_id[]" class="form-control" value="0"> |
|||
<input type="number" min="0.1" max="10" name="le_day_pr[]" class="form-control" value="{$le_day_array[0]}"> |
|||
<span class="input-group-addon">折</span> |
|||
</div> |
|||
</div> |
|||
{loop $levels $level} |
|||
<div style="margin-top: 10px;"> |
|||
<div class="input-group data-item"> |
|||
<span class="input-group-addon">[{$level['name']}]</span> |
|||
<input type="hidden" name="le_day_id[]" class="form-control" value="{$level['id']}"> |
|||
<input type="number" min="0.1" max="10" name="le_day_pr[]" class="form-control" value="{$le_day_array[$level['id']]}"> |
|||
<span class="input-group-addon">折</span> |
|||
</div> |
|||
</div> |
|||
{/loop} |
|||
<span class="help-block">请输入数字,保留一位小数</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用限制</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="halfcard[limit]" class="form-control" value="{$halfcard['limit']}" id="use_limit" /> |
|||
<span class="help-block">如:300元以内;酒水饮料除外;两人同行一人免单</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="levellimit" {if $halfcard['levelstatus'] == 1} style="display:none;" {/if}> |
|||
<label class="col-sm-2 control-label">等级限制</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$halfcard['level'])} checked {/if} name="halfcard[level][]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$halfcard['level'])} checked {/if} name="halfcard[level][]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
<span class="help-block">如果全都不勾选则默认全等级可用</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">次数限制</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" name="halfcard[timeslimit]" class="form-control" value="{$halfcard['timeslimit']}" id="time_limit" /> |
|||
<span class="help-block">商家每天提供折扣的次数,填0或不填则无限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('halfcard[describe]', $halfcard['describe']);} |
|||
</div> |
|||
</div> |
|||
{if !is_store()} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" class="form-control" name="halfcard[sort]" value="{$halfcard[sort]}"/> |
|||
<span class="help-block">请输入整数数字,序号越大,排序靠前</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="halfcard[status]" {if $halfcard['status'] == 1 || empty($halfcard) } checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="modal-module-merchant" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h3>选取</h3></div> |
|||
<div class="modal-body"> |
|||
<div class="row"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" name="keyword" value="" id="search-kwd-merchant" placeholder="请输入商家名称,不输入任何内容搜索结果为所有商家。" /> |
|||
<span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_merchant();">搜索</button></span> |
|||
</div> |
|||
</div> |
|||
<div id="module-merchant" style="padding-top:5px;"></div> |
|||
</div> |
|||
<div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
var dailyflag = $('#dailyflag').val(); |
|||
//alert(dailyflag); |
|||
if(dailyflag == 0){ |
|||
$('#discount').hide(); |
|||
}else{ |
|||
$('#discount').show(); |
|||
} |
|||
}); |
|||
</script> |
|||
<script language='javascript'> |
|||
$('#commentForm').submit(function(){ |
|||
if($('#sidmerchant').val() == '') { |
|||
util.tips("请选择商户"); |
|||
return false; |
|||
} |
|||
if($('#storetitle').val() == '') { |
|||
util.tips("请填写活动名称"); |
|||
return false; |
|||
} |
|||
var timetype = $(':radio[name="datestatus"]:checked').val(); |
|||
if (timetype == 1) { |
|||
var time = $(':checkbox[name="halfcard[week][]"]:checked').val(); |
|||
if(!time) { |
|||
util.tips("请选择每周特权活动时间"); |
|||
|
|||
return false; |
|||
} |
|||
}else if(timetype == 2){ |
|||
var time = $(':checkbox[name="halfcard[day][]"]:checked').val(); |
|||
if(!time) { |
|||
util.tips("请选择每月特权活动时间"); |
|||
return false; |
|||
} |
|||
} |
|||
if(!$.trim($(':input[name="halfcard[limit]"]').val())){ |
|||
util.tips("请填写使用限制,无限制请填无"); |
|||
return false; |
|||
} |
|||
if ($('#dailyflag').val()){ |
|||
var x = $.trim($(':input[name="halfcard[discount]"]').val()); |
|||
if (isNaN(x)){ |
|||
util.tips("请填写规范的平日折扣额度"); |
|||
return false; |
|||
} |
|||
} |
|||
// if(!$.trim($(':input[name="halfcard[adv]"]').val())){ |
|||
// util.tips("请至少选择一张幻灯片"); |
|||
// return false; |
|||
// } |
|||
// if(!$.trim($(':input[name="halfcard[describe]"]').val())){ |
|||
// util.tips("请填写使用说明"); |
|||
// return false; |
|||
// } |
|||
// if ($('#inspectflag').val() == 2){ |
|||
// util.tips("所选商户已有特权活动"); |
|||
// return false; |
|||
// } |
|||
|
|||
return true; |
|||
}); |
|||
|
|||
function inspect(){ |
|||
var merchantid = $('#sidmerchant').val(); |
|||
$.post("{php echo web_url('halfcard/halfcard_web/inspect')}", { id : merchantid,type:1 }, function(data){ |
|||
if(data.errno){ |
|||
util.tips("该商户已有特权活动"); |
|||
}else{ |
|||
if($('#storetitle').val().length < 1){ |
|||
$('#storetitle').val($('#namemerchant').val()); |
|||
} |
|||
util.tips("操作成功"); |
|||
} |
|||
}, 'json'); |
|||
} |
|||
|
|||
function search_merchant() { |
|||
$("#module-merchant").html("正在搜索....") |
|||
$.get("{php echo web_url('halfcard/halfcard_web/selectMerchant',array('type'=>1))}", { |
|||
keyword: $.trim($('#search-kwd-merchant').val()) |
|||
}, function(dat){ |
|||
$('#module-merchant').html(dat); |
|||
}); |
|||
} |
|||
function remove_merchant(obj){ |
|||
$('#goodsidmerchant').val(''); |
|||
$('#namemerchant').val(''); |
|||
$('#imgmerchant').attr("src",''); |
|||
$('#sidmerchant').val(''); |
|||
} |
|||
function select_merchant(o) { |
|||
var lastid = $('#sidmerchant').val(); |
|||
if (lastid != o.id) { |
|||
$('#sidmerchant').val(o.id); |
|||
$('#namemerchant').val(o.storename); |
|||
$('#imgmerchant').attr("src",o.logo); |
|||
$('#modal-module-merchant').modal('hide'); |
|||
inspect(); |
|||
}else{ |
|||
$('#modal-module-merchant').modal('hide'); |
|||
} |
|||
} |
|||
function asd(){ |
|||
var dailyflag = $('#dailyflag').val(); |
|||
if (dailyflag == 0) { |
|||
$('#discount').show(); |
|||
$('#dailyflag').val(1); |
|||
}else{ |
|||
$('#discount').hide(); |
|||
$('#dailyflag').val(0); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,515 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">添加大礼包</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="commentForm"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_rush"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">大礼包信息</div> |
|||
<div class="panel-body"> |
|||
{if !is_store()} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">选择商户</label> |
|||
<div class="col-sm-9"> |
|||
<div class='input-group'> |
|||
<div class="input-group "> |
|||
<input type="text" class="form-control col-sm-9" id="namemerchant" name="" value="{$package['storename']}" style="width: 460px;" disabled> |
|||
<input type="hidden" value="{$package['merchantid']}" id="firstid" /> |
|||
<span class="input-group-btn"> |
|||
<button class="btn btn-default" type="button" onclick="popwin = $('#modal-module-merchant').modal();">选择商家</button></span> |
|||
</div> |
|||
<div class="input-group " style="margin-top:.5em;"> |
|||
<input type="hidden" value="{$package['merchantid']}" name="package[merchantid]" id="sidmerchant"> |
|||
<img src="{if empty($package['logo'])}../web/resource/images/nopic.jpg{else}{php echo tomedia($package['logo'])}{/if}" class="img-responsive img-thumbnail" width="150" id="imgmerchant" /> |
|||
<em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除" onclick="remove_merchant(this)">×</em> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[title]" class="form-control" value="{$package['title']}" placeholder="填写活动名称,默认与商户名称相同" id="storetitle" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包价值</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[price]" class="form-control" value="{$package['price']}" placeholder="用于展示礼包价值,请填入正整数" id="price" /> |
|||
</div> |
|||
</div> |
|||
{if !is_store()} |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">商户结算金</label> |
|||
<div class="col-sm-9"> |
|||
<input type="number" name="package[storemoney]" class="form-control" min="0" value="{$package['storemoney']}" placeholder="每次核销礼包后给商户结算金额" /> |
|||
<span class="help-block">每次核销礼包后给商户结算金额,最多保留两位小数,填0或不填则不会为商家增加余额</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间周期类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="datestatus" {if $package['datestatus'] == 1 || empty($package) } checked {/if}>无 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" name="datestatus" {if $package['datestatus'] == 2} checked {/if}>每周 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="3" name="datestatus" {if $package['datestatus'] == 3} checked {/if}>每月 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="4" name="datestatus" {if $package['datestatus'] == 4} checked {/if}>每年 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用次数</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<input type="tel" placeholder="请输入整数数字" id="usetimes" class="form-control" name="package[usetimes]" value="{$package[usetimes]}"/> |
|||
<span class="input-group-addon">次</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">限制使用时间</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" id="wk" name="package[usedatestatus]" {if $package['usedatestatus'] == 1} checked {/if}>按星期 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="2" id="dd" name="package[usedatestatus]" {if $package['usedatestatus']==2} checked {/if}>按日期 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" id="cc" name="package[usedatestatus]" {if $package['usedatestatus']==0 || empty($package['usedatestatus'])} checked {/if}>关闭 |
|||
</label> |
|||
<span class="help-block">开启后,大礼包只能在设置的时间才能使用</span> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$('#wk').click(function(){ |
|||
$('#weeke').show(); |
|||
$('#activediscount').show(); |
|||
$('#daily').hide(); |
|||
}); |
|||
$('#dd').click(function(){ |
|||
$('#weeke').hide(); |
|||
$('#activediscount').show(); |
|||
$('#daily').show(); |
|||
}); |
|||
$('#cc').click(function(){ |
|||
$('#weeke').hide(); |
|||
$('#activediscount').hide(); |
|||
$('#daily').hide(); |
|||
}); |
|||
</script> |
|||
<div class="form-group" {if $package['usedatestatus'] != 1} style="display: none;"{/if} id="weeke"> |
|||
<label class="col-sm-2 control-label">按星期</label> |
|||
<div class="col-sm-9"> |
|||
{if $package} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="1" name="package[week][]" id="wk1" /> 星期一 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="2" name="package[week][]" id="wk2" /> 星期二 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="3" name="package[week][]" id="wk3" /> 星期三 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="4" name="package[week][]" id="wk4" /> 星期四 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="5" name="package[week][]" id="wk5" /> 星期五 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="6" name="package[week][]" id="wk6" /> 星期六 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="7" name="package[week][]" id="wk7" /> 星期日 |
|||
</label> |
|||
{loop $package['week'] $week} |
|||
<script type="text/javascript"> |
|||
if({php echo $week}==1){ |
|||
$('#wk1').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==2){ |
|||
$('#wk2').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==3){ |
|||
$('#wk3').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==4){ |
|||
$('#wk4').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==5){ |
|||
$('#wk5').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==6){ |
|||
$('#wk6').attr('checked','true'); |
|||
} |
|||
if({php echo $week}==7){ |
|||
$('#wk7').attr('checked','true'); |
|||
} |
|||
|
|||
</script> |
|||
{/loop} |
|||
{else} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="1" name="package[week][]" /> 星期一 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="2" name="package[week][]" /> 星期二 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="3" name="package[week][]" /> 星期三 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="4" name="package[week][]" /> 星期四 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="5" name="package[week][]" /> 星期五 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="6" name="package[week][]" /> 星期六 |
|||
</label> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="7" name="package[week][]" /> 星期日 |
|||
</label> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" {if $package['usedatestatus'] != 2} style="display: none;"{/if} id="daily"> |
|||
<label class="col-sm-2 control-label">按天数</label> |
|||
<div class="col-sm-9"> |
|||
{if $package['usedatestatus'] == 2} |
|||
<?php |
|||
for ($i=1;$i<32;$i++ ) { |
|||
if(in_array($i,$package['day'])){ |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" checked name="package[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
}else{ |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" name="package[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
}} |
|||
?> |
|||
{else} |
|||
<?php |
|||
for ($i=1;$i<32;$i++ ) { |
|||
?> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{php echo $i}" name="package[day][]" />{php echo $i} |
|||
</label> |
|||
<?php |
|||
} |
|||
?> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用限制</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="package[limit]" class="form-control" value="{$package['limit']}" id="use_limit" /> |
|||
<span class="help-block">如:300元以内;酒水饮料除外;两人同行一人免单;</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包限制</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">每日限</span> |
|||
<input type="tel" placeholder="请输入整数数字" class="form-control" name="package[timeslimit]" value="{$package[timeslimit]}"/> |
|||
<span class="input-group-addon">次,总数限</span> |
|||
<input type="tel" placeholder="请输入整数数字" class="form-control" name="package[allnum]" value="{$package[allnum]}"/> |
|||
<span class="input-group-addon">次</span> |
|||
</div> |
|||
<span class="help-block">礼包单日使用次数以及活动提供的总数量,填0或不填则无限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">用户限制</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">每天限</span> |
|||
<input type="tel" placeholder="请输入整数数字" class="form-control" name="package[oplimit]" value="{$package[oplimit]}"/> |
|||
<span class="input-group-addon">次,每周限</span> |
|||
<input type="tel" placeholder="请输入整数数字" class="form-control" name="package[weeklimit]" value="{$package[weeklimit]}"/> |
|||
<span class="input-group-addon">次,每月限</span> |
|||
<input type="tel" placeholder="请输入整数数字" class="form-control" name="package[monthlimit]" value="{$package[monthlimit]}"/> |
|||
<span class="input-group-addon">次</span> |
|||
</div> |
|||
<span class="help-block">每人每天、每周、每月的使用次数,填0或不填则无限制</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">等级限制</label> |
|||
<div class="col-sm-9"> |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="0" {if in_array(0,$package['level'])} checked {/if} name="package[level][]" />{$_W['wlsetting']['halflevel']['name']} |
|||
</label> |
|||
{loop $levels $level} |
|||
<label class="checkbox-inline"> |
|||
<input type="checkbox" value="{$level['id']}" {if in_array($level['id'],$package['level'])} checked {/if} name="package[level][]" />{$level['name']} |
|||
</label> |
|||
{/loop} |
|||
<span class="help-block">如果全都不勾选则默认全等级可用</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">限制开卡时间</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#timestatus').hide()"> |
|||
<input type="radio" value="0" name="timestatus" {if $package['timestatus'] == 0 || empty($package) } checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#timestatus').show()"> |
|||
<input type="radio" value="1" name="timestatus" {if $package['timestatus'] == 1 } checked {/if}>启用 |
|||
</label> |
|||
<div class="help-block">开启后,只有在设定时间内开卡的用户可以领取礼包</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="timestatus" {if $package['timestatus'] == 0 || empty($package)} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">开卡时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('time',array('starttime'=>date('Y-m-d H:i:s',$starttime),'endtime'=>date('Y-m-d H:i:s',$endtime)));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">限时活动</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline" onclick="$('#packtimestatus').hide()"> |
|||
<input type="radio" value="0" name="packtimestatus" {if $package['packtimestatus'] == 0 || empty($package) } checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline" onclick="$('#packtimestatus').show()"> |
|||
<input type="radio" value="1" name="packtimestatus" {if $package['packtimestatus'] == 1 } checked {/if}>启用 |
|||
</label> |
|||
<div class="help-block">开启后,只有在活动时间内才可以领取礼包</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="packtimestatus" {if $package['packtimestatus'] == 0 || empty($package)} style="display: none;" {/if}> |
|||
<label class="col-sm-2 control-label">活动时间</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
{php echo tpl_select_time_info('datetime',array('starttime'=>date('Y-m-d H:i:s',$datestarttime),'endtime'=>date('Y-m-d H:i:s',$dateendtime)));} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">续卡是否重置</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="resetswitch" {if $package['resetswitch'] == 0 || empty($package) } checked {/if}>禁用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="resetswitch" {if $package['resetswitch'] == 1 } checked {/if}>启用 |
|||
</label> |
|||
<div class="help-block">开启后,一卡通用户续费可以重置使用次数</div> |
|||
</div> |
|||
</div> |
|||
<!--<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">提前预约</label> |
|||
<div class="col-md-4"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">请提前</span> |
|||
<input type="tel" placeholder="可不填" class="form-control" name="package[appointment]" value="{$package[appointment]}"/> |
|||
<span class="input-group-addon">小时</span> |
|||
</div> |
|||
</div> |
|||
<label class="col-sm-2 control-label">赠送积分</label> |
|||
<div class="col-md-4"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">核销获得</span> |
|||
<input type="tel" placeholder="可不填" class="form-control" name="package[integral]" value="{$package[integral]}"/> |
|||
<span class="input-group-addon">积分</span> |
|||
</div> |
|||
</div> |
|||
</div>--> |
|||
{if !is_store()} |
|||
<div class="form-group" style="display: block;"> |
|||
<label class="col-sm-2 control-label">礼包排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="tel" class="form-control" name="package[sort]" value="{$package[sort]}"/> |
|||
<span class="help-block">请输入整数数字,序号越大,排序靠前</span> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('package[describe]', $package['describe']);} |
|||
</div> |
|||
</div> |
|||
{if !is_store()} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">列表显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="package[listshow]" {if $package['listshow'] == 0 || empty($package) } checked {/if}>启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="package[listshow]" {if $package['listshow'] == 1 } checked {/if}>禁用 |
|||
</label> |
|||
<div class="help-block">关闭后,在首页和一卡通列表页面不会显示该礼包</div> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<input type="checkbox" class="js-switch" name="package[status]" {if $package['status'] == 1 || empty($package) } checked="checked" {/if}> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div id="modal-module-merchant" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h3>选取</h3></div> |
|||
<div class="modal-body"> |
|||
<div class="row"> |
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" name="keyword" value="" id="search-kwd-merchant" placeholder="请输入商家名称,不输入任何内容搜索结果为所有商家。" /> |
|||
<span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_merchant();">搜索</button></span> |
|||
</div> |
|||
</div> |
|||
<div id="module-merchant" style="padding-top:5px;"></div> |
|||
</div> |
|||
<div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
$(function () { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function (e) { |
|||
e.preventDefault();//阻止a链接的跳转行为 |
|||
$(this).tab('show');//显示当前选中的链接及关联的content |
|||
}); |
|||
var dailyflag = $('#dailyflag').val(); |
|||
//alert(dailyflag); |
|||
if(dailyflag == 0){ |
|||
$('#discount').hide(); |
|||
}else{ |
|||
$('#discount').show(); |
|||
} |
|||
}); |
|||
</script> |
|||
<script language='javascript'> |
|||
$('#commentForm').submit(function(){ |
|||
{if !is_store()} |
|||
if($('#namemerchant').val() == '') { |
|||
$('#namemerchant').focus(); |
|||
util.tips("请选择商户"); |
|||
return false; |
|||
} |
|||
{/if} |
|||
if($('#storetitle').val() == '') { |
|||
util.tips("请填写活动名称"); |
|||
$('#storetitle').focus(); |
|||
return false; |
|||
} |
|||
if($('#usetimes').val() == '') { |
|||
util.tips("请填写使用次数"); |
|||
$('#usetimes').focus(); |
|||
return false; |
|||
} |
|||
if($('#price').val() == '') { |
|||
util.tips("请填写礼包价值"); |
|||
$('#price').focus(); |
|||
return false; |
|||
} |
|||
// if(!$.trim($(':input[name="package[adv]"]').val())){ |
|||
// util.tips("请至少选择一张幻灯片"); |
|||
// return false; |
|||
// } |
|||
if(!$.trim($(':input[name="package[describe]"]').val())){ |
|||
util.tips("请填写使用说明"); |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
}); |
|||
|
|||
function inspect(){ |
|||
var merchantid = $('#sidmerchant').val(); |
|||
$.post("{php echo web_url('halfcard/halfcard_web/inspect')}", { id : merchantid,type:2}, function(data){ |
|||
if(data.errno){ |
|||
util.tips("该商户已有大礼包活动"); |
|||
}else{ |
|||
if($('#storetitle').val().length < 1){ |
|||
$('#storetitle').val($('#namemerchant').val()); |
|||
} |
|||
util.tips("操作成功"); |
|||
} |
|||
}, 'json'); |
|||
} |
|||
|
|||
function search_merchant() { |
|||
$("#module-merchant").html("正在搜索....") |
|||
$.get("{php echo web_url('halfcard/halfcard_web/selectMerchant',array('type'=>2))}", { |
|||
keyword: $.trim($('#search-kwd-merchant').val()) |
|||
}, function(dat){ |
|||
$('#module-merchant').html(dat); |
|||
}); |
|||
} |
|||
function remove_merchant(obj){ |
|||
$('#goodsidmerchant').val(''); |
|||
$('#namemerchant').val(''); |
|||
$('#imgmerchant').attr("src",''); |
|||
$('#sidmerchant').val(''); |
|||
} |
|||
function select_merchant(o) { |
|||
var lastid = $('#sidmerchant').val(); |
|||
var fristid = $('#firstid').val(); |
|||
if (lastid != o.id) { |
|||
$('#sidmerchant').val(o.id); |
|||
$('#namemerchant').val(o.storename); |
|||
$('#imgmerchant').attr("src",o.logo); |
|||
$('#modal-module-merchant').modal('hide'); |
|||
inspect(); |
|||
}else{ |
|||
$('#modal-module-merchant').modal('hide'); |
|||
} |
|||
} |
|||
function asd(){ |
|||
var dailyflag = $('#dailyflag').val(); |
|||
if (dailyflag == 0) { |
|||
$('#discount').show(); |
|||
$('#dailyflag').val(1); |
|||
}else{ |
|||
$('#discount').hide(); |
|||
$('#dailyflag').val(0); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,68 @@ |
|||
<div class="app-form"> |
|||
<form {if $ac} action="{php echo web_url('halfcard/halftype/editmember')}" {else} action="{php echo web_url('halfcard/halfcard_web/editmember')}" {/if} method="post" class="form-horizontal form-validate"> |
|||
<div class="modal-dialog" style="z-index: 50;"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">编辑会员</h4> |
|||
</div> |
|||
<div class="modal-body" style="margin-left: 100px;"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">过期时间</label> |
|||
<div class="col-md-7"> |
|||
{php echo tpl_form_field_date('expiretime',date('Y-m-d H:i:s',$halfmember['expiretime']),true);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员等级</label> |
|||
<div class="col-md-7"> |
|||
<select name="levelid" style="width: 100%;"> |
|||
<option value="0" {if $halfmember['levelid'] == 0 || empty($halfmember['levelid'])} selected="selected" {/if} >{$delevel['name']}</option> |
|||
{loop $levels $level} |
|||
<option value="{$level['id']}" {if $halfmember['levelid'] == $level['id']} selected="selected" {/if} >{$level['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="disable" {if $halfmember['disable'] == 0 || empty($halfmember['disable'])} checked="checked" {/if} > 启用 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="disable" {if $halfmember['disable'] == 1 } checked="checked" {/if} > 禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<input type="hidden" name="id" id="id" value="{$halfmember['id']}" /> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
<button type="submit" class="btn btn-primary">提交更改</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<script> |
|||
$(document).on('show.bs.modal', '.modal', function(event) { |
|||
$(this).appendTo($('body')); |
|||
}).on('shown.bs.modal', '.modal.in', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}).on('hidden.bs.modal', '.modal', function(event) { |
|||
setModalsAndBackdropsOrder(); |
|||
}); |
|||
|
|||
|
|||
function setModalsAndBackdropsOrder() { |
|||
var modalZIndex = 1040; |
|||
$('.modal.in').each(function(index) { |
|||
var $modal = $(this); |
|||
modalZIndex++; |
|||
$modal.css('zIndex', modalZIndex); |
|||
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1); |
|||
}); |
|||
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden'); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,39 @@ |
|||
{php include wl_template('common/header');} |
|||
<div class="app-content"> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">说明设置</a></li> |
|||
</ul> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">说明设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">会员权益说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('describe',$set['describe']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">非会员说明</label> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('nodescribe',$set['nodescribe']);} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,352 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.trbody td{text-align: center;vertical-align:top;border-left:1px solid #ccc;border-bottom: 1px solid #ddd;} |
|||
.order-rank img{width:16px;height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all;overflow:hidden;background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: inherit;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{border-top: 1px solid rgba(221, 221, 221, 0);} |
|||
.col-md-1{padding-right: 0px;} |
|||
.all-tips{margin-left: 65px;} |
|||
span.effect-time{font-size: 12px;display: block;font-weight: 500;} |
|||
.row.row-fix, .form-group.form-group-fix{margin-left: -15px;margin-right: -15px;width: 500px;} |
|||
button.btn.btn-default.daterange.daterange-date{float: left;margin-left: 234px;position: absolute;z-index: 100;} |
|||
#sel_child{z-index: 10;width: 200px;position: absolute;display: none;} |
|||
.show1{display: block;} |
|||
.hide1{display: none;} |
|||
.daterange-date{display: none;} |
|||
.sty{display: block;width: 100%;font-size: 13px;height: 46px;overflow: hidden;white-space: nowrap;line-height: 46px;text-overflow: ellipsis;text-align: center;} |
|||
.spe{display: inline-block;text-align: center;display: block;height: 33px;margin-left: -12px;padding-top: 0px;line-height: 33px;} |
|||
.table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{white-space: normal;} |
|||
span.ppp{text-align: center;display: inline-block;font-size: 14px;width: 100%;overflow: hidden;text-overflow: ellipsis;color: #e43;} |
|||
select#sel_parent{z-index: 1000;} |
|||
.nickname{margin-left: 94px;height: 34px;width: 200px;} |
|||
.col-xs-12.col-sm-6.col-sm-9.col-lg-6{z-index: 9999;} |
|||
.start-time{font-size: 12px;} |
|||
.end-time{font-size: 12px;} |
|||
.mouth{margin-left: 94px;height: 34px;width:130px;display: none;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">商家特权</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"><a href="{php echo web_url('halfcard/halfcard_web/createHalfcard');}" class="btn btn-primary">添加特权</a></div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="halfcard_web" /> |
|||
<input type="hidden" name="do" value="halfcardList" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<input type="hidden" name="daily" value="{$_GPC['daily']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特权状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">启用中</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">未启用</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">审核中</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">被驳回</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">平时折扣</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('daily:0');}" class="btn {if intval($_GPC['daily']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('daily:1');}" class="btn {if $_GPC['daily'] == 1}btn-primary{else}btn-default{/if}">有</a> |
|||
<a href="{php echo wl_filter_url('daily:2');}" class="btn {if $_GPC['daily'] == 2}btn-primary{else}btn-default{/if}">无</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>特权标题</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>按星期</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>按月天数</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="order-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:40px">序号</th> |
|||
<th style="width:190px;text-align:center;">特权标题</th> |
|||
<th style="width:150px;text-align:center;">所属商家</th> |
|||
<th style="width:180px; text-align:center;">使用限制说明</th> |
|||
<th style="width:60px; text-align: center;">特权折扣</th> |
|||
<th style="width:120px; text-align: center;">活动时间</th> |
|||
<th style="width:60px; text-align: center;">平时折扣</th> |
|||
<th style="width:90px; text-align: center;">状态</th> |
|||
<th style="width:90px; text-align: center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $halfcard $y $item} |
|||
<tr> |
|||
<td style="width: 40px;" ><center>{php echo $y+1}</center></td> |
|||
<td class="goods-info line-feed" style="width:190px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$item['title']}</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<p>{$item['storename']}</p> |
|||
</td> |
|||
<td class="text-center" style="width:180px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<p>{$item['limit']}</p> |
|||
</td> |
|||
<td class="text-center" style="width:60px;"> |
|||
<span class="label label-default">{if $item['datestatus'] !=3 } {$item['activediscount']}折 {else}无{/if}</span> |
|||
</td> |
|||
<td class="text-center" style="width: 120px; font-size: 12px;" id="td1"> |
|||
{if $item['datestatus'] == 1} |
|||
{loop $item['week'] $week} |
|||
{if $week==1}<span>星期一</span>,{/if} |
|||
{if $week==2}<span>星期二</span>,{/if} |
|||
{if $week==3}<span>星期三</span>,{/if} |
|||
{if $week==4}<span>星期四</span>,{/if} |
|||
{if $week==5}<span>星期五</span>,{/if} |
|||
{if $week==6}<span>星期六</span>,{/if} |
|||
{if $week==7}<span>星期日</span>{/if} |
|||
{/loop} |
|||
{else if $item['datestatus'] == 2} |
|||
{loop $item['day'] $day} |
|||
<span>{$day}号,</span> |
|||
{/loop} |
|||
{else} |
|||
<span class="label label-default">无特权折扣</span> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:60px;"> |
|||
{if $item['daily']==1}<span class="label label-success">{$item['discount']}折</span>{/if} |
|||
{if $item['daily']==0}<span class="label label-danger">无折扣</span>{/if} |
|||
</td> |
|||
<td class="text-center" id="text-click" order-id="{$item['id']}" order-status="{$item['status']}" style="width:90px;"> |
|||
<a> |
|||
{if $item['status']==1}<span class="label label-success">已启用</span>{/if} |
|||
{if $item['status']==0}<span class="label label-default">已禁用</span>{/if} |
|||
{if $item['status']==2}<span class="label label-warning">审核中</span>{/if} |
|||
{if $item['status']==3}<span class="label label-danger">已驳回</span>{/if} |
|||
</a> |
|||
</td> |
|||
<td class="text-center"> |
|||
<a href="{php echo web_url('halfcard/halfcard_web/userhalfcardlist', array('id' => $item['id'],'title'=>$item['title']))}" >使用记录 -</a> |
|||
{if $item['status'] == 2 || $item['status'] == 3} |
|||
<a href="javascript:;" class="js-pass" order-id="{$item['id']}" > 通过 -</a> |
|||
{/if} |
|||
{if $item['status'] == 2} |
|||
<a href="javascript:;" class="js-reject" order-id="{$item['id']}" > 驳回 -</a> |
|||
{/if} |
|||
<a href="{php echo web_url('halfcard/halfcard_web/editHalfcard', array('id' => $item['id']))}" class="js-edit" order-id="{$item['id']}"> 编辑 -</a> |
|||
<a href="javascript:;" class="js-remove" order-id="{$item['id']}" >删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
$('.panel-default').delegate('#text-click', 'click', function(e){ |
|||
|
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var status = $this.attr('order-status'); |
|||
var statushtml = (status != 0) ? "已禁用" : "已启动"; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/delete')}", {id:id,status:status}, function(data){ |
|||
console.log(data); |
|||
if(!data.errno){ |
|||
util.tips(statushtml+"成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}); |
|||
$('#output').click(function(){ |
|||
var orderType = '{$_GPC['orderType']}'; |
|||
var status = '{$_GPC['status']}'; |
|||
var paytype = '{$_GPC['pay_type']}'; |
|||
var keywordtype = '{$_GPC['keywordtype']}'; |
|||
var keyword = '{$_GPC['keyword']}'; |
|||
var timetype = '{$_GPC['timetype']}'; |
|||
var times = "{$_GPC['time']['start']}"; |
|||
var timee = "{$_GPC['time']['end']}"; |
|||
location.href = "{php echo web_url('halfcard/order/output')}&orderType="+orderType+"&status="+status+"&paytype="+paytype+"&keywordtype="+keywordtype+"&keyword="+keyword+"&timetype="+timetype+"×="+times+"&timee="+timee; |
|||
}); |
|||
$(function(){ |
|||
{if ($flag1 || $daily)} |
|||
$('#sel_child').show(); |
|||
$('#box2').hide(); |
|||
{/if} |
|||
$('[name="rank_all"]').click(function() { |
|||
var checked = this.checked; |
|||
$('.js-rank').find('input:checkbox').each(function() { |
|||
this.checked = checked; |
|||
}); |
|||
}); |
|||
$('#export').click(function() { |
|||
if ($('[name="selecttime[start]"]').val() == '') { |
|||
alert('请选择下单时间'); |
|||
$(this).focus(); |
|||
return false; |
|||
}; |
|||
$(this).attr('type', 'submit').submit(); |
|||
}); |
|||
|
|||
$('.order-rank').each(function(){ |
|||
o.rank(this); |
|||
}); |
|||
|
|||
//删除 |
|||
$('.order-list').delegate('.js-remove', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
tip.confirm("此操作会删除特权活动,同时导致订单商品数据缺失或其他问题,确定要删除吗?",function () { |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deleteHalfcard')}", {id: id}, function (data) { |
|||
if (!data.errno) { |
|||
$this.parent().parent().parent().remove(); |
|||
util.tips("删除成功!"); |
|||
} |
|||
|
|||
; |
|||
}, 'json'); |
|||
}); |
|||
}); |
|||
|
|||
$('.order-list').delegate('.js-pass', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var flag = 1; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/passHalfcard')}", { id : id , flag : flag, type : 1}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("通过成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '通过审核?'}); |
|||
}); |
|||
$('.order-list').delegate('.js-reject', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var flag = 0; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/passHalfcard')}", { id : id , flag : flag, type : 1 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("驳回成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认驳回?'}); |
|||
}); |
|||
|
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
// alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deleteHalfcard')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
$('#sel_parent').click(function(){ |
|||
if(this.value != 1 && this.value != 4){ |
|||
$('.daterange-date').hide(); |
|||
$('#sel_child').hide(); |
|||
$(".nickname").removeAttr("style"); |
|||
$('.nickname').show(); |
|||
$('.mouth').hide; |
|||
$('.mouth').removeAttr('style'); |
|||
} |
|||
else{ |
|||
$('.daterange-date').hide(); |
|||
$('.nickname').hide(); |
|||
$('#sel_child').show(); |
|||
$('#sel_child').attr("display","block"); |
|||
$('.mouth').hide(); |
|||
} |
|||
//alert(this.value); |
|||
if(this.value==0){ |
|||
$('#sel_child').hide(); |
|||
$('.mouth').hide; |
|||
} |
|||
if(this.value==3){ |
|||
$('#sel_child').hide(); |
|||
$('.mouth').show(); |
|||
} |
|||
}); |
|||
|
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,358 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">用户列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<style type='text/css'> |
|||
.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.all-tips{margin-left: 65px;} |
|||
</style> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" {if $ac} value="{$ac}"{else} value="halfcard_web" {/if} /> |
|||
<input type="hidden" name="do" value="memberlist" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">商品状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">使用中</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">已失效</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>用户昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>用户电话</option> |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>实卡编号</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">时间筛选</label> |
|||
<div class="col-md-3"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="">请选择时间类型</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>开通时间</option> |
|||
<option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>过期时间</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="btn btn-primary" id="search">搜索</span> |
|||
<span class="btn btn-default" id="output">导出</span> |
|||
<input type="hidden" value="0" name="outflag" id="outflag" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#outflag').val(0); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
$("#output").click(function(){ |
|||
$('#outflag').val(1); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
function sandh(asd){ |
|||
if ($(asd).val() == 3) { |
|||
$('#keyword').hide(); |
|||
$('#usetype').show(); |
|||
}else{ |
|||
$('#keyword').show(); |
|||
$('#usetype').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width: 30px;"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th style="width:130px;text-align:center;">持卡人信息</th> |
|||
<th style="width:80px;text-align: center;">用户电话</th> |
|||
{if is_file(PATH_MODULE.'N814.log')} |
|||
<th style="width:80px;text-align: center;">银行卡号</th> |
|||
{/if} |
|||
<th style="width:100px; text-align:center;">开通时间</th> |
|||
<th style="width:50px; text-align:center;">用户状态</th> |
|||
<th style="width:60px; text-align:center;">用户等级</th> |
|||
<th style="width:100px; text-align: center;">失效时间</th> |
|||
<th style="width:80px; text-align: center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $member $y $item} |
|||
<tr> |
|||
<td><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></td> |
|||
<!--用户昵称--> |
|||
<td class="goods-info line-feed" style="width:150px;padding-left: 10px;height: 60px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<p class="" style="margin-bottom: 3px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">{$item['username']}</p> |
|||
{if $item['cardsn']}<p class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">实卡编号:{$item['cardsn']}</p>{/if} |
|||
</div> |
|||
</td> |
|||
<!--用户电话--> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['mobile']} |
|||
</td> |
|||
{if is_file(PATH_MODULE.'N814.log')} |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['banknum']} |
|||
</td> |
|||
{/if} |
|||
<!--开通时间--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
<!--用户状态--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;" > |
|||
{if $item['status'] == 1} |
|||
<span class="label label-primary">使用中</span> |
|||
{/if} |
|||
{if $item['status'] == 2} |
|||
<span class="label label-danger">已失效</span> |
|||
{/if} |
|||
{if $item['status'] == 3} |
|||
<span class="label label-warning">被禁用</span> |
|||
{/if} |
|||
</td> |
|||
<!--用户等级--> |
|||
<td class="text-center" style="width: 110px;"> |
|||
{$item['levelname']} |
|||
</td> |
|||
<!--失效时间--> |
|||
<td class="text-center" style="width: 110px;"> |
|||
{php echo date('Y-m-d H:i:s',$item['expiretime'])} |
|||
</td> |
|||
<!--操作--> |
|||
<td class="text-center wsmne" style="width: 110px;"> |
|||
{if $ac} |
|||
<a href="{php echo web_url('halfcard/halftype/editmember',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑 -</a> |
|||
{else} |
|||
<a href="{php echo web_url('halfcard/halfcard_web/editmember',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑 -</a> |
|||
{/if} |
|||
{if $item['disable'] == 1} |
|||
<a class="nodisablemember" merid = {$item['id']} href="javascript:;">解除禁用 -</a> |
|||
{else} |
|||
<a class="disablemember" merid = {$item['id']} href="javascript:;">禁用 -</a> |
|||
{/if} |
|||
<a class="deletemember" merid = {$item['id']} href="javascript:;">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<div id="de1" class="pull-left"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete pass">批量删除</a> |
|||
</div> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--<div id="de1" style="margin-top: 15px;"> |
|||
<a href="javascript:;" class="btn btn-primary min-width js-batch js-delete">同步到VIP</a> |
|||
</div>--> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
{if $ac} |
|||
$('.wsmne').delegate('.disablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/disablemember')}", { id : id , flag : 1}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("禁用成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.nodisablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/disablemember')}", { id : id,flag : 2 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("解除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认解除禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.deletemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/deletemember')}", {id : id}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除用户可能导致记录信息错误或不全,确定要删除吗?'}); |
|||
}); |
|||
{else} |
|||
$('.wsmne').delegate('.disablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/disablemember')}", { id : id , flag : 1}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("禁用成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.nodisablemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/disablemember')}", { id : id,flag : 2 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("解除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认解除禁用该用户?'}); |
|||
}); |
|||
|
|||
$('.wsmne').delegate('.deletemember','click',function(e){ |
|||
e.stopPropagation(); |
|||
var id = $(this).attr('merid'); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deletemember')}", {id : id}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除用户可能导致记录信息错误或不全,确定要删除吗?'}); |
|||
}); |
|||
{/if} |
|||
</script> |
|||
<script type="text/javascript"> |
|||
$(function(){ |
|||
$('[name="rank_all"]').click(function() { |
|||
var checked = this.checked; |
|||
$('.js-rank').find('input:checkbox').each(function() { |
|||
this.checked = checked; |
|||
}); |
|||
}); |
|||
$('#export').click(function() { |
|||
if ($('[name="selecttime[start]"]').val() == '') { |
|||
alert('请选择下单时间'); |
|||
$(this).focus(); |
|||
return false; |
|||
}; |
|||
$(this).attr('type', 'submit').submit(); |
|||
}); |
|||
|
|||
$('.order-rank').each(function(){ |
|||
o.rank(this); |
|||
}); |
|||
|
|||
//批量删除会员 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var mem_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
mem_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = mem_ids; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deletemember')}",{id:ids}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除完成!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '删除用户可能导致记录信息错误或不全,确定要删除吗?',placement:'right'}); |
|||
}); |
|||
}); |
|||
|
|||
//转换日期 |
|||
var dt=$('.date1').text().replace(/^\s+|\s+$/g, ""); |
|||
var yy=dt.slice(0,4); |
|||
var mm=dt.slice(4,6); |
|||
var dd=dt.slice(6,8); |
|||
var str=(yy+'-'+mm+'-'+dd).toString(); |
|||
$('.date1').text(str); |
|||
|
|||
//二级联动切换 |
|||
$('#sel_parent').click(function(){ |
|||
|
|||
if(this.value!=0){ |
|||
$('.daterange-date').hide(); |
|||
$('#sel_child').hide(); |
|||
$(".nickname").removeAttr("style"); |
|||
$('.nickname').show(); |
|||
} |
|||
else{ |
|||
$('.daterange-date').hide(); |
|||
$('.nickname').hide(); |
|||
$('#sel_child').hide(); |
|||
$('#sel_child').attr("display","block"); |
|||
} |
|||
//alert(this.value); |
|||
//if(this.value==0) |
|||
// $('#sel_child').hide(); |
|||
}) |
|||
|
|||
|
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,218 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.trbody td{text-align: center;vertical-align:top;border-left:1px solid #ccc;border-bottom: 1px solid #ddd;} |
|||
.order-rank img{width:16px;height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all;overflow:hidden;background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
.col-md-1{padding-right: 0px;} |
|||
.all-tips{margin-left: 65px;} |
|||
span.effect-time{font-size: 12px;display: block;font-weight: 500;} |
|||
.row.row-fix, .form-group.form-group-fix{margin-left: -15px;margin-right: -15px;width: 500px;} |
|||
button.btn.btn-default.daterange.daterange-date{float: left;margin-left: 234px;position: absolute;z-index: 100;} |
|||
#sel_child{z-index: 10;width: 200px;position: absolute;display: none;} |
|||
.show1{display: block;} |
|||
.hide1{display: none;} |
|||
.daterange-date{display: none;} |
|||
.sty{display: block;width: 100%;font-size: 13px;height: 46px;overflow: hidden;white-space: nowrap;line-height: 46px;text-overflow: ellipsis;text-align: center;} |
|||
.spe{display: inline-block;text-align: center;display: block;height: 33px;margin-left: -12px;padding-top: 0px;line-height: 33px;} |
|||
.table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{white-space: normal;} |
|||
span.ppp{text-align: center;display: inline-block;font-size: 14px;width: 100%;overflow: hidden;text-overflow: ellipsis;color: #e43;} |
|||
select#sel_parent{z-index: 1000;} |
|||
.nickname{margin-left: 94px;height: 34px;width: 200px;} |
|||
.col-xs-12.col-sm-6.col-sm-9.col-lg-6{z-index: 9999;} |
|||
.start-time{font-size: 12px;} |
|||
.end-time{font-size: 12px;} |
|||
.mouth{margin-left: 94px;height: 34px;width:130px;display: none;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">商家大礼包</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"><a href="{php echo web_url('halfcard/halfcard_web/createpackage');}" class="btn btn-primary">添加大礼包</a></div> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="halfcard_web" /> |
|||
<input type="hidden" name="do" value="packagelist" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">不限</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">启用中</a> |
|||
<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == 4}btn-primary{else}btn-default{/if}">未启用</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">审核中</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">被驳回</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">礼包标题</label> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover order-list"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:190px;text-align:center;">礼包信息</th> |
|||
<th style="width:150px; text-align:center;">限制简介</th> |
|||
<th style="width:120px; text-align: center;">属性</th> |
|||
<th style="width:60px; text-align: center;">领取</th> |
|||
<th style="width:150px;text-align:center;">活动时间</th> |
|||
<th style="width:90px; text-align: center;">状态</th> |
|||
<th style="width:150px; text-align:center;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $packagelist $y $item} |
|||
<tr> |
|||
<td class="goods-info line-feed" style="width:190px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/halfcard_web/changeinfo',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改活动名" data-toggle="ajaxEdit" >{$item['title']}</a> |
|||
<p style="margin: 0;">{$item['storename']}</p> |
|||
</span> |
|||
</div> |
|||
</td> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<a style="color: #428bca;" data-href="{php echo web_url('halfcard/halfcard_web/changeinfo',array('id' => $item['id'],'type'=>5))}" href="javascript:;" title="修改简介" data-toggle="ajaxEdit" >{$item['limit']}</a> |
|||
</td> |
|||
{if !is_store()} |
|||
<td class="text-center" style="width:120px;"> |
|||
<p style="margin: 0;">人气:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/halfcard_web/changeinfo',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改人气" data-toggle="ajaxEdit" >{$item['pv']}</a></p> |
|||
<p style="margin: 0;">排序:<a style="color: #428bca;" data-href="{php echo web_url('halfcard/halfcard_web/changeinfo',array('id' => $item['id'],'type'=>3))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$item['sort']}</a></p> |
|||
</td> |
|||
{else} |
|||
<td class="text-center" style="width:120px;"> |
|||
<p style="margin: 0;">人气:{$item['pv']}</p> |
|||
<p style="margin: 0;">排序:{$item['sort']}</p> |
|||
</td> |
|||
{/if} |
|||
<td class="text-center" style="width:60px;"> |
|||
<a style="color: #428bca;" href="{php echo web_url('halfcard/halfcard_web/userhalfcardlist',array('type'=>2,'id'=>$item['id']))}">{$item['givenum']}</a> |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
{if $item['packtimestatus']} |
|||
<p style="margin: 0;">{$item['datestarttime']}</p> |
|||
<p style="margin: 0;">{$item['dateendtime']}</p> |
|||
{else} |
|||
<p>长期</p> |
|||
{/if} |
|||
</td> |
|||
<td class="text-center" style="width:90px;"> |
|||
{if $item['status']==1}<span class="label label-success">已启用</span>{/if} |
|||
{if $item['status']==0}<span class="label label-default">已禁用</span>{/if} |
|||
{if $item['status']==2}<span class="label label-warning">审核中</span>{/if} |
|||
{if $item['status']==3}<span class="label label-danger">已驳回</span>{/if} |
|||
</td> |
|||
<td class="text-center" style="width:150px;"> |
|||
{if $item['status'] == 2 || $item['status'] == 3} |
|||
<a href="javascript:;" class="js-pass" order-id="{$item['id']}" > 通过 -</a> |
|||
{/if} |
|||
{if $item['status'] == 2} |
|||
<a href="javascript:;" class="js-reject" order-id="{$item['id']}" > 驳回 -</a> |
|||
{/if} |
|||
<a href="{php echo web_url('halfcard/halfcard_web/createpackage', array('id' => $item['id']))}" class="js-edit" order-id="{$item['id']}"> 编辑 -</a> |
|||
<a data-toggle="ajaxRemove" href="{php echo web_url('halfcard/halfcard_web/changeinfo',array('id' => $item['id'],'type'=>4))}" data-confirm="确认删除此活动?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
$(function(){ |
|||
$('.order-list').delegate('.js-pass', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var flag = 1; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/passHalfcard')}", { id : id , flag : flag, type : 2}, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("通过成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '通过审核?'}); |
|||
}); |
|||
$('.order-list').delegate('.js-reject', 'click', function(e){ |
|||
e.stopPropagation(); |
|||
var $this = $(this); |
|||
var id = $this.attr('order-id'); |
|||
var flag = 0; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/passHalfcard')}", { id : id , flag : flag , type : 2 }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("驳回成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认驳回?'}); |
|||
}); |
|||
|
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
// alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deleteHalfcard')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,255 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING}) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.all-tips{margin-left: 65px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#">开通记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" value="halfcard_web" /> |
|||
<input type="hidden" name="do" value="payhalfcardlist" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>用户昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>用户电话</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">开通时间</label> |
|||
<div class="col-md-2"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
<button class="btn btn-default" id="output">导出</button> |
|||
<input type="hidden" value="0" name="outflag" id="outflag" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:150px;text-align:center;">用户信息</th> |
|||
<th style="width:150px;text-align: center;">用户电话</th> |
|||
<th style="width:150px;text-align: center;">所属代理</th> |
|||
<th style="width:100px; text-align:center;">充值时长</th> |
|||
<th style="width:100px; text-align:center;">订单金额</th> |
|||
<th style="width:100px; text-align:center;">结算状态</th> |
|||
<th style="width:110px; text-align: center;">支付时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $pay $y $item} |
|||
<tr> |
|||
<!--一卡通内容--> |
|||
<td class="goods-info line-feed" style="width:150px;padding-left: 10px;height: 60px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<p class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;">{$item['nickname']}</p> |
|||
{if !empty($item['moinfo'])} |
|||
<a class="todetail" orderid = {$item['id']} href="javascript:;">更多信息</a> |
|||
{/if} |
|||
</div> |
|||
</td> |
|||
<!--用户信息--> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['mobile']} |
|||
</td> |
|||
<td class="text-center" style="width:150px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['agentuser']} |
|||
</td> |
|||
<!--创建时间--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['paytime'] > 1482135700} |
|||
{$item['howlong']}天 |
|||
{else} |
|||
{$item['howlong']}个月 |
|||
{/if} |
|||
</td> |
|||
<!--核销时间--> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;" > |
|||
{$item['price']}元 |
|||
</td> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;" > |
|||
{if $item['issettlement']==0}<span class="label label-info">未申请</span>{/if} |
|||
{if $item['issettlement']==1}<span class="label label-info">已结算</span>{/if} |
|||
</td> |
|||
<!--验证码--> |
|||
<td class="text-center" style="width: 110px;"> |
|||
{php echo date('Y-m-d H:i:s',$item['paytime'])} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="modal-module-gift" class="modal fade" tabindex="-1"> |
|||
<div class="modal-dialog" style='width: 920px;'> |
|||
<div class="modal-content" style="overflow: auto;"> |
|||
<div class="modal-header"> |
|||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> |
|||
<h2>更多信息</h2> |
|||
</div> |
|||
<div class="modal-body"> |
|||
<div id="detail" class="modal-body" style="padding:0;"></div> |
|||
</div> |
|||
<div class="modal-footer" style="padding: 5px 15px;"> |
|||
<a class="btn btn-primary js-order-remark-post" data-dismiss="modal" aria-hidden="true">确定</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#outflag').val(0); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
$("#output").click(function(){ |
|||
$('#outflag').val(1); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
function sandh(asd){ |
|||
if ($(asd).val() == 3) { |
|||
$('#keyword').hide(); |
|||
$('#howlong').show(); |
|||
}else{ |
|||
$('#keyword').show(); |
|||
$('#howlong').hide(); |
|||
} |
|||
} |
|||
</script> |
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
|
|||
$(function(){ |
|||
$('[name="rank_all"]').click(function() { |
|||
var checked = this.checked; |
|||
$('.js-rank').find('input:checkbox').each(function() { |
|||
this.checked = checked; |
|||
}); |
|||
}); |
|||
$('#export').click(function() { |
|||
if ($('[name="selecttime[start]"]').val() == '') { |
|||
alert('请选择下单时间'); |
|||
$(this).focus(); |
|||
return false; |
|||
}; |
|||
$(this).attr('type', 'submit').submit(); |
|||
}); |
|||
|
|||
$('.order-rank').each(function(){ |
|||
o.rank(this); |
|||
}); |
|||
|
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
|
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deleteHalfcardRecord')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
|
|||
//转换日期 |
|||
var dt=$('.date1').text().replace(/^\s+|\s+$/g, ""); |
|||
var yy=dt.slice(0,4); |
|||
var mm=dt.slice(4,6); |
|||
var dd=dt.slice(6,8); |
|||
var str=(yy+'-'+mm+'-'+dd).toString(); |
|||
$('.date1').text(str); |
|||
|
|||
//二级联动切换 |
|||
$('#sel_parent').click(function(){ |
|||
|
|||
if(this.value!=0){ |
|||
$('.daterange-date').hide(); |
|||
$('#sel_child').hide(); |
|||
$(".nickname").removeAttr("style"); |
|||
$('.nickname').show(); |
|||
} |
|||
else{ |
|||
$('.daterange-date').hide(); |
|||
$('.nickname').hide(); |
|||
$('#sel_child').hide(); |
|||
$('#sel_child').attr("display","block"); |
|||
} |
|||
//alert(this.value); |
|||
//if(this.value==0) |
|||
// $('#sel_child').hide(); |
|||
}) |
|||
|
|||
$('.todetail').click(function(){ |
|||
$("#detail").html(''); |
|||
popwin = $('#modal-module-gift').modal(); |
|||
var id = $(this).attr('orderid'); |
|||
$.ajax({ |
|||
url: "{php echo web_url('halfcard/halftype/moreinfo')}&id="+id, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$("#detail").html(html); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,25 @@ |
|||
<div class="form-group sms-template-1 data-item"> |
|||
<div class="col-sm-9 col-xs-12 col-md-offset-2"> |
|||
<div class="input-group col-sm-9" style="margin: 0px;padding-right: 10px;float: left;"> |
|||
<span class="input-group-addon" >名称</span> |
|||
<input type="text" name="hcname[]" class="form-control" value="{$data['hcname']}" /> |
|||
</div> |
|||
<!--<input type="text" name="data_temp[]" class="form-control valid" value="{$data['data_temp']}">--> |
|||
<div class="input-group form-group col-sm-3" style="margin: 0px;padding-right: 10px;float: left;"> |
|||
<span class="input-group-addon" >时长</span> |
|||
<input type="text" name="howlong[]" class="form-control valid" value="{$data['howlong']}"> |
|||
<span class="input-group-addon" >天</span> |
|||
</div> |
|||
<div class="input-group form-group col-sm-9" style="margin: 0px;padding-right: 0;float: left;"> |
|||
<span class="input-group-addon" >¥</span> |
|||
<input type="text" name="hcprice[]" class="form-control valid" value="{$data['hcprice']}"> |
|||
<span class="input-group-addon btn btn-default data-item-delete"><i class="fa fa-remove"></i> 删除</span> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$(document).on('click', '.data-item-delete', function () { |
|||
$(this).closest('.data-item').remove(); |
|||
}); |
|||
</script> |
|||
@ -0,0 +1,277 @@ |
|||
{php include wl_template('common/header');} |
|||
<style type='text/css'> |
|||
.trbody td{text-align: center;vertical-align:top;border-left:1px solid #ccc;border-bottom: 1px solid #ddd;} |
|||
.order-rank img{width:16px;height:16px;} |
|||
.js-remark,.js-admin-remark{word-break:break-all;overflow:hidden;background: #FDEEEE;color: #ED5050;padding: 5px 10px;} |
|||
td.goods-info{position:relative;padding-left:60px;} |
|||
.goods-info .img{position:absolute;top:50%;margin-top:-25px;background: url({IMAGE_LOADING} |
|||
) center center no-repeat;width:50px;height:50px;} |
|||
.goods-info span{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;} |
|||
.status-text{cursor:pointer;} |
|||
.col-md-1{padding-right: 0px;} |
|||
.all-tips{margin-left: 65px;} |
|||
span.effect-time{font-size: 12px;display: block;font-weight: 500;} |
|||
.row.row-fix, .form-group.form-group-fix{margin-left: -15px;margin-right: -15px;width: 500px;} |
|||
button.btn.btn-default.daterange.daterange-date{float: left;position: absolute;z-index: 100;} |
|||
#sel_child{z-index: 10;width: 200px;position: absolute;display: none;} |
|||
.show1{display: block;} |
|||
.hide1{display: none;} |
|||
.sty{display: block;width: 100%;font-size: 13px;height: 46px;overflow: hidden;white-space: nowrap;line-height: 46px;text-overflow: ellipsis;text-align: center;} |
|||
.spe{display: inline-block;text-align: center;display: block;height: 33px;margin-left: -12px;padding-top: 0px;line-height: 33px;} |
|||
.table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{white-space: normal;} |
|||
span.ppp{text-align: center;display: inline-block;font-size: 14px;width: 100%;overflow: hidden;text-overflow: ellipsis;color: #e43;} |
|||
select#sel_parent{z-index: 1000;} |
|||
.nickname{margin-left: 94px;height: 34px;width: 200px;display: block;} |
|||
.col-xs-12.col-sm-6.col-sm-9.col-lg-6{z-index: 9999;} |
|||
.start-time{font-size: 12px;} |
|||
.end-time{font-size: 12px;} |
|||
</style> |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active" ><a href="javascript:;">使用记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="weliam_smartcity" /> |
|||
<input type="hidden" name="p" value="halfcard" /> |
|||
<input type="hidden" name="ac" {if $ac} value="{$ac}" {else} value="halfcard_web" {/if} /> |
|||
<input type="hidden" name="do" {if $ac} value="uselists" {else} value="userhalfcardlist" {/if} /> |
|||
<input type="hidden" name="type" value="{$type}" /> |
|||
<div class="form-group max-with-all"> |
|||
<label class="col-sm-2 control-label">类型</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('type:1');}" class="btn {if $type == 1}btn-primary{else}btn-default{/if}">特权</a> |
|||
<a href="{php echo wl_filter_url('type:2');}" class="btn {if $type == 2}btn-primary{else}btn-default{/if}">礼包</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">关键字</label> |
|||
<div class="col-md-3"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="">关键字类型</option> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>活动信息</option> |
|||
{if !is_store()} |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>商户信息</option> |
|||
{/if} |
|||
<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>用户姓名</option> |
|||
<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>用户电话</option> |
|||
<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>核销员姓名</option> |
|||
</select> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">使用时间</label> |
|||
<div class="col-md-3"> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" id="export" value="0" name="export" /> |
|||
<button class="btn btn-default" id="search"><i class="fa fa-search"></i> 搜索</button> |
|||
<button class="btn btn-default btn-w-m" id="search2"><i class="fa fa-download"></i> 导出记录</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
$("#search").click(function(){ |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
$("#search2").click(function(){ |
|||
$('#export').val(1); |
|||
$('#form1')[0].submit(); |
|||
}); |
|||
</script> |
|||
<div class="app-table-list"> |
|||
<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;"> |
|||
<table class="table table-bordered table-hover"> |
|||
<thead style="background-color: #FFFFFF;"> |
|||
<tr> |
|||
<th style="width:30px;" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th style="width:150px;text-align:center;">活动信息</th> |
|||
<th style="width:120px ;text-align: center;">商户信息</th> |
|||
<th style="width:150px;text-align: center;">用户信息</th> |
|||
{if $type != 2} |
|||
<th style="width:80px; text-align:center;">订单金额</th> |
|||
<th style="width:80px; text-align: center;">支付金额</th> |
|||
{else} |
|||
<th style="width:100px; text-align:center;">领取时间</th> |
|||
{/if} |
|||
<th style="width:80px; text-align:center;">核销员</th> |
|||
<th style="width:100px; text-align:center;">使用时间</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody > |
|||
{loop $halfcard $y $item} |
|||
<tr> |
|||
<td class="text-center" style="width:40px; height: auto;"> |
|||
<center><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></center> |
|||
</td> |
|||
<!--一卡通内容--> |
|||
<td class="goods-info line-feed" style="width:180px;padding-left: 10px;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<p class="" style="margin: 0;overflow : hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp:2;-webkit-box-orient: vertical;">{$item['title']}</p> |
|||
</div> |
|||
</td> |
|||
<!--商户信息--> |
|||
<td class="text-center" style="width:150px;height:60px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<p style="margin: 0;">{$item['storename']}</p> |
|||
</td> |
|||
<!--用户信息--> |
|||
<td class="goods-info line-feed" style="width:150px; padding-left: 10px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;"> |
|||
<div class="img"><img src="{IMAGE_PIXEL}" class="scrollLoading" data-url="{php echo tomedia($item['avatar'])}" height="50" width="50" ></div> |
|||
<div class="all-tips"> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$item['username']}</span> |
|||
<span class="" style="font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif ;">{$item['mobile']}</span> |
|||
</div> |
|||
</td> |
|||
{if $type != 2} |
|||
<td class="text-center" style="width:80px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
¥{$item['ordermoney']} |
|||
</td> |
|||
<td class="text-center" style="width:80px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
<p style="margin-bottom: 5px;">¥{$item['realmoney']}</p>{if $item['freeflag']} <span class="label label-success">特权日</span>{/if} |
|||
</td> |
|||
{else} |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{php echo date('Y-m-d H:i:s',$item['createtime'])} |
|||
</td> |
|||
{/if} |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{$item['vername']} |
|||
</td> |
|||
<td class="text-center" style="width:100px;font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;"> |
|||
{if $item['usetime']} |
|||
{php echo date('Y-m-d H:i:s',$item['usetime'])} |
|||
{else} |
|||
<span class="label label-warning">未使用</span> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div id="de1" class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete">删除选中记录</a> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
require(['jquery', 'util'], function($, util){ |
|||
$('.js-copy').each(function(){ |
|||
var id=$(this).attr('data-id'); |
|||
util.clip($("#js-copy"+id), $(this).attr('data-url')); |
|||
}); |
|||
}); |
|||
</script> |
|||
<script type="text/javascript"> |
|||
$('#output').click(function(){ |
|||
var orderType = '{$_GPC['orderType']}'; |
|||
var status = '{$_GPC['status']}'; |
|||
var paytype = '{$_GPC['pay_type']}'; |
|||
var keywordtype = '{$_GPC['keywordtype']}'; |
|||
var keyword = '{$_GPC['keyword']}'; |
|||
var timetype = '{$_GPC['timetype']}'; |
|||
var times = "{$_GPC['time']['start']}"; |
|||
var timee = "{$_GPC['time']['end']}"; |
|||
location.href = "{php echo web_url('halfcard/order/output')}&orderType="+orderType+"&status="+status+"&paytype="+paytype+"&keywordtype="+keywordtype+"&keyword="+keyword+"&timetype="+timetype+"×="+times+"&timee="+timee; |
|||
}); |
|||
{if $ac} |
|||
$(function(){ |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halftype/deleteHalfcardRecord')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
{else} |
|||
$(function(){ |
|||
//删除用户记录 |
|||
$('#de1').delegate('.js-delete','click',function(e){ |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks=$('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if (this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
//alert(ids); |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('halfcard/halfcard_web/deleteHalfcardRecord')}", { ids : ids }, function(data){ |
|||
if(!data.errno){ |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, {html: '确认删除?'}); |
|||
}); |
|||
}); |
|||
{/if} |
|||
|
|||
|
|||
//转换日期 |
|||
var dt=$('.date1').text().replace(/^\s+|\s+$/g, ""); |
|||
var yy=dt.slice(0,4); |
|||
var mm=dt.slice(4,6); |
|||
var dd=dt.slice(6,8); |
|||
var str=(yy+'-'+mm+'-'+dd).toString(); |
|||
$('.date1').text(str); |
|||
|
|||
//二级联动切换 |
|||
$('#sel_parent').click(function(){ |
|||
if(this.value!=0){ |
|||
$('#sel_child').hide(); |
|||
$(".nickname").removeAttr("style"); |
|||
$('.nickname').show(); |
|||
}else{ |
|||
$('.nickname').hide(); |
|||
$('#sel_child').hide(); |
|||
$('#sel_child').attr("display","block"); |
|||
} |
|||
}) |
|||
|
|||
|
|||
|
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,6 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Headline{ |
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[文章头条]]></name> |
|||
<identifie><![CDATA[headline]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[market]]></type> |
|||
<description><![CDATA[通过文章的图文形式,来推荐商品,从而提升商品销量。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="true" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
<menu title="头条" font="fa-inbox"> |
|||
<entry title="头条列表" ac="headline" do="infoList" iscover="true"/> |
|||
<entry title="头条分类" ac="headline" do="index" /> |
|||
</menu> |
|||
<menu title="留言管理" font="fa-inbox"> |
|||
<entry title="留言列表" ac="headline" do="commentList"/> |
|||
</menu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="头条" font="fa-inbox"> |
|||
<entry title="头条列表" ac="headline" do="infoList" iscover="true"/> |
|||
<entry title="头条分类" ac="headline" do="index" /> |
|||
</menu> |
|||
<menu title="留言管理" font="fa-inbox"> |
|||
<entry title="留言列表" ac="headline" do="commentList"/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,367 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class HeadlineModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 头条列表信息 |
|||
* Author: zzw |
|||
* Date: 2019/7/8 15:18 |
|||
*/ |
|||
public function HeadlineList() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1; |
|||
$page_num = $_GPC['page_num'] ? $_GPC['page_num'] : 10; |
|||
$one_id = $_GPC['one_id'] ? : 0; |
|||
$two_id = $_GPC['two_id'] ? : 0;; |
|||
$sort = $_GPC['sort'] ? : 0;; |
|||
|
|||
#2、列表信息 |
|||
$list = WeliamWeChat::getHeadline('', $page, $page_num,$one_id,$two_id,$sort); |
|||
#3、获取总页数 |
|||
$total = pdo_fetchcolumn("SELECT COUNT(*) as total FROM ".tablename(PDO_NAME.'headline_content') |
|||
." WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "); |
|||
if($total > 0) $total_page = ceil($total / $page_num); |
|||
#4、头条列表顶部轮播图信息 |
|||
$banner = pdo_getall(PDO_NAME."adv",['type'=>10,'uniacid'=>$_W['uniacid'],'aid'=>$_W['aid'],'enabled' => 1],['link','thumb']); |
|||
foreach($banner as $key => &$val){ |
|||
$val['thumb'] = tomedia($val['thumb']); |
|||
} |
|||
#5、获取头条列表自定义菜单 |
|||
$settings = Setting::agentsetting_read('diypageset'); |
|||
if($settings['menu_headline'] > 0){ |
|||
$menudata = Diy::getMenu($settings['menu_headline'], TRUE); |
|||
}else{ |
|||
$menudata = DiyMenu::defaultHeadlineMenu(); |
|||
} |
|||
//基本设置 |
|||
$set = Setting::wlsetting_read('base'); |
|||
#6、数据拼装 |
|||
$data['menu'] = $menudata; |
|||
$data['head'] = is_array($banner) ? $banner : []; |
|||
$data['list'] = is_array($list) ? $list : []; |
|||
$data['total'] = $total_page ? $total_page : 0; |
|||
$data['banner_set'] = [ |
|||
'img_width' => $set['listwidth'] ? : 640, |
|||
'img_height' => $set['listheight'] ? : 300 |
|||
]; |
|||
|
|||
$this->renderSuccess('头条列表',$data); |
|||
} |
|||
/** |
|||
* Comment: 获取某条头条的详细信息 |
|||
* Author: zzw |
|||
*/ |
|||
public function HeadlineInfo() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id'];//头条id |
|||
$mid = $_W['mid'] ? : '';//用户id |
|||
if(!$id) wl_json(1,'缺少参数:id'); |
|||
#2、头条详细信息获取 |
|||
$info = pdo_fetch("SELECT |
|||
a.id, |
|||
a.author, |
|||
a.author_img, |
|||
a.title, |
|||
a.summary, |
|||
a.browse, |
|||
a.display_img, |
|||
a.content, |
|||
a.call_id, |
|||
a.labels, |
|||
a.goods_id, |
|||
a.goods_plugin, |
|||
a.advs, |
|||
b.name as one_name, |
|||
d.name as two_name |
|||
FROM " . tablename(PDO_NAME . "headline_content") |
|||
. " a LEFT JOIN " |
|||
. tablename(PDO_NAME . "headline_class") |
|||
. " b ON a.one_id = b.id " |
|||
. " LEFT JOIN " |
|||
. tablename(PDO_NAME . "headline_class") |
|||
. " d ON a.two_id = d.id " |
|||
. " WHERE a.id = {$id}"); |
|||
#3、获取集call信息 |
|||
if(p('call') && $info['call_id']){ |
|||
$call = pdo_fetch("SELECT a.id, b.title FROM " . tablename(PDO_NAME . "call") |
|||
. " a LEFT JOIN " |
|||
. tablename(PDO_NAME . "couponlist") |
|||
. " b ON a.prize_id = b.id " |
|||
. " WHERE a.uniacid = {$_W['uniacid']} AND a.id = {$info['call_id']} AND a.state = 1 ORDER BY id DESC "); |
|||
} |
|||
$info['call'] = $call ? $call : []; |
|||
#4、改变头条的阅读量 |
|||
$number = intval($info['browse']) + intval(1); |
|||
pdo_update(PDO_NAME . "headline_content", array("browse" => intval($number)), array('id' => $id)); |
|||
//处理幻灯片 |
|||
$info['advs'] = unserialize($info['advs']); |
|||
if(!empty($info['advs'])){ |
|||
foreach($info['advs'] as &$ad){ |
|||
$ad['img'] = tomedia($ad['img']); |
|||
} |
|||
} |
|||
#6、信息拼装 |
|||
$info['author_img'] = tomedia($info['author_img']); |
|||
$info['display_img'] = tomedia($info['display_img']); |
|||
if (is_base64($info['content'])) $info['content'] = base64_decode($info['content']); |
|||
$info['id'] = $id; |
|||
$info['labels'] = explode("#",$info['labels']); |
|||
//获取商品详情链接 rush-抢购商品;groupon-团购商品;wlfightgroup-拼团商品;coupon-卡券商品;bargain-砍价商品 |
|||
switch ($info['goods_plugin']) { |
|||
case 'rush': |
|||
$info['goods_url'] = h5_url('pages/subPages/goods/index',['id'=>$info['goods_id'],'type'=>1]); |
|||
if($info['goods_id'] > 0){ |
|||
$info['goods'] = pdo_get(PDO_NAME.'rush_activity', |
|||
['id'=>$info['goods_id'],'uniacid'=>$_W['uniacid']], |
|||
['id','thumb','name','price','oldprice']); |
|||
} |
|||
break;//抢购商品 |
|||
case 'groupon': |
|||
$info['goods_url'] = h5_url('pages/subPages/goods/index',['type'=>2,'id'=>$info['goods_id']]); |
|||
$info['goods'] = pdo_get(PDO_NAME.'groupon_activity', |
|||
['id'=>$info['goods_id'],'uniacid'=>$_W['uniacid']], |
|||
['id','thumb','name','price','oldprice']); |
|||
break;//团购商品 |
|||
case 'wlfightgroup': |
|||
$info['goods_url'] = h5_url('pages/subPages/goods/index',['type'=>3,'id'=>$info['goods_id']]); |
|||
if($info['goods_id'] > 0){ |
|||
$info['goods'] = pdo_fetch("SELECT id,logo as thumb,name,price,oldprice FROM " |
|||
.tablename(PDO_NAME.'fightgroup_goods') |
|||
." WHERE id = {$info['goods_id']} AND uniacid = {$_W['uniacid']} "); |
|||
} |
|||
break;//拼团商品 |
|||
case 'coupon': |
|||
$info['goods_url'] = h5_url('pages/subPages/goods/index',['type'=>5,'id'=>$info['goods_id']]); |
|||
if($info['goods_id'] > 0){ |
|||
$info['goods'] = pdo_fetch("SELECT id,logo as thumb,title as name,price FROM " |
|||
.tablename(PDO_NAME.'couponlist') |
|||
." WHERE id = {$info['goods_id']} AND uniacid = {$_W['uniacid']} "); |
|||
} |
|||
break;//优惠券 |
|||
case 'bargain': |
|||
$info['goods_url'] = h5_url('pages/subPages/goods/index',['type'=>7,'id'=>$info['goods_id']]); |
|||
if($info['goods_id'] > 0){ |
|||
$info['goods'] = pdo_fetch("SELECT id,thumb,name,price,oldprice FROM " |
|||
.tablename(PDO_NAME.'bargain_activity') |
|||
." WHERE id = {$info['goods_id']} AND uniacid = {$_W['uniacid']} "); |
|||
} |
|||
break;//砍价商品 |
|||
} |
|||
//转义商品图片 |
|||
if($info['goods'] &&is_array($info['goods'])){ |
|||
$info['goods']['thumb'] = tomedia($info['goods']['thumb']); |
|||
} |
|||
//内容转码 |
|||
$info['content'] = htmlspecialchars_decode($info['content']); |
|||
$info['content'] = str_replace("section","div",$info['content']); |
|||
|
|||
$this->renderSuccess('头条的详细信息',$info); |
|||
} |
|||
/** |
|||
* Comment: 头条留言功能 |
|||
* Author: zzw |
|||
* Date: 2019/7/8 16:58 |
|||
*/ |
|||
public function HeadlineComment (){ |
|||
global $_W , $_GPC; |
|||
$mid = $_W['mid'];//用户id |
|||
$hid = $_GPC['hid'];//头条id |
|||
$text = $_GPC['text'];//留言内容 |
|||
if(!$hid) wl_json(1,'缺少参数:头条id'); |
|||
if(!$mid) wl_json(1,'请先登录'); |
|||
if(!$text) wl_json(1,'缺少参数:留言内容'); |
|||
//判断文本内容是否非法 |
|||
$textRes = Filter::init($text,$_W['source'],1); |
|||
if($textRes['errno'] == 0) $this->renderError($textRes['message']); |
|||
//储存留言信息 |
|||
$data['mid'] = $mid; |
|||
$data['hid'] = $hid; |
|||
$data['times'] = time(); |
|||
$data['text'] = json_encode($text); |
|||
$result = pdo_insert(PDO_NAME . 'headline_comment' , $data); |
|||
if ($result) { |
|||
$id = pdo_insertid(); |
|||
$this->renderSuccess('留言成功',$id); |
|||
} else { |
|||
$this->renderError('留言失败'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 好评&头条留言点赞 |
|||
* Author: zzw |
|||
*/ |
|||
public function Fabulous (){ |
|||
global $_W , $_GPC; |
|||
$mid = $_W['mid'];//用户id |
|||
$class = $_GPC['class'];//点赞类别(1=好评点赞,2=头条留言点赞) |
|||
$relation_id = $_GPC['id'];//关联好评表||头条留言表的id |
|||
$table = PDO_NAME . "fabulous"; |
|||
$where['mid'] = $mid;//用户id |
|||
$where['class'] = $class; |
|||
$where['relation_id'] = $relation_id; |
|||
$existence = pdo_get($table , $where); |
|||
if ($existence) { |
|||
//点赞存在 取消点赞 |
|||
$result = pdo_delete($table , $where); |
|||
} else { |
|||
//点赞不存在 添加一条点赞信息 |
|||
$data = [ |
|||
'mid' => $mid , |
|||
'relation_id' => $relation_id , |
|||
'class' => $class , |
|||
'times' => time() , |
|||
]; |
|||
$result = pdo_insert($table , $data); |
|||
} |
|||
if ($result) { |
|||
$this->renderSuccess('点赞成功'); |
|||
} else { |
|||
$this->renderError('点赞失败'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 获取某个头条留言信息 |
|||
* Author: zzw |
|||
* Date: 2021/2/4 9:09 |
|||
*/ |
|||
public function getComment(){ |
|||
global $_W, $_GPC; |
|||
//参数获取 |
|||
$id = $_GPC['id'];//头条id |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$mid = $_W['mid'] ? : '';//用户id |
|||
//条件生成 头条留言信息 目前是只显示精选的留言 根据登录情况使用查询条件 |
|||
if($mid){ |
|||
$where = " WHERE (a.selected = 1 OR a.mid = {$mid}) AND a.hid = {$id}"; |
|||
}else{ |
|||
$where = " WHERE a.selected = 1 AND a.hid = {$id}"; |
|||
} |
|||
$order = " ORDER BY a.set_top DESC, a.times DESC "; |
|||
$limit = " LIMIT {$pageStart},{$pageIndex}"; |
|||
$field = " a.id,a.times,a.text,a.reply,a.reply_time,a.set_top,b.nickname,b.encodename,b.avatar"; |
|||
$sql = "SELECT {$field} FROM " . tablename(PDO_NAME . "headline_comment") |
|||
. " a LEFT JOIN " |
|||
. tablename(PDO_NAME . "member") |
|||
. " b ON a.mid = b.id "; |
|||
//信息列表获取 |
|||
$list = pdo_fetchall($sql.$where.$order.$limit); |
|||
foreach ($list as $k => &$v) { |
|||
$v['times'] = date("Y-m-d H:i:s", $v['times']); |
|||
$v['text'] = json_decode($v['text']); |
|||
$v['reply'] = json_decode($v['reply']); |
|||
$v['reply_time'] = date("Y-m-d H:i:s", $v['reply_time']); |
|||
//获取当前留言的点赞数量 |
|||
$v['fabulousNum'] = intval(implode(pdo_fetch("SELECT COUNT(*) FROM " . tablename(PDO_NAME . "fabulous") |
|||
. " WHERE `relation_id` = {$v['id']} AND `class` = 2"))); |
|||
//判断用户是否对当前留言点赞 |
|||
if ($mid) { |
|||
$v['fabulousState'] = (pdo_get(PDO_NAME . "fabulous" |
|||
, array('relation_id' => $v['id'], 'class' => 2, 'mid' => $mid))) ? true : false; |
|||
} else { |
|||
$v['fabulousState'] = false; |
|||
} |
|||
if ($v['encodename']) $v['nickname'] = base64_decode($v['encodename']); |
|||
} |
|||
//分页总数获取 |
|||
$totalSql = str_replace($field,'count(*)',$sql); |
|||
$total = pdo_fetchcolumn($totalSql.$where); |
|||
$data['total'] = ceil($total / $pageIndex); |
|||
$data['list'] = $list; |
|||
|
|||
$this->renderSuccess('头条留言信息',$data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 首页菜单栏 |
|||
* Author: wlf |
|||
* Date: 2021/10/22 11:37 |
|||
*/ |
|||
public function headlineSelectInfo(){ |
|||
global $_W , $_GPC; |
|||
#1、参数获取 |
|||
if(Customized::init('language1543') > 0 ){ |
|||
$data = [ |
|||
'top' => [ |
|||
['title' => '排序' , 'subscript' => 'orders' , 'status' => 1] , |
|||
] , |
|||
'orders' => [ |
|||
['title' => '最新' , 'val' => 0] , |
|||
['title' => '热度' , 'val' => 1] , |
|||
] , |
|||
]; |
|||
}else{ |
|||
$whole = [ |
|||
[ |
|||
'id' => '0' , |
|||
'name' => '全部' , |
|||
'list' => [] |
|||
] |
|||
]; |
|||
//获取掌上信息分类列表 |
|||
$list = pdo_fetchall("SELECT id,name FROM " . tablename(PDO_NAME . "headline_class") . " WHERE aid = {$_W['aid']} AND uniacid = {$_W['uniacid']} AND head_id = 0 AND state = 1 ORDER BY sort DESC,id DESC "); |
|||
if (is_array($list) && count($list) > 0) { |
|||
foreach ($list as $key => &$val) { |
|||
$val['list'] = pdo_fetchall("SELECT id,name FROM " . tablename(PDO_NAME . "headline_class") . " WHERE state = 1 AND head_id = {$val['id']} ORDER BY sort DESC,id DESC "); |
|||
} |
|||
} |
|||
$list = array_merge($whole , $list); |
|||
//信息拼装 |
|||
$data = [ |
|||
'top' => [ |
|||
['title' => '分类' , 'subscript' => 'class' , 'status' => 1] , |
|||
['title' => '排序' , 'subscript' => 'orders' , 'status' => 1] , |
|||
] , |
|||
'class' => $list , |
|||
'orders' => [ |
|||
['title' => '最新' , 'val' => 0] , |
|||
['title' => '热度' , 'val' => 1] , |
|||
] , |
|||
]; |
|||
} |
|||
|
|||
$this->renderSuccess('选择信息列表' , $data); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,422 @@ |
|||
<?php |
|||
/** |
|||
* Comment: 代理端头条信息管理 |
|||
* Author: ZZW |
|||
* Date: 2018/8/30 |
|||
* Time: 14:32 |
|||
*/ |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Headline_WeliamController { |
|||
|
|||
public function __construct () { |
|||
global $_W, $_GPC; |
|||
$_W['aid'] = $_W['aid'] ? $_W['aid'] : 0; |
|||
|
|||
} |
|||
/** |
|||
* Comment: 进入头条分类列表首页 |
|||
* Author: zzw |
|||
* Date: 2019/7/8 11:41 |
|||
*/ |
|||
public function index() { |
|||
global $_W, $_GPC; |
|||
#1、条件生成 |
|||
$name = $_GPC['name']; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = " uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
if ($name) { |
|||
$where .= " AND name LIKE '%{$name}%' "; |
|||
} |
|||
#2、查询一级菜单 |
|||
$sql = "SELECT id,head_id,`name`,sort,state FROM " . tablename(PDO_NAME . "headline_class") |
|||
. " WHERE {$where} AND head_id = 0 ORDER BY sort ASC"; |
|||
$total = count(pdo_fetchall($sql)); |
|||
$sql .= " limit " . ($pindex - 1) * $psize . ',' . $psize; |
|||
$list = pdo_fetchall($sql); |
|||
#2、查询一级菜单下面的二级菜单 |
|||
foreach ($list as $key => &$val) { |
|||
$val['footer'] = pdo_fetchall("SELECT id,head_id,`name`,sort,state FROM " . tablename(PDO_NAME . "headline_class") |
|||
. " WHERE head_id = {$val['id']} ORDER BY sort ASC"); |
|||
} |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
#4、获取顶级分类列表 |
|||
$headClass = pdo_getall(PDO_NAME . "headline_class", array('head_id' => 0, 'state' => 1, 'uniacid' => $_W['uniacid'], 'aid' => $_W['aid'])); |
|||
|
|||
include wl_template('headline/list'); |
|||
} |
|||
/** |
|||
* Comment: 添加/修改分类 |
|||
* Author: zzw |
|||
* Date: 2019/7/8 11:41 |
|||
*/ |
|||
public function editClass() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$id = $_GPC['id']; |
|||
!empty($_GPC['data']) && $data = $_GPC['data']; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid'] ? $_W['aid'] : 0; |
|||
#2、判断信息是否已经存在 或者未进行修改 |
|||
if (pdo_get(PDO_NAME . 'headline_class', $data)) wl_json(0, '请修改内容后提交!');//判断是否修改内容 |
|||
if (!$id) if (pdo_get(PDO_NAME . 'headline_class', ['name' => $data['name'],'aid'=>$data['aid'],'uniacid'=>$data['uniacid']])) wl_json(0, '当前分类已经存在!'); //判断当前分类是否存在 |
|||
#4、判断当前分类下是否存在子分类 |
|||
if ($data['head_id'] > 0) { |
|||
$is_have = pdo_getcolumn(PDO_NAME . "headline_class" , ['id' => $data['head_id']],'head_id'); |
|||
if ($is_have > 0) wl_json(0 , '当前分类为子分类,不能成为上级分类!'); |
|||
} |
|||
#3、添加/修改内容的操作 |
|||
if ($id) { |
|||
$result = pdo_update(PDO_NAME . 'headline_class', $data, array('id' => $id)); |
|||
} else { |
|||
$result = pdo_insert(PDO_NAME . 'headline_class', $data); |
|||
} |
|||
if ($result) { |
|||
wl_json(1, '操作成功'); |
|||
} else { |
|||
wl_json(0, '操作失败'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 修改分类单项数据信息 |
|||
* Author: zzw |
|||
* Date: 2019/7/8 11:41 |
|||
*/ |
|||
public function editField() { |
|||
global $_W, $_GPC; |
|||
#1、参数获取 |
|||
$data['id'] = $id = $_GPC['id']; |
|||
$data[$_GPC['field']] = $_GPC['value']; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid'] ? $_W['aid'] : 0; |
|||
#2、判断信息是否修改 |
|||
if (pdo_get(PDO_NAME . 'headline_class', $data)) wl_json(0, '请修改内容后提交!'); |
|||
#3、修改内容的操作 |
|||
unset($data['id']); |
|||
$result = pdo_update(PDO_NAME . 'headline_class', $data, array('id' => $id)); |
|||
if ($result) { |
|||
show_json(1, '修改成功'); |
|||
} else { |
|||
show_json(1, '操作失败'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除分类 |
|||
* Author: zzw |
|||
*/ |
|||
public function delClass() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
//将以当前分类下的所有的分类设为无上级菜单 |
|||
pdo_update(PDO_NAME . "headline_class", array('head_id' => 0), array('head_id' => $id)); |
|||
$result = pdo_delete(PDO_NAME . "headline_class", array('id' => $id)); |
|||
if ($result) { |
|||
show_json(1); |
|||
} else { |
|||
show_json(0, '删除失败'); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 进入头条信息列表 |
|||
* Author: zzw |
|||
*/ |
|||
public function infoList() { |
|||
global $_W, $_GPC; |
|||
$search = $_GPC['search']; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$where = " a.uniacid = {$_W['uniacid']} AND a.aid = {$_W['aid']} "; |
|||
if ($search) { |
|||
$search = trim($search); |
|||
$where .= " AND (a.title LIKE '%{$search}%' || a.author LIKE '%{$search}%' || b.name LIKE '%{$search}%' || d.name LIKE '%{$search}%') "; |
|||
} |
|||
$sql = "SELECT |
|||
a.id, |
|||
a.title, |
|||
a.author, |
|||
a.summary, |
|||
a.release_time, |
|||
a.browse, |
|||
a.call_id, |
|||
a.goods_name, |
|||
b.name as one_name, |
|||
d.name as two_name |
|||
FROM " |
|||
. tablename(PDO_NAME . "headline_content") |
|||
. " a LEFT JOIN " |
|||
. tablename(PDO_NAME . "headline_class") . " b ON a.one_id = b.id" |
|||
. " LEFT JOIN " |
|||
. tablename(PDO_NAME . "headline_class") . " d ON a.two_id = d.id" |
|||
. " WHERE {$where} ORDER BY release_time DESC "; |
|||
$total = count(pdo_fetchall($sql)); |
|||
$sql .= " limit " . ($pindex - 1) * $psize . ',' . $psize; |
|||
$list = pdo_fetchall($sql); |
|||
foreach ($list as $k => $v) { |
|||
$list[$k]['call'] = '未开启集call活动'; |
|||
if ($v['call_id']) { |
|||
$list[$k]['call'] = implode(pdo_get(PDO_NAME . "call", array('id' => $v['call_id']), array('title'))); |
|||
} |
|||
unset($list[$k]['call_id']); |
|||
} |
|||
|
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
|
|||
include wl_template('headline/infoList'); |
|||
} |
|||
public function import() { |
|||
global $_W, $_GPC; |
|||
if (!empty($_GPC['wechat_url'])) { |
|||
header('location: ' . web_url('headline/headline/getIntoEdit', ['wechat_url' => urlencode(trim($_GPC['wechat_url']))])); |
|||
die; |
|||
} |
|||
include wl_template('headline/import'); |
|||
} |
|||
/** |
|||
* Comment: 进入编辑页面 |
|||
* Author: zzw |
|||
*/ |
|||
public function getIntoEdit() { |
|||
global $_W, $_GPC; |
|||
#1、参数接收 |
|||
$id = $_GPC['id'];//头条id |
|||
$weChatUrl = urldecode($_GPC['wechat_url']);//微信图文的链接 |
|||
$time = time(); |
|||
$publicWhere = " AND uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
#2、获取集call活动信息列表 |
|||
if (p('call')) { |
|||
$callList = pdo_fetchall("SELECT id,title FROM " |
|||
. tablename(PDO_NAME . "call") . |
|||
" WHERE state = 1 AND receive_time > {$time} {$publicWhere}"); |
|||
} |
|||
#3、获取所有分类信息 |
|||
$classList = pdo_fetchall("SELECT head_id,id,`name` FROM " |
|||
. tablename(PDO_NAME . "headline_class") |
|||
. " WHERE `state` = 1 {$publicWhere} AND head_id = 0 ORDER BY sort ASC"); |
|||
#4、修改操作 获取修改数据 |
|||
if ($id) { |
|||
//获取当前头条详细信息 |
|||
$info = pdo_get(PDO_NAME . "headline_content", array("id" => $id)); |
|||
if (is_base64($info['content'])) $info['content'] = base64_decode($info['content']); |
|||
$advs = unserialize($info['advs']); |
|||
//获取当前一级分类的所有下级分类 |
|||
$subClass = pdo_fetchall("SELECT id,`name` FROM " |
|||
. tablename(PDO_NAME . "headline_class") |
|||
. " WHERE `state` = 1 AND head_id = {$info['one_id']} {$publicWhere} ORDER BY sort ASC"); |
|||
} |
|||
#5、判断wechat_url是否存在内容 存在则是使用微信图文 |
|||
if (!empty($weChatUrl)) { |
|||
$result = (new GatherArticle())->get_caiji($weChatUrl); |
|||
//信息重组 |
|||
$info['author'] = $result['nickname'];//作者昵称 |
|||
$info['title'] = $result['title'];//头条标题 |
|||
$info['summary'] = $result['desc'];//头条简介 |
|||
$info['display_img'] = $result['thumb'];//封面图片 |
|||
$info['content'] = $result['contents'];//具体内容 |
|||
} |
|||
|
|||
include wl_template('headline/edit'); |
|||
} |
|||
/** |
|||
* Comment: 获取某个分类的所有下级分类 |
|||
* Author: zzw |
|||
* Date: 2019/7/8 14:27 |
|||
*/ |
|||
public function getSubClass() { |
|||
global $_W, $_GPC; |
|||
#1、获取参数信息 |
|||
$id = $_GPC['id']; |
|||
if (!$id) wl_json(0, '缺少参数:id不存在'); |
|||
$publicWhere = " AND uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} "; |
|||
#2、获取当前分类的所有下级分类 |
|||
$subClass = pdo_fetchall("SELECT id,`name` FROM " |
|||
. tablename(PDO_NAME . "headline_class") |
|||
. " WHERE `state` = 1 AND head_id = {$id} {$publicWhere} ORDER BY sort ASC"); |
|||
wl_json(0, '下级分类列表', $subClass); |
|||
} |
|||
/** |
|||
* Comment: 添加/修改 头条信息 |
|||
* Author: zzw |
|||
*/ |
|||
public function edit() { |
|||
global $_W, $_GPC; |
|||
$data = $_GPC['data']; |
|||
$adv = $_GPC['adv']; |
|||
$link = $_GPC['link']; |
|||
if(!empty($adv)){ |
|||
foreach($adv as $key => $vle){ |
|||
$vipa['img'] = $vle; |
|||
$vipa['url'] = $link[$key]; |
|||
$advs[] = $vipa; |
|||
} |
|||
$data['advs'] = serialize($advs); |
|||
}else{ |
|||
$data['advs'] = ''; |
|||
} |
|||
$data['content'] = base64_encode($data['content']); |
|||
if ($_GPC['id']) { |
|||
//修改操作 查看是否修改 |
|||
$data['id'] = $_GPC['id']; |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$update = pdo_get(PDO_NAME . "headline_content", $data); |
|||
if ($update) wl_message('请修改后提交', referer(), 'error'); |
|||
unset($data['id']); |
|||
//进行修改操作 |
|||
$result = pdo_update(PDO_NAME . "headline_content", $data, array("id" => $_GPC['id'])); |
|||
} else { |
|||
//添加操作 |
|||
$data['uniacid'] = $_W['uniacid']; |
|||
$data['aid'] = $_W['aid']; |
|||
$data['release_time'] = time(); |
|||
$result = pdo_insert(PDO_NAME . "headline_content", $data); |
|||
} |
|||
if ($result) { |
|||
wl_message('操作成功!', web_url('headline/headline/infoList'), 'success'); |
|||
} else { |
|||
wl_message('操作失败,请重试', referer(), 'error'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 删除头条信息 |
|||
* Author: zzw |
|||
*/ |
|||
public function delHeadline() { |
|||
global $_W, $_GPC; |
|||
//参数获取 |
|||
$id = $_GPC['id']; |
|||
//删除头条信息 |
|||
$result = pdo_delete(PDO_NAME . "headline_content", array('id' => $id)); |
|||
//删除头条信息相关的评论信息 |
|||
pdo_delete(PDO_NAME . "headline_comment", array('hid' => $id)); |
|||
if ($result) { |
|||
show_json(1); |
|||
} else { |
|||
show_json(0, '删除失败'); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Comment: 留言列表 |
|||
* Author: zzw |
|||
*/ |
|||
public function commentList() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id'];//头条id |
|||
//获取头条列表 |
|||
$list = pdo_fetchall("SELECT id,title,release_time FROM " . tablename(PDO_NAME . "headline_content") |
|||
. " WHERE uniacid = {$_W['uniacid']} AND aid = {$_W['aid']} ORDER BY release_time DESC"); |
|||
//获取所有头条的未读信息总数 |
|||
foreach ($list as $k => &$v) { |
|||
$v['total'] = pdo_fetchcolumn("SELECT count(*) FROM " |
|||
. tablename(PDO_NAME . "headline_comment") |
|||
. " WHERE hid = {$v['id']} "); |
|||
$v['num'] = pdo_fetchcolumn("SELECT count(*) FROM " |
|||
. tablename(PDO_NAME . "headline_comment") |
|||
. " WHERE hid = {$v['id']} AND state = 0"); |
|||
$v['release_time'] = date("Y-m-d H:i:s", $v['release_time']); |
|||
} |
|||
//获取某一条头条的留言信息 |
|||
if (!$id) { |
|||
$id = $list[0]['id']; |
|||
} |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 10; |
|||
$sql = "SELECT * FROM " . tablename(PDO_NAME . "headline_comment") |
|||
. " WHERE hid = {$id} ORDER BY set_top DESC, times DESC"; |
|||
$sql .= " limit " . ($pindex - 1) * $psize . ',' . $psize; |
|||
$commentList = pdo_fetchall($sql); |
|||
$total = pdo_fetchcolumn('SELECT COUNT(1) FROM ' . tablename(PDO_NAME . 'headline_comment') . " WHERE hid = {$id}"); |
|||
$pager = wl_pagination($total, $pindex, $psize); |
|||
//将查询出来的未读信息修改为已读 |
|||
$idList = implode(',', array_column($commentList, 'id')); |
|||
pdo_query("UPDATE " . tablename(PDO_NAME . 'headline_comment') . " SET state = 1 WHERE id IN ({$idList})"); |
|||
//获取所有留言信息的留言用户的头像昵称 |
|||
foreach ($commentList as $key => &$val) { |
|||
$userInfo = pdo_fetch('SELECT nickname,avatar FROM ' . tablename(PDO_NAME . 'member') . " WHERE id = {$val['mid']}"); |
|||
$val['nickname'] = is_array($userInfo) ? $userInfo['nickname'] ? $userInfo['nickname'] : '' : ''; |
|||
$val['avatar'] = is_array($userInfo) ? $userInfo['avatar'] ? $userInfo['avatar'] : '' : ''; |
|||
$val['times'] = date("Y-m-d H:i:s", $val['times']); |
|||
} |
|||
|
|||
include wl_template('headline/commentList'); |
|||
} |
|||
/** |
|||
* Comment: 留言精选 |
|||
* Author: zzw |
|||
*/ |
|||
public function selected() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$selected = $_GPC['selected']; |
|||
if ($selected == 0) { |
|||
$update['selected'] = 1; |
|||
} else { |
|||
$update['selected'] = 0; |
|||
} |
|||
$result = pdo_update(PDO_NAME . "headline_comment", $update, array("id" => $id)); |
|||
if ($result) { |
|||
wl_json(1, '成功', $update['selected']); |
|||
} else { |
|||
wl_json(0, '失败', $update['selected']); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 设置留言置顶 |
|||
* Author: zzw |
|||
*/ |
|||
public function setTop() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$topState = $_GPC['topState']; |
|||
$hid = $_GPC['hid']; |
|||
//取消所有置顶信息 |
|||
$result = pdo_update(PDO_NAME . "headline_comment", array('set_top' => 0), array('hid' => $hid)); |
|||
if ($topState == 0) { |
|||
//设置置顶信息 |
|||
$result = pdo_update(PDO_NAME . "headline_comment", array('set_top' => 1), array('id' => $id, 'hid' => $hid)); |
|||
} |
|||
if ($result) { |
|||
wl_json(1, '成功'); |
|||
} else { |
|||
wl_json(0, '失败'); |
|||
} |
|||
} |
|||
/** |
|||
* Comment: 回复留言 |
|||
* Author: zzw |
|||
*/ |
|||
public function reply() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$data['reply'] = json_encode($_GPC['text']); |
|||
$data['reply_time'] = time(); |
|||
$result = pdo_update(PDO_NAME . "headline_comment", $data, array('id' => $id)); |
|||
if ($result) { |
|||
wl_json(1, '成功'); |
|||
} else { |
|||
wl_json(0, '失败'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Comment: 换灯片方法 |
|||
* Author: wlf |
|||
*/ |
|||
public function advurl(){ |
|||
global $_W, $_GPC; |
|||
$key = $_GPC['kw']; |
|||
include wl_template('headline/advurl'); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,9 @@ |
|||
<div class="data-item" style="margin: 0;margin-bottom:15px;"> |
|||
{php echo attachment_select('adv[]',$ad['img'],$key)} |
|||
<div class="input-group" style="margin: 0;margin-top:10px;"> |
|||
<input type="text" name="link[]" class="form-control is_judge" is_judge="false" value="{$ad['url']}" readonly="readonly" name="link" placeholder="" id="advlink{$key}"> |
|||
<span data-input="#advlink{$key}" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
<span class="input-group-addon btn btn-default clearinput">X清除链接</span> |
|||
<span onclick="removes(this)" class="input-group-addon btn btn-default data-item-delete">删除幻灯片</span> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,557 @@ |
|||
{php include wl_template('common/header');} |
|||
<style> |
|||
#titleList{ |
|||
float: left; |
|||
width: 220px; |
|||
border: 1px solid #e5e5e5; |
|||
margin-right: 30px; |
|||
} |
|||
#titleList .menuHref{ |
|||
float: left; |
|||
background-color: #FFF; |
|||
width: 100%; |
|||
border-bottom: 1px solid #e5e5e5; |
|||
padding: 10px; |
|||
color: rgb(15,15,15); |
|||
} |
|||
#titleList .menuHref:last-child{ |
|||
border-bottom: none; |
|||
} |
|||
#titleList .active{ |
|||
background: #1ab394; |
|||
color: #FFF; |
|||
} |
|||
#titleList .active .menuTime{ |
|||
background: #1ab394; |
|||
color: #FFF; |
|||
} |
|||
#titleList .menuHref .menuList{} |
|||
#titleList .menuHref .menuTitle{ |
|||
font-size: 15px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
line-height: 20px; |
|||
} |
|||
#titleList .menuHref .menuInfo{ |
|||
color: #aaa; |
|||
} |
|||
#titleList .menuHref .menuTime{ |
|||
margin-top: 10px; |
|||
display: block; |
|||
font-size: 14px; |
|||
line-height: 20px;} |
|||
#titleList .menuHref .menuNumber{} |
|||
#titleList .menuHref .menuUnread{ |
|||
float: right; |
|||
background: red; |
|||
color: #FFF; |
|||
width: 15px; |
|||
height: 15px; |
|||
line-height: 16px; |
|||
text-align: center; |
|||
border-radius: 50%; |
|||
} |
|||
#commonsList{ |
|||
float: left; |
|||
width: calc(100% - 300px); |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">留言列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-table-list"> |
|||
<div id="list" class="panel tab-pane panel-default"> |
|||
<div class="table-responsive"> |
|||
<div id="titleList"> |
|||
{loop $list $listKey $listVal} |
|||
<a href="{php echo web_url('headline/headline/commentList',array('id'=>$listVal['id']))}" class="menuHref {if $listVal['id'] == $id}active{/if} "> |
|||
<div class="menuList"> |
|||
<div class="menuTitle">{$listVal['title']}</div> |
|||
<div class="menuInfo"> |
|||
<span class="menuTime">{$listVal['release_time']}</span> |
|||
{if $listVal['num'] > 0 && $listVal['id'] != $id}<span class="menuUnread">{$listVal['num']}</span>{/if} |
|||
</div> |
|||
</div> |
|||
</a> |
|||
{/loop} |
|||
</div> |
|||
<table id="commonsList" class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="80%">留言内容</th> |
|||
<th class="text-center" width="20%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody id="tables"> |
|||
{loop $commentList $index $item} |
|||
<tr class="text-left text-left"> |
|||
<td class="textarea textarea-pd"> |
|||
<div class="dis-flex"> |
|||
<div class="user-image" style="background-image:url({$item['avatar']})"></div> |
|||
<div class="user-detail"> |
|||
<div class="user-name content-color">{$item['nickname']}</div> |
|||
<div class="comment-content">{php echo json_decode($item['text'])}</div> |
|||
<div class="comment-date content-color">{$item['times']}</div> |
|||
</div> |
|||
</div> |
|||
{if $item['reply']} |
|||
<div class="reply-text"> |
|||
<span class="content-color">作者回复:</span> |
|||
<p class="content-color">{php echo json_decode($item['reply'])}</p> |
|||
</div> |
|||
{/if} |
|||
</td> |
|||
<td comment_id="{$item['id']}"> |
|||
<a class="btn btn-sm btn-default btn-selected" href="javascript:;" selectedState="{$item['selected']}"> |
|||
{if $item['selected'] == 0} |
|||
精选 |
|||
{else} |
|||
取消精选 |
|||
{/if} |
|||
</a> |
|||
<a class="btn btn-sm btn-warning btn-setTop" href="javascript:;" topState="{$item['set_top']}"> |
|||
{if $item['set_top'] == 0} |
|||
置顶 |
|||
{else} |
|||
取消置顶 |
|||
{/if} |
|||
</a> |
|||
{if $item['reply'] == ''} |
|||
<a class="btn btn-sm btn-info btn-reply" href="javascript:;">回复</a> |
|||
{else} |
|||
<a class="btn btn-sm btn-disabled" href="javascript:;">已回复</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script > |
|||
//留言精选 |
|||
$("#tables").on('click','.btn-selected', function() { |
|||
var the = $(this); |
|||
var id = the.parent("td").attr("comment_id"); |
|||
var selected = the.attr("selectedState"); |
|||
var html = $.trim($(this).html()); |
|||
var htmls = '精选'; |
|||
$.post("{php echo web_url('headline/headline/selected');}", { |
|||
id: id, |
|||
selected: selected |
|||
}, function(res) { |
|||
if (res.errno == 1) { |
|||
if (html == '精选') { |
|||
htmls = '取消精选'; |
|||
} |
|||
the.html(htmls); |
|||
the.attr("selectedState", res.data); |
|||
} |
|||
|
|||
}, 'json'); |
|||
}); |
|||
//留言置顶 |
|||
$("#tables").on('click','.btn-setTop', function() { |
|||
var the = $(this); |
|||
var id = the.parent("td").attr("comment_id"); |
|||
var topState = the.attr("topState"); |
|||
var hid = "{php echo $id}"; |
|||
var html = $.trim($(this).html()); |
|||
$(".btn-setTop").html('置顶'); |
|||
$(".btn-setTop").attr("topState", 0); |
|||
$.post("{php echo web_url('headline/headline/setTop');}", { |
|||
id: id, |
|||
topState: topState, |
|||
hid: hid |
|||
}, function(res) { |
|||
if (res.errno == 1) { |
|||
//修改状态 |
|||
if (topState == 0) { |
|||
the.attr("topState", 1); |
|||
the.html('取消置顶'); |
|||
//内容置顶 |
|||
the.parent("td").parent("tr").prependTo($("#tables")); |
|||
} |
|||
} |
|||
}, 'json'); |
|||
}); |
|||
//回复留言 —— 弹出文本框 |
|||
$("#tables").on('click','.btn-reply', function() { |
|||
$('.t-reply').remove(); |
|||
var replyHtml = |
|||
'<div class="t-reply"><div class="reply-text"><span>作者回复:</span><div class="reply-text-c"><textarea class="reply-texta textarea-style" id="reply_text" maxlength="1024" placeholder="请输入回复内容..."></textarea><div class="reply-text-c-b"><div class="wordCount wordCount-tb">0/1024</div><a class="btn btn-sm comment-btn-reply submitBut" comment_id="" href="javascript:;">回复</a><a class="btn btn-sm comment-btn-cancel cancelBut" href="javascript:;">取消</a></div></div></div></div>'; |
|||
$(this).parents('.text-left').find('.textarea').append(replyHtml); |
|||
$(this).parents('.text-left').find('.submitBut').attr("comment_id", $(this).parent("td").attr("comment_id")); |
|||
$('.reply-texta').focus(); |
|||
apd_textarea(); |
|||
}); |
|||
|
|||
function apd_textarea() { |
|||
$("textarea").on('keyup', function() { |
|||
var length = $(this).val().length; |
|||
var maxlength = $(this).attr("maxlength"); |
|||
$(this).parent().find('.wordCount').html(length + "/" + maxlength); |
|||
}); |
|||
$('.cancelBut').on('click', function() { |
|||
$(this).parents('.text-left').find('.t-reply').remove(); |
|||
}); |
|||
//回复留言 —— 提交内容 |
|||
$(".submitBut").on('click', function() { |
|||
var the = $(this); |
|||
var id = the.attr("comment_id"); |
|||
var text = $("#reply_text").val(); |
|||
$.post("{php echo web_url('headline/headline/reply');}", { |
|||
id: id, |
|||
text: text |
|||
}, function(res) { |
|||
if (res.errno == 1) { |
|||
the.parents('.text-left').find('.btn-reply').parent().append( |
|||
'<a class="btn btn-sm btn-disabled" href="javascript:;">已回复</a>'); |
|||
the.parents('.text-left').find('.btn-reply').remove(); |
|||
the.parents('.text-left').find('.t-reply').remove(); |
|||
var html = "<div class='reply-text'>\n" + |
|||
"<span>作者回复:</span>" + text + |
|||
"</div>"; |
|||
$("[comment_id='" + id + "']").prev(".textarea").append(html); |
|||
} |
|||
$("#reply-model").click(); |
|||
}, 'json'); |
|||
}); |
|||
} |
|||
</script> |
|||
|
|||
|
|||
|
|||
|
|||
<!--<style> |
|||
.comment-btn-reply{ |
|||
background-color: #23c6c8; |
|||
border-color: #23c6c8; |
|||
color: #FFF; |
|||
padding: 5px 35px; |
|||
border-radius: 15px; |
|||
margin-right: 20px; |
|||
} |
|||
.comment-btn-cancel{ |
|||
background-color: #f7a54a; |
|||
border-color: #f7a54a; |
|||
color: #FFF; |
|||
padding: 5px 35px; |
|||
border-radius: 15px; |
|||
} |
|||
.reply-texta{ |
|||
width: 100%; |
|||
height: 150px; |
|||
max-width: 100%; |
|||
max-height: 150px; |
|||
resize:none; |
|||
margin-top: 10px; |
|||
} |
|||
.wordCount-tb{ |
|||
margin: 7px 0 ; |
|||
} |
|||
#tables tr .user-image { |
|||
width: 40px; |
|||
height: 40px; |
|||
background-repeat: no-repeat; |
|||
background-position: center; |
|||
background-size: 40px 40px; |
|||
margin-right: 20px; |
|||
flex-shrink: 0; |
|||
} |
|||
|
|||
#tables .dis-flex { |
|||
display: flex; |
|||
} |
|||
|
|||
#tables .user-detail { |
|||
padding-bottom: 10px; |
|||
} |
|||
|
|||
#tables .textarea-pd { |
|||
padding: 10px 10px 10px 30px !important; |
|||
} |
|||
|
|||
#tables .user-detail .comment-content { |
|||
margin: 5px 0; |
|||
} |
|||
|
|||
#tables .reply-text { |
|||
position: relative; |
|||
border-top: 1px solid #EFEFEF; |
|||
padding: 10px 20px 0 20px; |
|||
font-size: 13px; |
|||
color: #666; |
|||
margin-left: 80px; |
|||
} |
|||
|
|||
#tables .reply-text span:before { |
|||
content: " "; |
|||
width: 2px; |
|||
height: 12px; |
|||
position: absolute; |
|||
left: 22px; |
|||
top: 12px; |
|||
background-color: rgb(0, 162, 0); |
|||
} |
|||
|
|||
#tables .reply-text span { |
|||
margin-left: 15px; |
|||
} |
|||
#tables .reply-text p{ |
|||
margin-top: 2px; |
|||
} |
|||
#tables .content-color { |
|||
color: rgb(173, 160, 175); |
|||
} |
|||
|
|||
#list .table.table-hover.table-bordered { |
|||
float: right; |
|||
width: 85%; |
|||
} |
|||
|
|||
#list #leftMenuList { |
|||
float: left; |
|||
width: 15%; |
|||
max-height: 800px; |
|||
overflow-x: auto; |
|||
} |
|||
|
|||
#list #leftMenuList .menuList { |
|||
border-top: 1px solid #e5e5e5; |
|||
padding: 10px 10px; |
|||
height: 91px; |
|||
} |
|||
|
|||
#list #leftMenuList .menuList .menuTitle { |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
display: -webkit-box; |
|||
-webkit-box-orient: vertical; |
|||
-webkit-line-clamp: 2; |
|||
font-size: 16px; |
|||
height: 50px; |
|||
line-height: 25px; |
|||
} |
|||
|
|||
#list #leftMenuList .menuList .menuInfo { |
|||
height: 30px; |
|||
line-height: 30px; |
|||
color: #AAA; |
|||
font-size: 12px; |
|||
} |
|||
|
|||
#list #leftMenuList .menuList .menuInfo .menuTime { |
|||
float: left; |
|||
} |
|||
|
|||
#list #leftMenuList .menuList .menuInfo .menuNumber { |
|||
float: right; |
|||
} |
|||
|
|||
#list #leftMenuList .menuList .menuInfo .menuNumber .menuUnread { |
|||
color: #fc3801; |
|||
} |
|||
|
|||
#list #leftMenuList .menuHref { |
|||
color: #000; |
|||
} |
|||
|
|||
#list #leftMenuList .active { |
|||
background: #F2F2F2; |
|||
} |
|||
</style> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">留言列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="#" method="post"> |
|||
|
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div id="list" class="panel tab-pane panel-default"> |
|||
<div class="table-responsive"> |
|||
<div id="leftMenuList"> |
|||
{loop $list $listKey $listVal} |
|||
<a href="{php echo web_url('headline/headline/commentList',array('id'=>$listVal['id']))}" class="menuHref"> |
|||
<div class="menuList {if $listVal['id'] == $id}active{/if} "> |
|||
<div class="menuTitle">{$listVal['title']}</div> |
|||
<div class="menuInfo"> |
|||
<span class="menuTime">{$listVal['release_time']}</span> |
|||
<span class="menuNumber">共{$listVal['total']}条{if $listVal['num'] > 0 && $listVal['id'] != $id}/<span class="menuUnread">未读{$listVal['num']}条</span>{/if}</span> |
|||
</div> |
|||
</div> |
|||
</a> |
|||
{/loop} |
|||
</div> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="80%">留言内容</th> |
|||
<th class="text-center" width="20%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody id="tables"> |
|||
{loop $commentList $index $item} |
|||
<tr class="text-left text-left"> |
|||
<td class="textarea textarea-pd"> |
|||
<div class="dis-flex"> |
|||
<div class="user-image" style="background-image:url({$item['avatar']})"></div> |
|||
<div class="user-detail"> |
|||
<div class="user-name content-color">{$item['nickname']}</div> |
|||
<div class="comment-content">{php echo json_decode($item['text'])}</div> |
|||
<div class="comment-date content-color">{$item['times']}</div> |
|||
</div> |
|||
</div> |
|||
{if $item['reply']} |
|||
<div class="reply-text"> |
|||
<span class="content-color">作者回复:</span> |
|||
<p class="content-color">{php echo json_decode($item['reply'])}</p> |
|||
</div> |
|||
{/if} |
|||
</td> |
|||
<td comment_id="{$item['id']}"> |
|||
<a class="btn btn-sm btn-default btn-selected" href="javascript:;" selectedState="{$item['selected']}"> |
|||
{if $item['selected'] == 0} |
|||
精选 |
|||
{else} |
|||
取消精选 |
|||
{/if} |
|||
</a> |
|||
<a class="btn btn-sm btn-warning btn-setTop" href="javascript:;" topState="{$item['set_top']}"> |
|||
{if $item['set_top'] == 0} |
|||
置顶 |
|||
{else} |
|||
取消置顶 |
|||
{/if} |
|||
</a> |
|||
{if $item['reply'] == ''} |
|||
<a class="btn btn-sm btn-info btn-reply" href="javascript:;">回复</a> |
|||
{else} |
|||
<a class="btn btn-sm btn-disabled" href="javascript:;">已回复</a> |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script > |
|||
//留言精选 |
|||
$("#tables").on('click','.btn-selected', function() { |
|||
var the = $(this); |
|||
var id = the.parent("td").attr("comment_id"); |
|||
var selected = the.attr("selectedState"); |
|||
var html = $.trim($(this).html()); |
|||
var htmls = '精选'; |
|||
$.post("{php echo web_url('headline/headline/selected');}", { |
|||
id: id, |
|||
selected: selected |
|||
}, function(res) { |
|||
if (res.errno == 1) { |
|||
if (html == '精选') { |
|||
htmls = '取消精选'; |
|||
} |
|||
the.html(htmls); |
|||
the.attr("selectedState", res.data); |
|||
} |
|||
|
|||
}, 'json'); |
|||
}); |
|||
//留言置顶 |
|||
$("#tables").on('click','.btn-setTop', function() { |
|||
var the = $(this); |
|||
var id = the.parent("td").attr("comment_id"); |
|||
var topState = the.attr("topState"); |
|||
var hid = "{php echo $id}"; |
|||
var html = $.trim($(this).html()); |
|||
$(".btn-setTop").html('置顶'); |
|||
$(".btn-setTop").attr("topState", 0); |
|||
$.post("{php echo web_url('headline/headline/setTop');}", { |
|||
id: id, |
|||
topState: topState, |
|||
hid: hid |
|||
}, function(res) { |
|||
if (res.errno == 1) { |
|||
//修改状态 |
|||
if (topState == 0) { |
|||
the.attr("topState", 1); |
|||
the.html('取消置顶'); |
|||
//内容置顶 |
|||
the.parent("td").parent("tr").prependTo($("#tables")); |
|||
} |
|||
} |
|||
}, 'json'); |
|||
}); |
|||
//回复留言 —— 弹出文本框 |
|||
$("#tables").on('click','.btn-reply', function() { |
|||
$('.t-reply').remove(); |
|||
var replyHtml = |
|||
'<div class="t-reply"><div class="reply-text"><span>作者回复:</span><div class="reply-text-c"><textarea class="reply-texta textarea-style" id="reply_text" maxlength="1024" placeholder="请输入回复内容..."></textarea><div class="reply-text-c-b"><div class="wordCount wordCount-tb">0/1024</div><a class="btn btn-sm comment-btn-reply submitBut" comment_id="" href="javascript:;">回复</a><a class="btn btn-sm comment-btn-cancel cancelBut" href="javascript:;">取消</a></div></div></div></div>'; |
|||
$(this).parents('.text-left').find('.textarea').append(replyHtml); |
|||
$(this).parents('.text-left').find('.submitBut').attr("comment_id", $(this).parent("td").attr("comment_id")); |
|||
$('.reply-texta').focus(); |
|||
apd_textarea(); |
|||
}); |
|||
|
|||
function apd_textarea() { |
|||
$("textarea").on('keyup', function() { |
|||
var length = $(this).val().length; |
|||
var maxlength = $(this).attr("maxlength"); |
|||
$(this).parent().find('.wordCount').html(length + "/" + maxlength); |
|||
}); |
|||
$('.cancelBut').on('click', function() { |
|||
$(this).parents('.text-left').find('.t-reply').remove(); |
|||
}); |
|||
//回复留言 —— 提交内容 |
|||
$(".submitBut").on('click', function() { |
|||
var the = $(this); |
|||
var id = the.attr("comment_id"); |
|||
var text = $("#reply_text").val(); |
|||
$.post("{php echo web_url('headline/headline/reply');}", { |
|||
id: id, |
|||
text: text |
|||
}, function(res) { |
|||
if (res.errno == 1) { |
|||
the.parents('.text-left').find('.btn-reply').parent().append( |
|||
'<a class="btn btn-sm btn-disabled" href="javascript:;">已回复</a>'); |
|||
the.parents('.text-left').find('.btn-reply').remove(); |
|||
the.parents('.text-left').find('.t-reply').remove(); |
|||
var html = "<div class='reply-text'>\n" + |
|||
"<span>作者回复:</span>" + text + |
|||
"</div>"; |
|||
$("[comment_id='" + id + "']").prev(".textarea").append(html); |
|||
} |
|||
$("#reply-model").click(); |
|||
}, 'json'); |
|||
}); |
|||
} |
|||
</script>--> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,225 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li><a href="{php echo web_url('headline/headline/infoList')}">头条信息</a></li> |
|||
<li class="active"><a href="{php echo web_url('headline/headline/getIntoEdit')}">发布头条</a></li> |
|||
</ul> |
|||
<style> |
|||
#formList .chosen-select{ |
|||
width: 49.75%; |
|||
display: inline-block; |
|||
margin: 0; |
|||
} |
|||
</style> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<div class="panel panel-default"> |
|||
<form action="{php echo web_url('headline/headline/edit')}" class="form-horizontal form" method="post" onsubmit="return formcheck(this);"> |
|||
<div class="panel-heading">发布头条信息</div> |
|||
<div class="panel-body" id="formList"> |
|||
|
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">头条标题</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" maxlength="60" name="data[title]" value="{$info['title']}" placeholder="请输入头条标题" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">封面图片</div> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[display_img]',$info['display_img']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">幻灯片</div> |
|||
<div class="col-sm-9"> |
|||
<div id="datas"> |
|||
{loop $advs $key $ad} |
|||
{php include wl_template('headline/advurl');} |
|||
{/loop} |
|||
</div> |
|||
<span class="help-block">不设置任何幻灯片则会在文章头条顶部显示封面图片。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<a class="btn btn-info btn-add-type" href="javascript:;" onclick="addType();"> |
|||
<i class="fa fa-plus" title=""></i>增加一张幻灯片 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">头条简介</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="data[summary]" value="{$info['summary']}" placeholder="请输入头条简介" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">选择分类</label> |
|||
<div class="col-sm-5"> |
|||
<select name="data[one_id]" id="oneID" class="form-control chosen-select"> |
|||
<option value="">请选择一级分类</option> |
|||
{loop $classList $k $v} |
|||
<option value="{$v['id']}" {if $v['id'] == $info['one_id']}selected{/if}>{$v['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
<div class="col-sm-5"> |
|||
<select name="data[two_id]" id="twoID" class="form-control chosen-select"> |
|||
<option value="">请选择二级分类</option> |
|||
{loop $subClass $k $v} |
|||
<option value="{$v['id']}" {if $v['id'] == $info['two_id']}selected{/if}>{$v['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--<div class="form-group">--> |
|||
<!--<div class="col-sm-2 control-label must ">头条标签</div>--> |
|||
<!--<div class="col-sm-9">--> |
|||
<!--<input class="form-control" type="text" maxlength="100" name="data[labels]" value="{$info['labels']}" placeholder="请输入头条标签(多个标签使用#号隔开)" />--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">具体内容</div> |
|||
<div class="col-sm-9"> |
|||
{php echo tpl_diy_editor_create('data[content]',$info['content']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group-title">其他信息</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">作者昵称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" maxlength="15" name="data[author]" value="{$info['author']}" placeholder="请输入作者昵称" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must">作者头像</div> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[author_img]',$info['author_img']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="goods"> |
|||
<label class="col-sm-2 control-label must">推荐商品</label> |
|||
<div class="col-sm-9 is_judge" is_judge="false"> |
|||
{php echo tpl_select_goods($info);} |
|||
</div> |
|||
</div> |
|||
{if p('call')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">集call</label> |
|||
<div class="col-sm-9"> |
|||
<select name="data[call_id]" id="callID" class="form-control chosen-select" style="width: 100%;"> |
|||
<option value="">请选择集call活动(未选择则不开启集call活动)</option> |
|||
{loop $callList $k $v} |
|||
<option value="{$v['id']}" {if $v['id'] == $info['call_id']}selected{/if}>{$v['title']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
{/if} |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must ">浏览量</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control is_judge" is_judge="false" type="number" name="data[browse]" value="{$info['browse']}" placeholder="请输入初始浏览量" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must "></div> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="id" value="{$info['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary col-sm-1 min-width" /> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
let two_id = "{php echo $info['two_id']}"; |
|||
//提交信息进行判断 |
|||
function formcheck() { |
|||
//循环判断 |
|||
var state = true |
|||
,val |
|||
,tips; |
|||
$("#formList input").each(function () { |
|||
val = $(this).val(); |
|||
var is_judge = $(this).closest(".is_judge").attr("is_judge"); |
|||
if(is_judge != 'false'){ |
|||
if(val == ''){ |
|||
tips = ($(this).attr("placeholder"))?($(this).attr("placeholder")):'请上传图片'; |
|||
state = false; |
|||
return false; |
|||
} |
|||
} |
|||
}); |
|||
//判断文本域是否有内容 |
|||
var ue = UE.getEditor('data[content]'); |
|||
var content = ue.getContent(); |
|||
if(state == true && content == ''){ |
|||
tips = '请填写具体内容!'; |
|||
state = false; |
|||
} |
|||
//判断是否选择分类信息 |
|||
if(state == true && $("#oneID").val() == ''){ |
|||
tips = '请选择分类信息!'; |
|||
state = false; |
|||
} |
|||
if(tips){ |
|||
tip.msgbox.err(tips); |
|||
} |
|||
return state; |
|||
} |
|||
/** |
|||
* 分类二级联动 |
|||
* @type {Array} |
|||
*/ |
|||
$("#oneID").on("change", function () { |
|||
//删除现有的二级分类信息 |
|||
$("#twoID option:gt(0)").remove(); |
|||
//获取参数信息 |
|||
var id = $(this).val(), |
|||
list = [], |
|||
html = ''; |
|||
//请求后台获取下级菜单 |
|||
if(id > 0){ |
|||
$.post("{php echo web_url('headline/headline/getSubClass')}",{id:id}, function(data){ |
|||
list = data['data']; |
|||
//根据内容生成html |
|||
if (list) { |
|||
$.each(list, function (k, v) { |
|||
if(v['id'] == two_id){ |
|||
html += "<option value='" + v['id'] + "' selected>" + v['name'] + "</option>"; |
|||
}else{ |
|||
html += "<option value='" + v['id'] + "' >" + v['name'] + "</option>"; |
|||
} |
|||
}); |
|||
} |
|||
//加载新的内容信息 |
|||
$("#twoID").append(html); |
|||
}, 'json'); |
|||
} |
|||
}); |
|||
|
|||
var kw = 1; |
|||
function addType() { |
|||
$(".btn-add-type").button("loading"); |
|||
$.ajax({ |
|||
url: "{php echo web_url('headline/headline/advurl')}&kw="+kw, |
|||
cache: false |
|||
}).done(function (html) { |
|||
$(".btn-add-type").button("reset"); |
|||
$("#datas").append(html); |
|||
}); |
|||
kw++; |
|||
} |
|||
$(".form").on('click','.clearinput',function () { |
|||
$(this).prev().prev().val(''); |
|||
}); |
|||
function removes(asd){ |
|||
$(asd).closest('.data-item').remove(); |
|||
} |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,22 @@ |
|||
<form class="form-horizontal" action="{php echo web_url('headline/headline/import')}" method="post" enctype="multipart/form-data"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">一键导入微信图文</h4> |
|||
</div> |
|||
<div class="modal-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">图文链接</label> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" name="wechat_url" placeholder="请输入微信图文链接" required /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<button class="btn btn-primary" type="submit">导入</button> |
|||
<button data-dismiss="modal" class="btn btn-default" type="button">取消</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,85 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="{php echo web_url('headline/headline/infoList')}">头条信息</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<!--头部信息--> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a class="btn btn-primary" href="{php echo web_url('headline/headline/getIntoEdit')}">发布头条</a> |
|||
<a href="{php echo web_url('headline/headline/import')}" data-toggle='ajaxModal' class="btn btn-success">导入微信图文</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="{php echo web_url('headline/headline/infoList')}" method="post"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">搜索内容</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="search" value="{$search}" placeholder="作者/标题"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-6"> |
|||
<div class="input-group"> |
|||
<button class="btn btn-primary" type="submit" >搜索</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<!--列表信息--> |
|||
<div class="app-table-list"> |
|||
<div id="list" class="panel tab-pane panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" width="10%">标题</th> |
|||
<th class="text-center" width="10%">作者</th> |
|||
<th class="text-center" width="10%">简介</th> |
|||
<th class="text-center" width="10%">分类</th> |
|||
<th class="text-center" width="10%">关联商品</th> |
|||
{if p(call)} |
|||
<th class="text-center" width="10%">集call活动</th> |
|||
{/if} |
|||
<th class="text-center" width="10%">发布时间</th> |
|||
<th class="text-center" width="5%">浏览量</th> |
|||
<th class="text-center" width="20%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $k $v} |
|||
<tr class="text-center"> |
|||
<td>{$v['title']}</td> |
|||
<td>{$v['author']}</td> |
|||
<td>{$v['summary']}</td> |
|||
<td>{$v['one_name']}{if $v['one_name'] && $v['two_name']} — {/if} {$v['two_name']}</td> |
|||
<td>{$v['goods_name']}</td> |
|||
{if p(call)} |
|||
<td>{$v['call']}</td> |
|||
{/if} |
|||
<td>{php echo date("Y-m-d H:i:s",$v['release_time'])}</td> |
|||
<td>{$v['browse']}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-success js-clip" href="javascript:;" data-url="{php echo h5_url('pages/mainPages/headline/headlineDetail',['id'=>$v['id']])}" >复制链接</a> |
|||
<a class="btn btn-sm btn-info js-clip" href="javascript:;" data-url="pages/mainPages/headline/headlineDetail?id={$v['id']}" >复制路径</a> |
|||
<a class="btn btn-sm btn-warning" href="{php echo web_url('headline/headline/getIntoEdit',array('id'=>$v['id']))}" >编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('headline/headline/delHeadline',array('id'=>$v['id']))}" data-confirm="确定删除当前信息?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,217 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">头条分类</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a href="javascript:;" id="create_page" class="btn btn-primary addClass">新建分类</a> |
|||
</div> |
|||
<div class="filter-list"> |
|||
<form class="form-horizontal" action="{php echo web_url('headline/headline/index')}" method="post"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label">分类名称</div> |
|||
<div class="col-sm-9"> |
|||
<input type="text" class="form-control" name="name" value="{$name}" placeholder="请输入分类名称"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label"></div> |
|||
<div class="col-sm-6"> |
|||
<div class="input-group"> |
|||
<button class="btn btn-primary" type="submit" >搜索</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div id="list" class="panel tab-pane panel-default"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:40%">分类</th> |
|||
<th class="text-center" style="width:20%">排序</th> |
|||
<th class="text-center" style="width:20%">状态</th> |
|||
<th class="text-center" style="width:20%">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $k $v} |
|||
<tr class="text-center"> |
|||
<td class="name text-left"> |
|||
<a data-href="{php echo web_url('headline/headline/editField',array('id'=>$v['id'],'field'=>'name'))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit">{$v['name']}</a> |
|||
</td> |
|||
<td class="sort"> |
|||
{$v['sort']} |
|||
</td> |
|||
<td > |
|||
{if $v['state'] == 1} |
|||
<span class="label label-success">开启</span> |
|||
{else} |
|||
<span class="label label-danger">禁用</span> |
|||
{/if}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-warning editButton" href="javascript:;" name="{$v['name']}" sort="{$v['sort']}" head_id="{$v['head_id']}" classid="{$v['id']}" state="{$v['state']}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('headline/headline/delClass',array('id'=>$v['id']))}" data-confirm="确定删除当前分类?{if !$v['headname']}删除后当前菜单下的所有菜单将失去上级菜单!{/if}">删除</a> |
|||
</td> |
|||
</tr> |
|||
{loop $v['footer'] $index $item} |
|||
<tr class="text-center"> |
|||
<td class="name text-left"> |
|||
<a href="javascript:;" style="padding-left: 80px"> |
|||
<span style="color: #CCC;">|——</span> |
|||
<span class="className" data-href="{php echo web_url('headline/headline/editField',array('id'=>$item['id'],'field'=>'name'))}" title="修改名称" data-toggle="ajaxEdit">{$item['name']}</span> |
|||
</a> |
|||
</td> |
|||
<td class="sort"> |
|||
{$item['sort']} |
|||
</td> |
|||
<td> |
|||
{if $item['state'] == 1} |
|||
<span class="label label-success">开启</span> |
|||
{else} |
|||
<span class="label label-danger">禁用</span> |
|||
{/if}</td> |
|||
<td> |
|||
<a class="btn btn-sm btn-warning editButton" href="javascript:;" name="{$item['name']}" sort="{$item['sort']}" head_id="{$item['head_id']}" classid="{$item['id']}" state="{$item['state']}">编辑</a> |
|||
<a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('headline/headline/delClass',array('id'=>$item['id']))}" data-confirm="确定删除当前分类?">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 添加修改 --> |
|||
<div id="addFrom" class="modal fade" style="z-index: 9999;" aria-hidden="false"> |
|||
<div class="modal-dialog"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button data-dismiss="modal" class="close" type="button">×</button> |
|||
<h4 class="modal-title">新建分类</h4> |
|||
</div> |
|||
<div class="modal-body form-horizontal"> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must">分类名称</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" type="text" maxlength="10" name="name" placeholder="请输入分类名称" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label must">上级分类</label> |
|||
<div class="col-sm-9"> |
|||
<select name="head_id" id="headID" class="form-control chosen-select"> |
|||
<option value="0">无上级分类</option> |
|||
{loop $headClass $k $v} |
|||
<option value="{$v['id']}" >{$v['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must">分类排序</div> |
|||
<div class="col-sm-9"> |
|||
<input class="form-control" min="1" type="number" name="sort" sorts="{php echo $total+1}" value="{php echo $total+1}" placeholder="请输入分类排序"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="col-sm-2 control-label must">分类状态</div> |
|||
<div class="col-sm-9" id="inlineRadio"> |
|||
<label class="radio-inline" for="inlineRadio1"> |
|||
<input type="radio" id="inlineRadio1" name="state" value="1" checked>开启 |
|||
</label> |
|||
<label class="radio-inline" for="inlineRadio2"> |
|||
<input type="radio" id="inlineRadio2" name="state" value="0">禁用 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<div class="btn btn-primary" id="yesAdd" classid="">保存</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
//提示内容 |
|||
function tips(info) { |
|||
tip.msgbox.err(info); |
|||
} |
|||
//分类操作 |
|||
$(".addClass").on('click',function () { |
|||
//初始化内容 |
|||
$("#addFrom #yesAdd").attr("classid",''); |
|||
$("#addFrom [name='name']").val(''); |
|||
$("#addFrom [name='sort']").val($("#addFrom [name='sort']").attr("sorts")); |
|||
$("#inlineRadio1").click(); |
|||
$("#headID").val(0); |
|||
//弹出内容 |
|||
$("#addFrom").modal(); |
|||
//点击提交内容 |
|||
$("#yesAdd").on("click",function () { |
|||
//获取内容 |
|||
var id = $(this).attr("classid"); |
|||
updateData(id); |
|||
}); |
|||
}); |
|||
//编辑操作 |
|||
$(".editButton").on('click',function () { |
|||
$("#addFrom #yesAdd").attr("classid",$(this).attr("classid")); |
|||
$("#addFrom [name='name']").val($(this).attr("name")); |
|||
$("#addFrom [name='sort']").val($(this).attr("sort")); |
|||
if(($(this).attr("state")) == 1){ |
|||
$("#inlineRadio1").click(); |
|||
}else{ |
|||
$("#inlineRadio2").click(); |
|||
} |
|||
$("#headID").val($(this).attr("head_id")); |
|||
//弹出内容 |
|||
$("#addFrom").modal(); |
|||
//点击提交内容 |
|||
$("#yesAdd").on("click",function () { |
|||
//获取内容 |
|||
var id = $(this).attr("classid"); |
|||
updateData(id); |
|||
}); |
|||
}); |
|||
//提交分类的信息数据 |
|||
function updateData(id) { |
|||
//获取内容 |
|||
var name = $("#addFrom [name = 'name']").val(); |
|||
var head_id = $("[name = 'head_id']").val(); |
|||
var sort = $("[name = 'sort']").val(); |
|||
var state = $("#inlineRadio :checked").val(); |
|||
if(!name || !sort || !state){ |
|||
tips("请完整填写内容!"); |
|||
return false; |
|||
}else if(id == head_id){ |
|||
tips("上级分类不能是自己!"); |
|||
return false; |
|||
} |
|||
var data = {name:name,head_id:head_id,sort:sort,state:state}; |
|||
$.post("{php echo web_url('headline/headline/editClass');}",{data:data,id:id}, function (res) { |
|||
if(res.errno == 0){ |
|||
tips(res.message); |
|||
}else{ |
|||
tip.msgbox.suc(res.message); |
|||
setTimeout(function () { |
|||
location.reload(); |
|||
}, 500); |
|||
} |
|||
}, 'json'); |
|||
} |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,41 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Helper{ |
|||
/** |
|||
* Comment: 获取帮助分类列表 |
|||
* Author: zzw |
|||
* Date: 2019/9/18 9:45 |
|||
* @param bool $status |
|||
* @return array|bool |
|||
*/ |
|||
public static function getTypeList ($status = true){ |
|||
global $_W; |
|||
#1、根据条件获取帮助分类列表 |
|||
if ($status) { |
|||
//获取所有符合条件分类信息 |
|||
$class = pdo_getall(PDO_NAME . "helper_type" |
|||
, [ 'uniacid' => $_W['uniacid'] , 'status' => 1 ] |
|||
, [ 'id' , 'name' , 'img' ] , '' , ' sort DESC '); |
|||
} else { |
|||
//仅获取存在问题并且符合条件的分类列表 |
|||
$class = pdo_fetchall("SELECT a.id,a.name,a.img FROM " . tablename(PDO_NAME . "helper_type") |
|||
. " as a RIGHT JOIN " . tablename(PDO_NAME . "helper_question") |
|||
. " as b ON a.id = b.type WHERE a.uniacid = {$_W['uniacid']} AND a.status = 1 GROUP BY a.id ORDER BY a.sort DESC"); |
|||
} |
|||
#2、循环处理分类列表信息 |
|||
if (is_array($class) && count($class) > 0) { |
|||
foreach ($class as $classK => &$classV) { |
|||
$classV['img'] = tomedia($classV['img']); |
|||
} |
|||
} |
|||
|
|||
return $class; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[帮助中心]]></name> |
|||
<identifie><![CDATA[helper]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[help]]></type> |
|||
<description><![CDATA[帮助中心,解决常见问题和模块使用指南,方便用户。]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="帮助中心" font="fa-inbox"> |
|||
<entry title="问题管理" ac="helperquestion" do="lists" actions='["ac","helperquestion"]' iscover="true"/> |
|||
<entry title="分类列表" ac="helpertype" do="lists" actions='["ac","helpertype"]'/> |
|||
<entry title="幻灯片" do="lists" ac="helperslide" actions='["ac","helperslide"]'/> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,65 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
//问题管理控制器 |
|||
class Helperquestion_WeliamController { |
|||
|
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$uniacid = $_W['uniacid']; |
|||
$psize = 25; |
|||
$pindex = max(1, $_GPC['page']); |
|||
$listData = Util::getNumData("*", PDO_NAME . 'helper_question', array('uniacid' => $uniacid), 'sort desc', $pindex, $psize); |
|||
|
|||
$category = Util::getNumData("*", PDO_NAME . 'helper_type', array('uniacid' => $_W['uniacid'])); |
|||
$category = $category[0]; |
|||
|
|||
$list = $listData[0]; |
|||
$pager = $listData[1]; |
|||
|
|||
include wl_template('helper/questionlist'); |
|||
} |
|||
|
|||
public function add() { |
|||
global $_W, $_GPC; |
|||
$category = Util::getNumData("*", PDO_NAME . 'helper_type', array('uniacid' => $_W['uniacid'])); |
|||
$category = $category[0]; |
|||
$id = $_GPC['id']; |
|||
if ($id) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'helper_question', array('id' => $id)); |
|||
} |
|||
|
|||
if ($_GPC['data']) { |
|||
$temp = $_GPC['data']; |
|||
$cate = $_GPC['category']; |
|||
$temp['type'] = $cate; |
|||
$temp['uniacid'] = $_W['uniacid']; |
|||
$temp['content'] = htmlspecialchars_decode($temp['content']); |
|||
if ($temp['id']) { |
|||
pdo_update(PDO_NAME . 'helper_question', $temp, array('id' => $temp['id'])); |
|||
} else { |
|||
pdo_insert(PDO_NAME . 'helper_question', $temp); |
|||
} |
|||
wl_message('操作成功', web_url('helper/helperquestion/lists'), 'success'); |
|||
} |
|||
include wl_template('helper/questionadd'); |
|||
} |
|||
|
|||
public function del() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
$ids = $_GPC['ids']; |
|||
|
|||
if ($id) { |
|||
pdo_delete(PDO_NAME . 'helper_question', array('id' => $id)); |
|||
wl_message('操作成功', web_url('helper/helperquestion/lists'), 'success'); |
|||
} |
|||
|
|||
if ($ids) { |
|||
foreach ($ids as $key => $id) { |
|||
pdo_delete(PDO_NAME . 'helper_question', array('id' => $id)); |
|||
} |
|||
die(json_encode(array('errno' => 0, 'message' => '', 'id' => ''))); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
//幻灯片管理控制器 |
|||
class Helperslide_WeliamController { |
|||
|
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$uniacid = $_W['uniacid']; |
|||
$psize = 25; |
|||
$pindex = max(1, $_GPC['page']); |
|||
$listData = Util::getNumData("*", PDO_NAME . 'helper_slide', array('uniacid' => $uniacid), 'sort desc', $pindex, $psize); |
|||
|
|||
$list = $listData[0]; |
|||
$pager = $listData[1]; |
|||
|
|||
include wl_template('helper/slidelist'); |
|||
} |
|||
|
|||
public function add() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
if ($id) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'helper_slide', array('id' => $id)); |
|||
} |
|||
|
|||
if ($_GPC['data']) { |
|||
$temp = $_GPC['data']; |
|||
$temp['uniacid'] = $_W['uniacid']; |
|||
if ($temp['id']) { |
|||
pdo_update(PDO_NAME . 'helper_slide', $temp, array('id' => $temp['id'])); |
|||
} else { |
|||
pdo_insert(PDO_NAME . 'helper_slide', $temp); |
|||
} |
|||
wl_message('操作成功', web_url('helper/helperslide/lists'), 'success'); |
|||
} |
|||
include wl_template('helper/slideadd'); |
|||
|
|||
} |
|||
|
|||
public function del() { |
|||
global $_GPC, $_W; |
|||
pdo_delete(PDO_NAME . 'helper_slide', array('id' => $_GPC['id'])); |
|||
wl_message('操作成功', web_url('helper/helperslide/lists'), 'success'); |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Helpertype_WeliamController { |
|||
/** |
|||
* 查询列表,以分页显示 |
|||
*/ |
|||
public function lists() { |
|||
global $_W, $_GPC; |
|||
$uniacid = $_W['uniacid']; |
|||
$psize = 25; |
|||
$pindex = max(1, $_GPC['page']); |
|||
$listData = Util::getNumData('*', PDO_NAME . 'helper_type', array('uniacid' => $uniacid), 'sort desc', $pindex, $psize); |
|||
|
|||
$list = $listData[0]; |
|||
$pager = $listData[1]; |
|||
|
|||
include wl_template('helper/typelist'); |
|||
} |
|||
|
|||
public function add() { |
|||
global $_W, $_GPC; |
|||
$id = $_GPC['id']; |
|||
if ($id) { |
|||
$data = Util::getSingelData("*", PDO_NAME . 'helper_type', array('id' => $id)); |
|||
} |
|||
|
|||
if ($_GPC['data']) { |
|||
$temp = $_GPC['data']; |
|||
$temp['uniacid'] = $_W['uniacid']; |
|||
if ($temp['id']) { |
|||
pdo_update(PDO_NAME . 'helper_type', $temp, array('id' => $temp['id'])); |
|||
} else { |
|||
pdo_insert(PDO_NAME . 'helper_type', $temp); |
|||
} |
|||
wl_message('操作成功', web_url('helper/helpertype/lists'), 'success'); |
|||
} |
|||
include wl_template('helper/typeadd'); |
|||
} |
|||
|
|||
public function del() { |
|||
global $_GPC; |
|||
pdo_delete(PDO_NAME . 'helper_type', array('id' => $_GPC['id'])); |
|||
wl_message('操作成功', web_url('helper/helpertype/lists'), 'success'); |
|||
} |
|||
} |
|||
@ -0,0 +1,79 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">编辑问题</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="form"> |
|||
<div class="form-group-title">编辑问题</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[sort]" id="sort" class="form-control" value="{$data['sort']}" /> |
|||
<span class="help-block">提示:填写数字</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">问题标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[title]" id="title" class="form-control" value="{$data['title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">问题关键字</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[keyword]" id="keyword" class="form-control" value="{$data['keyword']}" /> |
|||
<span class="help-block">提示:问题关键字提供更精准的搜索推送服务, 并非入口关键字, 多个请以半角逗号隔开</span> |
|||
</div> |
|||
|
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">问题内容</label> |
|||
<div class="col-sm-9" id="editorId"> |
|||
{php echo tpl_diy_editor_create('data[content]', $data['content']);} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">问题分类</label> |
|||
<div class="col-sm-9" > |
|||
<select class="form-control" name="category"> |
|||
{loop $category $item} |
|||
<option value="{$item['id']}" {if intval($item['id'])==intval($data['type'])}selected="selected"{/if} >{$item['name']}</option> |
|||
{/loop} |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否推荐</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[recommend]" value="1" {if intval($data[ 'recommend'])==1 }checked="checked" {/if}>是 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[recommend]" value="0" {if intval($data[ 'recommend'])==0 }checked="checked" {/if}>否 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if intval($data[ 'status'])==1 }checked="checked" {/if}>是 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[status]" value="0" {if intval($data[ 'status'])==0 }checked="checked" {/if}>否 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="data[id]" value="{$data['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,93 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">问题列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a class="btn btn-primary" href="{php echo web_url('helper/helperquestion/add');}">添加问题</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th style="width:30px;" class="text-center"><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" /></th> |
|||
<th class="text-center" style="width:40px;">排序</th> |
|||
<th class="text-center" style="width:80px;">问题分类</th> |
|||
<th class="text-center" style="width:150px;">问题名称</th> |
|||
<th class="text-center" style="width:50px;">推荐</th> |
|||
<th class="text-center" style="width:50px;">状态</th> |
|||
<th class="text-center" style="width:80px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<center><input type="checkbox" name="checkbox[]" class="checkbox" value="{$item['id']}" /></center> |
|||
</td> |
|||
<td> |
|||
{$item['sort']} |
|||
</td> |
|||
<td> |
|||
{loop $category $cate} |
|||
{if intval($item['type'])==intval($cate['id'])} |
|||
{$cate['name']} |
|||
{/if} |
|||
{/loop} |
|||
</td> |
|||
<td> |
|||
{$item['title']} |
|||
</td> |
|||
<td>{if $item['recommend']==1}<span class="label label-primary">是</span>{else}<span class="label label-default">否</span>{/if}</td> |
|||
<td>{if $item['status']==1}<span class="label label-primary">显示</span>{else}<span class="label label-default">隐藏</span>{/if}</td> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('helper/helperquestion/add',array('id'=>$item['id']))}">编辑</a> |
|||
- |
|||
<a href="{php echo web_url('helper/helperquestion/del',array('id'=>$item['id']))}">删除</a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
<div id="de1"> |
|||
<a href="javascript:;" class="btn btn-default min-width js-batch js-delete">删除选中记录</a> |
|||
</div> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<script type="text/javascript"> |
|||
$('#de1').delegate('.js-delete', 'click', function(e) { |
|||
e.stopPropagation(); |
|||
var order_ids = []; |
|||
var $checks = $('.checkbox:checkbox:checked'); |
|||
$checks.each(function() { |
|||
if(this.checked) { |
|||
order_ids.push(this.value); |
|||
}; |
|||
}); |
|||
var $this = $(this); |
|||
var ids = order_ids; |
|||
util.nailConfirm(this, function(state) { |
|||
if(!state) return; |
|||
$.post("{php echo web_url('helper/helperquestion/del')}", { ids: ids }, function(data) { |
|||
if(!data.errno) { |
|||
util.tips("删除成功!"); |
|||
location.reload(); |
|||
}; |
|||
}, 'json'); |
|||
}, { html: '确认删除?' }); |
|||
}); |
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,60 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">编辑幻灯片</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="form"> |
|||
<div class="form-group-title">编辑幻灯片</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[sort]" id="sort" class="form-control" value="{$data['sort']}" /> |
|||
<span class="help-block">提示:填写数字</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">幻灯片标题<span class="must-fill">*</span></label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[title]" id="title" class="form-control" value="{$data['title']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">幻灯片图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[img]', $data['img']);} |
|||
<span class="help-block">图片建议为750X560,请将所有幻灯片图片尺寸保持一致</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">幻灯片链接</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group form-group" style="margin: 0;"> |
|||
<input type="text" value="{$data['url']}" readonly="readonly" class="form-control valid" name="data[url]" id="advlink"> |
|||
<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">状态</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if intval($data[ 'status'])==1 }checked="checked" {/if}>显示 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[status]" value="0" {if intval($data[ 'status'])==0 }checked="checked" {/if}>隐藏 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="data[id]" value="{$data['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,60 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">幻灯片列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a class="btn btn-primary" href="{php echo web_url('helper/helperslide/add');}">添加幻灯片</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:60px;">图片</th> |
|||
<th class="text-center" style="width:60px;">排序</th> |
|||
<th class="text-center" style="width:100px;">标题</th> |
|||
<th class="text-center" style="width:200px;">链接</th> |
|||
<th class="text-center" style="width:50px;">状态</th> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<img src="{php echo tomedia($item['img'])}" data-url="{php echo tomedia($item['img'])}" onerror="this.src='{php echo tomedia($item['img'])}'" class="scrollLoading" height="50px" width="100px" /> |
|||
</td> |
|||
<td> |
|||
{$item['sort']} |
|||
</td> |
|||
<td> |
|||
{$item['title']} |
|||
</td> |
|||
<td style="overflow: hidden;"> |
|||
{$item['url']} |
|||
</td> |
|||
<td>{if $item['status']==1}<span class="label label-primary">显示</span>{else}<span class="label label-default">隐藏</span>{/if}</td> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('helper/helperslide/add',array('id'=>$item['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('helper/helperslide/del',array('id'=>$item['id']))}">删除 </a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,63 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">编辑分类</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate" id="form"> |
|||
<div class="form-group-title">编辑分类</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">排序</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[sort]" id="sort" class="form-control" value="{$data['sort']}" /> |
|||
<span class="help-block">提示:填写数字</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分类名称</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="data[name]" id="name" class="form-control" value="{$data['name']}" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分类图标</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('data[img]', $data['img']);} |
|||
<span class="help-block">图片建议为100X100</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否首页推荐</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[recommend]" value="1" {if intval($data[ 'recommend'])==1 }checked="checked" {/if}>是 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[recommend]" value="0" {if intval($data[ 'recommend'])==0 }checked="checked" {/if}>否 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">是否显示</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[status]" value="1" {if intval($data[ 'status'])==1 }checked="checked" {/if}>是 |
|||
</label> |
|||
<label class="radio radio-success radio-inline"> |
|||
<input type="radio" name="data[status]" value="0" {if intval($data[ 'status'])==0 }checked="checked" {/if}>否 |
|||
</label> |
|||
<span class="help-block">提示:分类不显示,其分类下的问题也不显示</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="hidden" name="data[id]" value="{$data['id']}" /> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width"/> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</from> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,57 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs"> |
|||
<li class="active"><a href="javascript:;">分类列表</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-action"> |
|||
<a class="btn btn-primary" href="{php echo web_url('helper/helpertype/add');}">添加分类</a> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover table-bordered"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-center" style="width:60px;">图片</th> |
|||
<th class="text-center" style="width:60px;">排序</th> |
|||
<th class="text-center" style="width:150px;">分类名称</th> |
|||
<th class="text-center" style="width:100px;">推荐</th> |
|||
<th class="text-center" style="width:100px;">状态</th> |
|||
<th class="text-center" style="width:100px;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $item} |
|||
<tr class="text-center"> |
|||
<td> |
|||
<img src="{php echo tomedia($item['img'])}" data-url="{php echo tomedia($item['img'])}" onerror="this.src='{php echo tomedia($item['img'])}'" class="scrollLoading" height="50px" width="50px" /> |
|||
</td> |
|||
<td> |
|||
{$item['sort']} |
|||
</td> |
|||
<td> |
|||
{$item['name']} |
|||
</td> |
|||
<td>{if $item['recommend']==1}<span class="label label-primary">是</span>{else}<span class="label label-default">否</span>{/if}</td> |
|||
<td>{if $item['status']==1}<span class="label label-primary">显示</span>{else}<span class="label label-default">隐藏</span>{/if}</td> |
|||
<td style="position:relative;"> |
|||
<a href="{php echo web_url('helper/helpertype/add',array('id'=>$item['id']))}">编辑 </a> |
|||
- |
|||
<a href="{php echo web_url('helper/helpertype/del',array('id'=>$item['id']))}">删除 </a> |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,111 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class HelperModuleUniapp extends Uniapp { |
|||
/** |
|||
* Comment: 帮助中心信息获取 |
|||
* Author: zzw |
|||
* Date: 2019/8/23 10:27 |
|||
*/ |
|||
public function helpInfo(){ |
|||
global $_W,$_GPC; |
|||
#1、幻灯片信息获取 |
|||
$adv = pdo_getall(PDO_NAME."helper_slide" |
|||
,['uniacid'=>$_W['uniacid'],'status'=>1] |
|||
,['img','url'],'',' sort DESC '); |
|||
if(is_array($adv) && count($adv) > 0){ |
|||
foreach ($adv as $key => &$val){ |
|||
$val['img'] = tomedia($val['img']); |
|||
} |
|||
} |
|||
#2、分类列表信息获取 |
|||
$class = Helper::getTypeList(false); |
|||
#3、信息拼装 |
|||
$data['set'] = $_W['wlsetting']['helper']['status'] ? : 0; |
|||
$data['adv'] = $adv; |
|||
$data['class'] = $class; |
|||
|
|||
$this->renderSuccess('帮助中心信息获取',$data); |
|||
} |
|||
/** |
|||
* Comment: 获取问题列表 |
|||
* Author: zzw |
|||
* Date: 2019/8/23 10:43 |
|||
*/ |
|||
public function problemList(){ |
|||
global $_W,$_GPC; |
|||
#1、参数接收 |
|||
$is_recommend = $_GPC['is_recommend'] ? : 0;//是否推荐0=获取全部;1=仅获取推荐问题 |
|||
$type_id = $_GPC['type_id'] ? : 0;//0=获取全部;大于0仅获取当前分类问题 |
|||
$page = $_GPC['page'] ? : 1; |
|||
$pageIndex = $_GPC['page_index'] ? : 10; |
|||
$pageStart = $page * $pageIndex - $pageIndex; |
|||
$search = $_GPC['search'] ? : ''; |
|||
#2、条件生成 |
|||
$where = " WHERE uniacid = {$_W['uniacid']} AND status = 1 "; |
|||
if($is_recommend > 0) $where .= " AND recommend = 1 "; |
|||
if($type_id > 0) $where .= " AND type = {$type_id} "; |
|||
if(!empty($search)) $where .= " AND title LIKE '%{$search}%' "; |
|||
#3、列表 |
|||
$data['list'] = pdo_fetchall("SELECT id,title FROM ".tablename(PDO_NAME."helper_question") |
|||
.$where." ORDER BY sort DESC,id DESC LIMIT {$pageStart},{$pageIndex}"); |
|||
#3、获取总页数 |
|||
$total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename(PDO_NAME."helper_question") .$where); |
|||
$data['total'] = ceil($total / $pageIndex); |
|||
|
|||
$this->renderSuccess('获取问题列表',$data); |
|||
} |
|||
/** |
|||
* Comment: 获取问题的详细信息 |
|||
* Author: zzw |
|||
* Date: 2019/8/23 10:54 |
|||
*/ |
|||
public function detail(){ |
|||
global $_W,$_GPC; |
|||
#1、参数接收 |
|||
$_GPC['id'] ? $id = $_GPC['id'] : $this->renderError('缺少参数:id'); |
|||
#2、信息获取 |
|||
$info = pdo_get(PDO_NAME."helper_question",['id'=>$id] ,['title','content']); |
|||
$info['content'] = htmlspecialchars_decode($info['content']); |
|||
|
|||
$this->renderSuccess('问题的详细信息',$info); |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,289 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class Mobilerecharge { |
|||
/** |
|||
* 支付回调 |
|||
*/ |
|||
public function payRechargeOrderNotify($params){ |
|||
global $_W; |
|||
Util::wl_log('mrecharge_notify', PATH_DATA . "mrecharge/data/", $params); //写入异步日志记录 |
|||
$order_out = pdo_fetch("select * from" . tablename(PDO_NAME . 'mrecharge_order') . "where orderno='{$params['tid']}'"); |
|||
$_W['uniacid'] = $order_out['uniacid']; |
|||
$set = Setting::wlsetting_read('mobilerecharge'); |
|||
if ($order_out['status'] == 0 ){ |
|||
$data = array('status' => $params['result'] == 'success' ? 1 : 0); |
|||
$data['paytype'] = $params['type']; |
|||
$data['paytime'] = TIMESTAMP; |
|||
$data['transid'] = pdo_getcolumn(PDO_NAME.'paylogvfour',array('tid'=>$params['tid']),'transaction_id');; |
|||
//分销订单创建 |
|||
if($set['rechargedis'] > 0){ |
|||
if($set['rechargePlatform'] == 1){ |
|||
if($order_out['type'] == 1){ |
|||
$jing50one = $set['slowjing50one']; |
|||
$jing50two = $set['slowjing50two']; |
|||
$jing100one = $set['slowjing100one']; |
|||
$jing100two = $set['slowjing100two']; |
|||
$jing200one = $set['slowjing200one']; |
|||
$jing200two = $set['slowjing200two']; |
|||
}else if($order_out['type'] == 2){ |
|||
$jing50one = $set['fastjing50one']; |
|||
$jing50two = $set['fastjing50two']; |
|||
$jing100one = $set['fastjing100one']; |
|||
$jing100two = $set['fastjing100two']; |
|||
$jing200one = $set['fastjing200one']; |
|||
$jing200two = $set['fastjing200two']; |
|||
}else if($order_out['type'] == 3){ |
|||
$jing50one = $set['mostjing50one']; |
|||
$jing50two = $set['mostjing50two']; |
|||
$jing100one = $set['mostjing100one']; |
|||
$jing100two = $set['mostjing100two']; |
|||
$jing200one = $set['mostjing200one']; |
|||
$jing200two = $set['mostjing200two']; |
|||
} |
|||
|
|||
if($order_out['money'] == 50){ |
|||
$onemoney = $jing50one; |
|||
$twomoney = $jing50two; |
|||
}else if($order_out['money'] == 100){ |
|||
$onemoney = $jing100one; |
|||
$twomoney = $jing100two; |
|||
}else if($order_out['money'] == 200){ |
|||
$onemoney = $jing200one; |
|||
$twomoney = $jing200two; |
|||
} |
|||
$disorderid = Distribution::disCore($order_out['mid'],$order_out['price'],$onemoney,$twomoney,0,$order_out['id'],'mobilerecharge',1); |
|||
$data['disorderid'] = $disorderid; |
|||
} |
|||
} |
|||
pdo_update(PDO_NAME . 'mrecharge_order', $data, array('orderno' => $params['tid'])); //更新订单状态 |
|||
//通知支付成功 |
|||
News::paySuccess($order_out['id'],'mobilerecharge',1); |
|||
//36鲸下单 |
|||
if($order_out['channel'] == 1){ |
|||
$res = self::sljOrderSubmit($order_out); |
|||
} |
|||
//下单失败 加入计划任务 |
|||
if($res['error'] > 0){ |
|||
//退款 |
|||
//self::refund($order_out['orderno'],$res['msg']); |
|||
//添加结算抢购订单到计划任务 |
|||
$rushtask = [ |
|||
'type' => 'mrecharge' , |
|||
'orderid' => $order_out['id'] |
|||
]; |
|||
$rushtask = serialize($rushtask); |
|||
Queue::addTask(11 ,$rushtask,time(),$order_out['id']); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 36鲸渠道检测 |
|||
*/ |
|||
public function sljOrderStatus($mobile,$type,$money){ |
|||
global $_W; |
|||
$set = Setting::wlsetting_read('mobilerecharge'); |
|||
$apiurl = 'v1/mobile/status'; |
|||
$posturl = $set['domainname'].$apiurl; |
|||
|
|||
if($type == 1 ){ |
|||
$retype = 1; |
|||
}else if($type == 2){ |
|||
$retype = 0; |
|||
}else if($type == 3){ |
|||
$retype = 2; |
|||
} |
|||
$data = [ |
|||
'appKey' => $set['account'], |
|||
'mobile' => $mobile, |
|||
'time' => time(), |
|||
]; |
|||
if($retype > 0 ){ |
|||
$data['type'] = $retype; |
|||
} |
|||
$data['sign'] = self::sljGetSign($data,$set['secretkey']); |
|||
$info = curlPostRequest($posturl,$data); |
|||
if($info['result_code'] == 'SUCCESS'){ |
|||
if($info['data']['status'] == 1){ |
|||
if(in_array($money,$info['data']['quota'])){ |
|||
return ['error' => 0]; |
|||
}else{ |
|||
return ['error' => 1,'msg' => $money.'元面额充值升级中,请稍后再试']; |
|||
} |
|||
}else{ |
|||
return ['error' => 1,'msg' => $info['data']['tip']]; |
|||
} |
|||
}else{ |
|||
Util::wl_log('mrecharge_error', PATH_DATA . "mrecharge/data/", $info); //写入异步日志记录 |
|||
return ['error' => 1,'msg' => '通信错误,请刷新重试']; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 36鲸下单 |
|||
*/ |
|||
public function sljOrderSubmit($order_out){ |
|||
global $_W; |
|||
$set = Setting::wlsetting_read('mobilerecharge'); |
|||
//获取接口地址 |
|||
if($order_out['type'] == 1 ){ |
|||
$apiurl = 'v1/mobile/sloworder'; |
|||
}else if($order_out['type'] == 2){ |
|||
$apiurl = 'v1/mobile/order'; |
|||
}else if($order_out['type'] == 3){ |
|||
$apiurl = 'v1/mobile/express'; |
|||
} |
|||
$posturl = $set['domainname'].$apiurl; |
|||
//构建数据 |
|||
$data = [ |
|||
'appKey' => $set['account'], |
|||
'orderId' => $order_out['orderno'], |
|||
'mobile' => $order_out['mobile'], |
|||
'amount' => sprintf("%.2f",$order_out['money']), |
|||
'notifyUrl' => $_W['siteroot'].'addons/'.MODULE_NAME.'/plugin/mobilerecharge/sljAsyNotify.php' |
|||
]; |
|||
//获取签名 |
|||
$data['sign'] = self::sljGetSign($data,$set['secretkey']); |
|||
Util::wl_log('mrecharge_order', PATH_DATA . "mrecharge/data/", $data); //写入异步日志记录 |
|||
$info = curlPostRequest($posturl,$data); |
|||
if($info['result_code'] == 'SUCCESS'){ |
|||
pdo_update(PDO_NAME . 'mrecharge_order',['otherorderno' => $info['data']['number']],array('id' => $order_out['id'])); //更新订单状态 |
|||
Util::wl_log('mrecharge_success', PATH_DATA . "mrecharge/data/", $info); //写入异步日志记录 |
|||
return ['error' => 0]; |
|||
}else{ |
|||
Util::wl_log('mrecharge_error', PATH_DATA . "mrecharge/data/", $info); //写入异步日志记录 |
|||
return ['error' => 1,'msg' => $info['return_msg']]; |
|||
} |
|||
} |
|||
/** |
|||
* 36鲸签名生成 |
|||
*/ |
|||
public function sljGetSign($data,$seckey){ |
|||
ksort($data); |
|||
$arr = []; |
|||
foreach ($data as $key => $value) { |
|||
$arr[] = $key.'='.$value; |
|||
} |
|||
$arr[] = 'key='.$seckey; |
|||
$str = implode('&', $arr); |
|||
$str = strtoupper(md5($str)); |
|||
|
|||
return $str; |
|||
} |
|||
/** |
|||
* 订单退款 |
|||
*/ |
|||
static function refund($orderno,$reason = '下单失败',$money = 0, $unline = ''){ |
|||
global $_W; |
|||
$order = pdo_get('wlmerchant_mrecharge_order',array('orderno' => $orderno)); |
|||
|
|||
if ($unline) { |
|||
$res['status'] = 1; |
|||
} else { |
|||
$res = wlPay::refundMoney($order['id'], $money, '充值订单退款', 'mobilerecharge',2); |
|||
} |
|||
if ($res['status']) { |
|||
pdo_update('wlmerchant_mrecharge_order',array('status' => 3,'reason' => $reason,'finishtime' => time()),array('id' => $order['id'])); |
|||
} |
|||
if ($order['disorderid']) { |
|||
Distribution::refunddis($order['disorderid']); |
|||
} |
|||
News::refundNotice($order['id'],'mobilerecharge',$money,$reason); |
|||
|
|||
|
|||
return $res; |
|||
} |
|||
|
|||
/** |
|||
* 获取关注二维码路径地址 |
|||
*/ |
|||
static function getgzqrcode($mid){ |
|||
global $_W; |
|||
$qrid = pdo_getcolumn(PDO_NAME . 'qrcode', array('uniacid' => $_W['uniacid'], 'sid' => $mid, 'type' => 1, 'status' => 1, 'remark' => 'mobilerecharge'), 'qrid'); |
|||
$qrcode = pdo_get('qrcode', array('uniacid' => $_W['uniacid'], 'status' => 1, 'id' => $qrid, 'keyword' => 'weliam_smartcity_mobilerecharge')); |
|||
if ($qrcode['expire'] > 0) { |
|||
$createTime = $qrcode['createtime'];//建立时间 秒 |
|||
$expireTime = $qrcode['expire'];//有效时间 秒 |
|||
$endTime = ($createTime + $expireTime) - time();//距离结束时间还有多少时间 小于1则已经过期 |
|||
} else { |
|||
$endTime = 1; |
|||
} |
|||
if (empty($qrid) || $endTime < 1 || empty($qrcode)) { |
|||
//删除旧的二维码信息 |
|||
if ($qrid) { |
|||
pdo_update('qrcode', array('status' => 2), array('id' => $qrid)); |
|||
pdo_update(PDO_NAME . 'qrcode', array('status' => 2), array('qrid' => $qrid)); |
|||
} |
|||
//申请新的二维码信息 |
|||
Weixinqrcode::createkeywords('话费充值二维码:Mobilerecharge', 'weliam_smartcity_mobilerecharge'); |
|||
//判断是生成普通二维码 还是生成永久二维码 |
|||
$result = Weixinqrcode::createqrcode('话费充值二维码:Mobilerecharge', 'weliam_smartcity_mobilerecharge', 1, 1, -1, '话费充值二维码:weliam_smartcity_mobilerecharge'); |
|||
if (!is_error($result)) { |
|||
$qrid = $result; |
|||
pdo_update(PDO_NAME . 'qrcode', array('sid' => $mid), array('uniacid' => $_W['uniacid'], 'qrid' => $qrid)); |
|||
} |
|||
} |
|||
$qrurl = pdo_get('qrcode', array('id' => $qrid, 'uniacid' => $_W['uniacid']), array('url', 'ticket')); |
|||
return $qrurl; |
|||
} |
|||
/** |
|||
* 消息推送 |
|||
*/ |
|||
static function Processor($message) |
|||
{ |
|||
global $_W; |
|||
if (strtolower($message['msgtype']) == 'event') { |
|||
//获取数据 |
|||
$returnmess = array(); |
|||
$qrid = Weixinqrcode::get_qrid($message); |
|||
|
|||
$mid = pdo_getcolumn(PDO_NAME . 'qrcode', array('uniacid' => $_W['uniacid'], 'qrid' => $qrid), 'sid'); |
|||
|
|||
$set = Setting::wlsetting_read('mobilerecharge'); |
|||
|
|||
$pagepath = 'pages/subPages2/voucherCenter/voucherCenter?head_id='.$mid; |
|||
|
|||
if(empty($_W['attachurl_remote'])){ |
|||
$uni_remote_setting = uni_setting_load('remote'); |
|||
$_W['attachurl_remote'] = $uni_remote_setting['remote']['alioss']['url'].'/'; |
|||
} |
|||
|
|||
$share_title = $set['share_title']; |
|||
$share_desc = $set['share_desc']; |
|||
//文本替换 |
|||
$nickname = pdo_getcolumn(PDO_NAME.'member',array('id'=>$mid),'nickname');; |
|||
$time = date("Y-m-d H:i:s" , time()); |
|||
$sysname = $_W['wlsetting']['base']['name']; |
|||
$settings = Setting::wlsetting_read('share');//不存在代理商分享信息时获取平台分享信息 |
|||
if (empty($share_title)) { |
|||
$share_title = $settings['share_title']; |
|||
} else { |
|||
$share_title = str_replace('[昵称]' , $nickname , $share_title); |
|||
$share_title = str_replace('[时间]' , $time , $share_title); |
|||
$share_title = str_replace('[系统名称]' , $sysname , $share_title); |
|||
} |
|||
if (empty($share_desc)) { |
|||
$share_desc = $settings['share_desc']; |
|||
} else { |
|||
$share_desc = str_replace('[昵称]' , $nickname ,$share_desc); |
|||
$share_desc = str_replace('[时间]' , $time , $share_desc); |
|||
$share_desc = str_replace('[系统名称]' , $sysname , $share_desc); |
|||
} |
|||
$returnmess[] = array('title' => urlencode($share_title), 'description' => urlencode($share_desc), 'picurl' => tomedia($set['share_image']), 'url' => h5_url($pagepath)); |
|||
|
|||
Weixinqrcode::send_news($returnmess, $message); |
|||
|
|||
if($message['event'] == 'subscribe'){ |
|||
$laterflag = 1; |
|||
}else{ |
|||
$laterflag = 0; |
|||
} |
|||
Distribution::addJunior($mid, $_W['wlmember']['id'],'',1,$laterflag); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest> |
|||
<application> |
|||
<name><![CDATA[话费充值]]></name> |
|||
<identifie><![CDATA[mobilerecharge]]></identifie> |
|||
<version><![CDATA[1.0.0]]></version> |
|||
<type><![CDATA[expand]]></type> |
|||
<description><![CDATA[话费充值]]></description> |
|||
<author><![CDATA[微连科技]]></author> |
|||
<url><![CDATA[http://www.weliam.cn/]]></url> |
|||
</application> |
|||
<setting> |
|||
<agent embed="false" /> |
|||
<system embed="true" /> |
|||
<task embed="false" /> |
|||
</setting> |
|||
<agentmenu> |
|||
</agentmenu> |
|||
<systemmenu> |
|||
<menu title="话费充值" font="fa-inbox"> |
|||
<entry title="充值订单" ac="mrecharge" do="orderList" iscover="true" /> |
|||
<entry title="充值设置" ac="mrecharge" do="baseSet" /> |
|||
</menu> |
|||
</systemmenu> |
|||
</manifest> |
|||
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,45 @@ |
|||
<?php |
|||
if(is_file('../../../../wlversion.txt')){ |
|||
$version = file_get_contents('../../../../wlversion.txt'); |
|||
define("MODULE_NAME",$version); |
|||
}else{ |
|||
define("MODULE_NAME",'weliam_smartcity'); |
|||
} |
|||
require '../../../../framework/bootstrap.inc.php'; |
|||
require '../../../../addons/'.MODULE_NAME.'/core/common/defines.php'; |
|||
require '../../../../addons/'.MODULE_NAME.'/core/common/autoload.php'; |
|||
require '../../../../addons/'.MODULE_NAME.'/vendor/autoload.php'; |
|||
require '../../../../addons/'.MODULE_NAME.'/core/function/global.func.php'; |
|||
global $_W,$_GPC; |
|||
|
|||
|
|||
file_put_contents(PATH_DATA . "sljnotify.log", var_export($_GPC, true) . PHP_EOL, FILE_APPEND); |
|||
|
|||
//结果处理 |
|||
$status = $_GPC['status']; |
|||
$finishtime = strtotime($_GPC['createdAt']); |
|||
$order = pdo_get('wlmerchant_mrecharge_order',array('orderno' => $_GPC['orderId'])); |
|||
$_W['uniacid'] = $order['uniacid']; |
|||
if($status == 'SUCCESS'){ |
|||
pdo_update('wlmerchant_mrecharge_order',array('status' => 2,'finishtime' => $finishtime),array('orderno' => $_GPC['orderId'])); |
|||
|
|||
$first = '您的话费充值已到账'; |
|||
$type = '话费充值'; |
|||
$content = '面额:['.$order['money'].']元'; |
|||
$newStatus = '充值成功'; |
|||
$remark = '充值手机号:'.$order['mobile'].',感谢您的使用'; |
|||
News::jobNotice($order['mid'],$first,$type,$content,$newStatus,$remark,time()); |
|||
}else if($status == 'FAIL'){ |
|||
pdo_update('wlmerchant_mrecharge_order',array('status' => 3,'reason' => $_GPC['reason'],'finishtime' => time()),array('orderno' => $_GPC['orderId'])); |
|||
//退款 |
|||
Mobilerecharge::refund($_GPC['orderId'],$_GPC['reason']); |
|||
//发消息 |
|||
$first = '您的话费充值失败'; |
|||
$type = '话费充值'; |
|||
$content = '面额:['.$order['money'].']元'; |
|||
$newStatus = '充值失败'; |
|||
$remark = '失败原因:'.$_GPC['reason'].',我们对此深感抱歉'; |
|||
News::jobNotice($order['mid'],$first,$type,$content,$newStatus,$remark,time()); |
|||
} |
|||
|
|||
exit('SUCCESS'); |
|||
@ -0,0 +1,269 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class mrecharge_WeliamController { |
|||
|
|||
|
|||
/** |
|||
* Comment: 话费充值订单 |
|||
* Author: wlf |
|||
* Date: 2021/11/03 16:09 |
|||
*/ |
|||
public function orderList(){ |
|||
global $_W,$_GPC; |
|||
$pindex = max(1, intval($_GPC['page'])); |
|||
$psize = 20; |
|||
|
|||
$where = array(); |
|||
$where['uniacid'] = $_W['uniacid']; |
|||
|
|||
if(empty($_GPC['status'])){ |
|||
$where['status>'] = 1; |
|||
}else{ |
|||
$where['status'] = $_GPC['status']; |
|||
} |
|||
if($_GPC['keyword']){ |
|||
$keyword = $_GPC['keyword']; |
|||
if($_GPC['keywordtype'] == 1){ |
|||
$params[':name'] = "%{$keyword}%"; |
|||
$members = pdo_fetchall("SELECT * FROM ".tablename('wlmerchant_member')." WHERE uniacid = {$_W['uniacid']} AND nickname LIKE :name",$params); |
|||
if($members){ |
|||
$mids = "("; |
|||
foreach ($members as $key => $v) { |
|||
if($key == 0){ |
|||
$mids.= $v['id']; |
|||
}else{ |
|||
$mids.= ",".$v['id']; |
|||
} |
|||
} |
|||
$mids.= ")"; |
|||
$where['mid#'] = $mids; |
|||
}else{ |
|||
$where['mid'] = 0; |
|||
} |
|||
}else if($_GPC['keywordtype'] == 2){ |
|||
$where['mobile@'] = "%{$keyword}%"; |
|||
} |
|||
} |
|||
|
|||
if($_GPC['time_limit']){ |
|||
$time_limit = $_GPC['time_limit']; |
|||
$starttime = strtotime($_GPC['time_limit']['start']); |
|||
$endtime = strtotime($_GPC['time_limit']['end']); |
|||
if($_GPC['timetype'] == 1){ |
|||
$where['paytime>'] = $starttime; |
|||
$where['paytime<'] = $endtime+86400; |
|||
}else if($_GPC['timetype'] == 2){ |
|||
$where['finishtime>'] = $starttime; |
|||
$where['finishtime<'] = $endtime+86400; |
|||
} |
|||
} |
|||
if (empty($starttime) || empty($endtime)) { |
|||
$starttime = strtotime('-1 month'); |
|||
$endtime = time(); |
|||
} |
|||
|
|||
if(!empty($_GPC['export'])){ |
|||
$this -> export($where); |
|||
} |
|||
|
|||
$payonlinelist = Util::getNumData('*','wlmerchant_mrecharge_order',$where,'paytime DESC',$pindex,$psize,1); |
|||
$pager = $payonlinelist[1]; |
|||
$list = $payonlinelist[0]; |
|||
foreach ($list as $key => &$li) { |
|||
$member = pdo_get('wlmerchant_member',array('id' => $li['mid']),array('avatar','nickname')); |
|||
$li['avatar'] = tomedia($member['avatar']); |
|||
$li['nickname'] = $member['nickname']; |
|||
if($li['paytime'] > 0){ |
|||
$li['paytime'] = date('Y-m-d H:i:s',$li['paytime']); |
|||
} |
|||
if($li['finishtime'] > 0){ |
|||
$li['finishtime'] = date('Y-m-d H:i:s',$li['finishtime']); |
|||
} |
|||
} |
|||
|
|||
|
|||
include wl_template("page/orderList"); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 充值订单导出 |
|||
* Author: wlf |
|||
* Date: 2021/11/17 13:16 |
|||
*/ |
|||
public function export($where){ |
|||
global $_W,$_GPC; |
|||
$payonlinelist = Util::getNumData('*','wlmerchant_mrecharge_order',$where,'paytime DESC',0,0,1); |
|||
$list = $payonlinelist[0]; |
|||
|
|||
foreach ($list as $key => &$li) { |
|||
$member = pdo_get('wlmerchant_member',array('id' => $li['mid']),array('nickname')); |
|||
$li['nickname'] = $member['nickname']; |
|||
if($li['paytime'] > 0){ |
|||
$li['paytime'] = date('Y-m-d H:i:s',$li['paytime']); |
|||
} |
|||
if($li['finishtime'] > 0){ |
|||
$li['finishtime'] = date('Y-m-d H:i:s',$li['finishtime']); |
|||
} |
|||
$li['orderno'] = "\t".$li['orderno']."\t"; |
|||
} |
|||
|
|||
$filter = array( |
|||
'orderno' => '订单编号', |
|||
'nickname' => '用户昵称', |
|||
'mobile' => '充值号码', |
|||
'money' => '充值金额', |
|||
'channel' => '用户昵称', |
|||
'price' => '支付金额', |
|||
'paytime' => '支付时间', |
|||
'status' => '订单状态', |
|||
'paytype' => '支付方式', |
|||
'finishtime' => '完成时间', |
|||
'reason' => '其他说明' |
|||
); |
|||
|
|||
$data = array(); |
|||
for ($i=0; $i < count($list) ; $i++) { |
|||
foreach ($filter as $key => $title) { |
|||
if($key == 'status') { |
|||
switch ($list[$i][$key]) { |
|||
case '1': |
|||
$data[$i][$key] = '充值中'; |
|||
break; |
|||
case '2': |
|||
$data[$i][$key] = '已到账'; |
|||
break; |
|||
case '3': |
|||
$data[$i][$key] = '已退款'; |
|||
break; |
|||
} |
|||
}else if($key == 'paytype'){ |
|||
switch ($list[$i][$key]) { |
|||
case '1': |
|||
$data[$i][$key] = '余额支付'; |
|||
break; |
|||
case '2': |
|||
$data[$i][$key] = '微信支付'; |
|||
break; |
|||
case '3': |
|||
$data[$i][$key] = '支付宝支付'; |
|||
break; |
|||
case '4': |
|||
$data[$i][$key] = '货到付款'; |
|||
break; |
|||
case '5': |
|||
$data[$i][$key] = '小程序支付'; |
|||
break; |
|||
case '6': |
|||
$data[$i][$key] = '0元购'; |
|||
break; |
|||
case '7': |
|||
$data[$i][$key] = '混合支付'; |
|||
break; |
|||
default: |
|||
$data[$i][$key] = '其他或未支付'; |
|||
break; |
|||
} |
|||
}else if($key == 'channel'){ |
|||
if($list[$i]['channel'] == 1){ |
|||
$data[$i][$key] = '36鲸'; |
|||
} |
|||
if($list[$i]['type'] == 1){ |
|||
$data[$i][$key] .= '慢充'; |
|||
}else if($list[$i]['type'] == 2){ |
|||
$data[$i][$key] .= '快充'; |
|||
}else if($list[$i]['type'] == 3){ |
|||
$data[$i][$key] .= '特快充'; |
|||
} |
|||
}else { |
|||
$data[$i][$key] = $list[$i][$key]; |
|||
} |
|||
} |
|||
} |
|||
util_csv::export_csv_2($data, $filter, '充值订单表.csv'); |
|||
exit(); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 话费充值设置 |
|||
* Author: wlf |
|||
* Date: 2021/11/01 17:31 |
|||
*/ |
|||
public function baseSet(){ |
|||
global $_W,$_GPC; |
|||
$settings = Setting::wlsetting_read('mobilerecharge'); |
|||
if (checksubmit('submit')) { |
|||
$base = $_GPC['set']; |
|||
//数据处理 |
|||
$base['account'] = trim($base['account']); |
|||
$base['secretkey'] = trim($base['secretkey']); |
|||
$base['domainname'] = trim($base['domainname']); |
|||
|
|||
$base['fastjing50price'] = sprintf("%.2f",$base['fastjing50price']); |
|||
$base['fastjing50vip'] = sprintf("%.2f",$base['fastjing50vip']); |
|||
$base['fastjing100price'] = sprintf("%.2f",$base['fastjing100price']); |
|||
$base['fastjing100vip'] = sprintf("%.2f",$base['fastjing100vip']); |
|||
$base['fastjing200price'] = sprintf("%.2f",$base['fastjing200price']); |
|||
$base['fastjing200vip'] = sprintf("%.2f",$base['fastjing200vip']); |
|||
$base['fastjing50one'] = sprintf("%.2f",$base['fastjing50one']); |
|||
$base['fastjing50two'] = sprintf("%.2f",$base['fastjing50two']); |
|||
$base['fastjing100one'] = sprintf("%.2f",$base['fastjing100one']); |
|||
$base['fastjing100two'] = sprintf("%.2f",$base['fastjing100two']); |
|||
$base['fastjing200one'] = sprintf("%.2f",$base['fastjing200one']); |
|||
$base['fastjing200two'] = sprintf("%.2f",$base['fastjing200two']); |
|||
|
|||
$base['mostjing50price'] = sprintf("%.2f",$base['mostjing50price']); |
|||
$base['mostjing50vip'] = sprintf("%.2f",$base['mostjing50vip']); |
|||
$base['mostjing100price'] = sprintf("%.2f",$base['mostjing100price']); |
|||
$base['mostjing100vip'] = sprintf("%.2f",$base['mostjing100vip']); |
|||
$base['mostjing200price'] = sprintf("%.2f",$base['mostjing200price']); |
|||
$base['mostjing200vip'] = sprintf("%.2f",$base['mostjing200vip']); |
|||
$base['mostjing50one'] = sprintf("%.2f",$base['mostjing50one']); |
|||
$base['mostjing50two'] = sprintf("%.2f",$base['mostjing50two']); |
|||
$base['mostjing100one'] = sprintf("%.2f",$base['mostjing100one']); |
|||
$base['mostjing100two'] = sprintf("%.2f",$base['mostjing100two']); |
|||
$base['mostjing200one'] = sprintf("%.2f",$base['mostjing200one']); |
|||
$base['mostjing200two'] = sprintf("%.2f",$base['mostjing200two']); |
|||
|
|||
$base['slowjing50price'] = sprintf("%.2f",$base['slowjing50price']); |
|||
$base['slowjing50vip'] = sprintf("%.2f",$base['slowjing50vip']); |
|||
$base['slowjing100price'] = sprintf("%.2f",$base['slowjing100price']); |
|||
$base['slowjing100vip'] = sprintf("%.2f",$base['slowjing100vip']); |
|||
$base['slowjing200price'] = sprintf("%.2f",$base['slowjing200price']); |
|||
$base['slowjing200vip'] = sprintf("%.2f",$base['slowjing200vip']); |
|||
$base['slowjing50one'] = sprintf("%.2f",$base['slowjing50one']); |
|||
$base['slowjing50two'] = sprintf("%.2f",$base['slowjing50two']); |
|||
$base['slowjing100one'] = sprintf("%.2f",$base['slowjing100one']); |
|||
$base['slowjing100two'] = sprintf("%.2f",$base['slowjing100two']); |
|||
$base['slowjing200one'] = sprintf("%.2f",$base['slowjing200one']); |
|||
$base['slowjing200two'] = sprintf("%.2f",$base['slowjing200two']); |
|||
|
|||
Setting::wlsetting_save($base, 'mobilerecharge'); |
|||
wl_message('更新设置成功!', web_url('mobilerecharge/mrecharge/baseSet')); |
|||
} |
|||
|
|||
|
|||
include wl_template("page/baseSet"); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 话费充值订单退款 |
|||
* Author: wlf |
|||
* Date: 2021/11/16 13:38 |
|||
*/ |
|||
public function refundOrder(){ |
|||
global $_W,$_GPC; |
|||
$orderid = $_GPC['id']; |
|||
//删除计划任务 |
|||
pdo_delete('wlmerchant_waittask',array('important'=>$orderid,'key' => 11)); |
|||
//退款 |
|||
$orderno = pdo_getcolumn(PDO_NAME.'mrecharge_order',array('id'=>$orderid),'orderno'); |
|||
$res = Mobilerecharge::refund($orderno,'平台管理员退款'); |
|||
if($res['status']){ |
|||
show_json(1, '退款成功'); |
|||
}else{ |
|||
show_json(0, '退款失败,请刷新重试'); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,365 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li class="active"><a href="#tab_basic">基础设置</a></li> |
|||
<li ><a href="#tab_share">分享设置</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-form"> |
|||
<form action="" method="post" class="form-horizontal form form-validate"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading">话费充值设置</div> |
|||
<div class="panel-body"> |
|||
<div class="tab-content"> |
|||
<div class="tab-pane active" id="tab_basic"> |
|||
<div class="alert alert-warning"> |
|||
<p>请在三方充值平台系统后台查找对应数据填入设置项目</p> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">充值平台</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[rechargePlatform]" onclick="divhs(1)" {if $settings['rechargePlatform']==1} checked {/if}>36鲸 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[rechargePlatform]" onclick="divhs(0)" {if $settings['rechargePlatform']==0 || empty($settings) } checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="sljdiv" {if $settings['rechargePlatform']!=1} style = "display: none;" {/if} > |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">36鲸账号</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[account]" autocomplete="off" class="form-control" value="{$settings['account']}"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">36鲸秘钥</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[secretkey]" autocomplete="off" class="form-control" value="{$settings['secretkey']}"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">36鲸接口域名</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[domainname]" autocomplete="off" class="form-control" value="{$settings['domainname']}"> |
|||
<span class="help-block">以http开头,'/'号结束。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">慢充渠道</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[slowre]" onclick="$('#slowre').show();$('#slowdis').show();" {if $settings['slowre']==1} checked {/if}>开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[slowre]" onclick="$('#slowre').hide();$('#slowdis').hide();" {if $settings['slowre']==0 || empty($settings) } checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="slowre" {if $settings['slowre']!=1} style = "display: none;" {/if}> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">慢充金额设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值50元:价格¥</span> |
|||
<input type="number" name="set[slowjing50price]" class="form-control" value="{$settings['slowjing50price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[slowjing50vip]" class="form-control" value="{$settings['slowjing50vip']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值100元:价格¥</span> |
|||
<input type="number" name="set[slowjing100price]" class="form-control" value="{$settings['slowjing100price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[slowjing100vip]" class="form-control" value="{$settings['slowjing100vip']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值200元:价格¥</span> |
|||
<input type="number" name="set[slowjing200price]" class="form-control" value="{$settings['slowjing200price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[slowjing200vip]" class="form-control" value="{$settings['slowjing200vip']}" /> |
|||
</div> |
|||
<span class="help-block">价格填0或不填则不开启此面值充值,会员价填0或者不填则没有会员价,价格均保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">慢充提示文本</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="width: 100%;"> |
|||
<input type="text" name="set[slowtext]" class="form-control" value="{$settings['slowtext']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">快充渠道</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[fastre]" onclick="$('#fastre').show();$('#fastdis').show();" {if $settings['fastre']==1} checked {/if}>开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[fastre]" onclick="$('#fastre').hide();$('#fastdis').hide();" {if $settings['fastre']==0 || empty($settings) } checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="fastre" {if $settings['fastre']!=1} style = "display: none;" {/if}> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">快充金额设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值50元:价格¥</span> |
|||
<input type="number" name="set[fastjing50price]" class="form-control" value="{$settings['fastjing50price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[fastjing50vip]" class="form-control" value="{$settings['fastjing50vip']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值100元:价格¥</span> |
|||
<input type="number" name="set[fastjing100price]" class="form-control" value="{$settings['fastjing100price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[fastjing100vip]" class="form-control" value="{$settings['fastjing100vip']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值200元:价格¥</span> |
|||
<input type="number" name="set[fastjing200price]" class="form-control" value="{$settings['fastjing200price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[fastjing200vip]" class="form-control" value="{$settings['fastjing200vip']}" /> |
|||
</div> |
|||
<span class="help-block">价格填0或不填则不开启此面值充值,会员价填0或者不填则没有会员价,价格均保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">快充提示文本</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="width: 100%;"> |
|||
<input type="text" name="set[fasttext]" class="form-control" value="{$settings['fasttext']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">特快充渠道</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[mostre]" onclick="$('#mostre').show();$('#mostdis').show();" {if $settings['mostre']==1} checked {/if}>开启 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[mostre]" onclick="$('#mostre').hide();$('#mostdis').hide();" {if $settings['mostre']==0 || empty($settings) } checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div id="mostre" {if $settings['mostre']!=1} style = "display: none;" {/if}> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">快充金额设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值50元:价格¥</span> |
|||
<input type="number" name="set[mostjing50price]" class="form-control" value="{$settings['mostjing50price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[mostjing50vip]" class="form-control" value="{$settings['mostjing50vip']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值100元:价格¥</span> |
|||
<input type="number" name="set[mostjing100price]" class="form-control" value="{$settings['mostjing100price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[mostjing100vip]" class="form-control" value="{$settings['mostjing100vip']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值200元:价格¥</span> |
|||
<input type="number" name="set[mostjing200price]" class="form-control" value="{$settings['mostjing200price']}" /> |
|||
<span class="input-group-addon">会员价¥</span> |
|||
<input type="number" name="set[mostjing200vip]" class="form-control" value="{$settings['mostjing200vip']}" /> |
|||
</div> |
|||
<span class="help-block">价格填0或不填则不开启此面值充值,会员价填0或者不填则没有会员价,价格均保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" > |
|||
<label class="col-sm-2 control-label">快充提示文本</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group" style="width: 100%;"> |
|||
<input type="text" name="set[mosttext]" class="form-control" value="{$settings['mosttext']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
{if uniacid_p('distribution')} |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分销设置</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[rechargedis]" onclick="disdiv(1)" {if $settings['rechargedis']==1} checked {/if}>参与 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[rechargedis]" onclick="disdiv(0)" {if $settings['rechargedis']==0 || empty($settings) } checked {/if}>关闭 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="form-group disdiv" {if $settings['rechargedis']!=1} style = "display: none;" {/if} > |
|||
<div id="slowdis" {if $settings['slowre']!=1} style = "display: none;" {/if} > |
|||
<label class="col-sm-2 control-label">慢充分销设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值50元:一级佣金:</span> |
|||
<input type="number" name="set[slowjing50one]" class="form-control" value="{$settings['slowjing50one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[slowjing50two]" class="form-control" value="{$settings['slowjing50two']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值100元:一级佣金:</span> |
|||
<input type="number" name="set[slowjing100one]" class="form-control" value="{$settings['slowjing100one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[slowjing100two]" class="form-control" value="{$settings['slowjing100two']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值200元:一级佣金:</span> |
|||
<input type="number" name="set[slowjing200one]" class="form-control" value="{$settings['slowjing200one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[slowjing200two]" class="form-control" value="{$settings['slowjing200two']}" /> |
|||
</div> |
|||
<span class="help-block">金额不填或填0会按照分销商等级佣金比例计算佣金,价格均保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="fastdis" {if $settings['fastre']!=1} style = "display: none;" {/if} > |
|||
<label class="col-sm-2 control-label">快充分销设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值50元:一级佣金:</span> |
|||
<input type="number" name="set[fastjing50one]" class="form-control" value="{$settings['fastjing50one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[fastjing50two]" class="form-control" value="{$settings['fastjing50two']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值100元:一级佣金:</span> |
|||
<input type="number" name="set[fastjing100one]" class="form-control" value="{$settings['fastjing100one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[fastjing100two]" class="form-control" value="{$settings['fastjing100two']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值200元:一级佣金:</span> |
|||
<input type="number" name="set[fastjing200one]" class="form-control" value="{$settings['fastjing200one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[fastjing200two]" class="form-control" value="{$settings['fastjing200two']}" /> |
|||
</div> |
|||
<span class="help-block">金额不填或填0会按照分销商等级佣金比例计算佣金,价格均保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
<div id="mostdis" {if $settings['mostre']!=1} style = "display: none;" {/if} > |
|||
<label class="col-sm-2 control-label">特快充分销设置</label> |
|||
<div class="col-sm-9"> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值50元:一级佣金:</span> |
|||
<input type="number" name="set[mostjing50one]" class="form-control" value="{$settings['mostjing50one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[mostjing50two]" class="form-control" value="{$settings['mostjing50two']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值100元:一级佣金:</span> |
|||
<input type="number" name="set[mostjing100one]" class="form-control" value="{$settings['mostjing100one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[mostjing100two]" class="form-control" value="{$settings['mostjing100two']}" /> |
|||
</div> |
|||
<div class="input-group"> |
|||
<span class="input-group-addon">面值200元:一级佣金:</span> |
|||
<input type="number" name="set[mostjing200one]" class="form-control" value="{$settings['mostjing200one']}" /> |
|||
<span class="input-group-addon">二级佣金:</span> |
|||
<input type="number" name="set[mostjing200two]" class="form-control" value="{$settings['mostjing200two']}" /> |
|||
</div> |
|||
<span class="help-block">金额不填或填0会按照分销商等级佣金比例计算佣金,价格均保留两位小数。</span> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
<div class="tab-pane" id="tab_share"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-body"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享二维码类型</label> |
|||
<div class="col-sm-9"> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="1" name="set[qrcodetype]" {if $settings['qrcodetype']==1} checked {/if}>关注二维码 |
|||
</label> |
|||
<label class="radio-inline"> |
|||
<input type="radio" value="0" name="set[qrcodetype]" {if $settings['qrcodetype']==0} checked {/if}>普通二维码 |
|||
</label> |
|||
</div> |
|||
</div> |
|||
<div class="alert alert-info"> |
|||
<b>适用模板变量:[昵称] [时间] [系统名称] </b> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">公众号分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('set[share_image]', $settings['share_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*500,如果不选择,默认为系统分享信息</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">小程序分享图片</label> |
|||
<div class="col-sm-9"> |
|||
{php echo attachment_select('set[share_wxapp_image]', $settings['share_wxapp_image']);} |
|||
<span class="help-block">大小2M以下,建议尺寸500*400,如果不选择,默认为系统分享信息</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享标题</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[share_title]" class="form-control" value="{$settings['share_title']}" /> |
|||
<span class="help-block">如果不填写,默认为系统分享信息</span> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">分享描述</label> |
|||
<div class="col-sm-9"> |
|||
<input type="text" name="set[share_desc]" class="form-control" value="{$settings['share_desc']}" /> |
|||
<span class="help-block">如果不填写,默认为系统分享信息</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" /> |
|||
<input type="hidden" name="token" value="{$_W['token']}" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<script> |
|||
function divhs(flag){ |
|||
if(flag == 1){ |
|||
$('.sljdiv').show(); |
|||
}else if(flag == 0){ |
|||
$('.sljdiv').hide(); |
|||
} |
|||
} |
|||
|
|||
function disdiv(flag){ |
|||
if(flag == 1){ |
|||
$('.disdiv').show(); |
|||
}else if(flag == 0){ |
|||
$('.disdiv').hide(); |
|||
} |
|||
} |
|||
|
|||
$(function() { |
|||
window.optionchanged = false; |
|||
$('#myTab a').click(function(e) { |
|||
e.preventDefault(); //阻止a链接的跳转行为 |
|||
$(this).tab('show'); //显示当前选中的链接及关联的content |
|||
}) |
|||
}); |
|||
|
|||
</script> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,151 @@ |
|||
{php include wl_template('common/header');} |
|||
<ul class="nav nav-tabs" id="myTab"> |
|||
<li><a href="javascript:;">支付记录</a></li> |
|||
</ul> |
|||
<div class="app-content"> |
|||
<div class="app-filter"> |
|||
<div class="filter-list"> |
|||
<form action="" method="get" class="form-horizontal" role="form" id="form1"> |
|||
<input type="hidden" name="c" value="site" /> |
|||
<input type="hidden" name="a" value="entry" /> |
|||
<input type="hidden" name="m" value="{MODULE_NAME}" /> |
|||
<input type="hidden" name="p" value="mobilerecharge" /> |
|||
<input type="hidden" name="ac" value="mrecharge" /> |
|||
<input type="hidden" name="do" value="orderList" /> |
|||
<input type="hidden" name="status" value="{$_GPC['status']}" /> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label">订单状态</label> |
|||
<div class="col-sm-9"> |
|||
<div class="btn-group"> |
|||
<a href="{php echo wl_filter_url('status:0');}" class="btn {if intval($_GPC['status']) == 0}btn-primary{else}btn-default{/if}">全部</a> |
|||
<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">充值中</a> |
|||
<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">已到账</a> |
|||
<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == 3}btn-primary{else}btn-default{/if}">已退款</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">用户</label> |
|||
<div class="col-sm-9"> |
|||
<select name="keywordtype" class="form-control"> |
|||
<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>昵称</option> |
|||
<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>手机号</option> |
|||
</select> |
|||
<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入关键字"/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group form-inline"> |
|||
<label class="col-sm-2 control-label">时间</label> |
|||
<div class="col-sm-9"> |
|||
<select name="timetype" class="form-control"> |
|||
<option value="1" {if $_GPC['timetype']==0}selected="selected"{/if}>关闭</option> |
|||
<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>支付时间</option> |
|||
<option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>完成时间</option> |
|||
</select> |
|||
{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));} |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-2 control-label"></label> |
|||
<div class="col-sm-9"> |
|||
<button class="btn btn-primary" id="search">筛选</button> |
|||
<button class="btn btn-default min-width" name="export" type="submit" value="export"><i class="fa fa-download"></i>导出</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="app-table-list"> |
|||
<div class="table-responsive"> |
|||
<table class="table table-hover"> |
|||
<thead class="navbar-inner"> |
|||
<tr> |
|||
<th style="width:15%;">订单编号</th> |
|||
<th style="width:10%;">用户信息</th> |
|||
<th style="width:10%;">充值手机号</th> |
|||
<th style="width:8%;">充值面额</th> |
|||
<th style="width:7%;">充值渠道</th> |
|||
<th style="width:10%;">订单金额</th> |
|||
<th style="width:5%;">订单状态</th> |
|||
<th style="width:10%;">支付时间</th> |
|||
<th style="width:10%;">支付方式</th> |
|||
<th style="width:10%;">完成(到账/退款)时间</th> |
|||
<th style="width:5%;">操作</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{loop $list $de} |
|||
<tr> |
|||
<td>{$de['orderno']}</td> |
|||
<td><img src="{$de['avatar']}" style="width: 30px;height: 30px;"> {$de['nickname']}</td> |
|||
<td>{$de['mobile']}</td> |
|||
<td >{$de['money']}元</td> |
|||
<td > |
|||
{if $de['channel'] == 1} |
|||
<span class="label label-success">36鲸</span><br/><br/> |
|||
{if $de['type'] == 1}<span class="label label-success">慢充</span>{/if} |
|||
{if $de['type'] == 2}<span class="label label-warning">快充</span>{/if} |
|||
{if $de['type'] == 3}<span class="label label-danger">特快充</span>{/if} |
|||
{/if} |
|||
</td> |
|||
<td style="color:red;">¥{$de['price']}</td> |
|||
<td> |
|||
{if $de['status'] == 0} |
|||
<span class="label label-default">未支付</span> |
|||
{else if $de['status'] == 1} |
|||
<span class="label label-warning">充值中</span> |
|||
{else if $de['status'] == 2} |
|||
<span class="label label-success">已到账</span> |
|||
{else if $de['status'] == 3} |
|||
<span class="label label-danger">已退款</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if !empty($de['paytime'])}{$de['paytime']}{else} - 无 - {/if} |
|||
</td> |
|||
<td> |
|||
{if $de['paytype'] == 2} |
|||
<span class="label label-success">微信支付</span> |
|||
{else if $de['paytype'] == 3} |
|||
<span class="label label-info">支付宝</span> |
|||
{else if $de['paytype'] == 1} |
|||
<span class="label label-warning">余额支付</span> |
|||
{else if $de['paytype'] == 5} |
|||
<span class="label label-default">小程序</span> |
|||
{else if $de['paytype'] == 6} |
|||
<span class="label label-danger">0元购</span> |
|||
{else if $de['paytype'] == 0} |
|||
<span class="label label-default">未支付</span> |
|||
{else} |
|||
<span class="label label-danger">其他方式</span> |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if !empty($de['finishtime'])}{$de['finishtime']}{else} - 未完成 - {/if} |
|||
{if $de['status'] == 3} |
|||
<br/>{$de['reason']} |
|||
{/if} |
|||
</td> |
|||
<td> |
|||
{if $de['status'] != 3} |
|||
<p style="color: #428bca;display: inline-block;"><a href="{php echo web_url('mobilerecharge/mrecharge/refundOrder',array('id'=>$de['id']))}" data-toggle="ajaxRemove" data-confirm="确定退款此充值订单?">退款</a></p> |
|||
{else} |
|||
- 无 - |
|||
{/if} |
|||
</td> |
|||
</tr> |
|||
{/loop} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="app-table-foot clearfix"> |
|||
<div class="pull-left"> |
|||
|
|||
</div> |
|||
<div class="pull-right"> |
|||
{$pager} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{php include wl_template('common/footer');} |
|||
@ -0,0 +1,265 @@ |
|||
<?php |
|||
defined('IN_IA') or exit('Access Denied'); |
|||
|
|||
class MobilerechargeModuleUniapp extends Uniapp { |
|||
|
|||
/** |
|||
* Comment: 充值页面初始化 |
|||
* Author: wlf |
|||
* Date: 2021/11/02 11:39 |
|||
*/ |
|||
|
|||
public function rechargePageInfo(){ |
|||
global $_GPC, $_W; |
|||
$set = Setting::wlsetting_read('mobilerecharge'); |
|||
if(empty($set['rechargePlatform'])){ |
|||
$this->renderError("功能已关闭",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
//支付项目 |
|||
if($set['rechargePlatform'] == 1){ |
|||
$pricediv = []; |
|||
if($set['slowjing50price'] > 0){ |
|||
$pricediv[1][] = [ |
|||
'money' => 50, |
|||
'prcie' => $set['slowjing50price'], |
|||
'vipprice' => $set['slowjing50vip'] |
|||
]; |
|||
} |
|||
if($set['slowjing100price'] > 0) { |
|||
$pricediv[1][] = [ |
|||
'money' => 100, |
|||
'prcie' => $set['slowjing100price'], |
|||
'vipprice' => $set['slowjing100vip'] |
|||
]; |
|||
} |
|||
if($set['slowjing200price'] > 0) { |
|||
$pricediv[1][] = [ |
|||
'money' => 200, |
|||
'prcie' => $set['slowjing200price'], |
|||
'vipprice' => $set['slowjing200vip'] |
|||
]; |
|||
} |
|||
|
|||
if($set['fastjing50price'] > 0) { |
|||
$pricediv[2][] = [ |
|||
'money' => 50, |
|||
'prcie' => $set['fastjing50price'], |
|||
'vipprice' => $set['fastjing50vip'] |
|||
]; |
|||
} |
|||
if($set['fastjing100price'] > 0) { |
|||
$pricediv[2][] = [ |
|||
'money' => 100, |
|||
'prcie' => $set['fastjing100price'], |
|||
'vipprice' => $set['fastjing100vip'] |
|||
]; |
|||
} |
|||
if($set['fastjing200price'] > 0) { |
|||
$pricediv[2][] = [ |
|||
'money' => 200, |
|||
'prcie' => $set['fastjing200price'], |
|||
'vipprice' => $set['fastjing200vip'] |
|||
]; |
|||
} |
|||
if($set['mostjing50price'] > 0) { |
|||
$pricediv[3][] = [ |
|||
'money' => 50, |
|||
'prcie' => $set['mostjing50price'], |
|||
'vipprice' => $set['mostjing50vip'] |
|||
]; |
|||
} |
|||
if($set['mostjing100price'] > 0) { |
|||
$pricediv[3][] = [ |
|||
'money' => 100, |
|||
'prcie' => $set['mostjing100price'], |
|||
'vipprice' => $set['mostjing100vip'] |
|||
]; |
|||
} |
|||
if($set['mostjing200price'] > 0) { |
|||
$pricediv[3][] = [ |
|||
'money' => 200, |
|||
'prcie' => $set['mostjing200price'], |
|||
'vipprice' => $set['mostjing200vip'] |
|||
]; |
|||
} |
|||
$data['pricediv'] = $pricediv; |
|||
$data['slowre'] = $set['slowre'] ? : 0 ; |
|||
$data['slowtext'] = $set['slowtext']; |
|||
$data['fastre'] = $set['fastre'] ? : 0 ; |
|||
$data['fasttext'] = $set['fasttext']; |
|||
$data['mostre'] = $set['mostre'] ? : 0 ; |
|||
$data['mosttext'] = $set['mosttext']; |
|||
|
|||
} |
|||
//会员状态 |
|||
$data['vipflag'] = WeliamWeChat::VipVerification($_W['mid'] , true); |
|||
//幻灯片 |
|||
$advs = pdo_getall('wlmerchant_adv',array('uniacid' => $_W['uniacid'],'aid' => $_W['aid'],'type'=> 19 ,'enabled'=>1),array('thumb','link'),'','displayorder DESC'); |
|||
if(empty($advs) && $_W['aid'] > 0 ){ |
|||
$advs = pdo_getall('wlmerchant_adv',array('uniacid' => $_W['uniacid'],'aid' => 0,'type'=> 19 ,'enabled'=>1),array('thumb','link'),'','displayorder DESC'); |
|||
} |
|||
if(!empty($advs)){ |
|||
foreach ($advs as &$ad) { |
|||
$ad['thumb'] = tomedia($ad['thumb']); |
|||
} |
|||
} |
|||
$data['advs'] = $advs; |
|||
//二维码 |
|||
$source = $_W['source']; |
|||
if($set['qrcodetype'] > 0 ){ |
|||
//公众号关注路径 |
|||
$qrcode = Mobilerecharge::getgzqrcode($_W['mid']); |
|||
$path = $qrcode['url']; |
|||
}else{ |
|||
$path = 'pages/subPages2/voucherCenter/voucherCenter?head_id='.$_W['mid'];//基本路径,也是小程序路径 |
|||
if ($source != 3) $path = h5_url($path);//非小程序渠道 基本路径转超链接 |
|||
} |
|||
$filename = md5('mid' . $_W['mid'] . 'source' . $source);//保证图片唯一性,每种渠道,类型海报二维码都不一致 |
|||
if ($source == 3 && $set['qrcodetype'] != 1) { |
|||
//小程序 |
|||
$qrCodeLink = WeApp::getQrCode($path , 'qrcode_' . $filename . '.png'); |
|||
if (is_array($qrCodeLink)) $qrCodeLink = self::qrcodeimg($path , $filename); |
|||
} else { |
|||
//公众号/H5 |
|||
$qrCodeLink = Poster::qrcodeimg($path , $filename); |
|||
} |
|||
$data['qrimg'] = tomedia($qrCodeLink); |
|||
|
|||
$this->renderSuccess('话费充值页面初始化',$data); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 订单提交接口 |
|||
* Author: wlf |
|||
* Date: 2021/11/02 13:39 |
|||
*/ |
|||
public function createMrechargeOrder(){ |
|||
global $_GPC, $_W; |
|||
$mobile = $_GPC['mobile']; //充值电话 |
|||
$type = $_GPC['type']; //充值方式 |
|||
$money = $_GPC['money']; //充值面额 |
|||
if(empty($mobile)){ |
|||
$this->renderError("请输入充值手机号"); |
|||
} |
|||
if(empty($type) || empty($money)){ |
|||
$this->renderError("参数错误,请刷新重试"); |
|||
} |
|||
$set = Setting::wlsetting_read('mobilerecharge'); |
|||
if(empty($set['rechargePlatform'])){ |
|||
$this->renderError("功能已关闭",['url'=>h5_url('pages/mainPages/index/index')]); |
|||
} |
|||
//计算充值金额 |
|||
if($set['rechargePlatform'] == 1){ |
|||
//判断渠道 |
|||
$checkch = Mobilerecharge::sljOrderStatus($mobile,$type,$money); |
|||
if($checkch['error'] > 0){ |
|||
$this->renderError($checkch['msg']); |
|||
} |
|||
if($type == 1){ |
|||
$jing50price = $set['slowjing50price']; |
|||
$jing50vip = $set['slowjing50vip']; |
|||
$jing100price = $set['slowjing100price']; |
|||
$jing100vip = $set['slowjing100vip']; |
|||
$jing200price = $set['slowjing200price']; |
|||
$jing200vip = $set['slowjing200vip']; |
|||
}else if($type == 2){ |
|||
$jing50price = $set['fastjing50price']; |
|||
$jing50vip = $set['fastjing50vip']; |
|||
$jing100price = $set['fastjing100price']; |
|||
$jing100vip = $set['fastjing100vip']; |
|||
$jing200price = $set['fastjing200price']; |
|||
$jing200vip = $set['fastjing200vip']; |
|||
}else if($type == 3){ |
|||
$jing50price = $set['mostjing50price']; |
|||
$jing50vip = $set['mostjing50vip']; |
|||
$jing100price = $set['mostjing100price']; |
|||
$jing100vip = $set['mostjing100vip']; |
|||
$jing200price = $set['mostjing200price']; |
|||
$jing200vip = $set['mostjing200vip']; |
|||
} |
|||
if($money == 50){ |
|||
$price = $jing50price; |
|||
$vipprice = $jing50vip; |
|||
}else if($money == 100){ |
|||
$price = $jing100price; |
|||
$vipprice = $jing100vip; |
|||
}else if($money == 200){ |
|||
$price = $jing200price; |
|||
$vipprice = $jing200vip; |
|||
} |
|||
if($vipprice > 0){ |
|||
$halfflag = WeliamWeChat::VipVerification($_W['mid'] , true); |
|||
if($halfflag > 0){ |
|||
$price = $vipprice; |
|||
} |
|||
} |
|||
} |
|||
//校验金额 |
|||
if($price < 0.01){ |
|||
$this->renderError("充值金额错误,请刷新重试"); |
|||
} |
|||
$orderdata = [ |
|||
'uniacid' => $_W['uniacid'], |
|||
'aid' => $_W['aid'], |
|||
'orderno' => createUniontid(), |
|||
'money' => $money, |
|||
'channel' => $set['rechargePlatform'], |
|||
'type' => $type, |
|||
'price' => $price, |
|||
'status' => 0, |
|||
'createtime' => time(), |
|||
'mid' => $_W['mid'], |
|||
'mobile' => $mobile |
|||
]; |
|||
pdo_insert(PDO_NAME.'mrecharge_order',$orderdata); |
|||
$orderid = pdo_insertid(); |
|||
if (empty($orderid)) { |
|||
$this->renderError('创建订单失败,请刷新重试'); |
|||
} |
|||
$this->renderSuccess('订单信息',['orderid' => $orderid]); |
|||
} |
|||
|
|||
/** |
|||
* Comment: 用户订单列表 |
|||
* Author: wlf |
|||
* Date: 2021/11/02 13:39 |
|||
*/ |
|||
public function mrechargeOrderList(){ |
|||
global $_GPC, $_W; |
|||
$page = $_GPC['page'] ? $_GPC['page'] : 1; |
|||
$page_start = $page * 10 - 10; |
|||
$status = $_GPC['status']; |
|||
$whewe = " WHERE uniacid = {$_W['uniacid']} AND mid = {$_W['mid']}"; |
|||
if(empty($status)){ |
|||
$whewe .= " AND status > 0 "; |
|||
}else{ |
|||
$whewe .= " AND status = {$status} "; |
|||
} |
|||
$records = pdo_fetchall("SELECT orderno,type,price,money,reason,mobile,status FROM " . tablename("wlmerchant_mrecharge_order") . $whewe ." ORDER BY createtime DESC LIMIT {$page_start},10"); |
|||
$allnum = pdo_fetchcolumn('SELECT count(id) FROM ' . tablename('wlmerchant_mrecharge_order') .$whewe); |
|||
|
|||
if (!empty($records)) { |
|||
foreach ($records as &$red){ |
|||
$isChinaMobile = "/^134[0-8]\d{7}$|^(?:13[5-9]|147|15[0-27-9]|178|18[2-478])\d{8}$/"; //移动方面最新答复 |
|||
$isChinaUnion = "/^(?:13[0-2]|145|15[56]|176|18[56])\d{8}$/"; //向联通微博确认并未回复 |
|||
$isChinaTelcom = "/^(?:133|153|177|173|18[019])\d{8}$/"; //1349号段 电信方面没给出答复,视作不存在 |
|||
if(preg_match($isChinaMobile, $red['mobile'])){ |
|||
$red['operator'] = '1'; |
|||
}else if(preg_match($isChinaUnion, $red['mobile'])){ |
|||
$red['operator'] = '2'; |
|||
}else if(preg_match($isChinaTelcom, $red['mobile'])){ |
|||
$red['operator'] = '3'; |
|||
}else{ |
|||
$red['operator'] = '4'; |
|||
} |
|||
} |
|||
$records = array_values($records); |
|||
} |
|||
$data['list'] = $records; |
|||
$data['pagetotal'] = ceil($allnum / 10); |
|||
|
|||
$this->renderSuccess('充值记录' , $data); |
|||
} |
|||
|
|||
|
|||
} |
|||
Loading…
Reference in new issue