保证金列表调优
This commit is contained in:
parent
9408a92034
commit
568534719e
106
app/admin/controller/merchant/system/financial/Financial.php
Normal file
106
app/admin/controller/merchant/system/financial/Financial.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 保证金退款处理
|
||||||
|
* 说明: 店铺类型 相关(不同类型需要不同的保证金)
|
||||||
|
* @author:刘孝全
|
||||||
|
* @email:q8197264@126.com
|
||||||
|
* @date :2023年03月3日
|
||||||
|
*/
|
||||||
|
declare (strict_types = 1);
|
||||||
|
|
||||||
|
namespace app\admin\controller\merchant\system\financial;
|
||||||
|
|
||||||
|
use think\Request;
|
||||||
|
use app\admin\BaseController;
|
||||||
|
|
||||||
|
class Financial extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保证金退还记录
|
||||||
|
*/
|
||||||
|
public function lst()
|
||||||
|
{
|
||||||
|
[$page, $limit] = $this->getPage();
|
||||||
|
$where = $this->request->params(['date','status','financial_type','financial_status','keyword','is_trader','mer_id']);
|
||||||
|
$where['type'] = 0;
|
||||||
|
$data = $this->repository->getAdminList($where,$page,$limit);
|
||||||
|
return app('json')->success($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMarginLst()
|
||||||
|
{
|
||||||
|
[$page, $limit] = $this->getPage();
|
||||||
|
$where = $this->request->params(['date','status','financial_type','financial_status','keyword','is_trader','mer_id']);
|
||||||
|
$where['type'] = 1;
|
||||||
|
$data = $this->repository->getAdminList($where,$page,$limit);
|
||||||
|
return app('json')->success($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示创建资源表单页.
|
||||||
|
*
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存新建的资源
|
||||||
|
*
|
||||||
|
* @param \think\Request $request
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function save(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示指定的资源
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function read($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示编辑资源表单页.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存更新的资源
|
||||||
|
*
|
||||||
|
* @param \think\Request $request
|
||||||
|
* @param int $id
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指定资源
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \think\Response
|
||||||
|
*/
|
||||||
|
public function delete($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
@ -56,20 +56,21 @@ class MerchantMargin extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示保证金列表
|
* 获取保证金列表
|
||||||
*
|
*
|
||||||
* @return \think\Response
|
* @return json
|
||||||
*/
|
*/
|
||||||
public function lst(ServeOrderModel $order)
|
public function lst(ServeOrderModel $order)
|
||||||
{
|
{
|
||||||
$params = get_params();
|
$params = get_params();
|
||||||
$page = empty($params['page'])? 1 : (int)$params['page'];
|
$page = empty($params['page'])? 1 : (int)$params['page'];
|
||||||
$limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit'];
|
$limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit'];
|
||||||
$where = ['date','keyword','is_trader','category_id','type_id'];
|
$where = get_params(['date','keyword','is_trader','category_id','is_margin','type_id']);
|
||||||
$where['type'] = 10;//10==保证金
|
$where['type'] = 10;//10==保证金
|
||||||
|
|
||||||
$data = $order->GetList($where, $page, $limit);
|
$data = $order->GetList($where, $page, $limit);
|
||||||
|
|
||||||
|
|
||||||
return to_assign(0,'success', $data['data']=$data['list']);
|
return to_assign(0,'success', $data['data']=$data['list']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +141,10 @@ class MerchantMargin extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存新建的资源
|
* 保存新建的资源
|
||||||
*
|
*
|
||||||
|
@ -164,7 +164,7 @@ Route::group(function(){
|
|||||||
// 保证金退还
|
// 保证金退还
|
||||||
Route::group('margin/refund', function(){
|
Route::group('margin/refund', function(){
|
||||||
//退款申请
|
//退款申请
|
||||||
Route::get('refund/lst', 'financial.Financial/getMarginLst')->name('systemMarginRefundList')->option([
|
Route::get('lst', 'financial.Financial/getMarginLst')->name('systemMarginRefundList')->option([
|
||||||
'_alias' => '退款申请列表',
|
'_alias' => '退款申请列表',
|
||||||
]);
|
]);
|
||||||
Route::get('refund/show/:id', 'financial.Financial/refundShow')->name('systemMarginRefundShow')->option([
|
Route::get('refund/show/:id', 'financial.Financial/refundShow')->name('systemMarginRefundShow')->option([
|
||||||
@ -190,5 +190,8 @@ Route::group(function(){
|
|||||||
Route::post('refund/mark/:id', 'financial.Financial/mark')->name('systemMarginRefundMark')->option([
|
Route::post('refund/mark/:id', 'financial.Financial/mark')->name('systemMarginRefundMark')->option([
|
||||||
'_alias' => '备注',
|
'_alias' => '备注',
|
||||||
]);
|
]);
|
||||||
});
|
})->prefix('merchant.system.financial.Financial')->option([
|
||||||
|
'_path' => '/margin',
|
||||||
|
'_auth' => true,
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">关键字</label>
|
<label class="layui-form-label">关键字</label>
|
||||||
<div class="layui-input-block" style="display:flex">
|
<div class="layui-input-block" style="display:flex">
|
||||||
<input style="width:70%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
<input style="width:70%;float:left" type="text" name="keyword" placeholder="请输入关键字"
|
||||||
class="layui-input" autocomplete="off" />
|
class="layui-input" autocomplete="off" />
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit=""
|
<button class="layui-btn layui-btn-normal" lay-submit=""
|
||||||
lay-filter="searchform">提交搜索</button>
|
lay-filter="searchform">提交搜索</button>
|
||||||
@ -62,10 +62,10 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商户类别</label>
|
<label class="layui-form-label">商户类别</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="dddd" lay-filter="searchform">
|
<select name="is_trader" lay-filter="searchform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="10">自营</option>
|
<option value="1">自营</option>
|
||||||
<option value="11">非自营</option>
|
<option value="0">非自营</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -112,10 +112,10 @@
|
|||||||
|
|
||||||
<label class="layui-form-label">保证金状态</label>
|
<label class="layui-form-label">保证金状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select class="margin_state" name="margin_state" lay-filter="margin_state">
|
<select class="is_margin" name="is_margin" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="0">已付</option>
|
<option value="10">已付</option>
|
||||||
<option value="1">未付</option>
|
<option value="0">未付</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -147,7 +147,7 @@
|
|||||||
|
|
||||||
<label class="layui-form-label">退回状态</label>
|
<label class="layui-form-label">退回状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="refund" lay-filter="refund">
|
<select name="refund" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="0">未退回</option>
|
<option value="0">未退回</option>
|
||||||
<option value="1">已退回</option>
|
<option value="1">已退回</option>
|
||||||
@ -167,14 +167,14 @@
|
|||||||
|
|
||||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||||
<ul class="layui-tab-title">
|
<ul class="layui-tab-title">
|
||||||
<li lay-id="11" class="layui-this 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="site-demo-active" data-type="tabChange">退回保证金</li>
|
<li lay-id="22" class="tag-switch" data-type="tabChange">退回保证金</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="layui-tab-content" style="height: 100px;">
|
<div class="layui-tab-content" style="height: 100px;">
|
||||||
|
|
||||||
<!-- 缴存列表 -->
|
<!-- 缴存列表 -->
|
||||||
<div class="layui-tab-item layui-show">
|
<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>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -221,8 +221,8 @@
|
|||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||||
|
|
||||||
layui.pageTable = table.render({
|
layui.payTable = table.render({
|
||||||
elem: '#reduct_list',
|
elem: '#pay_list',
|
||||||
title: '保证金列表',
|
title: '保证金列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: '/admin/margin/lst',
|
url: '/admin/margin/lst',
|
||||||
@ -249,7 +249,7 @@
|
|||||||
title: '店铺类型',
|
title: '店铺类型',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
templet: '<div>{{d.merchant.type_id}}</div>'
|
templet: '<div>{{d.merchant.merchantType.type_name}}</div>'
|
||||||
}, {
|
}, {
|
||||||
field: 'real_name',
|
field: 'real_name',
|
||||||
title: '商户姓名',
|
title: '商户姓名',
|
||||||
@ -266,7 +266,22 @@
|
|||||||
field: 'status',
|
field: 'status',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
align: 'center',
|
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',
|
field: 'pay_time',
|
||||||
title: '支付时间',
|
title: '支付时间',
|
||||||
@ -287,7 +302,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
layui.pageTable = table.render({
|
layui.refundTable = table.render({
|
||||||
elem: '#refund_list',
|
elem: '#refund_list',
|
||||||
title: '退回保证金列表',
|
title: '退回保证金列表',
|
||||||
toolbar: '#refundToolbar',
|
toolbar: '#refundToolbar',
|
||||||
@ -363,25 +378,10 @@
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $ = layui.$, active = {
|
|
||||||
reload: function(){
|
|
||||||
let dataRload = getformdata();;
|
|
||||||
|
|
||||||
//执行重载
|
|
||||||
table.reload('testReload', {
|
|
||||||
page: {
|
|
||||||
curr: 1 //重新从第 1 页开始
|
|
||||||
}
|
|
||||||
,where: {
|
|
||||||
...dataRload
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//监听表格行工具事件
|
//监听表格行工具事件
|
||||||
table.on('tool(reduct_list)', function (obj) {
|
table.on('tool(pay_list)', function (obj) {
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
if (obj.event === 'reduct') {
|
if (obj.event === 'reduct') {
|
||||||
@ -407,9 +407,51 @@
|
|||||||
return false;
|
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{
|
||||||
|
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', 'jquery'],
|
layui.use(['laydate','element','table', 'jquery'],
|
||||||
function () {
|
function () {
|
||||||
var laydate = layui.laydate;
|
var laydate = layui.laydate;
|
||||||
var $ = layui.jquery,element = layui.element;
|
var $ = layui.jquery,element = layui.element;
|
||||||
@ -429,33 +471,23 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//触发事件
|
|
||||||
var 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";
|
|
||||||
// refund.childNodes().value='';
|
|
||||||
}else{
|
|
||||||
refund.style.display = "block";
|
|
||||||
marign.style.display = "none";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$('.site-demo-active').on('click', function(){
|
|
||||||
|
// 列表切换
|
||||||
|
$('.tag-switch').on('click', function(){
|
||||||
var othis = $(this), type = othis.data('type');
|
var othis = $(this), type = othis.data('type');
|
||||||
active[type] ? active[type].call(this, othis) : '';
|
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提交
|
//监听button提交
|
||||||
form.on('submit(searchform)', function(data) {
|
form.on('submit(searchform)', function(data) {
|
||||||
layui.pageTable.reload({
|
layui.payTable.reload({
|
||||||
where: {
|
where: {
|
||||||
...data.field
|
...data.field
|
||||||
},
|
},
|
||||||
@ -469,7 +501,7 @@
|
|||||||
|
|
||||||
form.on('select(searchform)', function(e) {
|
form.on('select(searchform)', function(e) {
|
||||||
let data = getformdata();
|
let data = getformdata();
|
||||||
layui.pageTable.reload({
|
layui.payTable.reload({
|
||||||
where: {
|
where: {
|
||||||
...data
|
...data
|
||||||
},
|
},
|
||||||
@ -480,12 +512,6 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听保证金状态select
|
|
||||||
$('.margin_state .layui-btn').on('click', function(){
|
|
||||||
var type = $(this).data('type');
|
|
||||||
active[type] ? active[type].call(this) : '';
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//选择时间
|
//选择时间
|
||||||
form.on('submit(chonse_date)', function(data){
|
form.on('submit(chonse_date)', function(data){
|
||||||
|
@ -14,6 +14,7 @@ use think\Model;
|
|||||||
use app\common\model\merchant\system\merchant\Merchant;
|
use app\common\model\merchant\system\merchant\Merchant;
|
||||||
use app\common\model\merchant\user\User;
|
use app\common\model\merchant\user\User;
|
||||||
use think\db\Query;
|
use think\db\Query;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ class ServeOrder extends Model
|
|||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
protected $talbe = 'eb_serve_order';
|
protected $talbe = 'eb_serve_order';
|
||||||
|
protected $pk = 'mer_id';
|
||||||
|
|
||||||
// 关联商户表
|
// 关联商户表
|
||||||
public function merchant()
|
public function merchant()
|
||||||
@ -35,6 +37,9 @@ class ServeOrder extends Model
|
|||||||
return $this->hasOne(User::class,'mer_id','ud');
|
return $this->hasOne(User::class,'mer_id','ud');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有商户的保证金数据
|
||||||
|
*/
|
||||||
function GetList($where, int $page, int $limit)
|
function GetList($where, int $page, int $limit)
|
||||||
{
|
{
|
||||||
$where['is_del'] = 0;
|
$where['is_del'] = 0;
|
||||||
@ -54,9 +59,11 @@ class ServeOrder extends Model
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ServeOrderRepository $orderRepository
|
* 条件过滤sql
|
||||||
*
|
*
|
||||||
* @return \think\response\Json
|
* @param array $where 条件数组
|
||||||
|
*
|
||||||
|
* @return object Query
|
||||||
*/
|
*/
|
||||||
public function Search($where):Query
|
public function Search($where):Query
|
||||||
{
|
{
|
||||||
@ -66,49 +73,62 @@ class ServeOrder extends Model
|
|||||||
function ($query) use($where){
|
function ($query) use($where){
|
||||||
$query->whereLike('mer_keyword|real_name|mer_name',"%{$where['keyword']}%");
|
$query->whereLike('mer_keyword|real_name|mer_name',"%{$where['keyword']}%");
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
$query->when(isset($where['is_trader']) && $where['is_trader'] !== '',
|
->when(isset($where['is_trader']) && $where['is_trader'] !== '',
|
||||||
function ($query) use($where){
|
function ($query) use($where){
|
||||||
$query->where('is_trader',$where['is_trader']);
|
$query->where('is_trader',$where['is_trader']);
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
$query->when(isset($where['category_id']) && $where['category_id'] !== '',
|
->when(isset($where['category_id']) && $where['category_id'] !== '',
|
||||||
function ($query) use($where){
|
function ($query) use($where){
|
||||||
$query->where('category_id',$where['category_id']);
|
$query->where('category_id',$where['category_id']);
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
$query->when(isset($where['type_id']) && $where['type_id'] !== '',
|
->when(isset($where['type_id']) && $where['type_id'] !== '',
|
||||||
function ($query) use($where){
|
function ($query) use($where){
|
||||||
$query->where('type_id',$where['type_id']);
|
$query->where('type_id',$where['type_id']);
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
$query->where('is_del',0);
|
->when(isset($where['is_margin']) && $where['is_margin'] !== '',
|
||||||
|
function($query)use($where){
|
||||||
|
$query->where('is_margin', $where['is_margin']);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
->where('is_del',0);
|
||||||
});
|
});
|
||||||
|
|
||||||
$query->when(isset($where['type']) && $where['type'] !== '',
|
$query->when(isset($where['type']) && $where['type'] !== '',
|
||||||
function ($query) use($where){
|
function ($query) use($where){
|
||||||
$query->where('ServeOrder.type',$where['type']);
|
$query->where('ServeOrder.type',$where['type']);
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
|
->when(isset($where['date']) && $where['date'] !== '',
|
||||||
$query->when(isset($where['date']) && $where['date'] !== '',
|
|
||||||
function ($query) use($where){
|
function ($query) use($where){
|
||||||
getModelTime($query,$where['date'],'ServeOrder.create_time');
|
getModelTime($query,$where['date'],'ServeOrder.create_time');
|
||||||
|
}
|
||||||
|
)
|
||||||
|
->when(isset($where['start_date'])&&isset($where['end_date'])&&$where['start_date']!==''&&$where['end_date']!=='',
|
||||||
|
function($query)use($where){
|
||||||
|
$query->where('create_time','between',[$where['start_date'], $where['end_date']]);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
->when(isset($where['mer_id']) && $where['mer_id'] !== '',
|
||||||
|
function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.mer_id',$where['mer_id']);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
->when(isset($where['status']) && $where['status'] !== '',
|
||||||
|
function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.status',$where['status']);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
->when(isset($where['is_del']) && $where['is_del'] !== '',
|
||||||
|
function ($query) use($where){
|
||||||
|
$query->where('ServeOrder.is_del',$where['is_del']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$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;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* 用户model
|
||||||
|
*
|
||||||
|
* @author:刘孝全
|
||||||
|
* @email:q8197264@126.com
|
||||||
|
* @date :2023年03月6日
|
||||||
|
*/
|
||||||
declare (strict_types = 1);
|
declare (strict_types = 1);
|
||||||
|
|
||||||
namespace app\common\model\merchant\user;
|
namespace app\common\model\merchant\user;
|
||||||
@ -11,5 +18,6 @@ use think\Model;
|
|||||||
class User extends Model
|
class User extends Model
|
||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
// protected $table = 'user';
|
protected $table = 'eb_user';
|
||||||
|
protected $pk = 'uid';
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ class UserBill extends Model
|
|||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
protected $table = 'eb_user_bill';
|
protected $table = 'eb_user_bill';
|
||||||
|
protected $pk = 'bill_id';
|
||||||
|
|
||||||
const TYPE_INFO = [
|
const TYPE_INFO = [
|
||||||
'brokerage/now_money' => '佣金转入余额',
|
'brokerage/now_money' => '佣金转入余额',
|
||||||
@ -47,6 +48,13 @@ class UserBill extends Model
|
|||||||
'now_money/sys_inc_money' => '系统增加余额',
|
'now_money/sys_inc_money' => '系统增加余额',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联user模型
|
||||||
|
*/
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->hasOne(User::class, 'uid', 'uid');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: 短信通知待开发
|
* TODO: 短信通知待开发
|
||||||
|
Loading…
x
Reference in New Issue
Block a user