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

修改后台佣金记录

  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: Administrator
  5 + * Date: 2020/3/26
  6 + * Time: 13:23
  7 + */
  8 +
  9 +namespace app\admin\controller;
  10 +
  11 +
  12 +use app\common\controller\Backend;
  13 +use think\Db;
  14 +
  15 +class Jilu extends Backend
  16 +{
  17 + /**
  18 + * OrderChat模型对象
  19 + * @var \app\admin\model\Territory
  20 + */
  21 + protected $model = null;
  22 +
  23 + public function _initialize()
  24 + {
  25 + parent::_initialize();
  26 + $this->model = new \app\admin\model\Record();
  27 + }
  28 +
  29 + /**
  30 + * 查看
  31 + */
  32 + public function index1($ids)
  33 + {
  34 + //设置过滤方法
  35 + $this->request->filter(['strip_tags']);
  36 + if ($this->request->isAjax()) {
  37 + //如果发送的来源是Selectpage,则转发到Selectpage
  38 + if ($this->request->request('keyField')) {
  39 + return $this->selectpage();
  40 + }
  41 + list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  42 + $total = $this->model
  43 + ->where($where)
  44 + ->where('teacher_id',$ids)
  45 + ->order($sort, $order)
  46 + ->count();
  47 +
  48 + $list = $this->model
  49 + ->where($where)
  50 + ->where('teacher_id',$ids)
  51 + ->order($sort, $order)
  52 + ->limit($offset, $limit)
  53 + ->select();
  54 +
  55 + $list = collection($list)->toArray();
  56 + $result = array("total" => $total, "rows" => $list);
  57 +
  58 + return json($result);
  59 + }
  60 + $this->assignconfig('ids',$ids);
  61 + return $this->view->fetch();
  62 + }
  63 +}
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <!--<div id="toolbar" class="toolbar">-->
  9 + <!--<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>-->
  10 + <!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('protocol/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
  11 + <!--<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>-->
  12 + <!--<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>-->
  13 + <!--<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>-->
  14 +
  15 + <!--<div class="dropdown btn-group {:$auth->check('protocol/multi')?'':'hide'}">-->
  16 + <!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
  17 + <!--<ul class="dropdown-menu text-left" role="menu">-->
  18 + <!--<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>-->
  19 + <!--<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>-->
  20 + <!--</ul>-->
  21 + <!--</div>-->
  22 +
  23 +
  24 + <!--</div>-->
  25 + <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
  26 + data-operate-edit="{:$auth->check('hobby/edit')}"
  27 + data-operate-del="{:$auth->check('hobby/del')}"
  28 + width="100%">
  29 + </table>
  30 + </div>
  31 + </div>
  32 +
  33 + </div>
  34 + </div>
  35 +</div>
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 +
  3 + var Controller = {
  4 + index1: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'jilu/index1' + '/ids/'+ Config.ids +location.search,
  9 + table: 'jilu',
  10 + },
  11 + });
  12 +
  13 + var table = $("#table");
  14 +
  15 + // 初始化表格
  16 + table.bootstrapTable({
  17 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  18 + pk: 'id',
  19 + sortName: 'id',
  20 + columns: [
  21 + [
  22 + {checkbox: true},
  23 + {field: 'id', title: __('Id')},
  24 + {field: 'type', title: __('类型'),formatter: Table.api.formatter.label,searchList:{'1': '订单结算','2':'提现审核中','3':'提现已结算'}},
  25 + {field: 'order_num', title: __('订单号')},
  26 + {field: 'money', title: __('金额')},
  27 + {field: 'createtime', title: __('创建时间'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
  28 + ]
  29 + ]
  30 + });
  31 +
  32 + // 为表格绑定事件
  33 + Table.api.bindevent(table);
  34 + },
  35 + add: function () {
  36 + Controller.api.bindevent();
  37 + },
  38 + edit: function () {
  39 + Controller.api.bindevent();
  40 + },
  41 + api: {
  42 + bindevent: function () {
  43 + Form.api.bindevent($("form[role=form]"));
  44 + }
  45 + }
  46 + };
  47 + return Controller;
  48 +});
@@ -42,7 +42,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -42,7 +42,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
42 {field: 'is_forbid', title: __('是否封禁'),formatter: Table.api.formatter.toggle,yes:'1',no:'0',searchList:{'0': '正常','1':'封禁'}}, 42 {field: 'is_forbid', title: __('是否封禁'),formatter: Table.api.formatter.toggle,yes:'1',no:'0',searchList:{'0': '正常','1':'封禁'}},
43 {field: 'is_stick', title: __('是否置顶'),formatter: Table.api.formatter.status,searchList:{'0':'不置顶','1': '置顶'}}, 43 {field: 'is_stick', title: __('是否置顶'),formatter: Table.api.formatter.status,searchList:{'0':'不置顶','1': '置顶'}},
44 // {field: 'territory_id', title: __('Territory_id'), operate:false}, 44 // {field: 'territory_id', title: __('Territory_id'), operate:false},
45 - {field: 'territory_id', title: __('Territory_id'), table: table, events: Table.api.events.operate, buttons: 45 + {field: 'territory_id', title: __('按钮组'), table: table, events: Table.api.events.operate, buttons:
46 [ 46 [
47 { 47 {
48 text: '擅长领域', 48 text: '擅长领域',
@@ -52,6 +52,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -52,6 +52,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
52 url: 'hobby/index1', 52 url: 'hobby/index1',
53 extend: 'data-area=\'["80%","80%"]\'' 53 extend: 'data-area=\'["80%","80%"]\''
54 }, 54 },
  55 + {
  56 + text: '收益记录',
  57 + title: '收益记录',
  58 + icon: 'fa fa-list',
  59 + classname: 'btn btn-xs btn-primary btn-dialog',
  60 + url: 'jilu/index1',
  61 + extend: 'data-area=\'["80%","80%"]\''
  62 + },
55 ], operate:false, formatter: Table.api.formatter.buttons 63 ], operate:false, formatter: Table.api.formatter.buttons
56 }, 64 },
57 {field: 'proportion', title: __('佣金比例'), operate:false}, 65 {field: 'proportion', title: __('佣金比例'), operate:false},