wupengfei 2 years ago
parent
commit
dd9c083529

+ 29 - 5
.idea/workspace.xml

@@ -2,8 +2,32 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/common/model/GoodsCate.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/mall/view/goods_cate/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/goods_cate/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/GoodsColumn.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/Group.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/GroupGoods.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/Menu.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/StoreGoods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/controller/StoreGoods.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/Territory.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/controller/TopSearch.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_cate/form.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_cate/index.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_cate/index_search.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_goods/custom.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_goods/goods_list.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_goods/index.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/gift_goods/index_search.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/goods_column/form.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/goods_column/index.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/menu/form.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/menu/index.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/remark_label/form.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/remark_label/index.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/store_goods/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/store_goods/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/store_goods/index_search.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/mall/view/store_goods/index_search.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/territory/form.html" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/mall/view/territory/index.html" beforeDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -122,7 +146,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$/../ddsc" />
     <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" />
@@ -201,7 +225,7 @@
       <workItem from="1662342663926" duration="3749000" />
       <workItem from="1662424055312" duration="8281000" />
       <workItem from="1662528828371" duration="14923000" />
-      <workItem from="1662597494801" duration="10647000" />
+      <workItem from="1662597494801" duration="11141000" />
     </task>
     <servers />
   </component>
@@ -225,10 +249,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="283" y="145" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1661844009119" />
-    <state x="1281" y="514" key="FileChooserDialogImpl" timestamp="1661842020031">
+    <state x="1281" y="514" key="FileChooserDialogImpl" timestamp="1662619147293">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1281" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1661842020031" />
+    <state x="1281" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1662619147293" />
     <state x="1035" y="389" key="MultipleFileMergeDialog" timestamp="1659576166292">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 13 - 0
application/common/model/GoodsCate.php

@@ -0,0 +1,13 @@
+<?php
+namespace app\common\model;
+use think\Model;
+// 商品分类
+class GoodsCate extends Model
+{
+    public static function getCateTree()
+    {
+        $all_cate = self::where(['status'=>1,'is_deleted'=>0])->order('sort desc ,id desc')->select();
+        return make_tree($all_cate);
+    }
+
+}

+ 0 - 144
application/mall/controller/GoodsColumn.php

@@ -1,144 +0,0 @@
-<?php
-namespace app\mall\controller;
-use library\Controller;
-
-/**
- * 商品专栏管理
- * Class GoodsColumn
- * @package app\mall\controller
- */
-class GoodsColumn extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GoodsColumn';
-
-    /**
-     * 商品专栏列表
-     * @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 = '专栏列表';
-        $query = $this->_query($this->table)->where('is_deleted',0);
-        $query->like('title');
-        $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->title = '编辑';
-        $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\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function forbidden()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 删除
-     * @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');
-    }
-
-}

+ 0 - 165
application/mall/controller/Group.php

@@ -1,165 +0,0 @@
-<?php
-namespace app\mall\controller;
-use app\common\model\GroupActivity;
-use library\Controller;
-/**
- * 拼团活动
- * Class Group
- * @package app\mall\controller
- */
-class Group extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GroupActivity';
-
-    /**
-     * 列表
-     * @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 = '活动列表';
-        $sel_where = [];
-        $sel_where[] = ['is_deleted','=',0];
-        if($title = $this->request->get('title')) $sel_where[] = ['title','like','%'.$title.'%'];
-        $query = $this->_query($this->table);
-        $query->where($sel_where)->order('status desc ,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->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 forbidden()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 启用
-     * @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 enable()
-    {
-        $this->_save($this->table, ['status' => 1]);
-    }
-
-    /**
-     * 删除
-     * @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 del()
-    {
-        $this->_save($this->table, ['is_deleted' => 1]);
-    }
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if($this->request->isPost())
-        {
-            $all_act = GroupActivity::field('id,start_time,end_time')
-                ->where([['is_deleted','=',0],['end_time','> time',date('Y-m-d H:i:s')]])
-                ->select()->toArray();
-            if(strtotime($data['start_time']) > strtotime($data['end_time']))  $this->error('结束时间有误');
-            $check_time = true;
-            foreach ($all_act as $v)
-            {
-                if($this->request->action() == 'edit' && isset_full_check($data,'id',$v['id'])) continue;
-                $check_time =check_act_time(strtotime($data['start_time']),strtotime($data['end_time']),strtotime($v['start_time']),strtotime($v['end_time']));
-                if($check_time == false) break;
-            }
-            if(!$check_time) $this->error('该时间段内已有活动');
-        }
-
-    }
-
-    protected function  _form_result($result){
-
-    }
-
-}

+ 0 - 213
application/mall/controller/GroupGoods.php

@@ -1,213 +0,0 @@
-<?php
-namespace app\mall\controller;
-use app\common\model\GroupGoodsItem;
-use app\common\model\StoreGoodsItem;
-use library\Controller;
-use library\tools\Data;
-use think\cache\driver\Redis;
-use think\Db;
-/**
- * 拼团商品
- * Class GroupGoods
- * @package app\mall\controller
- */
-class GroupGoods extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GroupGoods';
-
-    /**
-     * 列表
-     * @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()
-    {
-        $lid = input('id');
-        $search_name = input('search_name','');
-        $this->title =  Db::name('GroupActivity')->where('id',$lid)->value('title');
-        $this->lid = $lid;
-        $where = [];
-        $where[]= ['v.act_id','=',$lid];
-        if($search_name) $where[] = ['g.name','like',"%".$search_name."%"];
-        $list = $this->_query($this->table)->alias('v')
-            ->field('v.create_at,v.sort,v.id,v.goods_id,v.act_id,g.name as goods_name,g.cover,g.name,g.low_price,g.status,g.is_deleted')
-            ->where($where)
-            ->join('StoreGoods g','v.goods_id = g.id','LEFT')
-            ->order('v.sort desc ,v.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)
-    {
-        foreach ($data as &$v){
-            $v['goods_num'] = Db::name('GroupGoods')->where('act_id',$v['id'])->count();
-        }
-
-    }
-
-
-
-    /**
-     * 可添加商品列表
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function goods_list()
-    {
-        $lid = input('id');
-        $this->title = Db::name('GroupActivity')->where('id',$lid)->value('title');
-        $this->lid = $lid;
-        $name = input('name');
-        $sel_ids = Db::name('GroupGoods')->where(['act_id'=>$lid])->column('goods_id');
-        $where = [];
-        $where[]= ['is_deleted','=',0];
-        $where[]= ['status','=',1];
-        if(!empty($sel_ids)) $where[] = ['id','not in',$sel_ids];
-        if($name) $where[] = ['name','like','%'.$name.'%'];
-        $list = $this->_query('StoreGoods')
-            ->field('id,name,cover,low_price')
-            ->where($where)
-            ->order('sort desc ,id desc')->page();
-        return $this->fetch('goods_list');
-    }
-
-
-    /**
-     * ajax添加商品
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-
-    public function ajax_add()
-    {
-        $sel_goods = input('post.ids');
-        $act_id = input('post.act_id');
-        foreach ($sel_goods as $goods_id){
-            $int_data[]=[
-                'act_id' => $act_id,
-                'goods_id' => $goods_id,
-                'sort' => 0,
-                'create_at' => date("Y-m-d H:i:s")
-            ];
-            $goods_item = StoreGoodsItem::where('goods_id',$goods_id)->field("goods_id,id as spec_id,sell_price ,is_combo,original_price,sell_price")->select()->toArray();
-            array_walk($goods_item,function (&$v,$k)use($act_id){
-                $v['act_id'] = $act_id;
-                $v['group_price'] = $v['sell_price'];
-            });
-            (new GroupGoodsItem())->saveAll($goods_item);
-        }
-        Db::name('GroupGoods')->insertAll($int_data);
-
-        return json_encode(['code'=>200]);
-    }
-
-
-    /**
-     * 拼团设置
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function price_set()
-    {
-        if ($this->request->isGet()) {
-            $act_goods = $this->request->get('id');
-            $act_info = \app\common\model\GroupGoods::where('id',$act_goods)->find()->toArray();// 活动商品记录
-            $goods_info = Db::name('StoreGoods')->field('id,name')->where(['id' => $act_info['goods_id']])->find();// 商品详情
-            empty($goods_info) && $this->error('无效的商品信息,请稍候再试!');
-            $group_item = GroupGoodsItem::field('s.*,i.goods_spec ,i.stock istock,i.base_stock ibase_stock')->alias('s')
-                ->leftJoin('StoreGoodsItem i','i.id = s.spec_id')
-                ->where(['s.act_id'=>$act_info['act_id'],'s.goods_id'=>$act_info['goods_id']])
-                ->select()->toArray();// 拼团设置
-            $this->fetch('', ['goods_info' => $goods_info,'group_item'=>$group_item]);
-        }else{
-            $post = input('post.');
-            if(empty($post)) $this->error('数据错误');
-            $group_set = [];
-            //$redis = new Redis();
-            // GROUP_活动id_GroupGoodsItem主键 :剩余库存
-           // $redis_prefix = 'GROUP_'.$this->request->get('act_id').'_';
-            foreach ($post['id'] as $k=>$id) {
-                $group_set[$k]['id'] = $id;
-                $group_set[$k]['original_price'] = $post['original_price'][$k];
-                $group_set[$k]['sell_price'] = $post['sell_price'][$k];
-                $group_set[$k]['group_price'] = $post['group_price'][$k];
-               /* if($post['add_stock'][$k]  != 0){
-                    //$redis->inc($redis_prefix.'_'.$id,$post['add_stock'][$k]);
-                    GroupGoodsItem::where('id',$id)->setInc('stock',$post['add_stock'][$k]);
-                    GroupGoodsItem::where('id',$id)->setInc('base_stock',$post['add_stock'][$k]);
-                }*/
-            }
-            (new GroupGoodsItem())->saveAll($group_set);
-            $this->success('保存成功!');
-        }
-
-
-    }
-
-
-    /**
-     * 删除关联商品
-     * @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 del_goods()
-    {
-        $id = input('id');
-        $detail = \app\common\model\GroupGoods::where('id',$id)->find()->toArray();
-        GroupGoodsItem::where(['act_id'=>$detail['act_id'],'goods_id'=>$detail['goods_id']])->delete();
-        $this->_delete($this->table);
-    }
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-
-    }
-    protected function  _form_result($result){
-
-    }
-
-}

+ 0 - 166
application/mall/controller/Menu.php

@@ -1,166 +0,0 @@
-<?php
-namespace app\mall\controller;
-use library\Controller;
-use library\service\MenuService;
-use library\tools\Data;
-use think\Db;
-
-/**
- * 菜单
- * Class Menu
- * @package app\mall\controller
- */
-class Menu extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'MallMenu';
-
-    /**
-     * 菜单列表
-     * @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 = '菜单列表';
-        $query = $this->_query($this->table)->where('is_deleted',0)->page(false);
-    }
-
-    /**
-     * 数据列表处理
-     * @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)
-    {
-        foreach ($data as &$vo) {
-            $vo['ids'] = join(',', Data::getArrSubIds($data, $vo['id']));
-        }
-        $data = Data::arr2table($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->title = '编辑菜单';
-        $this->_form($this->table, 'form');
-    }
-
-    /**
-     * 表单数据处理
-     * @param array $vo
-     * @throws \ReflectionException
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _form_filter(&$vo)
-    {
-        if ($this->request->isGet()) {
-            // 读取系统功能节点
-            $this->nodes = MenuService::instance()->getList();
-            // 选择自己的上级菜单
-            if (empty($vo['pid']) && $this->request->get('pid', '0')) $vo['pid'] = $this->request->get('pid', '0');
-            // 列出可选上级菜单
-            $menus = Db::name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->column('id,pid,title,logo');
-            $this->menus = Data::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'title' => '顶部菜单']]));
-            if (isset($vo['id'])) foreach ($this->menus as $key => $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
-            foreach ($this->menus as $key => &$menu) {
-                if ($menu['spt'] >= 2) unset($this->menus[$key]);
-                if (isset($vo['spt']) && $vo['spt'] <= $menu['spt']) unset($this->menus[$key]);
-            }
-        }
-        if($this->request->isPost() && in_array($this->request->action(),['add','edit'])){
-            if(!isset($vo['id']) && $vo['pid']){
-                $plev = Db::name($this->table)->where('id',$vo['pid'])->value('lev');
-                $vo['lev'] = $plev + 1;
-            }
-        }
-    }
-
-    /**
-     * 启用
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function resume()
-    {
-        $this->_save($this->table, ['status' => '1']);
-    }
-
-    /**
-     * 禁用
-     * @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 forbid()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 删除
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function remove()
-    {
-        $this->_save($this->table, ['is_deleted' => 1]);
-    }
-
-}
-

+ 0 - 19
application/mall/controller/StoreGoods.php

@@ -37,18 +37,6 @@ class StoreGoods extends Controller
         $this->title = '商品管理';
         $where = [];
         $where['is_deleted'] = 0;
-        $this->is_presell = input('is_presell',-1) ;
-        $this->first_season = input('first_season',0) ;
-        $this->second_season = input('second_season',0) ;
-        $this->first_territory = input('first_territory',0) ;
-        $this->second_territory = input('second_territory',0) ;
-        $this->goods_season = GoodsSeason::getSeasonTree();
-        $this->goods_territory = GoodsTerritory::getTerritoryTree();
-        if($this->is_presell >= 0) $where['is_presell']=input('is_presell');
-        if($this->first_season > 0) $where['first_season']=input('first_season');
-        if($this->second_season > 0) $where['second_season']=input('second_season');
-        if($this->first_territory > 0) $where['first_territory']=input('first_territory');
-        if($this->second_territory > 0) $where['second_territory']=input('second_territory');
         $query = $this->_query($this->table)->where($where)->like('name');
         $query->dateBetween('create_at')->order('sort desc , id desc')->page();
     }
@@ -65,19 +53,12 @@ class StoreGoods extends Controller
     protected function _index_page_filter(&$data)
     {
         $this->clist = GoodsCate::getCateTree();
-        $all_season = GoodsSeason::column('title','id');
-        $all_territory= GoodsTerritory::column('title','id');
         $list = Db::name('StoreGoodsItem')->where('status', '1')->whereIn('goods_id', array_unique(array_column($data, 'id')))->select();
         foreach ($data as &$vo) {
             list($vo['list'], $vo['cate']) = [[], []];
             foreach ($list as $goods){
                 if ($goods['goods_id'] === $vo['id']) array_push($vo['list'], $goods);
             }
-            $vo['first_season_name'] =  isset($all_season[$vo['first_season']]) ? $all_season[$vo['first_season']]:'--';
-            $vo['second_season_name'] =  isset($all_season[$vo['second_season']]) ? $all_season[$vo['second_season']]:'';
-            $vo['first_territory_name'] =  isset($all_territory[$vo['first_territory']]) ? $all_territory[$vo['first_territory']]:'--';
-            $vo['second_territory_name'] =  isset($all_territory[$vo['second_territory']]) ? $all_territory[$vo['second_territory']]:'--';
-
         }
     }
 

+ 0 - 160
application/mall/controller/Territory.php

@@ -1,160 +0,0 @@
-<?php
-namespace app\mall\controller;
-use library\Controller;
-use library\service\MenuService;
-use library\tools\Data;
-use think\Db;
-
-/**
- * 地域
- * Class Territory
- * @package app\mall\controller
- */
-class Territory extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GoodsTerritory';
-
-    /**
-     * 地域列表
-     * @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 = '地域列表';
-        $query = $this->_query($this->table)->where('is_deleted',0)->page(false);
-    }
-
-    /**
-     * 数据列表处理
-     * @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)
-    {
-        foreach ($data as &$vo) {
-            $vo['ids'] = join(',', Data::getArrSubIds($data, $vo['id']));
-        }
-        $data = Data::arr2table($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->title = '编辑地域';
-        $this->_form($this->table, 'form');
-    }
-
-    /**
-     * 表单数据处理
-     * @param array $vo
-     * @throws \ReflectionException
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _form_filter(&$vo)
-    {
-        if ($this->request->isGet()) {
-            // 读取系统功能节点
-            $this->nodes = MenuService::instance()->getList();
-            // 选择自己的上级地域
-            if (empty($vo['pid']) && $this->request->get('pid', '0')) $vo['pid'] = $this->request->get('pid', '0');
-            // 列出可选上级地域
-            $menus = Db::name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->column('id,pid,title');
-            $this->menus = Data::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'title' => '顶部地域']]));
-            if (isset($vo['id'])) foreach ($this->menus as $key => $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
-            foreach ($this->menus as $key => &$menu) {
-                if ($menu['spt'] >= 2) unset($this->menus[$key]);
-                if (isset($vo['spt']) && $vo['spt'] <= $menu['spt']) unset($this->menus[$key]);
-            }
-        }
-    }
-
-    /**
-     * 启用
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function resume()
-    {
-        $this->_save($this->table, ['status' => '1']);
-    }
-
-    /**
-     * 禁用
-     * @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 forbid()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 删除
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function remove()
-    {
-        $this->_save($this->table, ['is_deleted' => 1]);
-    }
-
-}
-

+ 0 - 144
application/mall/controller/TopSearch.php

@@ -1,144 +0,0 @@
-<?php
-namespace app\mall\controller;
-use library\Controller;
-
-/**
- * 商品热搜管理
- * Class TopSearch
- * @package app\mall\controller
- */
-class TopSearch extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'TopSearch';
-
-    /**
-     * 商品热搜列表
-     * @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 = '热搜列表';
-        $query = $this->_query($this->table)->where('is_deleted',0);
-        $query->like('title');
-        $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->title = '编辑';
-        $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\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function forbidden()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 删除
-     * @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');
-    }
-
-}

+ 0 - 36
application/mall/view/gift_cate/form.html

@@ -1,36 +0,0 @@
-<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="title" maxlength="20"  value='{$vo.title|default=""}' placeholder="请输入分类名称" class="layui-input">
-                </div>
-            </div>
-
-            <div class="layui-form-item">
-                <label class="layui-form-label label-required">LOGO</label>
-                <div class="layui-input-block">
-                    <input name="logo" type="hidden" value="{$vo.logo|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}
-            <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="logo"]').uploadOneImage();
-    </script>
-</div>

+ 0 - 67
application/mall/view/gift_cate/index.html

@@ -1,67 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-<button data-modal='{:url("add")}' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='gift_cate/index_search'}
-    <table class="layui-table margin-top-20" lay-skin="line">
-        <thead>
-        <tr>
-            <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'>LOGO</th>
-            <th class="text-left" style="width: 30%">操作</th>
-        </tr>
-        </thead>
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-
-            <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.title|default=''}</td>
-            <td class='text-left nowrap'><img data-tips-image="{$vo.logo|default=''}"  src="{$vo.logo|default=''}" width="50px"></td>
-            <td class='text-left' style="width: 20%">
-                <a data-title="编辑分类" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                <a data-title="商品管理" class="layui-btn layui-btn-sm layui-btn-normal" data-open='{:url("/mall/gift_goods/index")}?id={$vo.id}'>商品管理</a>
-                {if $vo.status == 1}
-                <span class="layui-btn layui-btn-sm layui-btn-warm"  onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
-                {else}
-                <span class="layui-btn layui-btn-sm layui-btn-sm"  onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
-                {/if}
-                <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 = "/mall/gift_cate/"+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}
-
-
-

+ 0 - 16
application/mall/view/gift_cate/index_search.html

@@ -1,16 +0,0 @@
-<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="title" value="{$Think.get.title|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>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 79
application/mall/view/gift_goods/custom.html

@@ -1,79 +0,0 @@
-{include file='mall@store_goods/form_style'}
-<style>
-    .layui-form-radio{
-        margin: 0 !important;
-        padding-right:0 !important;
-    }
-</style>
-<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>
-            <div class="layui-input-block">
-                <div class="layui-input layui-bg-gray">{$goods_info.name}</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">定制开关</label>
-            <div class="layui-input-block margin-left-0 margin-top-15">
-                <label >
-                    <input  type="radio"  class="layui-input" value="0" name="is_custom"  lay-filter="is_custom"   {if  !isset($vo.is_custom) || !$vo.is_custom}checked{/if} >
-                </label>
-                <span class="margin-right-10">关闭</span>
-
-                <label>
-                    <input type="radio" class="layui-input" value="1" name="is_custom"   lay-filter="is_custom" {if  isset($vo.is_custom) && $vo.is_custom}checked{/if} >
-                </label>
-                <span class="margin-right-10">开启</span>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">定制风格</label>
-            <table class="layui-table" style="width: 85% !important;">
-                <thead>
-                <tr> </tr>
-                <tr>
-                    <th class="text-left">图片</th>
-                </tr>
-                <tr>
-                    <td width="auto" class="text-left"><input name="custom_cover" type="hidden" value="{$vo.custom_cover|default=''}"></td>
-                </tr>
-                </thead>
-            </table>
-            <script>$('[name="custom_cover"]').uploadMultipleImage()</script>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">定制色系</label>
-            <table class="layui-table" style="width: 85% !important;">
-                <thead>
-                <tr> </tr>
-                <tr>
-                    <th class="text-left">图片</th>
-                </tr>
-                <tr>
-                    <td width="auto" class="text-left"><input name="custom_color" type="hidden" value="{$vo.custom_color|default=''}"></td>
-                </tr>
-                </thead>
-            </table>
-            <script>$('[name="custom_color"]').uploadMultipleImage()</script>
-        </div>
-
-
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <input name="id" type="hidden" value="{$Think.get.id|default=''}"/>
-    <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>
-<script>
-    window.form.render();
-</script>

+ 0 - 98
application/mall/view/gift_goods/goods_list.html

@@ -1,98 +0,0 @@
-{extend name='admin@main'}
-{block name="button"}
-<a href="javascript:history.go(-1);"  data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
-{/block}
-{block name="content"}
-<div class="think-box-shadow">
-    <fieldset>
-        <legend>条件搜索</legend>
-        <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-            <input type="hidden" name="id" value="{$lid|default=0}" />
-            <div class="layui-form-item layui-inline">
-                <label class="layui-form-label">商品名称</label>
-                <div class="layui-input-inline">
-                    <input name="name" value="{$Think.get.name|default=''}" placeholder="商品名称" class="layui-input">
-                </div>
-            </div>
-
-            <div class="layui-form-item layui-inline">
-                <button class="layui-btn"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-                <span class="layui-btn" id="add_goods">添 加</span>
-            </div>
-        </form>
-    </fieldset>
-
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'><input id="sel_box" data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
-            <th class='text-left nowrap'>商品ID</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>
-            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
-            <td class='text-left nowrap'>{$vo.id|default=''}</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=''}" width="50px"></td>
-            <th class='text-left nowrap'>{$vo.low_price|default=''}</th>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有可添加商品</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    form.render();
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/mall/gift_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();
-                    },1500)
-                }
-            });
-        });
-    }
-
-
-    $("#add_goods").click(function () {
-        var sel_goods = new Array();
-        $.each($(".list-check-box"),function (k,v) {
-            if($(".list-check-box").eq(k).is(":checked")) {
-                sel_goods.push($(".list-check-box").eq(k).val());
-            }
-        })
-        if(sel_goods.length == 0){
-            layer.msg('请选择商品');
-            return false;
-        }
-        var cate_id = $("input[name='id']").val();
-        $.post('/mall/gift_goods/ajax_add',{ids:sel_goods,cate_id:cate_id},function (res) {
-            layer.msg('添加成功');
-            setTimeout(function () {
-                history.go(-1);
-            },1500)
-        })
-    })
-
-</script>
-{/block}
-
-
-

+ 0 - 81
application/mall/view/gift_goods/index.html

@@ -1,81 +0,0 @@
-{extend name='admin@main'}
-{block name="button"}
-<a data-open='{:url("goods_list")}?id={$lid}'   data-title="添加商品" class='layui-btn layui-btn-sm layui-btn-primary'>添加商品</a>
-{/block}
-{block name="content"}
-<div class="think-box-shadow">
-    <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="search_name" value="{$Think.get.search_name|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>
-
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <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 nowrap'>最低价</th>
-            <th class="text-left nowrap">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <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.goods_name|default=''}</td>
-            <td class='text-left nowrap'><img data-tips-image="{$vo.cover|default=''}"  src="{$vo.cover|default=''}" width="50px"></td>
-            <th class='text-left nowrap'>{$vo.is_custom ? '开启':'关闭'}</th>
-            <th class='text-left nowrap'>{$vo.low_price|default=''}</th>
-            <td class='text-left nowrap'>
-                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del_goods','{$vo.id}');">删 除</span>
-                <span class="layui-btn layui-btn-sm" data-modal='{:url("/mall/gift_goods/custom")}?id={$vo.id}&cate_id={$vo.cate_id}' >定制设置</span>
-                <span class="layui-btn layui-btn-sm" data-open='{:url("/mall/store_goods/edit")}?id={$vo.goods_id}' >商品详情</span>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    form.render();
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/mall/gift_goods/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg('删除成功');
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-</script>
-{/block}
-
-
-

+ 0 - 17
application/mall/view/gift_goods/index_search.html

@@ -1,17 +0,0 @@
-<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="title" value="{$Think.get.title|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>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 33
application/mall/view/goods_column/form.html

@@ -1,33 +0,0 @@
-<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="title" maxlength="20"  value='{$vo.title|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="desc" maxlength="20"  value='{$vo.desc|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 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}
-            <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();
-    </script>
-</div>

+ 0 - 65
application/mall/view/goods_column/index.html

@@ -1,65 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-<button data-modal='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    <table class="layui-table margin-top-20" lay-skin="line">
-        <thead>
-        <tr>
-            <th class='text-left nowrap' style="width: 30%">标题</th>
-            <th class='text-left nowrap' style="width: 20%">描述</th>
-            <th class='text-left nowrap' style="width: 25%">状态</th>
-            <th class="text-left nowrap" style="width: 25%">操作</th>
-        </tr>
-        </thead>
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='text-left nowrap'>{$vo.title|default=''}</td>
-            <td class='text-left nowrap'>{$vo.desc|default=''}</td>
-            <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
-            <td class='text-left' >
-                <a data-title="编辑" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {if $vo.status == 1}
-                <span class="layui-btn layui-btn-sm layui-btn-warm"  onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
-                {else}
-                <span class="layui-btn layui-btn-sm layui-btn-sm"  onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
-                {/if}
-                <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 = "/mall/goods_column/"+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}
-
-
-

+ 0 - 64
application/mall/view/menu/form.html

@@ -1,64 +0,0 @@
-<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>
-            <div class="layui-input-block">
-                <select name='pid' class='layui-select' lay-search  >
-                    <!--{foreach $menus as $menu}-->
-                    <!--{eq name='menu.id' value='$vo.pid|default=0'}-->
-                    <option selected value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
-                    <!--{else}-->
-                    <option value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
-                    <!--{/eq}-->
-                    <!--{/foreach}-->
-                </select>
-                <p class="help-block">必选,请选择上级菜单或顶级菜单(目前最多支持二级菜单)</p>
-            </div>
-        </div>
-
-
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">菜单Logo</label>
-            <div class="layui-input-block">
-                <input name="logo" type="hidden" value="{$vo.logo|default=''}"/>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">菜单名称</label>
-            <div class="layui-input-block">
-                <input name="title" value='{$vo.title|default=""}' required placeholder="请输入菜单名称" class="layui-input">
-                <p class="help-block">必填,请填写菜单名称,建议字符不要太长,一般4-6个汉字</p>
-            </div>
-        </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" style="margin-top: 100px">
-        <button class="layui-btn" type='submit'>保存数据</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
-    </div>
-
-</form>
-
-{block name='script'}
-<script>
-    window.form.render();
-    require(['jquery.autocompleter'], function () {
-        form.render();
-        $('[name="icon"]').on('change', function () {
-            $(this).parent().next().find('i').get(0).className = this.value
-        });
-        $('input[name=url]').autocompleter({
-            limit: 6, highlightMatches: true, template: '{{ label }} <span> {{ title }} </span>', source: (function (subjects, data) {
-                for (var i in subjects) data.push({value: subjects[i].node, label: subjects[i].node, title: subjects[i].title});
-                return data;
-            })(JSON.parse('{$nodes|raw|json_encode}'), [])
-        });
-    });
-    $('[name="logo"]').uploadOneImage();
-</script>
-{/block}

+ 0 - 78
application/mall/view/menu/index.html

@@ -1,78 +0,0 @@
-{extend name='admin@main'}
-{block name="button"}
-
-{if auth("add")}
-<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-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除菜单</button>
-{/if}
-
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {empty name='list'}
-    <blockquote class="layui-elem-quote">没 有 记 录 哦!</blockquote>
-    {else}
-    <table class="layui-table" 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 style="width:260px"></th>
-            <th style="width:260px"></th>
-            <th class='layui-hide-xs' style="width:180px"></th>
-            <th colspan="2"></th>
-        </tr>
-        </thead>
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr data-dbclick>
-            <td class='list-table-check-td think-checkbox'>
-                <input class="list-check-box" value='{$vo.ids}' 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="nowrap"><span class="color-desc">{$vo.spl|raw}</span>{$vo.title}</td>
-            <td class="nowrap"><img data-tips-image="{$vo.logo|default=''}"  src="{$vo.logo|default=''}" width="35px"></td>
-            <td class='text-center nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}</td>
-            <td class='text-center nowrap notselect'>
-                {if auth("add")}
-                <span class="text-explode">|</span>
-                <!--{if $vo.spt < 1}-->
-                <a class="layui-btn layui-btn-xs layui-btn-primary" data-title="添加子菜单" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
-                <!--{else}-->
-                <a class="layui-btn layui-btn-xs layui-btn-disabled">添 加</a>
-                <!--{/if}-->
-                {/if}
-                {if auth("edit")}
-                <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑菜单" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {/if}
-                <!--{if $vo.spt < 1}-->
-                <a class="layui-btn layui-btn-xs layui-btn-normal" data-title="商品管理"  data-open='{:url("/mall/menu_goods/index")}?first_id={$vo.id}'>商品管理</a>
-                <!--{else}-->
-                <a class="layui-btn layui-btn-xs layui-btn-normal" data-title="商品管理" data-open='{:url("/mall/menu_goods/index")}?id={$vo.id}'>商品管理</a>
-                <!--{/if}-->
-                {if $vo.status eq 1 and auth("forbid")}
-                <a class="layui-btn layui-btn-warm layui-btn-xs" data-confirm="确定要禁用菜单吗?" data-action="{:url('forbid')}" data-value="id#{$vo.ids};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
-                {elseif auth("resume")}
-                <a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('resume')}" data-value="id#{$vo.ids};status#1" data-csrf="{:systoken('resume')}">启 用</a>
-                {/if}
-                {if auth("remove")}
-                <a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.ids}" data-csrf="{:systoken('remove')}">删 除</a>
-                {/if}
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {/empty}
-</div>
-{/block}

+ 0 - 29
application/mall/view/remark_label/form.html

@@ -1,29 +0,0 @@
-
-<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="title" maxlength="20"  value='{$vo.title|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 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}
-            <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();
-    </script>
-</div>

+ 0 - 63
application/mall/view/remark_label/index.html

@@ -1,63 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-    <button data-modal='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    <table class="layui-table margin-top-20" lay-skin="line">
-        <thead>
-        <tr>
-            <th class='text-left nowrap' style="width: 50%">标题</th>
-            <th class='text-left nowrap' style="width: 25%">状态</th>
-            <th class="text-left nowrap" style="width: 25%">操作</th>
-        </tr>
-        </thead>
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='text-left nowrap'>{$vo.title|default=''}</td>
-            <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
-            <td class='text-left' >
-                <a data-title="编辑" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {if $vo.status == 1}
-                <span class="layui-btn layui-btn-sm layui-btn-warm"  onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
-                {else}
-                <span class="layui-btn layui-btn-sm layui-btn-sm"  onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
-                {/if}
-                <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 = "/mall/remark_label/"+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}
-
-
-

+ 1 - 19
application/mall/view/store_goods/index.html

@@ -14,7 +14,6 @@
                 <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
             </th>
             <th class='text-left nowrap' width="10%">商品详情</th>
-            <th class='text-left nowrap' width="10%">基本信息</th>
             <th class='text-left nowrap' width="10%">商品状态</th>
             <th class='text-left nowrap padding-0 relative' style="min-width:400px">
                 <div class="layui-row" style="line-height:28px">
@@ -40,15 +39,7 @@
                     商品名称:{$vo.name|default='--'}<br>
                 </div>
             </td>
-            <td class='text-left nowrap'>
-                是否预售:
-                {eq name='vo.is_presell' value='0'}<span class="layui-badge layui-bg-black margin-left-5">否</span>{/eq}
-                {eq name='vo.is_presell' value='1'}<span class="layui-badge layui-bg-blue margin-left-5">是</span>{/eq}
-                <br>
-                {eq name='vo.is_presell' value='1'}预售时间:{$vo.sell_time}<br>{/eq}
-                时令:{$vo.first_season_name}-{$vo.second_season_name}<br/>
-                地域:{$vo.first_territory_name}-{$vo.second_territory_name}
-            </td>
+
             <td class='text-left nowrap'>
                 快递费用:{$vo.price_express|default='0.00'} 元<br>
                 销售状态:{eq name='vo.status' value='0'}<span class="layui-badge">已下架</span>{else}<span class="layui-badge layui-bg-green">销售中</span>{/eq}<br>
@@ -102,15 +93,6 @@
                     {/if}
 
                 </div>
-
-                <div class="nowrap margin-bottom-5">
-                    {if auth("mall/store_goods/param")}
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" data-title="参数设置" data-modal='{:url("param")}?id={$vo.id}'>参 数</a>
-                    {else}
-                    <a data-tips-text="您没有商品参数设置的权限哦!" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">参 数</a>
-                    {/if}
-                </div>
-
             </td>
         </tr>
         {/foreach}

+ 0 - 122
application/mall/view/store_goods/index_search.html

@@ -9,132 +9,10 @@
         </div>
 
         <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">是否预售</label>
-            <div class="layui-input-inline">
-                <select name="is_presell" class="layui-select">
-                    <option value="-1">请选择</option>
-                    <option value="0"  {if $is_presell eq 0}selected{/if}>否</option>
-                    <option value="1"  {if $is_presell eq 1}selected{/if}>是</option>
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">时令</label>
-            <div class="layui-input-inline">
-                <select class="layui-select"  id="first_season" name="first_season" lay-filter="first_season">
-                    <option  data-first_sk="-1" value="0" >请选择</option>
-                    {foreach $goods_season as $sk=>$sv}
-                        <option   data-first_sk="{$sk}" value="{$sv['id']}"  {if $first_season eq $sv['id']}selected{/if}>{$sv['title']}</option>
-                    {/foreach}
-                </select>
-            </div>
-            <div class="layui-input-inline">
-                <select id="second_season" name="second_season" lay-filter="second_season" class="layui-select">
-
-                </select>
-            </div>
-            <input type="hidden" id="first_sval"  value="{$first_season|default='-1'}"/>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">地域</label>
-            <div class="layui-input-inline">
-                <select class="layui-select"  id="first_territory" name="first_territory" lay-filter="first_territory" lay-search>
-                    <option selected data-first_tk="-1" value="0">请选择</option>
-                    {if !empty($goods_territory)}
-                        {foreach $goods_territory as $sk=>$sv}
-                            <option   data-first_tk="{$sk}" value="{$sv['id']}"  {if $first_territory eq $sv['id']}selected{/if}>{$sv['title']}</option>
-                        {/foreach}
-                    {/if}
-                </select>
-            </div>
-            <div class="layui-input-inline">
-                <select class="layui-select"  id="second_territory" name="second_territory" lay-filter="second_territory" lay-search>
-
-                </select>
-            </div>
-            <input type="hidden" id="first_tval"  value="{$first_territory|default='-1'}"/>
-        </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();
-        var sel_second_season =  {$second_season};
-        var goods_season  = {:json_encode($goods_season)};
-        first_season(1);
-        function first_season(source) {
-            // 将其他选择框置空
-            var first_sk = $("select[name='first_season']").find("option:selected").data("first_sk")
-            $("#first_sval").val(first_sk);
-            $("select[name='second_season']").html('<option data-second_sk="-1" selected value="0">请选择</option>');
-            // 没有下级不继续
-            if(first_sk == -1 || !("children" in goods_season[first_sk])){
-                $("select[name='second_season']").val(0);
-                window.form.render();
-                return true;
-            }else{
-                var second_html = '<option data-second_sk="-1" selected value="0">请选择</option>';
-                var to_each =  goods_season[first_sk]['children'];
-                $.each(to_each,function (ck,cv) {
-                    if(source == 1 && sel_second_season == cv.id){
-                        second_html +='<option selected data-second_sk="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
-                    }else{
-                        second_html +='<option data-second_sk="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
-                    }
-                })
-                $("select[name='second_season']").html(second_html);
-                window.form.render();
-            }
-        }
-        form.on('select(first_season)', function(data){
-            var first_sk =  data.elem[data.elem.selectedIndex].dataset.first_sk;
-            //与之前选择的一样不处理
-            if($("#first_sval").val() == first_sk){
-                return true;
-            }
-            first_season(2)
-        })
-
-
-        // 地域联动 start
-        var sel_second_territory =  {$second_territory};
-        var goods_territory  = {:json_encode($goods_territory)};
-        first_territory(1);
-        function first_territory(source) {
-            // 将其他选择框置空
-            var first_tk = $("select[name='first_territory']").find("option:selected").data("first_tk");
-            $("#first_tval").val(first_tk);
-            $("select[name='second_territory']").html('<option data-second_tk="-1" value="0" selected>请选择</option>');
-            // 没有下级不继续
-            if(first_tk == -1 || !("children" in goods_territory[first_tk])){
-                window.form.render();
-                return true;
-            }else{
-                var second_html = '<option data-second_tk="-1" value="0" selected>请选择</option>';
-                var to_each =  goods_territory[first_tk]['children'];
-                $.each(to_each,function (ck,cv) {
-                    if(source == 1 && sel_second_territory == cv.id){
-                        second_html +='<option selected data-second_tk="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
-                    }else{
-                        second_html +='<option data-second_tk="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
-                    }
-                })
-                $("select[name='second_territory']").html(second_html);
-                window.form.render();
-            }
-        }
-        form.on('select(first_territory)', function(data){
-            var first_tk =  data.elem[data.elem.selectedIndex].dataset.first_tk;
-            //与之前选择的一样不处理
-            if($("#first_tval").val() == first_tk){
-                return true;
-            }
-            first_territory(2)
-        })
-        // 地域联动 end
     </script>
 </fieldset>

+ 0 - 57
application/mall/view/territory/form.html

@@ -1,57 +0,0 @@
-<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>
-            <div class="layui-input-block">
-                <select name='pid' class='layui-select' lay-search  >
-                    <!--{foreach $menus as $menu}-->
-                    <!--{eq name='menu.id' value='$vo.pid|default=0'}-->
-                    <option selected value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
-                    <!--{else}-->
-                    <option value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
-                    <!--{/eq}-->
-                    <!--{/foreach}-->
-                </select>
-                <p class="help-block">必选,请选择上级地域或顶级地域(目前最多支持二级地域)</p>
-            </div>
-        </div>
-
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">地域名称</label>
-            <div class="layui-input-block">
-                <input name="title" value='{$vo.title|default=""}' required placeholder="请输入地域名称" class="layui-input">
-                <p class="help-block">必填,请填写地域名称,建议字符不要太长,一般4-6个汉字</p>
-            </div>
-        </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" style="margin-top: 100px">
-        <button class="layui-btn" type='submit'>保存数据</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
-    </div>
-
-</form>
-
-{block name='script'}
-<script>
-    window.form.render();
-    require(['jquery.autocompleter'], function () {
-        form.render();
-        $('[name="icon"]').on('change', function () {
-            $(this).parent().next().find('i').get(0).className = this.value
-        });
-        $('input[name=url]').autocompleter({
-            limit: 6, highlightMatches: true, template: '{{ label }} <span> {{ title }} </span>', source: (function (subjects, data) {
-                for (var i in subjects) data.push({value: subjects[i].node, label: subjects[i].node, title: subjects[i].title});
-                return data;
-            })(JSON.parse('{$nodes|raw|json_encode}'), [])
-        });
-    });
-    $('[name="logo"]').uploadOneImage();
-</script>
-{/block}

+ 0 - 71
application/mall/view/territory/index.html

@@ -1,71 +0,0 @@
-{extend name='admin@main'}
-{block name="button"}
-
-{if auth("add")}
-<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-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除地域</button>
-{/if}
-
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {empty name='list'}
-    <blockquote class="layui-elem-quote">没 有 记 录 哦!</blockquote>
-    {else}
-    <table class="layui-table" 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 style="width:260px"></th>
-            <th class='layui-hide-xs' style="width:180px"></th>
-            <th colspan="2"></th>
-        </tr>
-        </thead>
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr data-dbclick>
-            <td class='list-table-check-td think-checkbox'>
-                <input class="list-check-box" value='{$vo.ids}' 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="nowrap"><span class="color-desc">{$vo.spl|raw}</span>{$vo.title}</td>
-            <td class='text-center nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}</td>
-            <td class='text-center nowrap notselect'>
-                {if auth("add")}
-                <span class="text-explode">|</span>
-                <!--{if $vo.spt < 1}-->
-                <a class="layui-btn layui-btn-xs layui-btn-primary" data-title="添加子地域" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
-                <!--{else}-->
-                <a class="layui-btn layui-btn-xs layui-btn-disabled">添 加</a>
-                <!--{/if}-->
-                {/if}
-                {if auth("edit")}
-                <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑地域" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {/if}
-                {if $vo.status eq 1 and auth("forbid")}
-                <a class="layui-btn layui-btn-warm layui-btn-xs" data-confirm="确定要禁用地域吗?" data-action="{:url('forbid')}" data-value="id#{$vo.ids};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
-                {elseif auth("resume")}
-                <a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('resume')}" data-value="id#{$vo.ids};status#1" data-csrf="{:systoken('resume')}">启 用</a>
-                {/if}
-                {if auth("remove")}
-                <a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.ids}" data-csrf="{:systoken('remove')}">删 除</a>
-                {/if}
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {/empty}
-</div>
-{/block}