WIN-2308041133\Administrator 5 hónapja
szülő
commit
e1ba058cd3

+ 66 - 0
application/admin/controller/wechat/LaveMonth.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace app\admin\controller\wechat;
+
+use app\common\controller\Backend;
+use app\admin\model\WechatResponse;
+
+/**
+ * 扣款服务签约列表
+ *
+ * @icon fa fa-circle-o
+ */
+class LaveMonth extends Backend
+{
+
+    protected $model = null;
+//    protected $noNeedRight = ['check_text_unique'];
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = model('LaveMonth');
+    }
+
+    /**
+     * 编辑
+     */
+    public function edit($ids = null)
+    {
+        $row = $this->model->get(['id' => $ids]);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if ($params) {
+                $row->save($params);
+                $this->success();
+            }
+            $this->error();
+        }
+        $this->view->assign("row", $row);
+        return $this->view->fetch();
+    }
+//
+//    /**
+//     * 判断价格是否唯一
+//     * @internal
+//     */
+//    public function check_text_unique()
+//    {
+//        $row = $this->request->post("row/a");
+//        $except = $this->request->post("except");
+//        $text = isset($row['price']) ? $row['price'] : '';
+//        if ($this->model->where('price', $text)->where(function ($query) use ($except) {
+//                if ($except) {
+//                    $query->where('price', '<>', $except);
+//                }
+//            })->count() == 0) {
+//            $this->success();
+//        } else {
+//            $this->error(__('Text already exists'));
+//        }
+//    }
+
+}

+ 33 - 0
application/admin/view/wechat/lave_month/index.html

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

+ 1 - 1
application/admin/view/wechat/plan_record/index.html

@@ -12,7 +12,7 @@
 <!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('wechat/plan_record/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
 <!--                        <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('wechat/plan_record/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('wechat/plan_record/multi')?'':'hide'}">
+                        <div class="dropdown btn-group {:$auth->check('wechat/lave_month/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>

+ 86 - 0
public/assets/js/backend/wechat/lave_month.js

@@ -0,0 +1,86 @@
+define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'wechat/lave_month/index',
+                    // add_url: 'wechat/lave_month/add',
+                    // edit_url: 'wechat/lave_month/edit',
+                    // del_url: 'wechat/lave_month/del',
+                    multi_url: 'wechat/lave_month/multi',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                sortName: 'id',
+                columns: [
+                    [
+                        {field: 'id', title: __('Id')},
+                        {field: 'cid', title: __('Cid')},
+                        {field: 'user_id', title: __('User_id')},
+                        {field: 'order_id', title: __('Order_id'), operate: 'LIKE'},
+                        {field: 'order_name', title: __('Order_name'), operate: 'LIKE'},
+                        {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {field: 'contact', title: __('Contact'), operate: 'LIKE'},
+                        {field: 'tel', title: __('Tel'), operate: 'LIKE'},
+                        {field: 'address', title: __('Address'), operate: 'LIKE'},
+                        {field: 'is_open', title: __('Is_open'), searchList: {"0":__('Is_open 0'),"1":__('Is_open 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_ticket', title: __('Is_ticket'), searchList: {"0":__('Is_ticket 0'),"1":__('Is_ticket 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'paid', title: __('Paid'), searchList: {"0":__('Paid 0'),"1":__('Paid 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'pay_type', title: __('Pay_type'), searchList: {"0":__('Pay_type 0'),"1":__('Pay_type 1'),"2":__('Pay_type 2'),"3":__('Pay_type 3'),"4":__('Pay_type 4')}, formatter: Table.api.formatter.normal},
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'SN', title: __('Sn'), operate: 'LIKE'},
+                        {field: 'type', title: __('Type'), searchList: {"0":__('Type 0'),"1":__('Type 1')}, formatter: Table.api.formatter.normal},
+                        {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]"));
+
+                // var refreshkey = function (data) {
+                //     $("input[name='row[price]']").val(data.eventkey).trigger("change");
+                //     Layer.closeAll();
+                //     var keytitle = data.text;
+                //     var cont = $(".clickbox .create-click:first");
+                //     $(".keytitle", cont).remove();
+                //     if (keytitle) {
+                //         cont.append('<div class="keytitle">' + __('Event key') + ':' + keytitle + '</div>');
+                //     }
+                // };
+                // $(document).on('click', "#select-resources", function () {
+                //     var key = $("input[name='row[eventkey]']").val();
+                //     parent.Backend.api.open($(this).attr("href") + "?key=" + key, __('Select'), {callback: refreshkey});
+                //     return false;
+                // });
+                //
+                // $(document).on('click', "#add-resources", function () {
+                //     parent.Backend.api.open($(this).attr("href") + "?key=", __('Add'), {callback: refreshkey});
+                //     return false;
+                // });
+            }
+        }
+
+    };
+    return Controller;
+});