WIN-2308041133\Administrator 7 months ago
parent
commit
fe063fb94d

+ 77 - 0
application/admin/controller/platform/VideoPlatformRecord.php

@@ -0,0 +1,77 @@
+<?php
+
+namespace app\admin\controller\platform;
+
+use app\common\controller\Backend;
+
+/**
+ * 第三方平台列表
+ *
+ */
+class VideoPlatformRecord extends Backend
+{
+
+    protected $relationSearch = true;
+
+
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+//        $this->model = new \app\admin\model\third\Platform;
+        $this->model = new \app\common\model\VideoPlatformRecord;
+//        $this->model = model('platform');
+    }
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //设置过滤方法
+
+        $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();
+            if(input('vid')){
+                $map['video_platform_record.vid']= input('vid');
+            }
+            if(input('platform_id')){
+                $map['video_platform_record.platform_id']= input('platform_id');
+            }
+            $total = $this->model
+                ->where($where)
+                ->order($sort, $order)
+                ->count();
+            $list = $this->model
+                ->where($where)
+                ->order($sort, $order)
+                ->limit($offset, $limit)
+                ->select();
+            $result = array("total" => $total, "rows" => $list);
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+    /**
+     * 编辑
+     */
+    public function edit($ids = NULL)
+    {
+        $row = $this->model->get($ids);
+        if (!$row)
+            $this->error(__('No Results were found'));
+        return parent::edit($ids);
+    }
+//    public function add()
+//    {
+//        return parent::add();
+//    }
+
+}

+ 27 - 0
application/admin/view/platform/record/edit.html

@@ -0,0 +1,27 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+    <div class="form-group">
+        <label for="c-num" class="control-label col-xs-12 col-sm-2">{:__('收益')}:</label>
+        <div class="col-xs-12 col-sm-4">
+            <input id="c-num" data-rule="required" class="form-control" name="row[num]" type="text" value="{$row.num|htmlentities}">
+        </div>
+    </div>
+<!--    <div class="form-group">-->
+<!--        <label for="c-company" class="control-label col-xs-12 col-sm-2">{:__('所属公司')}:</label>-->
+<!--        <div class="col-xs-12 col-sm-4">-->
+<!--            <input id="c-company" data-rule="required" class="form-control" name="row[company]" type="text"  value="{$row.company|htmlentities}">-->
+<!--        </div>-->
+<!--    </div>-->
+<!--    <div class="form-group">-->
+<!--        <label for="c-url" class="control-label col-xs-12 col-sm-2">{:__('网址')}:</label>-->
+<!--        <div class="col-xs-12 col-sm-4">-->
+<!--            <input id="c-url" data-rule="required" class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}">-->
+<!--        </div>-->
+<!--    </div>-->
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 28 - 0
application/admin/view/platform/record/index.html

@@ -0,0 +1,28 @@
+<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">
+                        {:build_toolbar('refresh,add,edit,del')}
+                        <div class="dropdown btn-group {:$auth->check('platform/platform/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" 
+                           data-operate-edit="{:$auth->check('platform/platform/edit')}" 
+                           data-operate-del="{:$auth->check('platform/platform/del')}" 
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 53 - 0
public/assets/js/backend/platform/record.js

@@ -0,0 +1,53 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'platform/platform/index',
+                    // add_url: 'platform/platform/add',
+                    edit_url: 'platform/platform/edit',
+                    // del_url: 'platform/platform/del',
+                    // multi_url: 'platform/platform/multi',
+                    table: 'video_platform_record',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                // sortName: 'user.id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id'),align: 'left',align: 'left', sortable: true},
+                        {field: 'vid', title: __('短剧名称'), align: 'left',operate: 'LIKE'},
+                        {field: 'platform_id', title: __('平台名称'),align: 'left', operate: 'LIKE'},
+                        {field: 'num', title: __('收益'),align: 'left', operate: 'LIKE'},
+                        {field: 'createtime', title: __('时间'),align: 'left', formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        {field: 'operate', title: __('Operate'),align: 'left', table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            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;
+});