作者 郭盛
1 个管道 的构建 通过 耗费 6 秒

修改后台佣金记录

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2020/3/26
* Time: 13:23
*/
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
class Jilu extends Backend
{
/**
* OrderChat模型对象
* @var \app\admin\model\Territory
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Record();
}
/**
* 查看
*/
public function index1($ids)
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->where('teacher_id',$ids)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->where('teacher_id',$ids)
->order($sort, $order)
->limit($offset, $limit)
->select();
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
$this->assignconfig('ids',$ids);
return $this->view->fetch();
}
}
\ No newline at end of file
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<!--<div id="toolbar" class="toolbar">-->
<!--<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>-->
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('protocol/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('hobby/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('protocol/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('protocol/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!--<div class="dropdown btn-group {:$auth->check('protocol/multi')?'':'hide'}">-->
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<!--<ul class="dropdown-menu text-left" role="menu">-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
<!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
<!--</ul>-->
<!--</div>-->
<!--</div>-->
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('hobby/edit')}"
data-operate-del="{:$auth->check('hobby/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index1: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'jilu/index1' + '/ids/'+ Config.ids +location.search,
table: 'jilu',
},
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'type', title: __('类型'),formatter: Table.api.formatter.label,searchList:{'1': '订单结算','2':'提现审核中','3':'提现已结算'}},
{field: 'order_num', title: __('订单号')},
{field: 'money', title: __('金额')},
{field: 'createtime', title: __('创建时间'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
... ... @@ -42,7 +42,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'is_forbid', title: __('是否封禁'),formatter: Table.api.formatter.toggle,yes:'1',no:'0',searchList:{'0': '正常','1':'封禁'}},
{field: 'is_stick', title: __('是否置顶'),formatter: Table.api.formatter.status,searchList:{'0':'不置顶','1': '置顶'}},
// {field: 'territory_id', title: __('Territory_id'), operate:false},
{field: 'territory_id', title: __('Territory_id'), table: table, events: Table.api.events.operate, buttons:
{field: 'territory_id', title: __('按钮组'), table: table, events: Table.api.events.operate, buttons:
[
{
text: '擅长领域',
... ... @@ -52,6 +52,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: 'hobby/index1',
extend: 'data-area=\'["80%","80%"]\''
},
{
text: '收益记录',
title: '收益记录',
icon: 'fa fa-list',
classname: 'btn btn-xs btn-primary btn-dialog',
url: 'jilu/index1',
extend: 'data-area=\'["80%","80%"]\''
},
], operate:false, formatter: Table.api.formatter.buttons
},
{field: 'proportion', title: __('佣金比例'), operate:false},
... ...