WIN-2308041133\Administrator 8 months ago
parent
commit
58fbd85cd0

+ 0 - 69
application/admin/controller/third/Platform.php

@@ -1,69 +0,0 @@
-<?php
-
-namespace app\admin\controller\third;
-
-use app\common\controller\Backend;
-
-class Platform extends Backend
-{
-    // 模型对象
-    protected $model = null;
-
-    public function _initialize()
-    {
-        parent::_initialize();
-        $this->model = new \app\admin\model\third\Platform;
-    }
-
-    // 列表页
-    public function index()
-    {
-        if ($this->request->isAjax()) {
-            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-            $total = $this->model
-                ->where($where)
-                ->order($sort, $order)
-                ->count();
-            $list = $this->model
-                ->where($where)
-                ->order($sort, $order)
-                ->limit($offset, $limit)
-                ->select();
-            $result = [
-                "total" => $total,
-                "rows" => $list,
-            ];
-            return json($result);
-        }
-        return $this->view->fetch();
-    }
-
-    // 添加/编辑
-    public function add()
-    {
-        if ($this->request->isPost()) {
-            $params = $this->request->post("row/a");
-            if ($params) {
-                $params['createtime'] = time(); // 自动填充时间戳
-                $result = $this->model->save($params);
-                if ($result) {
-                    $this->success();
-                } else {
-                    $this->error(__('Operation failed'));
-                }
-            }
-            $this->error(__('Parameter %s can not be empty', ''));
-        }
-        return $this->view->fetch();
-    }
-
-    // 删除
-    public function del($ids = "")
-    {
-        if ($ids) {
-            $this->model->destroy($ids);
-            $this->success();
-        }
-        $this->error(__('Parameter %s can not be empty', 'ids'));
-    }
-}

+ 0 - 22
application/admin/model/third/Platform.php

@@ -1,22 +0,0 @@
-<?php
-
-namespace app\admin\model\third;
-
-use think\Model;
-
-class Platform extends Model
-{
-    // 表名
-    protected $name = 'platform';
-
-    // 自动写入时间戳字段(createtime 为 int 类型)
-    protected $autoWriteTimestamp = 'int';
-    protected $createTime = 'createtime';
-    protected $updateTime = false;
-
-    // 字段格式化(将 createtime 转换为日期格式)
-    public function getCreatetimeAttr($value)
-    {
-        return date('Y-m-d H:i:s', $value);
-    }
-}

+ 0 - 22
application/admin/view/third/platform/add.html

@@ -1,22 +0,0 @@
-{extend name="../../layout/view.html" /}
-
-{block name="content"}
-<div class="panel panel-default">
-  <div class="panel-heading">添加平台</div>
-  <div class="panel-body">
-    <form class="form-horizontal" method="post">
-      <div class="form-group">
-        <label class="col-sm-2 control-label">平台名称</label>
-        <div class="col-sm-8">
-          <input type="text" name="row[name]" class="form-control" required>
-        </div>
-      </div>
-      <div class="form-group">
-        <div class="col-sm-8 col-sm-offset-2">
-          <button type="submit" class="btn btn-primary">提交</button>
-        </div>
-      </div>
-    </form>
-  </div>
-</div>
-{/block}

+ 0 - 34
application/admin/view/third/platform/edit.html

@@ -1,34 +0,0 @@
-<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-    <div class="form-group">
-        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('第三方平台名称')}:</label>
-        <div class="col-xs-12 col-sm-4">
-            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|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">-->
-<!--        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
-<!--        <div class="col-xs-12 col-sm-8">-->
-<!--            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}-->
-<!--        </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>

+ 0 - 37
application/admin/view/third/platform/index.html

@@ -1,37 +0,0 @@
-{extend name="../../layout/view.html" /}
-
-{block name="content"}
-<div class="panel panel-default">
-  <div class="panel-heading">
-    <span class="panel-title">第三方平台列表</span>
-    <div class="pull-right">
-      <a href="{:url('add')}" class="btn btn-primary btn-xs"><i class="fa fa-plus"></i> 添加</a>
-    </div>
-  </div>
-  <div class="panel-body">
-    <table id="bootstrap-table" class="table table-hover">
-      <thead>
-      <tr>
-        <th>ID</th>
-        <th>平台名称</th>
-        <th>创建时间</th>
-        <th>操作</th>
-      </tr>
-      </thead>
-      <tbody>
-      {volist name="list" id="vo"}
-      <tr>
-        <td>{$vo.id}</td>
-        <td>{$vo.name}</td>
-        <td>{$vo.createtime}</td>
-        <td>
-          <a href="{:url('edit', ['id' => $vo.id])}" class="btn btn-xs btn-warning"><i class="fa fa-edit"></i> 编辑</a>
-          <a href="javascript:;" data-url="{:url('del')}" data-id="{$vo.id}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-trash"></i> 删除</a>
-        </td>
-      </tr>
-      {/volist}
-      </tbody>
-    </table>
-  </div>
-</div>
-{/block}

+ 1 - 1
public/assets/js/backend/platform/platform.js

@@ -34,7 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         // {field: 'uid', title: __('使用人ID'),align: 'left', operate: 'LIKE'},
                         // {field: 'stime', title: __('使用时间'),align: 'left',formatter: Table.api.formatter.datetime, operate: 'LIKE'},
                         //
-                        {field: 'status', title: __('Status'),align: 'left',  formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
+                        // {field: 'status', title: __('Status'),align: 'left',  formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
                         {field: 'operate', title: __('Operate'),align: 'left', table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]