更改审核入驻客服表连接

This commit is contained in:
liuxiaoquan 2023-03-16 17:35:41 +08:00
parent d54d6bd588
commit 1aa66250e9
8 changed files with 948 additions and 10 deletions

View File

@ -6,25 +6,48 @@
*
* @ 商户管理
*/
namespace app\admin\controller\merchant\system;
namespace app\admin\controller\merchant\system\merchant;
use think\App;
use app\admin\BaseController;
use app\common\model\merchant\system\merchant\Merchant as MerchantModel;
class Merchant extends BaseController{
protected $model;
protected $path = [
'index' => 'merchant/system/merchant/merchant/lst',
'read' => 'merchant/system/merchant/merchant/read',
'add' => 'merchant/system/merchant/merchant/add',
'edit' => 'merchant/system/merchant/merchant/edit',
'descr'=>'merchant/system/merchant/merchant/index',
'mark' => 'merchant/system/merchant/merchant/mark'
];
public function __construct()
public function __construct(App $app)
{
parent::__construct($app);
}
function classify(){
public function index()
{
return View($this->path['index']);
}
public function system() {
/**
* 商户列表数据
*/
public function lst()
{
[$page, $limit] = $this->getPage();
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);
return app('json')->success($this->repository->lst($where, $page, $limit));
}
public function count()
{
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);
return app('json')->success($this->repository->count($where));
}
}

View File

@ -88,7 +88,7 @@ class Product extends BaseController
if (isset($params['keywords']) && !empty($params['keywords'])){
// $where[]= ['sotre_name','like','%'.$params['keywords'].'%'];
$where['keywords'] = $where['store_name'] = $params['keywords'];
$where['keyword'] = $where['store_name'] = $params['keywords'];
}
$page = empty($params['page'])?1:$params['page'];

View File

@ -10,6 +10,8 @@ namespace app\admin\model;
use think\Model;
use app\admin\model\store\ProductCate;
use app\common\model\merchant\system\merchant\Merchant;
use think\facade\Db;
class EbStoreProduct extends Model
@ -46,7 +48,134 @@ class EbStoreProduct extends Model
{
return $this->hasOne(StoreBrand::class,'brand_id','brand_id')->field('brand_id,brand_name');
}
/*
* -----------------------------------------------------------------------------------------------------------------
* 搜索器
* -----------------------------------------------------------------------------------------------------------------
*/
public function searchMerCateIdAttr($query, $value)
{
$cate_ids = (StoreCategory::where('path','like','%/'.$value.'/%'))->column('store_category_id');
$cate_ids[] = intval($value);
$product_id = ProductCate::whereIn('mer_cate_id',$cate_ids)->column('product_id');
$query->whereIn('Product.product_id',$product_id);
}
public function searchKeywordAttr($query, $value)
{
if (!$value) return;
if (is_numeric($value)) {
$query->whereLike("Product.store_name|Product.keyword|bar_code|Product.product_id", "%{$value}%");
}
// else {
// // $word = app()->make(VicWordService::class)->getWord($value);
// $word = $value;
// $query->where(function ($query) use ($word, $value) {
// foreach ($word as $item) {
// $query->whereOr('Product.store_name|Product.keyword', 'LIKE', "%$item%");
// }
// $query->order(Db::raw('REPLACE(Product.store_name,\'' . $value . '\',\'\')'));
// });
// }
}
public function searchStatusAttr($query, $value)
{
if($value === -1){
$query->where('Product.status', 'in',[-1,-2]);
}else {
$query->where('Product.status',$value);
}
}
public function searchCateIdAttr($query, $value)
{
$query->where('cate_id',$value);
}
public function searchCateIdsAttr($query, $value)
{
$query->whereIn('cate_id',$value);
}
public function searchIsShowAttr($query, $value)
{
$query->where('is_show',$value);
}
public function searchPidAttr($query, $value)
{
$cateId = app()->make(StoreCategoryRepository::class)->allChildren(intval($value));
$query->whereIn('cate_id', $cateId);
}
public function searchStockAttr($query, $value)
{
$value ? $query->where('stock','<=', $value) : $query->where('stock', $value);
}
public function searchIsNewAttr($query, $value)
{
$query->where('is_new',$value);
}
public function searchPriceAttr($query, $value)
{
if(empty($value[0]) && !empty($value[1]))
$query->where('price','<',$value[1]);
if(!empty($value[0]) && empty($value[1]))
$query->where('price','>',$value[0]);
if(!empty($value[0]) && !empty($value[1]))
$query->whereBetween('price',[$value[0],$value[1]]);
}
public function searchBrandIdAttr($query, $value)
{
$query->whereIn('brand_id',$value);
}
public function searchIsGiftBagAttr($query, $value)
{
$query->where('is_gift_bag',$value);
}
public function searchIsGoodAttr($query, $value)
{
$query->where('is_good',$value);
}
public function searchIsUsedAttr($query, $value)
{
$query->where('is_used',$value);
}
public function searchProductTypeAttr($query, $value)
{
$query->where('Product.product_type',$value);
}
// public function searchSeckillStatusAttr($query, $value)
// {
// $product_id = (new StoreSeckillActiveDao())->getStatus($value)->column('product_id');
// $query->whereIn('Product.product_id',$product_id);
// }
public function searchStoreNameAttr($query, $value)
{
$query->where('Product.store_name','like','%'.$value.'%');
}
public function searchMerStatusAttr($query, $value)
{
$query->where('mer_status',$value);
}
public function searchProductIdAttr($query, $value)
{
$query->where('Product.product_id',$value);
}
public function searchPriceOnAttr($query, $value)
{
$query->where('price','>=',$value);
}
public function searchPriceOffAttr($query, $value)
{
$query->where('price','<=',$value);
}
public function searchisFictiAttr($query, $value)
{
$query->where('type',$value);
}
public function searchGuaranteeTemplateIdAttr($query, $value)
{
$query->whereIn('guarantee_template_id',$value);
}
public function searchTempIdAttr($query, $value)
{
$query->whereIn('Product.temp_id',$value);
}
/**
* TODO 商户商品列表

View File

@ -43,6 +43,78 @@ Route::group(function(){
'_auth' => true,
]);
//商户管理
Route::group('system/merchant', function () {
Route::get('index', '.Merchant/index')->name('systemMerchantLst')->option([
'_alias' => '商户列表页',
]);
Route::get('lst', '.Merchant/list')->name('systemMerchantLst')->option([
'_alias' => '商户列表',
]);
Route::get('count', '.Merchant/count')->name('systemMerchantCount')->option([
'_alias' => '商户列表统计',
]);
Route::get('add', '.Merchant/add')->name('systemMerchantCreateForm')->option([
'_alias' => '商户添加表单页',
]);
Route::post('add', '.Merchant/add')->name('systemMerchantCreate')->option([
'_alias' => '商户添加',
]);
Route::get('edit', '.Merchant/edit')->name('systemMerchantUpdateForm')->option([
'_alias' => '商户编辑表单页',
'_auth' => false,
'_form' => 'systemMerchantUpdate',
]);
Route::post('edit', '.Merchant/edit')->name('systemMerchantUpdate')->option([
'_alias' => '商户编辑',
]);
Route::post('status', '.Merchant/switchStatus')->name('systemMerchantStatus')->option([
'_alias' => '商户修改推荐',
]);
Route::post('close', '.Merchant/switchClose')->name('systemMerchantClose')->option([
'_alias' => '商户开启/关闭',
]);
Route::delete('del', '.Merchant/del')->name('systemMerchantDelete')->option([
'_alias' => '商户删除',
]);
Route::post('password', '.MerchantAdmin/password')->name('systemMerchantAdminPassword')->option([
'_alias' => '商户修改密码',
]);
Route::get('password', '.MerchantAdmin/passwordForm')->name('systemMerchantAdminPasswordForm')->option([
'_alias' => '商户修改密码表单页',
'_auth' => false,
'_form' => 'systemMerchantAdminPassword',
]);
Route::post('login', '.Merchant/login')->name('systemMerchantLogin')->option([
'_alias' => '商户登录',
]);
Route::get('changecopy', '/changeCopyNumForm')->name('systemMerchantChangeCopyForm')->option([
'_alias' => '修改采集商品次数表单页',
'_auth' => false,
'_form' => 'systemMerchantChangeCopy',
]);
Route::post('changecopy', '.Merchant/changeCopyNum')->name('systemMerchantChangeCopy')->option([
'_alias' => '修改采集商品次数',
]);
})->prefix('merchant.system.merchant')->option([
'_path' => '/merchant/list',
'_auth' => true,
'_append'=> [
[
'_name' =>'uploadImage',
'_path' =>'/merchant/list',
'_alias' => '上传图片',
'_auth' => true,
],
[
'_name' =>'systemAttachmentLst',
'_path' =>'/merchant/list',
'_alias' => '图片列表',
'_auth' => true,
],
]
]);
//入驻申请列表
Route::group('merchant/intention', function () {
Route::get('index', '/index')->name('systemMerchantIntentionLst')->option([

View File

@ -0,0 +1,691 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<!-- 时间选择 -->
<div class="layui-form">
<form id="filterform" class="layui-form" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">选择时间</label>
<div class="layui-input-block">
<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="range_date">
<div class="layui-input-inline">
<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="end-date" class="layui-input" placeholder="结束日期">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-inline" style="width:45%;">
<div class="layui-form-item">
<label class="layui-form-label">关键字</label>
<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" lay-submit=""
lay-filter="searchform">提交搜索</button>
</div>
</div>
</div>
<div class="layui-input-inline" style="width:35%;float:none;">
<div class="layui-form-item">
<label class="layui-form-label">商户类别</label>
<div class="layui-input-block">
<select name="is_trader" lay-filter="searchform">
<option value=""></option>
<option value="1">自营</option>
<option value="0">非自营</option>
</select>
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<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_id" lay-filter="seleform">
<option value=""></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:45%;">
<div class="layui-form-item">
<label class="layui-form-label">店铺类型</label>
<div class="layui-input-block">
<select name="type_id" lay-filter="seleform">
<option value=""></option>
{volist name="type" key="k" id="vo"}
<option value="{$vo.mer_type_id}">{$vo.type_name}</option>
{/volist}
</select>
</div>
</div>
</div>
</div>
<!-- change tab -->
<div class="layui-form-item" id="set_margin" style="display:block;">
<div class="layui-input-inline" style="width:46%;">
<div class="layui-form-item">
<label class="layui-form-label">保证金状态</label>
<div class="layui-input-block">
<select class="is_margin" name="is_margin" lay-filter="seleform">
<option value=""></option>
<option value="10">已付</option>
<option value="0">未付</option>
</select>
</div>
</div>
</div>
</div>
<!-- change tab end -->
<!-- change tab -->
<div class="layui-form-item" id="refund_margin" style="display:none;">
<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">
<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>
<div class="layui-input-inline" style="width:35%;">
<div class="layui-form-item">
<label class="layui-form-label">退回状态</label>
<div class="layui-input-block">
<select name="refund" lay-filter="seleform">
<option value=""></option>
<option value="0">未退回</option>
<option value="1">已退回</option>
</select>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- test end -->
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
<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="pay_list" lay-filter="pay_list">
</table>
</div>
<!-- 退回保证金列表 -->
<div class="layui-tab-item">
<div class="layui-tab-item layui-show">
<table class="layui-hide" id="refund_list" lay-filter="refund_list">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- 缴存操作 -->
<script type="text/html" id="toolbarDemo"></script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reduct">保证金扣费</a>
<a class="layui-btn layui-btn-xs" lay-event="record">扣费记录</a>
</div>
</script>
<!-- 退回操作 -->
<script type="text/html" id="refundToolbar"></script>
<script type="text/html" id="refundBar">
<div class="layui-btn-group">
<a class="layui-btn layui-btn-xs" lay-event="mark">备注</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="status">审核</a>
<a class="layui-btn layui-btn-xs" lay-event="record">扣费记录</a>
</div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table, tool = layui.tool, form = layui.form;
layui.payTable = table.render({
elem: '#pay_list',
title: '保证金列表',
toolbar: '#toolbarDemo',
url: '/admin/margin/lst',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'ID',
field: 'mer_id',
title: 'ID',
align: 'center',
width: 80
},
{
field: 'mer_name',
title: '商户名称',
align: 'center',
width: 200,
templet: '<div>{{d.merchant.mer_name}}</div>'
}, {
field: 'type_id',
title: '店铺类型',
align: 'center',
width: 220,
templet: '<div>{{d.merchant.merchantType.type_name}}</div>'
}, {
field: 'real_name',
title: '商户姓名',
align: 'center',
width: 220,
templet: '<div>{{d.merchant.real_name}}</div>'
}, {
field: 'margin',
title: '保证金额度',
align: 'center',
width: 100,
templet: '<div>{{d.merchant.margin}}</div>'
}, {
field: 'status',
title: '状态',
align: 'center',
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: '支付时间',
align: 'center',
width: 150
},
{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 190,
align: 'center'
}
]
]
});
function refundList(data){
layui.refundTable = table.render({
elem: '#refund_list',
title: '退回保证金列表',
toolbar: '#refundToolbar',
url: '/admin/margin/refund/lst',
parseData:(res)=>{
return {
"code": res.code, //解析接口状态
"msg": res.msg, //解析提示文本
"count": res.data.count, //解析数据长度
"data": res.data.list //解析数据列表
};
},
where: {
...data
},
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'ID',
field: 'mer_id',
title: 'ID',
align: 'center',
width: 80
},
{
field: 'mer_name',
title: '商户名称1',
align: 'center',
width: 200,
templet: '<div>{{d.merchant.mer_name}}</div>'
}, {
field: 'type_id',
title: '店铺类型',
align: 'center',
width: 220,
templet: '<div>{{d.merchant.merchantType.type_name}}</div>'
}, {
field: 'real_name',
title: '商户姓名',
align: 'center',
width: 220,
templet: '<div>{{d.merchant.real_name}}</div>'
}, {
field: 'margin',
title: '保证金额度',
align: 'center',
width: 100,
templet: '<div>{{d.merchant.margin}}</div>'
}, {
field: 'status',
title: '保证金申请状态',
align: 'center',
width: 150,
templet:(d)=>{
switch(d.status) {
case 0:
return '待审核';
case 1:
return '通过';
case -1:
return '未通过';
}
}
}, {
field: 'create_time',
title: '申请时间',
align: 'center',
width: 150
},{
field: 'extract_money',
title: '结余保证金',
align: 'center',
width: 150
},{
field: 'financial_status',
title: '退回状态',
align: 'center',
width: 150,
templet:(d)=>{
switch(d.status) {
case 0:
return '未退';
// case 1:
// return '通过';
// case -1:
// return '未通过';
}
}
},
{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#refundBar',
width: 190,
align: 'center'
}
]
]
});
}
// 获取表单所有参数
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;
}
//监听表格行工具事件
table.on('tool(pay_list)', function (obj) {
var data = obj.data;
// console.log(data);
if (obj.event === 'reduct') {
tool.side('/admin/margin/form?id=' + obj.data.mer_id);
} else if (obj.event === 'record') {
tool.side('/admin/margin/read?id=' + obj.data.mer_id);
}
return false;
});
//监听表格行工具事件
table.on('tool(refund_list)', function (obj) {
var data = obj.data;
if (obj.event === 'status') {
alert("审核");
tool.post('/admin/margin/status?id=' + obj.data.mer_id, obj.data);
} else if (obj.event === 'mark') {
tool.side('/admin/margin/form?id=' + obj.data.mer_id);
} else if (obj.event === 'record') {
tool.side('/admin/margin/read?id=' + obj.data.mer_id);
}
return false;
});
//触发事件
var $ = layui.$, active = {
tabChange: function(){
//切换到指定Tab项
// element.tabChange('demo', this.getAttribute('lay-id')); //切换tab
var marign = document.getElementById('set_margin');
var refund = document.getElementById('refund_margin');
if ('11'==this.getAttribute('lay-id')) {
marign.style.display = "block";
refund.style.display = "none";
}else{
let data = getformdata();
refundList(data)
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
},
});
}
};
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) : '';
}
});
// 列表切换
$('.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{
// refundList()
// 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;
});
// 监听select 提交
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>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,14 @@
<?php
declare (strict_types = 1);
namespace app\common\model\merchant\system\financial;
use think\Model;
/**
* @mixin \think\Model
*/
class FinancialRecord extends Model
{
//
}

View File

@ -38,6 +38,15 @@ class Merchant extends Model
protected $pk = 'mer_id';
/** ------------------- 依赖 ------------------- */
/**
* 所属供应链
* 远程一对一
*/
public function supplyChain()
{
return $this->hasOneThrough(SupplyChainLinkMerchant::class, SupplyChain::class);
}
public function getDeliveryWayAttr($value)
{
if (!$value) return [];

View File

@ -214,7 +214,7 @@ class MerchantIntention extends Model
$store_service_data['is_goods'] = 1;
$store_service_data['phone'] = $intention['phone'];
$store_service_data['create_time'] = date('Y-m-d H:i:s');
Db::table('eb_store_service')->insert($store_service_data);
Db::connect('shop')->table('eb_store_service')->insert($store_service_data);
// topservice
$top_store_service['mer_id'] = 0;
$top_store_service['uid'] = $intention['uid'];
@ -226,7 +226,7 @@ class MerchantIntention extends Model
$top_store_service['is_open'] = 1;
$top_store_service['phone'] = $intention['phone'];
$top_store_service['create_time'] = date('Y-m-d H:i:s');
Db::table('eb_store_service')->insert($top_store_service);
Db::connect('shop')->table('eb_store_service')->insert($top_store_service);
// 暂不开通通知
// Queue::push(SendSmsJob::class, ['tempId' => 'APPLY_MER_SUCCESS', 'id' => $smsData]);