xxxrrrdddd 2 年之前
父節點
當前提交
17fb821b7f

+ 74 - 0
application/admin/controller/MobileAnchor.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 主播
+ *
+ * @icon fa fa-circle-o
+ */
+class MobileAnchor extends Backend
+{
+    
+    /**
+     * MobileAnchor模型对象
+     * @var \app\admin\model\MobileAnchor
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\MobileAnchor;
+
+    }
+
+    public function import()
+    {
+        parent::import();
+    }
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+    
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = false;
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+            $list = $this->model
+                    
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->paginate($limit);
+
+            foreach ($list as $row) {
+                $row->visible(['id','name','create_time']);
+                
+            }
+
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+}

+ 7 - 0
application/admin/lang/zh-cn/mobile_anchor.php

@@ -0,0 +1,7 @@
+<?php
+
+return [
+    'Id'          => 'ID',
+    'Name'        => '主播名称',
+    'Create_time' => '创建时间'
+];

+ 11 - 0
application/admin/model/MobileAnchor.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class MobileAnchor extends Model
+{
+    protected $autoWriteTimestamp=true;
+}

+ 9 - 1
application/admin/model/MobileOrder.php

@@ -3,6 +3,9 @@
 namespace app\admin\model;
 
 use think\Model;
+use think\model\relation\BelongsTo;
+use think\model\relation\HasMany;
+use think\model\relation\HasOne;
 
 
 class MobileOrder extends \app\common\model\MobileOrder
@@ -16,8 +19,13 @@ class MobileOrder extends \app\common\model\MobileOrder
         return $arr[$no];
     }
 
-    public function subRemark(): \think\model\relation\HasMany
+    public function subRemark(): HasMany
     {
         return $this->hasMany(MobileOrderSubRemark::class)->order('mobile_order_sub_remark.mobile_order_sub_remark_id','desc');
     }
+
+    public function anchor(): BelongsTo
+    {
+        return $this->belongsTo(MobileAnchor::class)->setEagerlyType(0);
+    }
 }

+ 27 - 0
application/admin/validate/MobileAnchor.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class MobileAnchor extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 16 - 0
application/admin/view/mobile_anchor/add.html

@@ -0,0 +1,16 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" class="form-control" name="row[name]" type="text">
+        </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>

+ 16 - 0
application/admin/view/mobile_anchor/edit.html

@@ -0,0 +1,16 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|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>

+ 35 - 0
application/admin/view/mobile_anchor/index.html

@@ -0,0 +1,35 @@
+<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('mobile_anchor/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('mobile_anchor/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('mobile_anchor/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('mobile_anchor/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('mobile_anchor/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('mobile_anchor/edit')}" 
+                           data-operate-del="{:$auth->check('mobile_anchor/del')}" 
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 14 - 0
application/admin/view/mobile_order/index.html

@@ -41,3 +41,17 @@
     let admins ={:json_encode($admins)};
     let adminInfo = {$adminInfo|json_encode};
 </script>
+<script id="anchor-search" type="text/html">
+    <div class="row">
+        <div class="col-xs-12">
+            <input type="hidden" class="operate" data-name="mobile_anchor_id" value="=" />
+            <input
+                    id="c-anchor"
+                    data-field="name"
+                    data-source="mobile_anchor/index"
+                    class="form-control selectpage"
+                    name="mobile_anchor_id"
+                    type="text">
+        </div>
+    </div>
+</script>

+ 23 - 4
database/lh_hdlkeji_com.sql

@@ -10,7 +10,7 @@ Target Server Type    : MYSQL
 Target Server Version : 50650
 File Encoding         : 65001
 
-Date: 2022-06-27 10:19:34
+Date: 2022-06-27 13:35:45
 */
 
 SET FOREIGN_KEY_CHECKS=0;
@@ -79,7 +79,7 @@ CREATE TABLE `admin` (
 -- ----------------------------
 -- Records of admin
 -- ----------------------------
-INSERT INTO `admin` VALUES ('1', 'admin', '15812345678', 'Admin', '', 'a2085c845d0f62d9c162da19bfec34e4', 'f63352', 'http://lh.hdlkeji.com/uploads/20220514/54a53f46cf005f3b32f4271fbcf89493.jpg', 'admin@admin.com', '0', '1656294251', '127.0.0.1', '1491635035', '1656294251', '1ad626be-c5d3-43f3-a696-4c37533699bf', 'normal', '0', '0', null, null, null);
+INSERT INTO `admin` VALUES ('1', 'admin', '15812345678', 'Admin', '', 'a2085c845d0f62d9c162da19bfec34e4', 'f63352', 'http://lh.hdlkeji.com/uploads/20220514/54a53f46cf005f3b32f4271fbcf89493.jpg', 'admin@admin.com', '0', '1656305561', '113.109.204.97', '1491635035', '1656305561', '4b2581b5-83cd-4a1f-99ca-a0a495797b6e', 'normal', '0', '0', null, null, null);
 INSERT INTO `admin` VALUES ('2', 'aaa', null, 'aaa', '', 'b2de4acbc049fbfecf7839ac23aa7d7e', 'X2Lh57', '/assets/img/avatar.png', 'aaa@aaa.com', '0', null, null, '1649225764', '1649226368', '', 'normal', '0', '0', null, null, null);
 INSERT INTO `admin` VALUES ('4', 'chinamobile', null, '中国移动', '', '2a10c7dd398a6870cdf4d64db649d141', 'LtEBQW', '/assets/img/avatar.png', '', '0', null, null, '1649294102', '1649389357', '', 'normal', '1', '0', '中国移动', '13652225555', 'https://beauti-no.a.com/uploads/20220407/8ea3fa5b1b733b97e248ea13604842cc.jpg');
 INSERT INTO `admin` VALUES ('5', 'meimei', null, '美美靓号', '', 'fa52906a6eeae796639da123e9dcf27d', 'h2Iwmb', '/assets/img/avatar.png', '', '0', null, null, '1649484442', '1649484442', '', 'normal', '1', '0', '美美靓号', '13525555555', 'https://beauti-no.a.com/uploads/20220407/8ea3fa5b1b733b97e248ea13604842cc.jpg');
@@ -112,7 +112,7 @@ CREATE TABLE `admin_log` (
   `createtime` int(10) DEFAULT NULL COMMENT '操作时间',
   PRIMARY KEY (`id`),
   KEY `name` (`username`)
-) ENGINE=InnoDB AUTO_INCREMENT=4072 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='管理员日志表';
+) ENGINE=InnoDB AUTO_INCREMENT=4075 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='管理员日志表';
 
 -- ----------------------------
 -- Records of admin_log
@@ -4126,6 +4126,9 @@ INSERT INTO `admin_log` VALUES ('4068', '1', 'admin', '/admin.php/auth/group/rol
 INSERT INTO `admin_log` VALUES ('4069', '1', 'admin', '/admin.php/auth/group/edit/ids/3?dialog=1', '权限管理 / 角色组 / 编辑', '{\"dialog\":\"1\",\"__token__\":\"***\",\"row\":{\"rules\":\"373,294,296,300,301,302,303,399,412,413,414,415,416,417,386,310,311,312,313,314,315,340,381,396,418,391,318,419,68,69,70,71,72,291,261,104,105,106,107,108,109,309,67,259,66,103,371,292,299,338,389,316,370,354,95\",\"pid\":\"1\",\"name\":\"代理商\",\"status\":\"normal\"},\"ids\":\"3\"}', '127.0.0.1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53', '1656295918');
 INSERT INTO `admin_log` VALUES ('4070', '1', 'admin', '/admin.php/auth/rule/edit/ids/356?dialog=1', '权限管理 / 菜单规则 / 编辑', '{\"dialog\":\"1\",\"__token__\":\"***\",\"row\":{\"ismenu\":\"0\",\"pid\":\"354\",\"name\":\"mobile_order_flow\\/add_operation\",\"title\":\"主站添加备注\",\"url\":\"\",\"icon\":\"fa fa-circle-o\",\"weigh\":\"0\",\"condition\":\"\",\"menutype\":\"addtabs\",\"extend\":\"\",\"remark\":\"\",\"status\":\"normal\"},\"ids\":\"356\"}', '127.0.0.1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53', '1656295942');
 INSERT INTO `admin_log` VALUES ('4071', '1', 'admin', '/admin.php/auth/group/roletree', '权限管理 / 角色组', '{\"id\":\"3\",\"pid\":\"1\"}', '127.0.0.1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53', '1656295949');
+INSERT INTO `admin_log` VALUES ('4072', '1', 'admin', '/admin.php/index/login', '登录', '{\"__token__\":\"***\",\"username\":\"admin\",\"password\":\"***\",\"captcha_sms\":\"1111\"}', '112.228.183.205', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53', '1656301909');
+INSERT INTO `admin_log` VALUES ('4073', '1', 'admin', '/admin.php/general.config/edit', '常规管理 / 系统配置 / 编辑', '{\"__token__\":\"***\",\"row\":{\"system_wxp_name\":\"美美靓号\",\"system_service_mobile\":\"13855550808\",\"system_wxp_qrcode\":\"http:\\/\\/lh.hdlkeji.com\\/uploads\\/20220426\\/7e3b11d217bc705a79218cde4bf84e26.png\",\"service_work_time\":\"09:30-19:00\",\"system_sms_open\":\"0\",\"disable_send_province\":\"3206,2670,2816\",\"system_index_tr\":\"2\",\"system_index_m1\":\"1\",\"system_service_mobile_show\":\"1\",\"system_id_form_open\":\"1\"}}', '112.228.183.205', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53', '1656301926');
+INSERT INTO `admin_log` VALUES ('4074', '1', 'admin', '/admin.php/index/login', '登录', '{\"__token__\":\"***\",\"username\":\"admin\",\"password\":\"***\",\"captcha_sms\":\"1111\"}', '113.109.204.97', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 HBPC/12.0.0.300', '1656305561');
 
 -- ----------------------------
 -- Table structure for ad_index_ordered_flow
@@ -8626,7 +8629,7 @@ INSERT INTO `config` VALUES ('44', 'system_index_tr', 'config', '首页右上角
 INSERT INTO `config` VALUES ('45', 'system_index_m1', 'config', '首页特价号展示', '', 'radio', '1', '{\"1\":\"流量卡\",\"2\":\"号码定制\"}', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
 INSERT INTO `config` VALUES ('46', 'system_service_mobile_show', 'config', '是否展示客服电话', '', 'switch', '1', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
 INSERT INTO `config` VALUES ('47', 'proxy_auth_group_id', 'user', '供应商默认角色组ID', '', 'number', '2', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
-INSERT INTO `config` VALUES ('48', 'system_id_form_open', 'config', '身份证开关', '', 'switch', '0', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
+INSERT INTO `config` VALUES ('48', 'system_id_form_open', 'config', '身份证开关', '', 'switch', '1', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
 INSERT INTO `config` VALUES ('49', 'kd_bird_userId', 'kd_bird', '用户ID', '', 'string', '1765002', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
 INSERT INTO `config` VALUES ('50', 'kd_bird_apiKey', 'kd_bird', '密钥', '', 'string', '020f21f6-e063-431b-8515-d3e40127c61a', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
 INSERT INTO `config` VALUES ('52', 'flow_main_logo', 'flow_config', '上方图片', '上方图片', 'image', 'http://lh.hdlkeji.com/uploads/20220621/4144e10715a590dd3742bd907f920d34.png', '', '', '', '{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}');
@@ -9383,6 +9386,22 @@ INSERT INTO `mobile` VALUES ('1852', '3', null, null, '中国移动', '199005588
 INSERT INTO `mobile` VALUES ('1853', '3', null, null, '中国移动', '17878787878', '1', '中国移动', '25', '1965', '广州', '1964', '广东', '0.00', '10800000.00', '10800000.00', '0.00', '0.00', '0.00', '10800000.00', '1656137979', '1656137979', '0', '0', null, '0', null, null, '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '1', '0', '0', '0', '0', '0', '5', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '7', '8', '7', '8', '7', '8', '7', '8', '7', '8', '1859', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '', '', '0', '0', '22', '0', '0', '');
 
 -- ----------------------------
+-- Table structure for mobile_anchor
+-- ----------------------------
+DROP TABLE IF EXISTS `mobile_anchor`;
+CREATE TABLE `mobile_anchor` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
+  `name` char(30) DEFAULT NULL COMMENT '主播名称',
+  `create_time` bigint(20) unsigned DEFAULT NULL COMMENT '创建时间',
+  `update_time` bigint(20) unsigned DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主播';
+
+-- ----------------------------
+-- Records of mobile_anchor
+-- ----------------------------
+
+-- ----------------------------
 -- Table structure for mobile_hold_log
 -- ----------------------------
 DROP TABLE IF EXISTS `mobile_hold_log`;

+ 52 - 0
public/assets/js/backend/mobile_anchor.js

@@ -0,0 +1,52 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'mobile_anchor/index' + location.search,
+                    add_url: 'mobile_anchor/add',
+                    edit_url: 'mobile_anchor/edit',
+                    del_url: 'mobile_anchor/del',
+                    multi_url: 'mobile_anchor/multi',
+                    import_url: 'mobile_anchor/import',
+                    table: 'mobile_anchor',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'name', title: __('Name')},
+                        {field: 'create_time', title: __('Create_time'),formatter: Table.api.formatter.datetime,addClass:'datetimerange',operate:'range'},
+                        {field: 'operate', title: __('Operate'), 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;
+});

+ 1 - 3
public/assets/js/backend/mobile_order.js

@@ -92,9 +92,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','clipboard'],
                         return `<div style="max-width: 200px;text-align: left;" class="break-words">${a.join('')}</div>`
                     },width:200,valign:'top',align:'left'},
                 {field: 'status', title: __('Status'),formatter: Table.api.formatter.label,searchList:status},
+                {field: 'anchor.name', title: __('主播名称'),formatter: Table.api.formatter.label,searchList(){return Template('anchor-search',{});}},
                 {field: 'rules.rule', title: __('规律'),visible: false,searchList:mobileRules},
-                {field: 'remark_backend', title: __('主站备注'),formatter: Table.api.formatter.content,operate:"like",align: 'left',valign: 'top'},
-                //{field: 'remark_sub', title: __('分站备注'),formatter: Table.api.formatter.content,operate:false},
                 {field: '', title: __('退款记录'),formatter(_,order){
                         let a=[]
                         order.refund_log.forEach(item=>{
@@ -219,7 +218,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','clipboard'],
             if(!adminInfo.is_manager){
                 Table.api.removeColumn('operation_log',columns)
             }
-            Table.api.removeColumn('remark_backend',columns)
 
 
             // 初始化表格