重新提交冲突文件
This commit is contained in:
parent
a67c1beafa
commit
8cd4ef91f6
5
\
Normal file
5
\
Normal file
@ -0,0 +1,5 @@
|
||||
合并分支:更新
|
||||
# 请输入一个提交信息以解释此合并的必要性,尤其是将一个更新后的上游分支
|
||||
# 合并到主题分支。
|
||||
#
|
||||
# 以 '#' 开头的行将被忽略,而且空提交说明将会终止提交。
|
@ -129,10 +129,8 @@ class Merchant extends BaseController
|
||||
|
||||
$total = StoreOrderModel::where($where)->count();
|
||||
|
||||
$list = StoreOrderModel::with(['merchant'])->order('order_id desc')->page($params['page'])->limit($params['limit'])->select();
|
||||
foreach ($list as $k =>$v){
|
||||
$list[$k]['uid'] = Db::connect('shop')->table('eb_user')->where('uid',$v['uid'])->value('nickname');
|
||||
}
|
||||
$list = StoreOrderModel::with(['merchant'])->order('order_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
|
@ -280,6 +280,7 @@
|
||||
// 日期范围
|
||||
layui.use(['laydate','table','element', 'jquery'], function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#range_date'
|
||||
|
@ -35,7 +35,6 @@
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
console.log(data);
|
||||
if (data.field == '') {
|
||||
layer.msg('请先完善商品详情');
|
||||
return false;
|
||||
|
@ -15,29 +15,29 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">选择时间</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-btn-group" id="witch_date">
|
||||
<button name="both" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button name="today" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
||||
<button name="yeserday" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
||||
<div class="layui-btn-group">
|
||||
<input id="chonse_start_date" type="hidden" name="start_date" value="" readonly placeholder="选择时间">
|
||||
<input id="chonse_end_date" type="hidden" name="end_date" value="" readonly placeholder="选择时间">
|
||||
<button id="both" name="both" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button name="today" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
||||
<button name="yeserday" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
||||
<button name="week" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
||||
<button name="30day" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
||||
<button name="month" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
||||
<button name="year" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<!-- <label class="layui-form-label">日期范围</label> -->
|
||||
<div class="layui-inline" id="test6">
|
||||
<div class="layui-inline" id="range_date">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="start_date" id="test-startDate-1" class="layui-input"
|
||||
placeholder="开始日期">
|
||||
<input type="text" autocomplete="off" name="start_date" id="start-date" class="layui-input" placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="end_date" id="test-endDate-1" class="layui-input"
|
||||
placeholder="结束日期">
|
||||
<input type="text" autocomplete="off" name="end_date" id="end-date" class="layui-input" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,14 +46,14 @@
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline" style="width:46%">
|
||||
<div class="layui-input-inline" style="width:45%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width:80%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
||||
<div class="layui-input-block" style="display:flex">
|
||||
<input style="width:70%;float:left" type="text" name="keyword" placeholder="请输入关键字"
|
||||
class="layui-input" autocomplete="off" />
|
||||
<button class="layui-btn layui-btn-normal" style="width:20%" lay-submit=""
|
||||
lay-filter="searchform" type="button">提交搜索</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit=""
|
||||
lay-filter="searchform">提交搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -62,10 +62,10 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户类别</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="dddd" lay-filter="searchform">
|
||||
<select name="is_trader" lay-filter="searchform">
|
||||
<option value=""></option>
|
||||
<option value="10">自营</option>
|
||||
<option value="11">非自营</option>
|
||||
<option value="1">自营</option>
|
||||
<option value="0">非自营</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -75,33 +75,29 @@
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline" style="width:46%;">
|
||||
<div class="layui-input-inline" style="width:45%;float:none;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户分类</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="category" lay-filter="searchform">
|
||||
<select name="category_id" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
{volist name="category" key="k" id="vo"}
|
||||
<option value="{$vo.merchant_category_id}">{$vo.category_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline" style="width:35%;">
|
||||
<div class="layui-input-inline" style="width:45%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">店铺类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="type" lay-filter="type">
|
||||
<select name="type_id" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
{volist name="type" key="k" id="vo"}
|
||||
<option value="{$vo.mer_type_id}">{$vo.type_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -116,13 +112,10 @@
|
||||
|
||||
<label class="layui-form-label">保证金状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select class="test_state" name="status" lay-filter="status">
|
||||
<select class="is_margin" name="is_margin" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
<option value="10">已付</option>
|
||||
<option value="0">未付</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -134,19 +127,18 @@
|
||||
<!-- change tab -->
|
||||
<div class="layui-form-item" id="refund_margin" style="display:none;">
|
||||
|
||||
<div class="layui-input-inline" style="width:46%;">
|
||||
<div class="layui-input-inline" style="width:45%;">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<label class="layui-form-label">审核</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">已审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核失败</button>
|
||||
<input type="hidden" id="status" name="status" value="" readonly placeholder="核审状态值">
|
||||
<button name="both" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button name="wait" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
||||
<button name="success" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核通过</button>
|
||||
<button name="failed" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核未通过</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -155,13 +147,10 @@
|
||||
|
||||
<label class="layui-form-label">退回状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="refund" lay-filter="refund">
|
||||
<select name="refund" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
<option value="0">未退回</option>
|
||||
<option value="1">已退回</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -178,14 +167,14 @@
|
||||
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li lay-id="11" class="layui-this site-demo-active" data-type="tabChange">缴存保证金</li>
|
||||
<li lay-id="22" class="site-demo-active" data-type="tabChange">退回保证金</li>
|
||||
<li lay-id="11" class="layui-this tag-switch" data-type="tabChange">缴存保证金</li>
|
||||
<li lay-id="22" class="tag-switch" data-type="tabChange">退回保证金</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
|
||||
<!-- 缴存列表 -->
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table class="layui-hide" id="reduct_list" lay-filter="reduct_list">
|
||||
<table class="layui-hide" id="pay_list" lay-filter="pay_list">
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -232,8 +221,8 @@
|
||||
function gouguInit() {
|
||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: '#reduct_list',
|
||||
layui.payTable = table.render({
|
||||
elem: '#pay_list',
|
||||
title: '保证金列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/margin/lst',
|
||||
@ -260,7 +249,7 @@
|
||||
title: '店铺类型',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchant.type_id}}</div>'
|
||||
templet: '<div>{{d.merchant.merchantType.type_name}}</div>'
|
||||
}, {
|
||||
field: 'real_name',
|
||||
title: '商户姓名',
|
||||
@ -277,7 +266,22 @@
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 150
|
||||
width: 150,
|
||||
templet: function(d){
|
||||
switch (d.merchant.is_margin) {
|
||||
case 0:
|
||||
return '<div>无</div>'
|
||||
case 1:
|
||||
return '<div>有未支付</div>'
|
||||
case 10:
|
||||
return '<div>已支付</div>'
|
||||
case -1:
|
||||
return '<div>申请退款</div>'
|
||||
case -10:
|
||||
return '<div>拒绝退款</div>'
|
||||
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'pay_time',
|
||||
title: '支付时间',
|
||||
@ -298,7 +302,7 @@
|
||||
});
|
||||
|
||||
|
||||
layui.pageTable = table.render({
|
||||
layui.refundTable = table.render({
|
||||
elem: '#refund_list',
|
||||
title: '退回保证金列表',
|
||||
toolbar: '#refundToolbar',
|
||||
@ -374,32 +378,10 @@
|
||||
return data;
|
||||
}
|
||||
|
||||
var $ = layui.$, active = {
|
||||
reload: function(){
|
||||
let dataRload = getformdata();;
|
||||
|
||||
//执行重载
|
||||
table.reload('testReload', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//监听表头工具栏事件
|
||||
// table.on('toolbar(store_product)', function (obj) {
|
||||
// if (obj.event === 'add') {
|
||||
// tool.side("/admin/merchant/type/form");
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(reduct_list)', function (obj) {
|
||||
table.on('tool(pay_list)', function (obj) {
|
||||
var data = obj.data;
|
||||
// console.log(data);
|
||||
if (obj.event === 'reduct') {
|
||||
@ -425,69 +407,8 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
console.log(data.elem.name, data.field)
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
date:data.elem.name,
|
||||
...data.field
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
// layui.form.render();
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('select(searchform)', function(e) {
|
||||
let data = getformdata();
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听
|
||||
$('.test_state .layui-btn').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
// 日期范围
|
||||
layui.use(['laydate','element', 'jquery'],
|
||||
function () {
|
||||
var laydate = layui.laydate;
|
||||
var $ = layui.jquery,element = layui.element;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#test6'
|
||||
//设置开始日期、日期日期的 input 选择器
|
||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||
, range: ['#test-startDate-1', '#test-endDate-1']
|
||||
,done: function(value, date, endDate){
|
||||
let data = getformdata()
|
||||
data.date = ''
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//触发事件
|
||||
var active = {
|
||||
var $ = layui.$, active = {
|
||||
tabChange: function(){
|
||||
//切换到指定Tab项
|
||||
// element.tabChange('demo', this.getAttribute('lay-id')); //切换tab
|
||||
@ -496,26 +417,223 @@
|
||||
if ('11'==this.getAttribute('lay-id')) {
|
||||
marign.style.display = "block";
|
||||
refund.style.display = "none";
|
||||
// refund.childNodes().value='';
|
||||
}else{
|
||||
refund.style.display = "block";
|
||||
marign.style.display = "none";
|
||||
}
|
||||
},
|
||||
reload: function(){
|
||||
let dataRload = getformdata();
|
||||
|
||||
//执行重载
|
||||
table.reload('pay_list', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
},
|
||||
refund_reload: ()=>{
|
||||
let dataRload = getformdata();
|
||||
|
||||
//执行重载
|
||||
table.reload('refund_list', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$('.site-demo-active').on('click', function(){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
active[type] ? active[type].call(this, othis) : '';
|
||||
|
||||
layui.use(['laydate','element','table', 'jquery'],
|
||||
function () {
|
||||
var laydate = layui.laydate;
|
||||
var $ = layui.jquery,element = layui.element;
|
||||
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#range_date'
|
||||
//设置开始日期、日期日期的 input 选择器
|
||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||
, range: ['#start-date', '#end-date']
|
||||
,done: function(value, date, endDate){
|
||||
switchDateForm(true);
|
||||
|
||||
$('#both').removeClass('layui-btn-primary')
|
||||
$('#both').siblings().addClass('layui-btn-primary')
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
}
|
||||
});
|
||||
|
||||
//Hash地址的定位
|
||||
// var layid = location.hash.replace(/^#test=/, '');
|
||||
// element.tabChange('test', layid);
|
||||
|
||||
|
||||
// 列表切换
|
||||
$('.tag-switch').on('click', function(){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
active[type] ? active[type].call(this, othis) : '';
|
||||
if ('11'==this.getAttribute('lay-id')) {
|
||||
active['reload'] ? active['reload'].call(this, othis) : '';
|
||||
}else{
|
||||
active['refund_reload'] ? active['refund_reload'].call(this, othis) : '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//监听button提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.payTable.reload({
|
||||
where: {
|
||||
...data.field
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
form.on('select(searchform)', function(e) {
|
||||
let data = getformdata();
|
||||
layui.payTable.reload({
|
||||
where: {
|
||||
...data
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//选择时间
|
||||
form.on('submit(chonse_date)', function(data){
|
||||
let start_date = '';
|
||||
let end_date = getDaysAgo();
|
||||
|
||||
let name = data.elem.name;
|
||||
if (name =='today') {
|
||||
start_date=end_date;
|
||||
end_date = getDaysAgo(-1);
|
||||
}else if(name == 'yeserday'){
|
||||
start_date = getDaysAgo(1);
|
||||
}else if(name == 'week'){
|
||||
start_date = getDaysAgo(7);
|
||||
}else if(name == '30day'){
|
||||
start_date = getDaysAgo(30);
|
||||
}else if(name == 'month'){
|
||||
let days = (new Date).getDate()-1
|
||||
start_date = getDaysAgo(days);
|
||||
}else if(name == 'year'){
|
||||
var year = (new Date()).getFullYear();//获取当前年份
|
||||
start_date = year+'-01-01'
|
||||
}else{
|
||||
end_date = '';
|
||||
}
|
||||
|
||||
switchClass(this)
|
||||
|
||||
switchDateForm(false);
|
||||
$('#chonse_start_date').val(start_date);
|
||||
$('#chonse_end_date').val(end_date);
|
||||
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
|
||||
return false;
|
||||
})
|
||||
|
||||
|
||||
// 商户审核
|
||||
form.on('submit(statusform)', function(data) {
|
||||
let name = data.elem.name
|
||||
let status = 0;
|
||||
|
||||
if (name=='wait') {
|
||||
status = 0;
|
||||
}else if(name=='success'){
|
||||
status = 1;
|
||||
}else if(name=='failed'){
|
||||
status = 2;
|
||||
}
|
||||
if (name=='both'){
|
||||
$('#status').attr('disabled', true);
|
||||
}else{
|
||||
$('#status').attr('disabled', false);
|
||||
}
|
||||
switchClass(this)
|
||||
$('#status').val(status);
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听select提交
|
||||
form.on('select(seleform)', function(data) {
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// 切换button选中样式
|
||||
function switchClass(e)
|
||||
{
|
||||
$(e).removeClass('layui-btn-primary')
|
||||
$(e).siblings().addClass('layui-btn-primary')
|
||||
}
|
||||
|
||||
// 两个时间表单是互斥的,只能提交一个
|
||||
function switchDateForm(chonse=false)
|
||||
{
|
||||
let range = chonse?false:true;
|
||||
$('#start-date').attr("disabled",range);
|
||||
$('#end-date').attr("disabled",range);
|
||||
|
||||
$('#chonse_start_date').attr("disabled",chonse);
|
||||
$('#chonse_end_date').attr("disabled",chonse);
|
||||
if (chonse) {
|
||||
$('#chonse_start_date').val("");
|
||||
$('#chonse_end_date').val("");
|
||||
}else{
|
||||
$('#start-date').val("");
|
||||
$('#end-date').val("");
|
||||
}
|
||||
}
|
||||
|
||||
//获取n天以前日期
|
||||
function getDaysAgo(n=0) {
|
||||
let myDate = new Date();
|
||||
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * n); //最后一个数字30可改,n天前的意思
|
||||
let lastY = lw.getFullYear();
|
||||
let lastM = lw.getMonth() + 1;
|
||||
let lastD = lw.getDate();
|
||||
lastM = lastM < 10 ? "0" + lastM : lastM;
|
||||
lastD = lastD < 10 ? "0" + lastD : lastD;
|
||||
let startData = lastY+"-"+lastM+"-" +lastD; //n天之前日期
|
||||
|
||||
return startData;
|
||||
}
|
||||
|
||||
// 获取表单所有参数
|
||||
function getformdata() {
|
||||
var form = $('#filterform').serializeArray();
|
||||
var data = new Array();
|
||||
for(let i=0;i<form.length; i++){
|
||||
data[form[i].name] = form[i].value;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -37,15 +37,15 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_margin" value="1" title="有" checked="{$detail.is_margin}">
|
||||
<input type="radio" name="is_margin" value="0" title="无" checked="{$detail.is_margin}">
|
||||
<input lay-filter="is_margin"type="radio" name="is_margin" value="1" title="有" {if $detail.is_margin == 1}checked{/if}>
|
||||
<input lay-filter="is_margin" type="radio" name="is_margin" value="0" title="无" {if $detail.is_margin == 0}checked{/if}>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="{$detail.margin}">
|
||||
<input id="margin" type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="{$detail.margin}">
|
||||
</td>
|
||||
<td colspan="5">单位:元</td>
|
||||
</tr>
|
||||
@ -116,14 +116,34 @@
|
||||
// }
|
||||
});
|
||||
|
||||
let tval = '';
|
||||
form.on('radio(is_margin)', (data)=>{
|
||||
if (data.value>0) {
|
||||
$('#margin').val(tval);
|
||||
$('#margin').attr({'disabled':false});
|
||||
}else{
|
||||
tval = $('#margin').val();
|
||||
$('#margin').val('');
|
||||
$('#margin').attr('disabled',true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field == '') {
|
||||
layer.msg('请先完善店铺类型');
|
||||
return false;
|
||||
}
|
||||
if (data.field.is_margin) {
|
||||
if (data.field.margin <1) {
|
||||
layer.msg('请输入店铺压金');
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
data.field.margin = ''
|
||||
}
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
|
@ -132,6 +132,7 @@
|
||||
height: 500
|
||||
});
|
||||
|
||||
|
||||
if (area_id != 0) {
|
||||
street(area_id)
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
<!--</script>-->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group"><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
@ -21,13 +21,13 @@
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<!--<script type="text/html" id="toolbarDemo">-->
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}-->
|
||||
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>-->
|
||||
<!-- {/if}-->
|
||||
<!-- </div>-->
|
||||
<!--</script>-->
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
|
@ -21,13 +21,13 @@
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<!--<script type="text/html" id="toolbarDemo">-->
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}-->
|
||||
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>-->
|
||||
<!-- {/if}-->
|
||||
<!-- </div>-->
|
||||
<!--</script>-->
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
|
@ -80,58 +80,24 @@ abstract class BaseController
|
||||
protected function initialize()
|
||||
{
|
||||
|
||||
|
||||
//每页显示数据量
|
||||
$this->pageSize = Request::param('page_size', \think\facade\Config::get('app.page_size'));
|
||||
|
||||
$token = Request::header('x-Token');
|
||||
if ($token) {
|
||||
if (strpos($token, 'Bearer') === 0){
|
||||
$token = trim(substr($token, 6));
|
||||
}
|
||||
if (count(explode('.', $token)) != 3) {
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}
|
||||
$config = get_system_config('token');
|
||||
try {
|
||||
JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
||||
$decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
|
||||
$user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
|
||||
if ($user && $user['n_user_id']!=0){
|
||||
$this->request->uid=$user['n_user_id'];
|
||||
}else{
|
||||
$this->request->uid=$this->addUser($decoded->jti[0],$user);
|
||||
}
|
||||
//return (array)$decoded;
|
||||
// $decoded_array = json_decode(json_encode($decoded),TRUE);
|
||||
// $jwt_data = $decoded_array['data'];
|
||||
// 暂时去除 -----------------------------------------------------
|
||||
// $token = Request::header('x-Token');
|
||||
// if ($token) {
|
||||
// if (strpos($token, 'Bearer') === 0){
|
||||
// $token = trim(substr($token, 6));
|
||||
// }
|
||||
// if (count(explode('.', $token)) != 3) {
|
||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||
// }
|
||||
// $config = get_system_config('token');
|
||||
|
||||
if (!$user){
|
||||
return json(['code'=>403,'msg'=>'签名错误']);
|
||||
return false;
|
||||
}
|
||||
$user = Db::table('fa_user')->where('id',$user['n_user_id'])->find();
|
||||
//$request->uid = $jwt_data['userid'];
|
||||
// define('JWT_UID', $user['id']);
|
||||
// $response = $next($request);
|
||||
// return $response;
|
||||
//return $next($request);
|
||||
} catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
|
||||
return json(['code'=>403,'msg'=>'签名错误']);
|
||||
}catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
|
||||
return json(['code'=>401,'msg'=>'token失效']);
|
||||
}catch(\Firebase\JWT\ExpiredException $e) { // token过期
|
||||
return json(['code'=>401,'msg'=>'token已过期']);
|
||||
}catch(Exception $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}catch(\UnexpectedValueException $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
} catch(\DomainException $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}
|
||||
}else{
|
||||
// define('JWT_UID', '');
|
||||
return json(['code'=>404,'msg'=>'token不能为空']);
|
||||
}
|
||||
// return json($token);
|
||||
// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
||||
// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
|
||||
|
||||
// return $decoded->jti[0];
|
||||
// exit;
|
||||
@ -227,4 +193,3 @@ abstract class BaseController
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
<?php
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
@ -7,4 +6,5 @@ return [
|
||||
//验证勾股cms是否完成安装
|
||||
\app\home\middleware\Install::class,
|
||||
\app\api\middleware\AllowOriginMiddleware::class,
|
||||
|
||||
];
|
@ -2,7 +2,6 @@
|
||||
use think\facade\Route;
|
||||
Route::group('/',function () {
|
||||
Route::get('ArticleComment/isread', 'ArticleComment/isread');
|
||||
Route::get('ArticleComment/one list', 'ArticleComment/OneList');
|
||||
Route::get('Village/get_my_village', 'Village/get_my_village');
|
||||
Route::get('Village/get_my_town', 'Village/get_my_town');
|
||||
Route::get('Userinfo/get_ranking', 'Userinfo/get_ranking');
|
||||
@ -115,7 +114,6 @@ Route::group('/',function () {
|
||||
//红白喜事轮播图
|
||||
Route::get('Slide/get_slide_two', 'Slide/get_slide_two');
|
||||
Route::get('User/index', 'User/index');
|
||||
Route::get('Village/thumbs_up', 'Village/thumbs_up');
|
||||
})->middleware(\app\api\middleware\Auth::class);
|
||||
|
||||
Route::group('/',function () {
|
||||
@ -158,7 +156,7 @@ Route::group('/',function () {
|
||||
Route::get('Village/get_ranking_list', 'Village/get_ranking_list');
|
||||
Route::get('Census/get_list', 'Census/get_list');
|
||||
Route::get('Village/get_village', 'Village/get_village');
|
||||
|
||||
Route::get('Village/thumbs_up', 'Village/thumbs_up');
|
||||
Route::get('Village/get_detail', 'Village/get_detail');
|
||||
Route::get('Village/get_list', 'Village/get_list');
|
||||
Route::get('Village/get_json', 'Village/get_json');
|
||||
|
@ -1,7 +0,0 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
Options +FollowSymlinks -Multiviews
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
|
||||
</IfModule>
|
Loading…
x
Reference in New Issue
Block a user