chenhao 4 lat temu
rodzic
commit
5242664ae7

+ 163 - 0
application/admin/controller/Userweixiu.php

@@ -0,0 +1,163 @@
+<?php
+
+namespace app\admin\controller;
+
+use library\Controller;
+use library\tools\Data;
+use think\Db;
+
+/**
+ * 维修和报备
+ * Class Userimage
+ * @package app\admin\controller
+ */
+class Userweixiu extends Controller
+{
+
+    /**
+     * 指定当前数据表
+     * @var string
+     */
+    public $table = 'user_weixiu_baobei';
+
+    /**
+     * 系统用户管理
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function index()
+    {
+        $id = $this->request->get('id');
+        $type = $this->request->get('type');
+        $this->uid=$id;
+        $where['uid'] = $id;
+        $where['type'] = $type;
+        $this->title = '维修与报备';
+        $query = $this->_query($this->table)->where($where)->like('name,phone,status');
+        $query->dateBetween('login_at,create_at')->where($where)->order('id desc')->page();
+
+
+    }
+    /**
+     * 数据列表处理
+     */
+    protected function _index_page_filter(&$data)
+    {
+//        foreach ($data as &$v) {
+//            $v['images'] = explode('|',$v['image']);
+//        }
+
+    }
+    /**
+     * 添加系统用户
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function add()
+    {
+        $this->applyCsrfToken();
+        $this->_form($this->table, 'form');
+    }
+
+    /**
+     * 编辑系统用户
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function edit()
+    {
+
+
+        $this->applyCsrfToken();
+
+        $this->_form($this->table, 'form');
+
+
+    }
+    /**
+     * 表单数据处理
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function _form_filter(&$data)
+    {
+        $uid = $this->request->get('uid');
+        if (isset($uid))  $data['uid'] = $uid;
+
+        if ($this->request->isPost()) {
+
+            if (empty($data['create_time'])) $data['create_time'] = date('Y-m-d H:i:s',time());
+//            // 用户权限处理
+//            $data['authorize'] = (isset($data['authorize']) && is_array($data['authorize'])) ? join(',', $data['authorize']) : '';
+//            // 用户账号重复检查
+//            if (isset($data['id'])) unset($data['username']);
+//            elseif (Db::name($this->table)->where(['username' => $data['username'], 'is_deleted' => '0'])->count() > 0) {
+//                $this->error("账号{$data['username']}已经存在,请使用其它账号!");
+//            }
+        } else {
+            $data['authorize'] = explode(',', isset($data['authorize']) ? $data['authorize'] : '');
+            $this->authorizes = Db::name('SystemAuth')->where(['status' => '1'])->order('sort desc,id desc')->select();
+        }
+    }
+
+    /**
+     * 禁用系统用户
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function forbid()
+    {
+
+        if (in_array('10000', explode(',', $this->request->post('id')))) {
+            $this->error('系统超级账号禁止操作!');
+        }
+        $this->applyCsrfToken();
+        $this->_save($this->table, ['status' => '2']);
+    }
+
+    /**
+     * 启用系统用户
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function resume()
+    {
+        $data = $this->request->get();
+        $this->applyCsrfToken();
+        $this->_save($this->table, ['status' => '1']);
+    }
+
+    /**
+     * 删除系统用户
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function remove()
+    {
+        if (in_array('10000', explode(',', $this->request->post('id')))) {
+            $this->error('系统超级账号禁止删除!');
+        }
+        $this->applyCsrfToken();
+        $this->_delete($this->table);
+    }
+
+}
+

+ 2 - 1
application/admin/view/index/index.html

@@ -26,7 +26,8 @@
     <!-- 顶部菜单 开始 -->
     <div class="layui-header notselect">
         <a href="{:url('@')}" class="layui-logo layui-elip">
-            {:sysconf('app_name')} {if sysconf('app_version')}<sup class="padding-left-5">{:sysconf('app_version')}</sup>{/if}
+<!--            {:sysconf('app_name')} {if sysconf('app_version')}<sup class="padding-left-5">{:sysconf('app_version')}</sup>{/if}-->
+            德高后台<sup class="padding-left-5">{:sysconf('app_version')}</sup>
         </a>
         <ul class="layui-nav layui-layout-left">
             <li class="layui-nav-item" lay-unselect>

+ 44 - 0
application/admin/view/userweixiu/form.html

@@ -0,0 +1,44 @@
+<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
+    <div class="layui-card-body padding-left-40">
+
+            <div class="layui-form-item">
+                <label class="relative block">
+                    <span class="color-green font-w7">姓名</span>
+
+                    <input type="text" maxlength="20" autocomplete="off" autofocus name="name" value='{$vo.name|default=""}'  placeholder="" class="layui-input">
+                </label>
+
+            </div>
+            <div class="layui-form-item">
+                <label class="relative block">
+                    <span class="color-green font-w7">手机号</span>
+                    <input type="tel" maxlength="11" autocomplete="off" autofocus name="phone" value='{$vo.phone|default=""}'  placeholder="" class="layui-input">
+                </label>
+            </div>
+            <div class="layui-form-item">
+                <label class="relative block">
+                    <span class="color-green font-w7">地址</span>
+                    <input type="text"  autocomplete="off" autofocus name="address" value='{$vo.address|default=""}'  placeholder="" class="layui-input">
+                </label>
+            </div>
+            <div class="layui-form-item">
+                <label class="relative block">
+                    <span class="color-green font-w7">详细地址</span>
+                    <input type="text" autocomplete="off" autofocus name="address_info" value='{$vo.address_info|default=""}'  placeholder="" class="layui-input">
+                </label>
+            </div>
+        </div>
+
+
+<!--    </div>-->
+    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+   <input type='hidden' value='{$vo.uid}' name='uid'>
+    {notempty name='vo.create_time'}<input type='hidden' value='{$vo.create_time|default=""}' name='create_time'>{/notempty}
+
+    <div class="layui-form-item text-center">
+        <button class="layui-btn" type='submit'>提交</button>
+<!--        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>-->
+    </div>
+
+</form>
+

+ 80 - 0
application/admin/view/userweixiu/index.html

@@ -0,0 +1,80 @@
+{extend name='main'}
+
+{block name="button"}
+
+<!--{if auth("add")}-->
+<!--<button data-modal='{:url("add")}?uid={$uid}' data-title="添加用户" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>-->
+<!--{/if}-->
+
+<!--{if auth("remove")}-->
+<!--<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些用户吗?" class='layui-btn layui-btn-sm layui-btn-primary'>删除用户</button>-->
+<!--{/if}-->
+
+{/block}
+
+{block name="content"}
+<div class="think-box-shadow">
+    {include file='userweixiu/index_search'}
+    <table class="layui-table margin-top-10" lay-skin="line">
+        {notempty name='list'}
+        <thead>
+        <tr>
+            <th class='list-table-check-td think-checkbox'>
+                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
+            </th>
+            <th class='text-left nowrap'>编号</th>
+            <th class='text-left nowrap'>姓名</th>
+            <th class='text-left nowrap'>手机号</th>
+            <th class='text-left nowrap'>地址</th>
+            <th class='text-left nowrap'>详细地址</th>
+            <th class='text-left nowrap'>预约时间</th>
+            <th class='text-left nowrap'>状态</th>
+
+<!--            <th class='text-left nowrap'>状态</th>-->
+            <th class='text-left nowrap'></th>
+        </tr>
+        </thead>
+        {/notempty}
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr data-dbclick>
+            <td class='list-table-check-td think-checkbox'>
+                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
+            </td>
+            <td class='text-left nowrap'>{$vo.number}</td>
+            <td class='text-left nowrap'>{$vo.name}</td>
+            <td class='text-left nowrap'>{$vo.phone}</td>
+            <td class='text-left nowrap'>{$vo.address}</td>
+            <td class='text-left nowrap'>{$vo.address_info}</td>
+            <td class='text-left nowrap'>{$vo.create_time}</td>
+
+            <td class='text-left nowrap'>{eq name='vo.status' value='1'}<span class="color-red">未完成</span>{else}<span class="color-green">已完成</span>{/eq}</td>
+
+            <td class='text-left nowrap'>
+                <a data-dbclick class="layui-btn layui-btn-sm" data-title="修改" data-modal='{:url("edit")}?id={$vo.id}&type=2'>修改</a>
+
+<!--                {if auth("pass")}-->
+<!--                <a class="layui-btn layui-btn-normal layui-btn-sm" data-title="施工照片" data-modal='{:url("pass")}?id={$vo.id}'>施工照片</a>-->
+<!--                {/if}-->
+<!--                <a class="layui-btn layui-btn-normal layui-btn-sm" data-title="施工照片管理" data-modal='{:url("pass")}?id={$vo.id}'>施工照片管理</a>-->
+                {if $vo.status eq 1 and auth("forbid")}
+                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#2" data-csrf="{:systoken('forbid')}">设为已完成</a>
+                {elseif $vo.status eq 2 and auth("resume")}
+                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('resume')}">设为未完成</a>
+                {/if}
+
+                {if auth("remove")}
+                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该用户吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
+                {/if}
+
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+
+</div>
+
+{/block}

+ 57 - 0
application/admin/view/userweixiu/index_search.html

@@ -0,0 +1,57 @@
+<fieldset>
+
+    <legend>条件搜索</legend>
+
+    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
+
+        <div class="layui-form-item layui-inline">
+            <label class="layui-form-label">用户账号</label>
+            <div class="layui-input-inline">
+                <input name="name" value="" placeholder="请输入用户名" class="layui-input">
+            </div>
+        </div>
+
+        <div class="layui-form-item layui-inline">
+            <label class="layui-form-label">联系手机</label>
+            <div class="layui-input-inline">
+                <input name="phone" value="" placeholder="请输入联系手机" class="layui-input">
+            </div>
+        </div>
+
+<!--        <div class="layui-form-item layui-inline">-->
+<!--            <label class="layui-form-label">联系邮箱</label>-->
+<!--            <div class="layui-input-inline">-->
+<!--                <input name="mail" value="{$Think.get.mail|default=''}" placeholder="请输入联系邮箱" class="layui-input">-->
+<!--            </div>-->
+<!--        </div>-->
+
+        <div class="layui-form-item layui-inline">
+            <label class="layui-form-label">使用状态</label>
+            <div class="layui-input-inline">
+                <select class="layui-select" name="status">
+                    {foreach [''=>'-- 全部状态 --','1'=>'未完成','2'=>'已完成'] as $k=>$v}
+                    {eq name='Think.get.status' value='$k.""'}
+                    <option selected value="{$k}">{$v}</option>
+                    {else}
+                    <option value="{$k}">{$v}</option>
+                    {/eq}
+                    {/foreach}
+                </select>
+            </div>
+        </div>
+
+<!--        <div class="layui-form-item layui-inline">-->
+<!--            <label class="layui-form-label">登录时间</label>-->
+<!--            <div class="layui-input-inline">-->
+<!--                <input data-date-range name="login_at" value="{$Think.get.login_at|default=''}" placeholder="请选择登录时间" class="layui-input">-->
+<!--            </div>-->
+<!--        </div>-->
+
+        <div class="layui-form-item layui-inline">
+            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+        </div>
+    </form>
+
+</fieldset>
+
+<script>form.render()</script>

+ 33 - 0
application/admin/view/userweixiu/pass.html

@@ -0,0 +1,33 @@
+<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
+
+    <div class="layui-card-body padding-left-40">
+        <div class="layui-form-item">
+            <span class="color-green label-required-prev">视频及施工图片</span>
+
+            <table class="layui-table">
+                <thead>
+                <tr>
+                    <th class="text-center">视频</th>
+                    <th class="text-left">施工图片</th>
+                </tr>
+                <tr>
+                    <td width="90px" class="text-center"><input name="logo" type="hidden" value="{$vo.logo|default=''}"></td>
+                    <td width="auto" class="text-left"><input name="image" type="hidden" value="{$vo.image|default=''}"></td>
+                </tr>
+                </thead>
+            </table>
+
+            <script>$('[name="logo"]').uploadOneVideo(), $('[name="image"]').uploadMultipleImage()</script>
+        </div>
+
+    </div>
+
+    <div class="hr-line-dashed"></div>
+    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+
+    <div class="layui-form-item text-center">
+        <button class="layui-btn" type='submit'>保存数据</button>
+<!--        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>-->
+    </div>
+
+</form>

+ 9 - 3
application/admin/view/uuser/index.html

@@ -6,9 +6,9 @@
 <!--<button data-modal='{:url("add")}' data-title="添加用户" class='layui-btn layui-btn-sm layui-btn-primary'>添加用户</button>-->
 <!--{/if}-->
 
-{if auth("remove")}
-<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些用户吗?" class='layui-btn layui-btn-sm layui-btn-primary'>删除用户</button>
-{/if}
+<!--{if auth("remove")}-->
+<!--<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些用户吗?" class='layui-btn layui-btn-sm layui-btn-primary'>删除用户</button>-->
+<!--{/if}-->
 
 {/block}
 
@@ -72,6 +72,12 @@
                 {eq name='vo.levels' value='0'}
                 <a data-dbclick class="layui-btn layui-btn-normal layui-btn-sm" data-open='{:url("userfeedback/index")}?id={$vo.id}'>跟进反馈</a>
                 {/eq}
+                {eq name='vo.levels' value='0'}
+                <a data-dbclick class="layui-btn layui-btn-normal layui-btn-sm" data-open='{:url("userweixiu/index")}?id={$vo.id}&type=1'>维修</a>
+                {/eq}
+                {eq name='vo.levels' value='0'}
+                <a data-dbclick class="layui-btn layui-btn-normal layui-btn-sm" data-open='{:url("userweixiu/index")}?id={$vo.id}&type=2'>报备</a>
+                {/eq}
 <!--                {eq name='vo.levels' value='0'}-->
 <!--                <a data-dbclick class="layui-btn layui-btn-normal layui-btn-sm" data-open='{:url("userorder/index")}?id={$vo.id}'>服务订单</a>-->
 <!--                {/eq}-->