保证金功能与页面完善
This commit is contained in:
parent
f80b8b7538
commit
5f0f32e5e9
27
app/admin/controller/merchant/system/merchant/Merchant.php
Normal file
27
app/admin/controller/merchant/system/merchant/Merchant.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 表单页面
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
namespace app\admin\controller\merchant\system;
|
||||||
|
|
||||||
|
use app\admin\BaseController;
|
||||||
|
use app\common\model\merchant\system\merchant\Merchant as MerchantModel;
|
||||||
|
|
||||||
|
class Merchant extends BaseController{
|
||||||
|
|
||||||
|
protected $model;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function classify(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function system() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -12,7 +12,7 @@ namespace app\admin\controller\merchant\system\merchant;
|
|||||||
|
|
||||||
use app\admin\BaseController;
|
use app\admin\BaseController;
|
||||||
use think\Request;
|
use think\Request;
|
||||||
use app\common\model\merchant\system\merchant\MerchantMargin as MarchantMarginModel;
|
use app\common\model\merchant\system\serve\ServeOrder as ServeOrderModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺保证金管理类
|
* 店铺保证金管理类
|
||||||
@ -21,32 +21,66 @@ class MerchantMargin extends BaseController
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $margin;
|
protected $margin;
|
||||||
|
protected $path;
|
||||||
|
|
||||||
public function __construct(MarchantMarginModel $margin)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->margin = $margin;
|
// $this->margin = $margin;
|
||||||
|
$this->path = [
|
||||||
|
'index' => 'merchant/system/merchant/margin/list',
|
||||||
|
'read' => 'merchant/system/merchant/margin/read',
|
||||||
|
'edit' => 'merchant/system/merchant/margin/edit'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Index()
|
||||||
|
{
|
||||||
|
return View($this->path['index']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示资源列表
|
* 显示保证金列表
|
||||||
*
|
*
|
||||||
* @return \think\Response
|
* @return \think\Response
|
||||||
*/
|
*/
|
||||||
public function lst()
|
public function lst(ServeOrderModel $order)
|
||||||
{
|
{
|
||||||
echo 'margin list';
|
$params = get_params();
|
||||||
|
$page = empty($params['page'])? 1 : (int)$params['page'];
|
||||||
|
$limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit'];
|
||||||
|
$where = ['date','keyword','is_trader','category_id','type_id'];
|
||||||
|
$where['type'] = 10;//10==保证金
|
||||||
|
|
||||||
|
$data = $order->GetList($where, $page, $limit);
|
||||||
|
|
||||||
|
return to_assign(0,'success', $data['data']=$data['list']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示创建资源表单页.
|
* 获取保证金扣费记录 record
|
||||||
*
|
|
||||||
* @return \think\Response
|
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function getMarginLst()
|
||||||
{
|
{
|
||||||
//
|
return View($this->path['read']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置扣减保证金表单
|
||||||
|
*/
|
||||||
|
public function setMarginForm()
|
||||||
|
{
|
||||||
|
return View($this->path['edit']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置扣减保证金
|
||||||
|
*/
|
||||||
|
public function setMargin()
|
||||||
|
{
|
||||||
|
echo 'fail';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存新建的资源
|
* 保存新建的资源
|
||||||
*
|
*
|
||||||
@ -92,14 +126,4 @@ class MerchantMargin extends BaseController
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除指定资源
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return \think\Response
|
|
||||||
*/
|
|
||||||
public function delete($id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -91,22 +91,29 @@ Route::group(function(){
|
|||||||
|
|
||||||
//店铺保证金
|
//店铺保证金
|
||||||
Route::group('/margin', function(){
|
Route::group('/margin', function(){
|
||||||
|
|
||||||
|
// 主页
|
||||||
|
Route::get('index', '/index')->name('systemMerchantMarginIndex'
|
||||||
|
)->option([
|
||||||
|
'_alias'=>'主页列表 ',
|
||||||
|
]);
|
||||||
|
|
||||||
//缴纳记录
|
//缴纳记录
|
||||||
Route::get('lst', '/lst')->name('systemMerchantMarginLst')->option([
|
Route::get('lst', '/lst')->name('systemMerchantMarginLst')->option([
|
||||||
'_alias' => '缴纳记录',
|
'_alias' => '缴纳记录',
|
||||||
]);
|
]);
|
||||||
//扣费记录
|
//扣费记录
|
||||||
Route::get('list/:id', '/getMarginLst')->name('systemMarginList')->option([
|
Route::get('read', '/getMarginLst')->name('systemMarginList')->option([
|
||||||
'_alias' => '扣费记录',
|
'_alias' => '扣费记录',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//扣除保证金
|
//扣除保证金
|
||||||
Route::get('set/:id/form', '/setMarginForm')->name('systemMarginSetForm')->option([
|
Route::get('form', '/setMarginForm')->name('systemMarginSetForm')->option([
|
||||||
'_alias' => '扣除保证金表单',
|
'_alias' => '扣除保证金表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'systemMarginSet',
|
'_form' => 'systemMarginSet',
|
||||||
]);
|
]);
|
||||||
Route::post('set', '/setMargin')->name('systemMarginSet')->option([
|
Route::post('reduct', '/setMargin')->name('systemMarginSet')->option([
|
||||||
'_alias' => '扣除保证金',
|
'_alias' => '扣除保证金',
|
||||||
]);
|
]);
|
||||||
})->prefix('merchant.system.merchant.MerchantMargin')->option([
|
})->prefix('merchant.system.merchant.MerchantMargin')->option([
|
||||||
|
134
app/admin/view/merchant/system/merchant/margin/edit.html
Normal file
134
app/admin/view/merchant/system/merchant/margin/edit.html
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
{block name="style"}
|
||||||
|
<style type="text/css">
|
||||||
|
.editormd-code-toolbar select {
|
||||||
|
display: inline-block
|
||||||
|
}
|
||||||
|
|
||||||
|
.editormd li {
|
||||||
|
list-style: inherit;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{/block}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
<form class="layui-form p-4">
|
||||||
|
<h3 class="pb-3">保证金扣费</h3>
|
||||||
|
<table class="layui-table layui-table-form">
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="layui-td-gray">店铺类型名称<font>*</font></td>
|
||||||
|
<td colspan="6">
|
||||||
|
<input type="text" name="type_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||||
|
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="layui-td-gray">店铺类型要求</td>
|
||||||
|
<td colspan="6">
|
||||||
|
<textarea class="layui-textarea" name="type_info"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="layui-td-gray">店铺保证金</td>
|
||||||
|
<td colspan="6">
|
||||||
|
<table class="layui-table layui-table-form">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input type="radio" name="is_margin" value="1" title="有" checked="">
|
||||||
|
<input type="radio" name="is_margin" value="0" title="无" checked="">
|
||||||
|
</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="">
|
||||||
|
</td>
|
||||||
|
<td colspan="5">单位:元</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="layui-td-gray">其它说明</td>
|
||||||
|
<td colspan="6">
|
||||||
|
<textarea class="layui-textarea" name="description"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="pt-3">
|
||||||
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type='button'>立即提交</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
||||||
|
|
||||||
|
<!-- 脚本 -->
|
||||||
|
{block name="script"}
|
||||||
|
<script src="/static/assets/js/xm-select.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var moduleInit = ['tool','treeGrid', 'tagpicker', 'tinymce', 'admin'];
|
||||||
|
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||||
|
|
||||||
|
function gouguInit() {
|
||||||
|
var treeGrid = layui.treeGrid,table = layui.table
|
||||||
|
|
||||||
|
var tool = layui.tool;
|
||||||
|
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||||
|
|
||||||
|
var editor = layui.tinymce;
|
||||||
|
var edit = editor.render({
|
||||||
|
selector: "#container_content",
|
||||||
|
height: 500,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 店铺权限
|
||||||
|
layui.use(['tree', 'util'], function(){
|
||||||
|
var tree = layui.tree
|
||||||
|
,layer = layui.layer
|
||||||
|
,util = layui.util
|
||||||
|
//模拟数据
|
||||||
|
,data = [];
|
||||||
|
|
||||||
|
|
||||||
|
//监听提交
|
||||||
|
form.on('submit(webform)', function (data) {
|
||||||
|
console.log(data.field);
|
||||||
|
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||||
|
if (data.field == '') {
|
||||||
|
layer.msg('请先完善店铺类型');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let callback = function (e) {
|
||||||
|
layer.msg(e.msg);
|
||||||
|
if (e.code == 0) {
|
||||||
|
tool.tabRefresh(71);
|
||||||
|
tool.sideClose(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tool.post('/admin/merchant/type/add', data.field, callback);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
<!-- /脚本 -->
|
372
app/admin/view/merchant/system/merchant/margin/list.html
Normal file
372
app/admin/view/merchant/system/merchant/margin/list.html
Normal file
@ -0,0 +1,372 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="p-3">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 时间选择 -->
|
||||||
|
<div class="layui-form">
|
||||||
|
|
||||||
|
<form class="layui-form" action="">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">日期范围</label>
|
||||||
|
<div class="layui-inline" id="test6">
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" autocomplete="off" id="test-startDate-1" class="layui-input"
|
||||||
|
placeholder="开始日期">
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid">-</div>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" autocomplete="off" id="test-endDate-1" class="layui-input"
|
||||||
|
placeholder="结束日期">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-inline" style="width:45%">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">关键字</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<input style="width:70%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
||||||
|
class="layui-input" autocomplete="off" />
|
||||||
|
<button class="layui-btn layui-btn-normal" lay-submit=""
|
||||||
|
lay-filter="searchform">提交搜索</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
|
||||||
|
|
||||||
|
<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="interest" lay-filter="aihao">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="0">写作</option>
|
||||||
|
<option value="1">阅读</option>
|
||||||
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
|
</select>
|
||||||
|
</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="interest" lay-filter="aihao">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="0">写作</option>
|
||||||
|
<option value="1">阅读</option>
|
||||||
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-form-item">
|
||||||
|
|
||||||
|
|
||||||
|
<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="interest" lay-filter="aihao">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="0">写作</option>
|
||||||
|
<option value="1">阅读</option>
|
||||||
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
|
</select>
|
||||||
|
</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="interest" lay-filter="aihao">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="0">写作</option>
|
||||||
|
<option value="1">阅读</option>
|
||||||
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</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 class="layui-this">缴存保证金</li>
|
||||||
|
<li>退回保证金</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>
|
||||||
|
</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-normal layui-btn-xs" lay-event="status">审核</a>
|
||||||
|
<a class="layui-btn layui-btn-xs" lay-event="mark">备注</a>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
||||||
|
<!-- 脚本 -->
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
const moduleInit = ['tool'];
|
||||||
|
function gouguInit() {
|
||||||
|
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||||
|
layui.pageTable = table.render({
|
||||||
|
elem: '#reduct_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.type_id}}</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
|
||||||
|
}, {
|
||||||
|
field: 'pay_time',
|
||||||
|
title: '支付时间',
|
||||||
|
align: 'center',
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fixed: 'right',
|
||||||
|
field: 'right',
|
||||||
|
title: '操作',
|
||||||
|
toolbar: '#barDemo',
|
||||||
|
width: 190,
|
||||||
|
align: 'center'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
layui.pageTable = table.render({
|
||||||
|
elem: '#refund_list',
|
||||||
|
title: '退回保证金列表',
|
||||||
|
toolbar: '#refundToolbar',
|
||||||
|
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.type_id}}</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
|
||||||
|
}, {
|
||||||
|
field: 'pay_time',
|
||||||
|
title: '支付时间',
|
||||||
|
align: 'center',
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fixed: 'right',
|
||||||
|
field: 'right',
|
||||||
|
title: '操作',
|
||||||
|
toolbar: '#barDemo',
|
||||||
|
width: 190,
|
||||||
|
align: 'center'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//监听表头工具栏事件
|
||||||
|
// 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) {
|
||||||
|
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') {
|
||||||
|
tool.side('/admin/margin/read?id=' + obj.data.mer_id);
|
||||||
|
} else if (obj.event === 'mark') {
|
||||||
|
tool.side('/admin/margin/form?id=' + obj.data.mer_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听搜索提交
|
||||||
|
// form.on('submit(searchform)', function(data) {
|
||||||
|
// layui.pageTable.reload({
|
||||||
|
// where: {
|
||||||
|
// keywords: data.field.keywords
|
||||||
|
// },
|
||||||
|
// page: {
|
||||||
|
// curr: 1
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// return false;
|
||||||
|
// });
|
||||||
|
|
||||||
|
// 日期范围
|
||||||
|
layui.use('laydate', function () {
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
//日期范围
|
||||||
|
laydate.render({
|
||||||
|
elem: '#test6'
|
||||||
|
//设置开始日期、日期日期的 input 选择器
|
||||||
|
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||||
|
, range: ['#test-startDate-1', '#test-endDate-1']
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
<!-- /脚本 -->
|
108
app/admin/view/merchant/system/merchant/margin/read.html
Normal file
108
app/admin/view/merchant/system/merchant/margin/read.html
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
|
||||||
|
<div class="p-3">
|
||||||
|
|
||||||
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||||
|
<ul class="layui-tab-title">
|
||||||
|
<li class="layui-this">扣费记录</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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
||||||
|
<!-- 脚本 -->
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
const moduleInit = ['tool'];
|
||||||
|
function gouguInit() {
|
||||||
|
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||||
|
layui.pageTable = table.render({
|
||||||
|
elem: '#reduct_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: 500,
|
||||||
|
templet: '<div>{{d.merchant.mer_name}}</div>'
|
||||||
|
},{
|
||||||
|
field: 'margin',
|
||||||
|
title: '扣费金额',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
templet: '<div>{{d.merchant.margin}}</div>'
|
||||||
|
},{
|
||||||
|
field: 'pay_time',
|
||||||
|
title: '操作时间',
|
||||||
|
align: 'center',
|
||||||
|
width: 200
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//监听表头工具栏事件
|
||||||
|
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) {
|
||||||
|
console.log(obj.data);
|
||||||
|
var data = obj.data;
|
||||||
|
if (obj.event === 'reduct') {
|
||||||
|
tool.side('/admin/margin/read?id=' + obj.data.id);
|
||||||
|
} else if (obj.event === 'record') {
|
||||||
|
tool.side('/admin/margin/form?id=' + obj.data.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 日期范围
|
||||||
|
layui.use('laydate', function () {
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
//日期范围
|
||||||
|
laydate.render({
|
||||||
|
elem: '#test6'
|
||||||
|
//设置开始日期、日期日期的 input 选择器
|
||||||
|
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||||
|
, range: ['#test-startDate-1', '#test-endDate-1']
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
<!-- /脚本 -->
|
@ -0,0 +1,63 @@
|
|||||||
|
{extend name="common/base"/}
|
||||||
|
{block name="style"}
|
||||||
|
<style>
|
||||||
|
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||||
|
</style>
|
||||||
|
{/block}
|
||||||
|
<!-- 主体 -->
|
||||||
|
{block name="body"}
|
||||||
|
<div class="layui-form p-4">
|
||||||
|
<h3 class="pb-3">查看店铺类型</h3>
|
||||||
|
<table class="layui-table layui-table-form">
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">店铺类型名称</td>
|
||||||
|
<td colspan="7"><input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||||
|
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}" readonly></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">店铺类型要求</td>
|
||||||
|
<td colspan="7">
|
||||||
|
<input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||||
|
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_info}" readonly>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">店铺保证金</td>
|
||||||
|
<td colspan="7"><input type="text" name="price" lay-verify="required" lay-reqText="请输入商品关键字"
|
||||||
|
autocomplete="off" placeholder="请输入商品关键字" class="layui-input" value="{$detail.margin}" readonly></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">店铺权限</td>
|
||||||
|
<td colspan="3">
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray" style="text-align:left">其它说明</td>
|
||||||
|
<td colspan="6">
|
||||||
|
<textarea class="layui-textarea" name="store_info" readonly>{$detail.store_info}</textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray" style="text-align:left">创建时间</td>
|
||||||
|
<td colspan="6">
|
||||||
|
{$detail.create_time}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray" style="text-align:left">修改时间</td>
|
||||||
|
<td colspan="6">
|
||||||
|
{$detail.update_time}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
<!-- /主体 -->
|
@ -20,7 +20,7 @@
|
|||||||
<td colspan="2" class="layui-td-gray">店铺类型名称<font>*</font></td>
|
<td colspan="2" class="layui-td-gray">店铺类型名称<font>*</font></td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<input type="text" name="type_name" lay-verify="required" lay-reqText="请输入商品名称"
|
<input type="text" name="type_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="123131{$detail.type_name}">
|
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="layui-form p-4">
|
<div class="layui-form p-4">
|
||||||
<h3 class="pb-3">文章详情</h3>
|
<h3 class="pb-3">查看店铺类型</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">店铺类型名称</td>
|
<td class="layui-td-gray">店铺类型名称</td>
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\merchant;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class FinancialRecord extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
32
app/common/model/merchant/system/merchant/Merchant.php
Normal file
32
app/common/model/merchant/system/merchant/Merchant.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 店铺管理 model
|
||||||
|
*
|
||||||
|
* @author:刘孝全
|
||||||
|
* @email:q8197264@126.com
|
||||||
|
* @date :2023年03月6日
|
||||||
|
*/
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\merchant;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class Merchant extends Model
|
||||||
|
{
|
||||||
|
protected $connection = 'shop';
|
||||||
|
protected $table = 'eb_merchant';
|
||||||
|
|
||||||
|
public function merchantType()
|
||||||
|
{
|
||||||
|
return $this->hasOne(MerchantType::class, 'mer_type_id', 'type_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function typeName()
|
||||||
|
{
|
||||||
|
return $this->merchantType()->bind(['type_name']);
|
||||||
|
}
|
||||||
|
}
|
14
app/common/model/merchant/system/merchant/MerchantAdmin.php
Normal file
14
app/common/model/merchant/system/merchant/MerchantAdmin.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\merchant;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class MerchantAdmin extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\merchant;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class MerchantApplyments extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\merchant;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class MerchantCategory extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\merchant;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class MerchantIntention extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
@ -12,7 +12,6 @@ namespace app\common\model\merchant\system\merchant;
|
|||||||
|
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use think\facade\Db;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @mixin \think\Model
|
* @mixin \think\Model
|
||||||
|
14
app/common/model/merchant/system/serve/ServeMeal.php
Normal file
14
app/common/model/merchant/system/serve/ServeMeal.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\serve;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class ServeMeal extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
102
app/common/model/merchant/system/serve/ServeOrder.php
Normal file
102
app/common/model/merchant/system/serve/ServeOrder.php
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 店铺所向平台订购服务的订单 model
|
||||||
|
*
|
||||||
|
* @author:刘孝全
|
||||||
|
* @email:q8197264@126.com
|
||||||
|
* @date :2023年03月3日
|
||||||
|
*/
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\system\serve;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
use app\common\model\merchant\system\merchant\Merchant;
|
||||||
|
use app\common\model\merchant\user\User;
|
||||||
|
use think\db\Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
*/
|
||||||
|
class ServeOrder extends Model
|
||||||
|
{
|
||||||
|
protected $connection = 'shop';
|
||||||
|
protected $talbe = 'eb_serve_order';
|
||||||
|
|
||||||
|
// 关联商户表
|
||||||
|
public function merchant()
|
||||||
|
{
|
||||||
|
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关联用户表
|
||||||
|
public function userInfo()
|
||||||
|
{
|
||||||
|
return $this->hasOne(User::class,'mer_id','ud');
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetList($where, int $page, int $limit)
|
||||||
|
{
|
||||||
|
$where['is_del'] = 0;
|
||||||
|
|
||||||
|
$query = self::Search($where)->with([
|
||||||
|
'merchant' => function($query){
|
||||||
|
$query->with(['merchantType']);
|
||||||
|
$query->field('mer_id,mer_name,is_trader,mer_avatar,type_id,mer_phone,mer_address,is_margin,margin,real_name,ot_margin');
|
||||||
|
}
|
||||||
|
])->order('ServeOrder.create_time DESC');
|
||||||
|
|
||||||
|
$count = $query->count();
|
||||||
|
$list = $query->page((int)$page, (int)$limit)->select();
|
||||||
|
|
||||||
|
return compact('count','list');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ServeOrderRepository $orderRepository
|
||||||
|
*
|
||||||
|
* @return \think\response\Json
|
||||||
|
*/
|
||||||
|
public function Search($where):Query
|
||||||
|
{
|
||||||
|
$query = self::hasWhere('merchant',function($query) use($where) {
|
||||||
|
|
||||||
|
$query->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use($where){
|
||||||
|
$query->whereLike('mer_keyword|real_name|mer_name',"%{$where['keyword']}%");
|
||||||
|
});
|
||||||
|
$query->when(isset($where['is_trader']) && $where['is_trader'] !== '', function ($query) use($where){
|
||||||
|
$query->where('is_trader',$where['is_trader']);
|
||||||
|
});
|
||||||
|
$query->when(isset($where['category_id']) && $where['category_id'] !== '', function ($query) use($where){
|
||||||
|
$query->where('category_id',$where['category_id']);
|
||||||
|
});
|
||||||
|
$query->when(isset($where['type_id']) && $where['type_id'] !== '', function ($query) use($where){
|
||||||
|
$query->where('type_id',$where['type_id']);
|
||||||
|
});
|
||||||
|
$query->where('is_del',0);
|
||||||
|
});
|
||||||
|
|
||||||
|
$query->when(isset($where['type']) && $where['type'] !== '', function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.type',$where['type']);
|
||||||
|
});
|
||||||
|
|
||||||
|
$query->when(isset($where['date']) && $where['date'] !== '', function ($query) use($where){
|
||||||
|
getModelTime($query,$where['date'],'ServeOrder.create_time');
|
||||||
|
});
|
||||||
|
|
||||||
|
$query->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.mer_id',$where['mer_id']);
|
||||||
|
});
|
||||||
|
|
||||||
|
$query->when(isset($where['status']) && $where['status'] !== '', function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.status',$where['status']);
|
||||||
|
});
|
||||||
|
|
||||||
|
$query->when(isset($where['is_del']) && $where['is_del'] !== '', function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.is_del',$where['is_del']);
|
||||||
|
});
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
15
app/common/model/merchant/user/User.php
Normal file
15
app/common/model/merchant/user/User.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\common\model\merchant\user;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \think\Model
|
||||||
|
*/
|
||||||
|
class User extends Model
|
||||||
|
{
|
||||||
|
protected $connection = 'shop';
|
||||||
|
// protected $table = 'user';
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user