WIN-2308041133\Administrator 7 months ago
parent
commit
e80ce99057

+ 78 - 0
application/admin/controller/platform/VideoShare.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace app\admin\controller\platform;
+
+use app\common\controller\Backend;
+
+/**
+ * 第三方平台列表
+ *
+ */
+class VideoShare 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\VideoShare;
+//        $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_share.vid']= input('vid');
+            }
+            if(input('uid')){
+                $map['video_share.uid']= input('uid');
+            }
+            $total = $this->model
+                ->where($where)
+                ->order($sort, $order)
+                ->count();
+            $list = $this->model
+                ->where($where)
+                ->with('uid,videolist')
+                ->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/videoshare/index.html

@@ -0,0 +1,27 @@
+<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/videoshare/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-del="{:$auth->check('platform/videoshare/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 53 - 0
public/assets/js/backend/platform/videoshare.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/videoshare/index',
+                    // add_url: 'platform/videoshare/add',
+                    // edit_url: 'platform/videoshare/edit',
+                    del_url: 'platform/videoshare/del',
+                    // multi_url: 'platform/videoshare/multi',
+                    table: 'video_platform_videoshare',
+                }
+            });
+
+            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: 'vname', title: __('短剧名称'), align: 'left',operate: 'LIKE'},
+                        {field: 'pname', 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;
+});