wupengfei 2 年之前
父节点
当前提交
9a07be4ef5

+ 10 - 6
.idea/workspace.xml

@@ -2,8 +2,12 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/index.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/index_search.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -122,7 +126,7 @@
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/common/model" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/operate/view/supplier_goods" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -133,11 +137,11 @@
   </component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\application\common\model" />
+      <recent name="D:\zs\gaoyixia\application\operate\view\supplier_goods" />
+      <recent name="D:\zs\gaoyixia\application\operate\view" />
       <recent name="D:\zs\gaoyixia\application\operate\controller" />
+      <recent name="D:\zs\gaoyixia\application\common\model" />
       <recent name="D:\zs\gaoyixia\application\api\controller" />
-      <recent name="D:\zs\gaoyixia\application\operate\view" />
-      <recent name="D:\zs\gaoyixia\application\operate\view\activity" />
     </key>
   </component>
   <component name="SvnConfiguration">
@@ -209,7 +213,7 @@
       <workItem from="1663289320226" duration="8186000" />
       <workItem from="1663374115380" duration="19161000" />
       <workItem from="1663548946176" duration="17651000" />
-      <workItem from="1663721089544" duration="6068000" />
+      <workItem from="1663721089544" duration="7241000" />
     </task>
     <servers />
   </component>

+ 134 - 0
application/operate/controller/SupplierGoods.php

@@ -0,0 +1,134 @@
+<?php
+namespace app\operate\controller;
+use library\Controller;
+use think\Db;
+
+/**
+ * 供货商商品
+ * Class SupplierGoods
+ * @package app\mall\controller
+ */
+class SupplierGoods extends Controller
+{
+
+    /**
+     * 绑定数据表
+     * @var string
+     */
+    protected $table = 'SupplierGoods';
+
+    /**
+     * 供货商商品列表
+     * @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()
+    {
+        $this->title = '供货商商品列表';
+        $supplier_id = input('get.id');
+        $this->supplier_id = $supplier_id;
+        $query = $this->_query($this->table)->where('is_deleted',0)->where('supplier_id',$supplier_id);
+        $query->like('name');
+        if(input('place')) $query->where('place',input('place'));
+        $query->order(' sort desc , id desc')->page();
+    }
+
+    /**
+     * 数据列表处理
+     * @auth true
+     * @menu true
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    protected function _index_page_filter(&$data)
+    {
+
+    }
+
+
+
+
+
+
+
+    /**
+     * 添加供货商商品
+     * @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 add()
+    {
+        $this->title = '添加供货商商品';
+        $this->_form($this->table, 'form');
+    }
+
+
+    /**
+     * 编辑供货商商品
+     * @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 edit()
+    {
+        $this->place_desc =['','视频首页'];
+        $this->title = '编辑供货商商品';
+        $this->supplier_id = input('supplier_id');
+        $this->_form($this->table, 'form');
+    }
+
+
+
+    /**
+     * 启用
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function enable()
+    {
+        $this->_save($this->table, ['status' => 1]);
+    }
+
+    /**
+     * 删除
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function del()
+    {
+        $this->_save($this->table, ['is_deleted' => 1]);
+    }
+
+
+    /**
+     * 表单数据处理
+     * @auth true
+     * @menu true
+     * @param array $data
+     */
+    protected function _form_filter(&$data)
+    {
+        $data['create_at'] = date('Y-m-d H:i:s');
+    }
+
+}

+ 1 - 0
application/operate/view/supplier/index.html

@@ -29,6 +29,7 @@
             <td class='text-left'>{$vo.create_at|default='--'}</td>
             <td class='text-left' style="width: 20%">
                 <a data-title="编辑" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
+                <a data-title="商品管理" class="layui-btn layui-btn-sm" data-open='{:url("/operate/supplier_goods/index")}?id={$vo.id}'>编 辑</a>
                 <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
             </td>
         </tr>

+ 39 - 0
application/operate/view/supplier_goods/form.html

@@ -0,0 +1,39 @@
+<style>
+</style>
+<div class="think-box-shadow">
+    <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
+        <div class="layui-card-body">
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">名称</label>
+                <div class="layui-input-block">
+                    <input name="name" maxlength="50"  value='{$vo.name|default=""}' placeholder="请输入名称" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">封面</label>
+                <div class="layui-input-block">
+                    <input name="cover" type="hidden" value="{$vo.cover|default=''}">
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">排序</label>
+                <div class="layui-input-block">
+                    <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
+                </div>
+            </div>
+            {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+            <input type='hidden' value='{$supplier_id|default="0"}' name='supplier_id'>
+            <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>
+        </div>
+    </form>
+    <script>
+        window.form.render();
+        $('[name="cover"]').uploadOneImage();
+    </script>
+</div>

+ 65 - 0
application/operate/view/supplier_goods/index.html

@@ -0,0 +1,65 @@
+{extend name='admin@main'}
+
+{block name="button"}
+<button data-modal='{:url("add")}?supplier_id={$supplier_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
+{/block}
+
+{block name="content"}
+<div class="think-box-shadow">
+    {include file='banner/index_search'}
+    <table class="layui-table margin-top-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
+            <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
+            <th class='text-left nowrap'>名称</th>
+            <th class='text-left nowrap'>轮播图</th>
+            <th class='text-left nowrap'>位置</th>
+            <th class="text-left" style="width: 20%">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
+            <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
+            <td class='text-left nowrap'>{$vo.name|default=''}</td>
+            <td class='text-left nowrap'><img data-tips-image="{$vo.cover|default=''}"  src="{$vo.cover|default=''}" height="50" width="110px"></td>
+            <td class='text-left nowrap'>{$place_desc[$vo.place]}</td>
+            <td class='text-left' style="width: 20%">
+                <a data-title="编辑轮播图" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}&supplier_id={$vo.supplier_id}'>编 辑</a>
+                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/operate/supplier_goods/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
+{/block}
+
+
+

+ 26 - 0
application/operate/view/supplier_goods/index_search.html

@@ -0,0 +1,26 @@
+<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">
+                <select class="layui-select" name="place">
+                    <option value="0">全部</option>
+                    {foreach $place_desc as $k=>$v}
+                        {if $v}
+                            {if $Think.get.place eq $k}
+                                <option selected value="{$k}">{$v}</option>
+                            {else}
+                                <option  value="{$k}">{$v}</option>
+                            {/if}
+                         {/if}
+                    {/foreach}
+                </select>
+            </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>
+    <script>form.render()</script>
+</fieldset>