moonsflyer пре 3 месеци
родитељ
комит
4134aaafa8
100 измењених фајлова са 0 додато и 18222 уклоњено
  1. 0 39
      app/admin/controller/finance/Finance.php
  2. 0 65
      app/admin/controller/finance/Integral.php
  3. 0 270
      app/admin/controller/finance/Shop.php
  4. 0 476
      app/admin/controller/finance/User.php
  5. 0 125
      app/admin/controller/goods/Brand.php
  6. 0 142
      app/admin/controller/goods/Category.php
  7. 0 122
      app/admin/controller/goods/Column.php
  8. 0 48
      app/admin/controller/goods/Comment.php
  9. 0 226
      app/admin/controller/goods/Goods.php
  10. 0 108
      app/admin/controller/goods/Unit.php
  11. 0 118
      app/admin/controller/integral/IntegralGoods.php
  12. 0 161
      app/admin/controller/integral/IntegralOrder.php
  13. 0 159
      app/admin/controller/kefu/Kefu.php
  14. 0 110
      app/admin/controller/kefu/KefuLang.php
  15. 0 118
      app/admin/controller/live/LiveGoods.php
  16. 0 123
      app/admin/controller/live/LiveRoom.php
  17. 0 89
      app/admin/controller/order/Invoice.php
  18. 0 130
      app/admin/controller/order/Order.php
  19. 0 232
      app/admin/logic/finance/FinanceLogic.php
  20. 0 123
      app/admin/logic/finance/IntegralLogic.php
  21. 0 233
      app/admin/logic/finance/ShopSettlementLogic.php
  22. 0 446
      app/admin/logic/finance/ShopWithdrawalLogic.php
  23. 0 929
      app/admin/logic/finance/WithdrawLogic.php
  24. 0 111
      app/admin/logic/goods/BrandLogic.php
  25. 0 229
      app/admin/logic/goods/CategoryLogic.php
  26. 0 111
      app/admin/logic/goods/ColumnLogic.php
  27. 0 163
      app/admin/logic/goods/CommentLogic.php
  28. 0 371
      app/admin/logic/goods/GoodsLogic.php
  29. 0 98
      app/admin/logic/goods/UnitLogic.php
  30. 0 199
      app/admin/logic/integral/IntegralGoodsLogic.php
  31. 0 362
      app/admin/logic/integral/IntegralOrderLogic.php
  32. 0 102
      app/admin/logic/kefu/KefuLangLogic.php
  33. 0 231
      app/admin/logic/kefu/KefuLogic.php
  34. 0 219
      app/admin/logic/live/LiveGoodsLogic.php
  35. 0 240
      app/admin/logic/live/LiveRoomLogic.php
  36. 0 172
      app/admin/logic/order/InvoiceLogic.php
  37. 0 539
      app/admin/logic/order/OrderLogic.php
  38. 0 70
      app/admin/validate/goods/BrandValidate.php
  39. 0 149
      app/admin/validate/goods/CategoryValidate.php
  40. 0 50
      app/admin/validate/goods/ColumnValidate.php
  41. 0 45
      app/admin/validate/goods/GoodsValidate.php
  42. 0 65
      app/admin/validate/goods/UnitValidate.php
  43. 0 137
      app/admin/validate/integral/IntegralGoodsValidate.php
  44. 0 144
      app/admin/validate/integral/IntegralOrderValidate.php
  45. 0 68
      app/admin/validate/kefu/KefuLangValidate.php
  46. 0 98
      app/admin/validate/kefu/KefuValidate.php
  47. 0 30
      app/admin/validate/kefu/LoginValidate.php
  48. 0 86
      app/admin/validate/live/LiveGoodsValidate.php
  49. 0 83
      app/admin/validate/live/LiveRoomValidate.php
  50. 0 50
      app/admin/validate/order/OrderValidate.php
  51. 0 439
      app/admin/view/finance/finance/center.html
  52. 0 195
      app/admin/view/finance/integral/integral.html
  53. 0 193
      app/admin/view/finance/shop/account.html
  54. 0 215
      app/admin/view/finance/shop/settlement.html
  55. 0 75
      app/admin/view/finance/shop/settlement_detail.html
  56. 0 91
      app/admin/view/finance/shop/settlement_record.html
  57. 0 305
      app/admin/view/finance/shop/withdrawal.html
  58. 0 154
      app/admin/view/finance/shop/withdrawal_detail.html
  59. 0 24
      app/admin/view/finance/shop/withdrawal_examine.html
  60. 0 43
      app/admin/view/finance/shop/withdrawal_transfer.html
  61. 0 478
      app/admin/view/finance/user/account.html
  62. 0 307
      app/admin/view/finance/user/commission.html
  63. 0 157
      app/admin/view/finance/user/detail.html
  64. 0 322
      app/admin/view/finance/user/recharge.html
  65. 0 92
      app/admin/view/finance/user/review.html
  66. 0 118
      app/admin/view/finance/user/transfer.html
  67. 0 463
      app/admin/view/finance/user/withdrawal.html
  68. 0 71
      app/admin/view/goods/brand/add.html
  69. 0 81
      app/admin/view/goods/brand/edit.html
  70. 0 232
      app/admin/view/goods/brand/lists.html
  71. 0 129
      app/admin/view/goods/category/add.html
  72. 0 141
      app/admin/view/goods/category/edit.html
  73. 0 268
      app/admin/view/goods/category/lists.html
  74. 0 31
      app/admin/view/goods/column/add.html
  75. 0 32
      app/admin/view/goods/column/edit.html
  76. 0 184
      app/admin/view/goods/column/lists.html
  77. 0 284
      app/admin/view/goods/comment/lists.html
  78. 0 884
      app/admin/view/goods/goods/add.html
  79. 0 31
      app/admin/view/goods/goods/audit.html
  80. 0 151
      app/admin/view/goods/goods/goods_base.html
  81. 0 8
      app/admin/view/goods/goods/goods_content.html
  82. 0 45
      app/admin/view/goods/goods/goods_distribution.html
  83. 0 131
      app/admin/view/goods/goods/goods_sale_setting.html
  84. 0 191
      app/admin/view/goods/goods/goods_spec.html
  85. 0 529
      app/admin/view/goods/goods/lists.html
  86. 0 31
      app/admin/view/goods/goods/more_audit.html
  87. 0 24
      app/admin/view/goods/goods/more_lower.html
  88. 0 24
      app/admin/view/goods/goods/re_audit.html
  89. 0 61
      app/admin/view/goods/goods/set_info.html
  90. 0 21
      app/admin/view/goods/unit/add.html
  91. 0 22
      app/admin/view/goods/unit/edit.html
  92. 0 159
      app/admin/view/goods/unit/lists.html
  93. 0 257
      app/admin/view/integral/integral_goods/add.html
  94. 0 285
      app/admin/view/integral/integral_goods/edit.html
  95. 0 267
      app/admin/view/integral/integral_goods/lists.html
  96. 0 207
      app/admin/view/integral/integral_order/delivery.html
  97. 0 249
      app/admin/view/integral/integral_order/detail.html
  98. 0 172
      app/admin/view/integral/integral_order/express.html
  99. 0 437
      app/admin/view/integral/integral_order/lists.html
  100. 0 98
      app/admin/view/kefu/kefu/add.html

+ 0 - 39
app/admin/controller/finance/Finance.php

@@ -1,39 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\finance;
-
-use app\common\basics\AdminBase;
-use app\admin\logic\finance\FinanceLogic;
-use think\facade\View;
-
-/**
- * 财务中心
- * Class Finance
- * @package app\admin\controller\finance
- */
-class Finance extends AdminBase
-{
-    public function center()
-    {
-
-        View::assign('shop', FinanceLogic::shop());
-        return view();
-    }
-}

+ 0 - 65
app/admin/controller/finance/Integral.php

@@ -1,65 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\finance;
-
-
-use app\admin\logic\finance\IntegralLogic;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-class Integral extends AdminBase
-{
-    /**
-     * @notes 积分明细
-     * @return \think\response\Json|\think\response\View
-     * @author ljj
-     * @date 2022/2/22 6:00 下午
-     */
-    public function integral()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $data = IntegralLogic::integral($get);
-            return JsonServer::success('', $data, 1);
-        }
-
-        return view();
-    }
-
-
-    /**
-     * @notes 导出积分明细Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function export()
-    {
-        $params = $this->request->get();
-        $result = IntegralLogic::integral($params, true);
-        if(false === $result) {
-            return JsonServer::error(IntegralLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-}

+ 0 - 270
app/admin/controller/finance/Shop.php

@@ -1,270 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\finance;
-
-use app\admin\logic\finance\ShopSettlementLogic;
-use app\admin\logic\finance\ShopWithdrawalLogic;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-use think\facade\View;
-
-/**
- * 财务-商家相关
- * Class Shop
- * @package app\admin\controller\finance
- */
-class Shop extends AdminBase
-{
-    /**
-     * @Notes: 商家提现列表
-     * @Author: 张无忌
-     */
-    public function withdrawal()
-    {
-        if($this->request->isAjax()){
-            $get= $this->request->get();
-            $lists = ShopWithdrawalLogic::lists($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-
-        View::assign('summary', ShopWithdrawalLogic::summary());
-        View::assign('statistics', ShopWithdrawalLogic::statistics());
-        return view();
-    }
-
-    /**
-     * @Notes: 商家提现详细
-     * @Author: 张无忌
-     * @return \think\response\View
-     */
-    public function withdrawalDetail()
-    {
-        $id = $this->request->get('id');
-        View::assign('detail', ShopWithdrawalLogic::detail($id));
-        return view();
-    }
-
-    /**
-     * @Notes: 商家提现统计
-     * @Author: 张无忌
-     */
-    public function withdrawalStatistics()
-    {
-        if ($this->request->isAjax()) {
-            $statistics = ShopWithdrawalLogic::statistics();
-            return JsonServer::success('获取成功', $statistics);
-        }
-
-        return JsonServer::error('请求异常');
-    }
-
-    /**
-     * @Notes: 审核商家提现
-     * @Author: 张无忌
-     */
-    public function withdrawalExamine()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $res = ShopWithdrawalLogic::examine($post);
-            if ($res === false) {
-                $error = ShopWithdrawalLogic::getError() ?: '审核失败';
-                return JsonServer::error($error);
-            }
-
-            return JsonServer::success('审核成功');
-        }
-
-        return view();
-    }
-
-    /**
-     * @Notes: 商家提现转账
-     * @Author: 张无忌
-     */
-    public function withdrawalTransfer()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $res = ShopWithdrawalLogic::transfer($post);
-            if ($res === false) {
-                $error = ShopWithdrawalLogic::getError() ?: '审核失败';
-                return JsonServer::error($error);
-            }
-
-            return JsonServer::success('审核成功');
-        }
-
-        $id = $this->request->get('id');
-        View::assign('detail', ShopWithdrawalLogic::detail($id));
-        return view();
-    }
-    
-    /**
-     * @notes 在线转账
-     * @return \think\response\Json|void
-     * @author lbzy
-     * @datetime 2023-06-07 09:48:22
-     */
-    function WithdrawalTransferOnline()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $res = ShopWithdrawalLogic::transfer_online($post);
-            if ($res === false) {
-                $error = ShopWithdrawalLogic::getError() ? : '在线转账失败';
-                return JsonServer::error($error);
-            }
-            
-            return JsonServer::success(ShopWithdrawalLogic::getError() ? : '在线转账成功');
-        }
-    }
-
-
-    /**
-     * @Notes: 商家结算列表
-     * @Author: 张无忌
-     */
-    public function settlement()
-    {
-        if($this->request->isAjax()){
-            $get= $this->request->get();
-            $lists = ShopSettlementLogic::lists($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-
-        $statistics = ShopSettlementLogic::statistics();
-        View::assign('statistics', $statistics);
-        return view();
-    }
-
-    /**
-     * @Notes: 商家结算记录
-     * @Author: 张无忌
-     */
-    public function settlementRecord()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = ShopSettlementLogic::record($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-
-        $shop_id = $this->request->get('shop_id');
-        $statistics = ShopSettlementLogic::statistics($shop_id);
-        View::assign('shop_id', $shop_id);
-        View::assign('statistics', $statistics);
-        return view();
-    }
-
-    /**
-     * @Notes: 商家结算详细记录
-     * @Author: 张无忌
-     */
-    public function settlementDetail()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = ShopSettlementLogic::detail($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-
-        $settle_id = $this->request->get('settle_id');
-        View::assign('settle_id', $settle_id);
-        return view();
-    }
-
-
-    /**
-     * @Notes: 账户明细列表
-     * @Author: 张无忌
-     */
-    public function account()
-    {
-        if($this->request->isAjax()){
-            $get= $this->request->get();
-            $lists = ShopWithdrawalLogic::account($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-
-        return view();
-    }
-
-
-    /**
-     * @notes 导出商家提现Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function withdrawalExport()
-    {
-        $params = $this->request->get();
-        $result = ShopWithdrawalLogic::lists($params, true);
-        if(false === $result) {
-            return JsonServer::error(ShopWithdrawalLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-    /**
-     * @notes 导出商家结算Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function settlementExport()
-    {
-        $params = $this->request->get();
-        $result = ShopSettlementLogic::lists($params, true);
-        if(false === $result) {
-            return JsonServer::error(ShopSettlementLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-
-    /**
-     * @notes 导出商家账户明细Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function accountExport()
-    {
-        $params = $this->request->get();
-        $result = ShopWithdrawalLogic::account($params, true);
-        if(false === $result) {
-            return JsonServer::error(ShopWithdrawalLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-}

+ 0 - 476
app/admin/controller/finance/User.php

@@ -1,476 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\finance;
-
-use app\common\basics\AdminBase;
-use app\common\model\AccountLog;
-use app\common\server\JsonServer;
-use app\admin\logic\finance\WithdrawLogic;
-use app\common\model\order\Order as OrderModel;
-use app\common\model\Client_;
-use app\common\enum\PayEnum;
-
-/**
- * 财务-会员相关
- * Class User
- * @package app\admin\controller\finance
- */
-class User extends AdminBase
-{
-    /**
-     * @notes 会员佣金提现列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/13 7:01 下午
-     */
-    public function withdrawal()
-    {
-
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $data = WithdrawLogic::lists($get);
-            return JsonServer::success('', $data, 1);
-        }
-        $today = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
-        ];
-
-        $yesterday = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
-        ];
-
-
-        $days_ago7 = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
-            date('Y-m-d 23:59:59', time())
-        ];
-
-        $days_ago30 = [
-            date('Y-m-d 00:00:00', strtotime("-30 day")),
-            date('Y-m-d 23:59:59', time())
-        ];
-        $summary = WithdrawLogic::summary();
-        return view('', [
-            'today' => $today,
-            'yesterday' => $yesterday,
-            'days_ago7' => $days_ago7,
-            'days_ago30' => $days_ago30,
-            'summary' => $summary
-        ]);
-    }
-
-    /**
-     * @notes 会员佣金明细列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/13 7:01 下午
-     */
-    public function commission()
-    {
-
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $data = WithdrawLogic::commission($get);
-            return JsonServer::success('', $data, 1);
-        }
-        $today = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
-        ];
-
-        $yesterday = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
-        ];
-
-
-        $days_ago7 = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
-            date('Y-m-d 23:59:59', time())
-        ];
-
-        $days_ago30 = [
-            date('Y-m-d 00:00:00', strtotime("-30 day")),
-            date('Y-m-d 23:59:59', time())
-        ];
-        return view('', [
-            'today' => $today,
-            'yesterday' => $yesterday,
-            'days_ago7' => $days_ago7,
-            'days_ago30' => $days_ago30,
-            'source_type' => AccountLog::getEarningsChange()
-        ]);
-    }
-
-    /**
-     * @notes 充值明细列表
-     * @return \think\response\Json|\think\response\View
-     * @author suny
-     * @date 2021/7/13 7:01 下午
-     */
-    public function recharge()
-    {
-
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $data = WithdrawLogic::recharge($get);
-            return JsonServer::success('', $data, 1);
-        }
-        // 订单状态
-        $order_status = OrderModel::getOrderStatus(true);
-        // 订单类型
-        $order_type = OrderModel::getOrderType(true);
-        // 订单来源
-        $order_source = Client_::getClient(true);
-        unset($order_source[2]);
-        // 支付方式
-        $pay_way = PayEnum::getPayWay(true);
-        unset($pay_way[3], $pay_way[4]);
-        // 配送方式
-        $today = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
-        ];
-
-        $yesterday = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
-        ];
-
-
-        $days_ago7 = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
-            date('Y-m-d 23:59:59', time())
-        ];
-
-        $days_ago30 = [
-            date('Y-m-d 00:00:00', strtotime("-30 day")),
-            date('Y-m-d 23:59:59', time())
-        ];
-        return view('', [
-            'order_status' => $order_status,
-            'order_type' => $order_type,
-            'order_source' => $order_source,
-            'pay_way' => $pay_way,
-            'today' => $today,
-            'yesterday' => $yesterday,
-            'days_ago7' => $days_ago7,
-            'days_ago30' => $days_ago30,
-        ]);
-    }
-
-
-    /**
-     * @notes 账户明细列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function account()
-    {
-
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $data = WithdrawLogic::account($get);
-            return JsonServer::success('', $data, 1);
-        }
-        $today = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
-        ];
-
-        $yesterday = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
-        ];
-
-
-        $days_ago7 = [
-            date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
-            date('Y-m-d 23:59:59', time())
-        ];
-
-        $days_ago30 = [
-            date('Y-m-d 00:00:00', strtotime("-30 day")),
-            date('Y-m-d 23:59:59', time())
-        ];
-        return view('', [
-            'today' => $today,
-            'yesterday' => $yesterday,
-            'days_ago7' => $days_ago7,
-            'days_ago30' => $days_ago30,
-        ]);
-    }
-
-    /**
-     * @notes 会员佣金提现详情
-     * @return \think\response\View
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function withdraw_detail()
-    {
-
-        $id = $this->request->get('id', '', 'intval');
-        $detail = WithdrawLogic::detail($id);
-        return view('detail', [
-            'detail' => $detail
-        ]);
-    }
-
-    /**
-     * @notes 显示提现审核界面
-     * @return \think\response\View
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function withdraw_review()
-    {
-
-        $id = $this->request->get('id', '', 'intval');
-        return view('review', [
-            'id' => $id
-        ]);
-    }
-
-    /**
-     * @notes 审核通过
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function confirm()
-    {
-
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $result = WithdrawLogic::confirm($post);
-            if ($result['code']) {
-                return JsonServer::success($result['msg']);
-            } else {
-                return JsonServer::error($result['msg']);
-            }
-        }
-    }
-
-    /**
-     * @notes 审核拒绝
-     * @return \think\response\Json
-     * @throws \think\exception\PDOException
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function refuse()
-    {
-
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            WithdrawLogic::refuse($post);
-            return JsonServer::success('已拒绝提现');
-        }
-    }
-
-    /**
-     * @notes 显示提现转账界面
-     * @return \think\response\View
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function transfer()
-    {
-
-        $id = $this->request->get('id', '', 'intval');
-        return view('', [
-            'id' => $id
-        ]);
-    }
-
-    /**
-     * @notes 转账失败
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function transferFail()
-    {
-
-        $post = $this->request->post();
-        $result = WithdrawLogic::transferFail($post);
-        if ($result['code']) {
-            return JsonServer::success($result['msg']);
-        } else {
-            return JsonServer::error($result['msg']);
-        }
-    }
-
-    /**
-     * @notes 转账成功
-     * @return \think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function transferSuccess()
-    {
-
-        $post = $this->request->post();
-        $result = WithdrawLogic::transferSuccess($post);
-        if ($result['code']) {
-            return JsonServer::success($result['msg']);
-        } else {
-            return JsonServer::error($result['msg']);
-        }
-    }
-
-    /**
-     * @notes 提现结果查询
-     * @return \think\response\Json
-     * @author suny
-     * @date 2021/7/13 7:02 下午
-     */
-    public function search()
-    {
-
-        $id = $this->request->post('id', '', 'intval');
-        $result = WithdrawLogic::search($id);
-        if ($result['code']) {
-            return JsonServer::success($result['msg']);
-        } else {
-            return JsonServer::error($result['msg']);
-        }
-    }
-
-    /**
-     * @notes 提现失败
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/13 7:03 下午
-     */
-    public function withdrawFailed()
-    {
-
-        $id = $this->request->post('id', '', 'intval');
-        WithdrawLogic::withdrawFailed($id);
-        return JsonServer::success('提现失败已回退佣金');
-    }
-
-
-    /**
-     * @notes 导出充值明细Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function rechargeExport()
-    {
-        $params = $this->request->get();
-        $result = WithdrawLogic::recharge($params, true);
-        if(false === $result) {
-            return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-
-    /**
-     * @notes 导出账户明细Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function accountExport()
-    {
-        $params = $this->request->get();
-        $result = WithdrawLogic::account($params, true);
-        if(false === $result) {
-            return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-
-    /**
-     * @notes 导出佣金明细Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function commissionExport()
-    {
-        $params = $this->request->get();
-        $result = WithdrawLogic::commission($params, true);
-        if(false === $result) {
-            return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-
-
-    /**
-     * @notes 导出佣金提现Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function withdrawalExport()
-    {
-        $params = $this->request->get();
-        $result = WithdrawLogic::lists($params, true);
-        if(false === $result) {
-            return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-}

+ 0 - 125
app/admin/controller/goods/Brand.php

@@ -1,125 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\goods;
-
-
-use app\admin\logic\goods\BrandLogic;
-use app\admin\validate\goods\BrandValidate;
-use app\common\basics\AdminBase;
-use app\common\model\goods\GoodsBrand as GoodsBrandModel;
-use app\common\server\JsonServer;
-
-
-/**
- * 商品品牌
- * Class GoodsBrand
- * @package app\admin\controller
- */
-class Brand extends AdminBase
-{
-    /**
-     * Notes: 列表
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('获取成功', BrandLogic::lists($get));
-        }
-        return view();
-    }
-
-
-    /**
-     * Notes: 添加
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new BrandValidate())->goCheck('add');
-            if (BrandLogic::add($post)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(BrandLogic::getError() ?: '操作失败');
-        }
-        return view('', ['capital' => getCapital()]);
-    }
-
-    /**
-     * Notes: 编辑
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public function edit()
-    {
-        $id = $this->request->get('id');
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new BrandValidate())->goCheck('edit');
-            if (BrandLogic::edit($post)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(BrandLogic::getError() ?: '操作失败');
-        }
-        return view('', [
-            'detail'    => GoodsBrandModel::find($id),
-            'capital'   => getCapital()
-        ]);
-    }
-
-    /**
-     * Notes: 删除
-     * @author 段誉(2021/4/15 10:49)
-     * @return \think\response\Json
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            $id = $this->request->post('id');
-            (new BrandValidate())->goCheck('del');
-            if (BrandLogic::del($id)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(BrandLogic::getError() ?: '操作失败');
-        }
-    }
-
-
-    /**
-     * Notes: 切换状态
-     * @author 段誉(2021/4/15 15:17)
-     * @return \think\response\Json
-     */
-    public function switchStatus()
-    {
-        $post = $this->request->post();
-        GoodsBrandModel::update(['is_show' => $post['is_show']], ['id' => $post['id']]);
-        return JsonServer::success('操作成功');
-    }
-}

+ 0 - 142
app/admin/controller/goods/Category.php

@@ -1,142 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\goods;
-
-use app\common\basics\AdminBase;
-use app\admin\logic\goods\CategoryLogic;
-use app\admin\validate\goods\CategoryValidate;
-use think\exception\ValidateException;
-use app\common\server\JsonServer;
-use think\facade\View;
-
-/**
- * 平台商品分类
- * Class Category
- * @package app\admin\controller\goods
- */
-class Category extends AdminBase
-{
-    /**
-     * 列表
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $category_tree = CategoryLogic::lists();
-            // reqData方式渲染
-            $treeTableData = [
-                'code' => 0,
-                'msg' => '分类列表',
-                'data' => json_encode($category_tree)
-            ];
-            return json($treeTableData);
-        }
-        return view();
-    }
-
-    /**
-     * 添加
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['del'] = 0;
-            try {
-                validate(CategoryValidate::class)->scene('add')->check($post);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getError());
-            }
-            $res = CategoryLogic::add($post);
-            if ($res) {
-                return JsonServer::success('分类添加成功');
-            } else {
-                return JsonServer::error('分类添加失败');
-            }
-        }
-
-        $category_list = CategoryLogic::categoryTwoTree();
-        return view('add', ['category_list' => $category_list]);
-    }
-
-    /**
-     * 删除
-     */
-    public function del()
-    {
-        $post = $this->request->post();
-        try {
-            validate(CategoryValidate::class)->scene('del')->check($post);
-        } catch (ValidateException $e) {
-            return JsonServer::error($e->getError());
-        }
-        $res = CategoryLogic::del($post);
-        if ($res) {
-            return JsonServer::success('删除分类成功');
-        } else {
-            return JsonServer::error('删除分类失败');
-        }
-    }
-
-
-    /**
-     * 编辑
-     */
-    public function edit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['del'] = 0;
-            try {
-                validate(CategoryValidate::class)->scene('edit')->check($post);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getError());
-            }
-            $res = CategoryLogic::edit($post);
-            if ($res) {
-                return JsonServer::success('编辑分类成功');
-            } else {
-                return JsonServer::error('编辑分类失败');
-            }
-        }
-
-        $id = $this->request->get('id');
-        $detail = CategoryLogic::getCategory($id);
-        $category_list = CategoryLogic::categoryTwoTree();
-        return view('edit', [
-            'detail' => $detail,
-            'category_list' => $category_list
-        ]);
-    }
-
-    /**
-     * 修改显示状态
-     */
-    public function switchStatus()
-    {
-        $post = $this->request->post();
-        $res = CategoryLogic::switchStatus($post);
-        if ($res) {
-            return JsonServer::success('修改成功');
-        } else {
-            return JsonServer::error('修改失败');
-        }
-    }
-}

+ 0 - 122
app/admin/controller/goods/Column.php

@@ -1,122 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\goods;
-
-
-use app\admin\logic\goods\ColumnLogic;
-use app\admin\validate\goods\ColumnValidate;
-use app\common\basics\AdminBase;
-use app\common\model\goods\GoodsColumn as GoodsColumnModel;
-use app\common\server\JsonServer;
-
-
-/**
- * 商品栏目
- * Class GoodsColumn
- * @package app\admin\controller
- */
-class Column extends AdminBase
-{
-    /**
-     * Notes: 列表
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('获取成功', ColumnLogic::lists($get));
-        }
-        return view();
-    }
-
-
-    /**
-     * Notes: 添加
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new ColumnValidate())->goCheck('add');
-            if (ColumnLogic::add($post)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(ColumnLogic::getError() ?: '操作失败');
-        }
-        return view();
-    }
-
-    /**
-     * Notes: 编辑
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public function edit()
-    {
-        $id = $this->request->get('id');
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new ColumnValidate())->goCheck('edit');
-            if (ColumnLogic::edit($post)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(ColumnLogic::getError() ?: '操作失败');
-        }
-        return view('', ['detail' => GoodsColumnModel::find($id)]);
-    }
-
-    /**
-     * Notes: 删除
-     * @author 段誉(2021/4/15 10:49)
-     * @return \think\response\Json
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            $id = $this->request->post('id');
-            (new ColumnValidate())->goCheck('del');
-            if (ColumnLogic::del($id)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(ColumnLogic::getError() ?: '操作失败');
-        }
-    }
-
-
-    /**
-     * Notes: 切换状态
-     * @author 段誉(2021/4/15 15:17)
-     * @return \think\response\Json
-     */
-    public function switchStatus()
-    {
-        $post = $this->request->post();
-        GoodsColumnModel::update(['status' => $post['status']],['id' => $post['id']]);
-        return JsonServer::success('操作成功');
-    }
-}

+ 0 - 48
app/admin/controller/goods/Comment.php

@@ -1,48 +0,0 @@
-<?php
-namespace app\admin\controller\goods;
-
-use app\admin\logic\goods\CommentLogic;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-class Comment extends AdminBase
-{
-    /**
-     * 评价列表
-     */
-    public function lists()
-    {
-        if($this->request->isAjax()) {
-            $get = $this->request->get();
-            $data = CommentLogic::lists($get);
-            return JsonServer::success('', $data);
-        }
-        return view();
-    }
-
-    /**
-     * 显示/隐藏商品评价
-     */
-    public function changeStatus()
-    {
-        $post = $this->request->post();
-        $result = CommentLogic::changeStatus($post);
-        if($result === true) {
-            return JsonServer::success('操作成功');
-        }
-        return JsonServer::error(CommentLogic::getError());
-    }
-
-    /**
-     * 删除
-     */
-    public function del()
-    {
-        $post = $this->request->post();
-        $result = CommentLogic::del($post);
-        if($result === true) {
-            return JsonServer::success('删除成功');
-        }
-        return JsonServer::error(CommentLogic::getError());
-    }
-}

+ 0 - 226
app/admin/controller/goods/Goods.php

@@ -1,226 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\goods;
-
-use app\common\basics\AdminBase;
-use app\common\enum\GoodsEnum;
-use app\common\model\goods\GoodsBrand;
-use app\common\model\goods\GoodsUnit;
-use app\common\model\Freight;
-use app\common\model\goods\Supplier;
-use app\common\model\goods\Goods as GoodsModel;
-use app\common\server\JsonServer;
-use app\admin\logic\goods\CategoryLogic as MallCategoryLogic;
-use app\admin\logic\goods\GoodsLogic;
-use app\admin\logic\goods\ColumnLogic;
-use app\shop\logic\goods\CategoryLogic as ShopCategoryLogic;
-use think\exception\ValidateException;
-use app\admin\validate\goods\GoodsValidate;
-
-/**
- * 商品管理
- * Class Goods
- */
-class Goods extends AdminBase
-{
-    /**
-     * Notes: 列表
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('', GoodsLogic::lists($get));
-        }
-
-        $cate_list = MallCategoryLogic::categoryTreeeTree();
-        $statistics = GoodsLogic::statistics();
-        $column_list = ColumnLogic::getList();
-        return view('', [
-            'statistics' => $statistics,
-            'cate_list' => $cate_list,
-            'column_list' => $column_list,
-            'goods_type'        => GoodsEnum::getTypeDesc()
-        ]);
-    }
-
-    /**
-     * 查看
-     */
-    public function view()
-    {
-        $goods_id = $this->request->get('goods_id');
-        $shop_id = GoodsModel::where('id', $goods_id)->value('shop_id');
-        return view('goods/goods/add', [
-            'category_lists' => json_encode(MallCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE),
-            'shop_category_lists' => json_encode(ShopCategoryLogic::listAll($shop_id), JSON_UNESCAPED_UNICODE),
-            'brand_lists' => json_encode(GoodsBrand::getNameColumn(), JSON_UNESCAPED_UNICODE),
-            'supplier_lists' => json_encode(Supplier::getNameColumn(), JSON_UNESCAPED_UNICODE),
-            'unit_lists' => json_encode(GoodsUnit::getNameColumn(), JSON_UNESCAPED_UNICODE),
-            'freight_lists' => json_encode(Freight::getNameColumn($shop_id), JSON_UNESCAPED_UNICODE),
-            'info' => json_encode(GoodsLogic::info($goods_id), JSON_UNESCAPED_UNICODE)
-        ]);
-    }
-
-    /**
-     * 违规重审
-     */
-    public function reAudit()
-    {
-        if ($this->request->isAjax()) {
-            try {
-                $params = $this->request->post();
-                validate(GoodsValidate::class)->scene('re_audit')->check($params);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getMessage());
-            }
-            $result = GoodsLogic::reAudit($params);
-            if ($result) {
-                return JsonServer::success('保存成功');
-            }
-            return JsonServer::error('保存失败');
-        }
-
-        $goods_id = $this->request->get('goods_id', '', 'intval');
-        return view('re_audit', [
-            'goods_id' => $goods_id
-        ]);
-    }
-
-    /**
-     * 商品设置
-     */
-    public function setInfo()
-    {
-        if ($this->request->isAjax()) {
-            try {
-                $params = $this->request->post();
-                validate(GoodsValidate::class)->scene('set_info')->check($params);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getMessage());
-            }
-            $result = GoodsLogic::setInfo($params);
-            if ($result) {
-                return JsonServer::success('设置成功');
-            }
-            return JsonServer::error('设置失败');
-        }
-        $goods_id = $this->request->get('goods_id', '', 'intval');
-        $goods_detail = GoodsModel::find($goods_id);
-        $goods_detail['column_ids'] = $goods_detail['column_ids'] ? explode(',', $goods_detail['column_ids']) : [];
-        $goods_detail['column_ids'] = json_encode($goods_detail['column_ids']);
-        $column_list = ColumnLogic::getList();
-        return view('set_info', [
-            'goods_id' => $goods_id,
-            'column_list' => json_encode($column_list),
-            'goods_detail' => $goods_detail
-        ]);
-    }
-
-    /**
-     * 审核
-     */
-    public function audit()
-    {
-        if ($this->request->isAjax()) {
-            try {
-                $params = $this->request->post();
-                validate(GoodsValidate::class)->scene('audit')->check($params);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getMessage());
-            }
-            $result = GoodsLogic::audit($params);
-            if ($result) {
-                return JsonServer::success('操作完成');
-            }
-            return JsonServer::error('操作失败');
-        }
-        $goods_id = $this->request->get('goods_id', '', 'intval');
-        return view('audit', [
-            'goods_id' => $goods_id
-        ]);
-    }
-
-    public function totalCount()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('获取成功', GoodsLogic::statistics($get));
-        }
-    }
-
-
-    /**
-     * @notes 批量下架
-     * @return \think\response\Json|\think\response\View
-     * @author ljj
-     * @date 2022/9/20 6:21 下午
-     */
-    public function moreLower()
-    {
-        if ($this->request->isAjax()) {
-            try {
-                $params = $this->request->post();
-                validate(GoodsValidate::class)->scene('moreLower')->check($params);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getMessage());
-            }
-            $result = GoodsLogic::moreLower($params);
-            if (false === $result) {
-                return JsonServer::error(GoodsLogic::getError());
-            }
-            return JsonServer::success('操作成功');
-        }
-
-        $ids = $this->request->get('ids');
-        return view('more_lower', [
-            'ids' => $ids
-        ]);
-    }
-
-    /**
-     * @notes 批量审核
-     * @return \think\response\Json|\think\response\View
-     * @author ljj
-     * @date 2022/9/20 6:38 下午
-     */
-    public function moreAudit()
-    {
-        if ($this->request->isAjax()) {
-            try {
-                $params = $this->request->post();
-                validate(GoodsValidate::class)->scene('moreAudit')->check($params);
-            } catch (ValidateException $e) {
-                return JsonServer::error($e->getMessage());
-            }
-            $result = GoodsLogic::moreAudit($params);
-            if (false === $result) {
-                return JsonServer::error(GoodsLogic::getError());
-            }
-            return JsonServer::success('操作成功');
-        }
-
-        $ids = $this->request->get('ids');
-        return view('more_audit', [
-            'ids' => $ids
-        ]);
-    }
-}

+ 0 - 108
app/admin/controller/goods/Unit.php

@@ -1,108 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\goods;
-
-
-use app\admin\logic\goods\UnitLogic;
-use app\admin\validate\goods\UnitValidate;
-use app\common\basics\AdminBase;
-use app\common\model\goods\GoodsUnit as GoodsUnitModel;
-use app\common\server\JsonServer;
-
-/**
- * 商品单位
- * Class GoodsUnit
- * @package app\admin\controller
- */
-class Unit extends AdminBase
-{
-    /**
-     * Notes: 列表
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('获取成功', UnitLogic::lists($get));
-        }
-        return view();
-    }
-
-
-    /**
-     * Notes: 添加
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new UnitValidate())->goCheck('add');
-            if (UnitLogic::addUnit($post)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(UnitLogic::getError() ?: '操作失败');
-        }
-        return view();
-    }
-
-    /**
-     * Notes: 编辑
-     * @author 段誉(2021/4/15 10:49)
-     * @return string|\think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public function edit()
-    {
-        $id = $this->request->get('unit_id');
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new UnitValidate())->goCheck('edit');
-            if (UnitLogic::editUnit($post)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(UnitLogic::getError() ?: '操作失败');
-        }
-        return view('', ['detail' => GoodsUnitModel::find($id)]);
-    }
-
-    /**
-     * Notes: 删除
-     * @author 段誉(2021/4/15 10:49)
-     * @return \think\response\Json
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            $id = $this->request->post('id');
-            (new UnitValidate())->goCheck('del');
-            if (UnitLogic::del($id)) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(UnitLogic::getError() ?: '操作失败');
-        }
-    }
-}

+ 0 - 118
app/admin/controller/integral/IntegralGoods.php

@@ -1,118 +0,0 @@
-<?php
-
-namespace app\admin\controller\integral;
-
-use app\admin\logic\integral\IntegralGoodsLogic;
-use app\admin\validate\integral\IntegralGoodsValidate;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-/**
- * 积分商城-积分商品
- * Class IntegralGoods
- * @package app\admin\controller\integral
- */
-class IntegralGoods extends AdminBase
-{
-
-    /**
-     * @notes 商品列表
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/2/25 18:28
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = IntegralGoodsLogic::getLists($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-        return view();
-    }
-
-
-    /**
-     * @notes 添加商品
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/2/25 18:27
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 0;
-            (new IntegralGoodsValidate())->goCheck('add', $post);
-            $res = IntegralGoodsLogic::add($post);
-            if (false === $res) {
-                $error = IntegralGoodsLogic::getError() ?: '操作失败';
-                return JsonServer::error($error);
-            }
-            return JsonServer::success('操作成功');
-        }
-        return view();
-    }
-
-
-    /**
-     * @notes 编辑积分商品
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/3/1 15:40
-     */
-    public function edit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 0;
-            (new IntegralGoodsValidate())->goCheck('edit', $post);
-            $res = IntegralGoodsLogic::edit($post);
-            if (false === $res) {
-                $error = IntegralGoodsLogic::getError() ?: '操作失败';
-                return JsonServer::error($error);
-            }
-            return JsonServer::success('操作成功');
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail'   => IntegralGoodsLogic::detail($id),
-        ]);
-    }
-
-
-    /**
-     * @notes 删除商品
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2022/2/25 18:26
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new IntegralGoodsValidate())->goCheck('del');
-            IntegralGoodsLogic::del($post);
-            return JsonServer::success('操作成功');
-        }
-        return JsonServer::error('操作失败');
-    }
-
-
-    /**
-     * @notes 切换状态
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2022/2/25 18:26
-     */
-    public function switchStatus()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            IntegralGoodsLogic::switchStatus($post);
-            return JsonServer::success('操作成功');
-        }
-        return JsonServer::error('操作失败');
-    }
-
-}

+ 0 - 161
app/admin/controller/integral/IntegralOrder.php

@@ -1,161 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\integral;
-
-
-use app\admin\logic\integral\IntegralOrderLogic;
-use app\admin\validate\integral\IntegralOrderValidate;
-use app\common\basics\AdminBase;
-use app\common\enum\IntegralGoodsEnum;
-use app\common\enum\IntegralOrderEnum;
-use app\common\server\JsonServer;
-
-class IntegralOrder extends AdminBase
-{
-    /**
-     * @notes 兑换订单列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author ljj
-     * @date 2022/3/3 10:38 上午
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('', IntegralOrderLogic::lists($get));
-        }
-
-        // 订单状态
-        $order_status = IntegralOrderEnum::getOrderStatus(true);
-        // 兑换类型
-        $type = IntegralGoodsEnum::getTypeDesc(true);
-
-        return view('', [
-            'order_status' => $order_status,
-            'type' => $type,
-        ]);
-    }
-
-    /**
-     * @notes 兑换订单详情
-     * @return \think\response\View
-     * @author ljj
-     * @date 2022/3/3 11:10 上午
-     */
-    public function detail()
-    {
-        $id = $this->request->get('id');
-        $detail = IntegralOrderLogic::detail($id);
-        return view('', [
-            'detail' => $detail,
-        ]);
-    }
-
-    /**
-     * @notes 发货详情
-     * @return \think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author ljj
-     * @date 2022/3/3 11:48 上午
-     */
-    public function delivery()
-    {
-        $id = $this->request->get('id');
-        $detail = IntegralOrderLogic::deliveryDetail($id);
-        $express = IntegralOrderLogic::express();
-        return view('', [
-            'detail' => $detail,
-            'express' => $express
-        ]);
-    }
-
-    /**
-     * @notes 发货操作
-     * @return \think\response\Json|void
-     * @author ljj
-     * @date 2022/3/3 2:53 下午
-     */
-    public function deliveryHandle()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new IntegralOrderValidate())->goCheck('deliveryHandle', $post);
-            $result = IntegralOrderLogic::deliveryHandle($post,$this->adminId);
-            if (true !== $result) {
-                return JsonServer::error($result);
-            }
-            return JsonServer::success('发货成功');
-        }
-    }
-
-    /**
-     * @notes 物流信息
-     * @return \think\response\View
-     * @author ljj
-     * @date 2022/3/3 3:32 下午
-     */
-    public function express()
-    {
-        $id = $this->request->get('id');
-        $detail = IntegralOrderLogic::detail($id);
-        $detail['shipping'] = IntegralOrderLogic::shippingInfo($detail['id']);
-        return view('', [
-            'detail' => $detail
-        ]);
-    }
-
-    /**
-     * @notes 确认收货
-     * @return \think\response\Json|void
-     * @author ljj
-     * @date 2022/3/3 3:39 下午
-     */
-    public function confirm()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new IntegralOrderValidate())->goCheck('confirm', $post);
-            IntegralOrderLogic::confirm($post['id'],$this->adminId);
-            return JsonServer::success('确认成功');
-        }
-    }
-
-    /**
-     * @notes 取消订单
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2022/3/3 18:00
-     */
-    public function cancel()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new IntegralOrderValidate())->goCheck('cancel', $post);
-            IntegralOrderLogic::cancel($post['id']);
-            return JsonServer::success('取消成功');
-        }
-    }
-
-}

+ 0 - 159
app/admin/controller/kefu/Kefu.php

@@ -1,159 +0,0 @@
-<?php
-
-namespace app\admin\controller\kefu;
-
-use app\admin\logic\kefu\KefuLogic;
-use app\admin\validate\kefu\KefuValidate;
-use app\admin\validate\kefu\LoginValidate;
-use app\common\basics\AdminBase;
-use app\common\model\Role;
-use app\common\server\JsonServer;
-use think\facade\Request;
-
-/**
- * 客服管理控制器
- * Class Kefu
- * @package app\admin\controller\kefu
- */
-class Kefu extends AdminBase
-{
-
-    /**
-     * @notes 客服列表
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2021/11/26 18:40
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = KefuLogic::getLists($get);
-            return JsonServer::success('获取成功', $lists);
-        }
-        return view();
-    }
-
-    /**
-     * @notes 添加客服
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2021/11/26 18:04
-     */
-    public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
-            (new KefuValidate())->goCheck('add', $post);
-            $res = KefuLogic::add($post);
-            if (false === $res) {
-                $error = KefuLogic::getError() ?: '操作失败';
-                return JsonServer::error($error);
-            }
-            return JsonServer::success('操作成功');
-        }
-        return view();
-    }
-
-
-    /**
-     * @notes 编辑客服
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2021/11/27 10:45
-     */
-    public function edit()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            $post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
-            (new KefuValidate())->goCheck('edit', $post);
-            $res = KefuLogic::edit($post);
-            if (false === $res) {
-                $error = KefuLogic::getError() ?: '操作失败';
-                return JsonServer::error($error);
-            }
-            return JsonServer::success('操作成功');
-        }
-
-        $id = $this->request->get('id');
-        return view('', [
-            'detail'   => KefuLogic::detail($id),
-        ]);
-    }
-
-
-
-    /**
-     * @notes 删除客服
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2021/11/26 18:53
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            (new KefuValidate())->goCheck('del');
-            KefuLogic::del($post);
-            return JsonServer::success('操作成功');
-        }
-    }
-
-
-    /**
-     * @notes 管理员列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2021/11/26 18:01
-     */
-    public function adminLists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('', KefuLogic::getAdminLists($get));
-        }
-        return view('', ['role_lists' => (new Role())->getRoleLists()]);
-    }
-
-
-    /**
-     * @notes 设置状态
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2021/11/26 18:40
-     */
-    public function status()
-    {
-        if ($this->request->isAjax()) {
-            $post = $this->request->post();
-            KefuLogic::setStatus($post);
-            return JsonServer::success('操作成功');
-        }
-    }
-
-
-    /**
-     * @notes 登录工作台
-     * @return \think\response\Json
-     * @author 段誉
-     * @date 2021/12/15 19:57
-     */
-    public function login()
-    {
-        if ($this->request->isAjax()) {
-            $id = $this->request->post('id/d');
-            (new LoginValidate())->goCheck();
-            $res = KefuLogic::login($id);
-            if (false === $res) {
-                return JsonServer::error(KefuLogic::getError() ?: '系统错误');
-            }
-            return JsonServer::success('', ['url' => $res]);
-        }
-    }
-
-}

+ 0 - 110
app/admin/controller/kefu/KefuLang.php

@@ -1,110 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\controller\kefu;
-use app\admin\logic\kefu\KefuLangLogic;
-use app\admin\logic\kefu\KefuLogic;
-use app\admin\validate\kefu\KefuLangValidate;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-
-/**
- * 客服术语
- * Class KefuLang
- * @package app\admin\controller\kefu
- */
-class KefuLang extends AdminBase
-{
-    /**
-     * @notes 列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DbException
-     * @author cjhao
-     * @date 2021/11/29 15:20
-     */
-    public function lists()
-    {
-        if($this->request->isAjax()){
-            $page = $this->request->get('page', 1);
-            $limit = $this->request->get('limit', 10);
-            $lists = KefuLangLogic::lists($limit,$page);
-            return JsonServer::success('获取成功', $lists);
-        }
-        return view();
-    }
-
-
-    /**
-     * @notes 添加话术
-     * @return \think\response\Json|\think\response\View
-     * @author cjhao
-     * @date 2021/11/29 15:59
-     */
-    public function add()
-    {
-        if($this->request->isAjax()){
-            $post= (new KefuLangValidate())->goCheck('add');
-            $result = KefuLangLogic::add($post);
-            if($result){
-                return JsonServer::success('新增成功', []);
-            }
-            return JsonServer::error('新增失败');
-        }
-        return view();
-
-    }
-
-    /**
-     * @notes 编辑话术
-     * @return \think\response\Json|\think\response\View
-     * @author cjhao
-     * @date 2021/11/29 15:59
-     */
-    public function edit()
-    {
-        if($this->request->isAjax()){
-            $post= (new KefuLangValidate())->goCheck();
-            $result = KefuLangLogic::edit($post);
-            if($result){
-                return JsonServer::success('修改成功', []);
-            }
-            return JsonServer::error('修改失败');
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail'   => KefuLangLogic::detail($id),
-        ]);
-
-    }
-
-    /**
-     * @notes 删除话术
-     * @return \think\response\Json
-     * @author cjhao
-     * @date 2021/11/29 16:35
-     */
-    public function del()
-    {
-        $post= (new KefuLangValidate())->goCheck('del');
-        $result = KefuLangLogic::del($post['id']);
-        if($result){
-            return JsonServer::success('删除成功', []);
-        }
-        return JsonServer::error('删除失败');
-    }
-}

+ 0 - 118
app/admin/controller/live/LiveGoods.php

@@ -1,118 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\live;
-
-
-use app\admin\logic\live\LiveRoomLogic;
-use app\common\basics\AdminBase;
-use app\common\server\JsonServer;
-use app\admin\logic\live\LiveGoodsLogic;
-use app\admin\validate\live\LiveGoodsValidate;
-
-
-/**
- * 直播商品
- * Class LiveGoods
- * @package app\admin\controller\live
- */
-class LiveGoods extends AdminBase
-{
-
-    /**
-     * @notes 直播间列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2023/2/16 10:38
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = LiveGoodsLogic::lists($get);
-            return JsonServer::success('', $lists);
-        }
-        return view('', [
-            'shop' => LiveRoomLogic::shopLists()
-        ]);
-    }
-
-
-    /**
-     * @notes 添加直播商品
-     * @return \think\response\Json|\think\response\View
-     * @throws \GuzzleHttp\Exception\GuzzleException
-     * @author 段誉
-     * @date 2023/2/16 10:38
-     */
-    public function audit()
-    {
-        if ($this->request->isAjax()) {
-            $params = (new LiveGoodsValidate())->goCheck('audit');
-            $result = LiveGoodsLogic::audit($params);
-            if ($result !== true) {
-                return JsonServer::error(LiveGoodsLogic::getError());
-            }
-            return JsonServer::success('操作成功');
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => LiveGoodsLogic::detail($id),
-        ]);
-    }
-
-
-
-    /**
-     * @notes 直播商品详情
-     * @return \think\response\View
-     * @author 段誉
-     * @date 2023/2/16 16:40
-     */
-    public function detail()
-    {
-        $params = (new LiveGoodsValidate())->goCheck('detail');
-        return view('', [
-            'detail' => LiveGoodsLogic::detail($params),
-        ]);
-    }
-
-
-    /**
-     * @notes 删除直播商品
-     * @return \think\response\Json|void
-     * @author 段誉
-     * @date 2023/2/17 10:20
-     */
-    public function del()
-    {
-        if ($this->request->isAjax()) {
-            $params = (new LiveGoodsValidate())->goCheck('del');
-            $result = LiveGoodsLogic::del($params);
-            if ($result !== true) {
-                return JsonServer::error(LiveGoodsLogic::getError());
-            }
-            return JsonServer::success('操作成功');
-        }
-    }
-
-}

+ 0 - 123
app/admin/controller/live/LiveRoom.php

@@ -1,123 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-
-namespace app\admin\controller\live;
-
-
-use app\common\basics\AdminBase;
-use app\common\enum\LiveRoomEnum;
-use app\common\server\JsonServer;
-use app\admin\logic\live\LiveRoomLogic;
-use app\admin\validate\live\LiveRoomValidate;
-
-
-/**
- * 直播间
- * Class LiveRoom
- * @package app\admin\controller\live
- */
-class LiveRoom extends AdminBase
-{
-
-    /**
-     * @notes 直播间列表
-     * @return \think\response\Json|\think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2023/2/16 10:38
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            $lists = LiveRoomLogic::lists($get);
-            return JsonServer::success('', $lists);
-        }
-        return view('', [
-            'live_status' => LiveRoomEnum::getLiveStatusDesc(),
-            'shop' => LiveRoomLogic::shopLists(),
-        ]);
-    }
-
-
-    /**
-     * @notes 编辑直播间
-     * @return \think\response\Json|\think\response\View
-     * @throws \GuzzleHttp\Exception\GuzzleException
-     * @author 段誉
-     * @date 2023/2/16 10:38
-     */
-    public function audit()
-    {
-        if ($this->request->isAjax()) {
-            $params = (new LiveRoomValidate())->goCheck('audit');
-            $result = LiveRoomLogic::audit($params);
-            if ($result !== true) {
-                return JsonServer::error(LiveRoomLogic::getError());
-            }
-            return JsonServer::success('操作成功');
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => LiveRoomLogic::detail($id),
-        ]);
-    }
-
-
-    /**
-     * @notes 直播间详情
-     * @return \think\response\View
-     * @author 段誉
-     * @date 2023/2/16 16:40
-     */
-    public function detail()
-    {
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => LiveRoomLogic::detail($id),
-        ]);
-    }
-
-
-    /**
-     * @notes 推荐值设置
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2023/2/16 16:56
-     */
-    public function recommend()
-    {
-        if ($this->request->isAjax()) {
-            $params = (new LiveRoomValidate())->goCheck('recommend');
-            $result = LiveRoomLogic::recommend($params);
-            if ($result) {
-                return JsonServer::success('操作成功');
-            }
-            return JsonServer::error(LiveRoomLogic::getError());
-        }
-        $id = $this->request->get('id');
-        return view('', [
-            'detail' => LiveRoomLogic::detail($id),
-        ]);
-    }
-
-
-}

+ 0 - 89
app/admin/controller/order/Invoice.php

@@ -1,89 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\order;
-
-use app\common\basics\AdminBase;
-use app\common\model\order\Order;
-use app\common\server\JsonServer;
-use app\admin\logic\order\InvoiceLogic;
-
-
-/**
- * 发票管理
- * Class Invoice
- * @package app\shop\controller\order
- */
-class Invoice extends AdminBase
-{
-
-    /**
-     * @notes 发票列表
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/4/12 17:34
-     */
-    public function lists()
-    {
-        if ($this->request->isAjax()) {
-            $get = $this->request->get();
-            return JsonServer::success('', InvoiceLogic::getInvoiceLists($get));
-        }
-        return view('', [
-            'order_status' => order::getOrderStatus(true)
-        ]);
-    }
-
-
-    /**
-     * @notes 开票
-     * @return \think\response\Json|\think\response\View
-     * @author 段誉
-     * @date 2022/4/12 19:00
-     */
-    public function detail()
-    {
-        $id = $this->request->get('id/d');
-        return view('detail', [
-            'detail' => InvoiceLogic::detail($id)
-        ]);
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function export()
-    {
-        $params = $this->request->get();
-        $result = InvoiceLogic::getInvoiceLists($params, true);
-        if(false === $result) {
-            return JsonServer::error(InvoiceLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-
-}

+ 0 - 130
app/admin/controller/order/Order.php

@@ -1,130 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\controller\order;
-
-use app\common\basics\AdminBase;
-use app\common\model\order\order as OrderModel;
-use app\common\server\JsonServer;
-use app\admin\logic\order\OrderLogic;
-use app\common\model\Client_;
-use app\common\enum\PayEnum;
-use app\common\model\order\OrderLog;
-
-
-/**
- * Class order
- * @package app\admin\controller\order
- */
-class Order extends AdminBase
-{
-
-    /**
-     * @notes 订单列表
-     * @return \think\response\Json|\think\response\View
-     * @author suny
-     * @date 2021/7/13 7:07 下午
-     */
-    public function lists()
-    {
-        $data = OrderLogic::statistics(input());
-        
-        // 订单状态
-        $order_status = OrderModel::getOrderStatus();
-        // 拼装数量统计
-        $order_status   = OrderLogic::getStat($order_status);
-        $all            = OrderLogic::getAll();
-        
-        if ($this->request->isAjax()) {
-            $data['statistics'] = [
-                'all'           => $all,
-                'order_status'  => $order_status,
-            ];
-            return JsonServer::success('', $data);
-        }
-        
-        return view('', [
-            'all'           => $all,
-            'statistics'    => $data,
-            'order_status'  => $order_status,
-            'order_type'    => OrderModel::getOrderType(true),
-            'order_source'  => Client_::getClient(),
-            'pay_way'       => PayEnum::getPayWay(),
-            'delivery_type' => OrderModel::getDeliveryType(true),
-        ]);
-    }
-
-    /**
-     * @notes 订单详情
-     * @return \think\response\View
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/13 7:07 下午
-     */
-    public function detail()
-    {
-
-        $id = $this->request->get('id');
-        $detail = OrderLogic::getDetail($id);
-        $order_log = OrderLog::getOrderLog($id);
-        return view('', [
-            'detail' => $detail,
-            'logs' => $order_log
-        ]);
-    }
-
-    /**
-     * @notes 物流信息
-     * @return \think\response\View
-     * @author suny
-     * @date 2021/7/13 7:07 下午
-     */
-    public function express()
-    {
-        $id = $this->request->get('id');
-        $detail = OrderLogic::getDetail($id);
-        $detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
-        return view('', [
-            'detail' => $detail
-        ]);
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/4/24 10:20
-     */
-    public function export()
-    {
-        $params = $this->request->get();
-        $result = OrderLogic::statistics($params, true);
-        if(false === $result) {
-            return JsonServer::error(OrderLogic::getError() ?: '导出失败');
-        }
-        return JsonServer::success('', $result);
-    }
-}

+ 0 - 232
app/admin/logic/finance/FinanceLogic.php

@@ -1,232 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\finance;
-
-
-use app\common\basics\Logic;
-use app\common\model\AccountLog;
-use app\common\model\order\Order;
-use app\common\enum\PayEnum;
-use app\common\enum\OrderEnum;
-use app\common\enum\OrderRefundEnum;
-use app\common\enum\AfterSaleEnum;
-use app\common\enum\WithdrawalEnum;
-use app\common\enum\DistributionOrderGoodsEnum;
-use app\common\enum\WithdrawEnum;
-use app\common\model\user\User;
-use app\common\model\shop\Shop;
-use app\common\model\shop\ShopWithdrawal;
-use app\common\model\shop\ShopSettlement;
-use app\common\model\WithdrawApply;
-
-
-class FinanceLogic extends Logic
-{
-    /**
-     * @Notes: 商家汇总
-     */
-    public static function shop()
-    {
-
-        $model = new Order();
-        $modelShopSettlement = new ShopSettlement();
-        $modelShopWithdrawal = new ShopWithdrawal();
-        $modelWithdrawApply  = new WithdrawApply();
-
-
-
-
-        //已结算交易服务费(平台收入)、(商家)已结算交易服务费
-        $shopAmount = $settlePoundageAmount = $modelShopSettlement
-            ->sum('trade_service_fee');
-
-        //会员提现手续费(平台收入
-        $userPoundage =  $modelWithdrawApply
-            ->where([
-                ['status', '=', WithdrawEnum::STATUS_SUCCESS]
-            ])
-            ->sum('poundage');
-
-        //商家提现手续费(平台收入)
-        $commissionAmount =  $modelShopWithdrawal
-            ->sum('poundage_amount');
-
-        //成交订单笔数
-        $orderNum = $model
-            ->where([
-                ['pay_status', '>', PayEnum::UNPAID]
-            ])
-            ->count('id');
-
-        //营业额
-        $orderAmount = $model
-            ->where([
-                ['pay_status', '>', PayEnum::UNPAID]
-            ])
-            ->sum('order_amount');
-
-
-        //退款订单金额
-        $refundAmount = $model
-            ->where([
-                ['shipping_status', '=', OrderEnum::SHIPPING_NO],
-                ['pay_status', '=', PayEnum::REFUNDED],
-                ['refund_status', 'in', [OrderEnum::REFUND_STATUS_PART_REFUND, OrderEnum::REFUND_STATUS_ALL_REFUND]],
-            ])
-            ->sum('refund_amount');
-
-        //待退款订单金额
-        $refundAmountIng = $model->alias('o')
-            ->join('order_refund or', 'or.order_id = o.id')
-            ->where([
-                ['o.shipping_status', '=', OrderEnum::SHIPPING_NO],
-                ['or.refund_status', '<>', OrderRefundEnum::REFUND_STATUS_COMPLETE]
-            ])
-            ->sum('or.refund_amount');
-
-        //售后退款金额
-        $salesRefundAmount = $model->alias('o')
-            ->join('after_sale as', 'as.order_id = o.id')
-            ->where([
-                ['o.shipping_status', '=', OrderEnum::SHIPPING_FINISH],
-                ['as.status', '=', AfterSaleEnum::STATUS_COMPLETE]
-            ])
-            ->sum('as.refund_price');
-
-        //待售后退款金额
-        $salesRefundAmountIng = $model->alias('o')
-            ->join('after_sale as', 'as.order_id = o.id')
-            ->where([
-                ['o.shipping_status', '=', OrderEnum::SHIPPING_FINISH],
-                ['as.status', '=', AfterSaleEnum::STATUS_WAITING]
-            ])
-            ->sum('as.refund_price');
-
-
-        //已结算成交订单数
-        $settleOrederNum = $modelShopSettlement
-            ->sum('deal_order_count');
-
-        //已结算营业额
-        $settleOrederAmount = $modelShopSettlement
-            ->sum('business_money');
-
-        //待结算营业额
-        $settleOrederAmountWait = $model
-            ->where([
-                ['refund_status', '=', 0 ],
-                ['settle_id', '=', OrderEnum::SETTLE_WAIT]
-            ])
-            ->sum('order_amount');
-
-        //已结算分销佣金金额
-        $settleDistributionAmount = $modelShopSettlement
-            ->sum('distribution_money');
-
-        //已结算入账金额
-        $settleWithdrawalAmount = $modelShopSettlement
-            ->sum('entry_account_money');
-
-        //已提现金额
-        $withdrawaLeftamount = $modelShopWithdrawal
-            ->where([
-                ['status', '=', WithdrawalEnum::SUCCESS_STATUS]
-            ])
-            ->sum('apply_amount');
-
-        //提现中金额
-        $withdrawaLeftamountIng = $modelShopWithdrawal
-            ->where([
-                ['status', '=', WithdrawalEnum::HANDLE_STATUS]
-            ])
-            ->sum('apply_amount');
-
-        //可提现金额       
-        $modelShop = new Shop();
-        $shopWallet = $modelShop->sum('wallet');
-
-        //会员余额
-        $modelUser = new User();
-        $userMoney = $modelUser
-            ->where([
-                ['del', '=', 0]
-            ])
-            ->sum('user_money');
-
-
-        //会员已结算分销佣金金额                   
-        $userSettleDistributionAmount = $model->alias('o')
-            ->join('order_goods og', 'og.order_id = o.id')
-            ->join('distribution_order_goods dog', 'dog.order_goods_id = og.id')
-            ->where([
-                ['o.settle_id', '=', OrderEnum::SETTLE_FINISH],
-                ['dog.status', '=', DistributionOrderGoodsEnum::STATUS_SUCCESS]
-            ])
-            ->sum('dog.money');
-
-        //已提现佣金金额
-        $userDistributionMoney = $modelWithdrawApply
-            ->where([
-                ['status', '=', WithdrawEnum::STATUS_SUCCESS]
-            ])
-            ->sum('money');
-
-        //提现中佣金金额
-        $userDistributionMoneyIng = $modelWithdrawApply
-            ->where([
-                ['status', '=', WithdrawEnum::STATUS_ING]
-            ])
-            ->sum('money');
-
-        //可提现佣金金额
-        $userDistributionMoneyWait = $modelUser
-            ->where([
-                ['del', '=', 0]
-            ])
-            ->sum('earnings');
-
-
-        //总积分
-        $all_integral = AccountLog::where(['change_type'=>1,'source_type'=>AccountLog::integral_change])->sum('change_amount');
-
-        //签到送出积分
-        $sign_in_integral = AccountLog::where(['source_type'=>AccountLog::sign_in_integral])->sum('change_amount');
-
-        //使用积分
-        $use_integral = AccountLog::where(['change_type'=>2,'source_type'=>AccountLog::integral_change])->sum('change_amount');
-
-        //下单赠送积分
-        $consume_award_integral = AccountLog::where(['source_type'=>AccountLog::consume_award_integral])->sum('change_amount');
-
-        return [
-            'shopAmount'                    =>  $shopAmount, //已结算交易服务费(平台收入)
-            'userPoundage'                  =>  $userPoundage, //会员提现手续费(平台收入)
-            'commissionAmount'              =>  $commissionAmount, //提现中佣金金额
-            'orderNum'                      =>  $orderNum, //成交订单笔数
-            'orderAmount'                   =>  $orderAmount, //营业额
-            'refundAmount'                  =>  $refundAmount, //退款订单金额
-            'refundAmountIng'               =>  $refundAmountIng, //待退款订单金额
-            'salesRefundAmount'             =>  $salesRefundAmount, //售后退款金额
-            'salesRefundAmountIng'          =>  $salesRefundAmountIng, //待售后退款金额
-            'settleOrederNum'               =>  $settleOrederNum, //已结算成交订单数
-            'settleOrederAmount'            =>  $settleOrederAmount, //已结算营业额
-            'settleOrederAmountWait'        =>  $settleOrederAmountWait, //待结算营业额
-            'settleDistributionAmount'      =>  $settleDistributionAmount, //已结算分销佣金金额
-            'settleWithdrawalAmount'        =>  $settleWithdrawalAmount, //已结算入账金额
-            'settlePoundageAmount'          =>  $settlePoundageAmount, //已结算交易服务费
-            'withdrawaLeftamount'           =>  $withdrawaLeftamount, //已提现金额
-            'withdrawaLeftamountIng'        =>  $withdrawaLeftamountIng, //提现中金额
-            'shopWallet'                    =>  $shopWallet, //可提现金额
-            'userMoney'                     =>  $userMoney, //会员余额
-            'userSettleDistributionAmount'  =>  $userSettleDistributionAmount, //会员已结算分销佣金金额
-            'userDistributionMoney'         =>  $userDistributionMoney, //已提现佣金金额
-            'userDistributionMoneyIng'      =>  $userDistributionMoneyIng, //提现中佣金金额
-            'userDistributionMoneyWait'     =>  $userDistributionMoneyWait, //可提现佣金金额
-            'all_integral'                  =>  $all_integral, //总积分
-            'sign_in_integral'              =>  $sign_in_integral, //签到送出积分
-            'use_integral'                  =>  $use_integral, //使用积分
-            'consume_award_integral'        =>  $consume_award_integral, //下单赠送积分
-        ];
-    }
-}

+ 0 - 123
app/admin/logic/finance/IntegralLogic.php

@@ -1,123 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\logic\finance;
-
-
-use app\common\basics\Logic;
-use app\common\model\AccountLog;
-use app\common\server\ExportExcelServer;
-
-class IntegralLogic extends Logic
-{
-    /**
-     * @notes 积分明细
-     * @param $get
-     * @return array
-     * @author ljj
-     * @date 2022/2/22 5:59 下午
-     */
-    public static function integral($get, $is_export = false)
-    {
-        $where[] = ['source_type','in',AccountLog::integral_change];
-        //用户信息
-        if (isset($get['user_info']) && $get['user_info'] != '') {
-            $where[] = ['u.sn|u.nickname', '=', $get['user_info']];
-        }
-        //开始时间
-        if (isset($get['start_time']) && $get['start_time'] != '') {
-            $where[] = ['al.create_time', '>=', strtotime($get['start_time'])];
-        }
-        //结束时间
-        if (isset($get['end_time']) && $get['end_time'] != '') {
-            $where[] = ['al.create_time', '<=', strtotime($get['end_time'])];
-        }
-
-        // 导出
-        if (true === $is_export) {
-            return self::export($where);
-        }
-
-        $lists = AccountLog::alias('al')
-            ->join('user u', 'al.user_id = u.id')
-            ->field('al.id,al.user_id,al.source_type,al.change_amount,al.left_amount,al.remark,al.change_type,al.create_time,u.sn as user_sn,u.nickname')
-            ->where($where)
-            ->page($get['page'], $get['limit'])
-            ->order('id','desc')
-            ->select()
-            ->toArray();
-
-        foreach ($lists as &$list) {
-            $list['change_amount'] = $list['change_type'] == 1 ? '+'.$list['change_amount'] : '-'.$list['change_amount'];
-        }
-
-
-        $count = AccountLog::alias('al')
-            ->join('user u', 'al.user_id = u.id')
-            ->where($where)
-            ->count();
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-
-    /**
-     * @notes 导出商家账户明细Excel
-     * @param array $where
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function export($where)
-    {
-        try {
-            $lists = AccountLog::alias('al')
-                ->join('user u', 'al.user_id = u.id')
-                ->field('al.id,al.user_id,al.source_type,al.change_amount,al.left_amount,al.remark,al.change_type,al.create_time,u.sn as user_sn,u.nickname')
-                ->where($where)
-                ->order('id','desc')
-                ->select()
-                ->toArray();
-
-            foreach ($lists as &$list) {
-                $list['change_amount'] = $list['change_type'] == 1 ? '+'.$list['change_amount'] : '-'.$list['change_amount'];
-            }
-
-            $excelFields = [
-                'user_sn' => '用户编号',
-                'nickname' => '会员信息',
-                'source_type' => '变动类型',
-                'change_amount' => '积分变动',
-                'left_amount' => '剩余积分',
-                'remark' => '备注',
-                'create_time' => '变动时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('积分明细');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-}

+ 0 - 233
app/admin/logic/finance/ShopSettlementLogic.php

@@ -1,233 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\finance;
-
-
-use app\common\basics\Logic;
-use app\common\enum\ShopEnum;
-use app\common\enum\PayEnum;
-use app\common\enum\OrderEnum;
-use app\common\model\order\Order;
-use app\common\model\shop\ShopSettlement;
-use app\common\model\shop\ShopSettlementRecord;
-use app\common\server\ExportExcelServer;
-use app\common\server\UrlServer;
-
-class ShopSettlementLogic extends Logic
-{
-    /**
-     * @Notes: 商家结算列表
-     * @Author: 张无忌
-     * @param $get
-     * @return array
-     */
-    public static function lists($get, $is_export = false)
-    {
-        try {
-            $where = [];
-            if (!empty($get['name'])) {
-                $where[] = ['S.name', 'like', '%'.$get['name'].'%'];
-            }
-
-            if (!empty($get['start_time'])) {
-                $where[] = ['SL.create_time', '>=', strtotime($get['start_time'])];
-            }
-
-            if (!empty($get['end_time'])) {
-                $where[] = ['SL.create_time', '<=', strtotime($get['end_time'])];
-            }
-
-            // 导出
-            if (true === $is_export) {
-                return self::settlementExport($where);
-            }
-
-            $model = new ShopSettlement();
-            $lists = $model->field([
-                    'SL.id,SL.shop_id,S.name,S.type,S.logo',
-                    'sum(SL.deal_order_count) AS deal_order_count',
-                    'sum(SL.business_money) AS business_money',
-                ])->alias('SL')
-                ->join('shop S', 'S.id = SL.shop_id')
-                ->group('shop_id')
-                ->where($where)
-                ->paginate([
-                    'page'      => $get['page'],
-                    'list_rows' => $get['limit'],
-                    'var_page'  => 'page'
-                ])->toArray();
-
-            foreach ($lists['data'] as &$item) {
-                $item['type'] = ShopEnum::getShopTypeDesc($item['type']);
-                $item['logo'] = UrlServer::getFileUrl($item['logo']);
-            }
-
-            return ['count'=>$lists['total'], 'lists'=>$lists['data']];
-        } catch (\Exception $e) {
-            return ['error'=>$e->getMessage()];
-        }
-    }
-
-    /**
-     * @Notes: 商家结算记录
-     * @Author: 张无忌
-     * @param $get
-     * @return array
-     */
-    public static function record($get)
-    {
-        try {
-            $model = new ShopSettlement();
-            $lists = $model->field(true)
-                ->where(['shop_id'=>$get['shop_id']])
-                ->order('id', 'desc')
-                ->paginate([
-                    'page'      => $get['page'],
-                    'list_rows' => $get['limit'],
-                    'var_page' => 'page'
-                ])
-                ->toArray();
-
-            return ['count'=>$lists['total'], 'lists'=>$lists['data']];
-        } catch (\Exception $e) {
-            return ['error'=>$e->getMessage()];
-        }
-    }
-
-    /**
-     * @Notes: 结算详细
-     * @Author: 张无忌
-     * @param $get
-     * @return array
-     */
-    public static function detail($get)
-    {
-        try {
-            $where[] = ['settle_id', '=', (int)$get['settle_id']];
-            if (!empty($get['order_sn']) and $get['order_sn'])
-                $where[] = ['order_sn', 'like', '%'.$get['order_sn'].'%'];
-
-            $model = new ShopSettlementRecord();
-            $lists = $model->field(true)
-                ->where($where)
-                ->order('id', 'asc')
-                ->paginate([
-                    'page'      => $get['page'],
-                    'list_rows' => $get['limit'],
-                    'var_page' => 'page'
-                ])
-                ->toArray();
-
-            return ['count'=>$lists['total'], 'lists'=>$lists['data']];
-        } catch (\Exception $e) {
-            return ['error'=>$e->getMessage()];
-        }
-    }
-
-    /**
-     * @Notes: 结算统计
-     * @return array
-     */
-    public static function statistics($shop_id = 0)
-    {
-        $where = [];
-        if($shop_id){
-            $where[] = ['shop_id', '=' , $shop_id];
-        }
-                   
-        //营业额
-        $modelOrder = new Order();
-
-        //已结算成交订单数
-        $modelShopSettlement = new ShopSettlement();
-        $settleOrederNum = $modelShopSettlement
-                ->where($where)
-                ->sum('deal_order_count');
-
-        //已结算营业额
-        $settleOrederAmount = $modelShopSettlement
-                ->where($where)
-                ->sum('business_money');
-
-        //待结算营业额
-        $settleOrederAmountWait =  $modelOrder
-                ->where([
-                    ['pay_status', '>', PayEnum::UNPAID],
-                    ['settle_id', '=', OrderEnum::SETTLE_WAIT]
-                ])
-                ->sum('order_amount');
-        
-        //已结算分销佣金金额
-        $settleDistributionAmount = $modelShopSettlement
-                ->where($where)
-                ->sum('distribution_money');
-                        
-        //已结算入账金额
-        $settleWithdrawalAmount = $modelShopSettlement
-                ->where($where)
-                ->sum('entry_account_money');  
-
-        //已结算交易服务费
-        $settlePoundageAmount = $modelShopSettlement
-                ->where($where)
-                ->sum('trade_service_fee');     
-
-        return [
-            'settleOrederNum'               =>  $settleOrederNum, //已结算成交订单数
-            'settleOrederAmount'            =>  $settleOrederAmount, //已结算营业额
-            'settleOrederAmountWait'        =>  $settleOrederAmountWait, //待结算营业额
-            'settleDistributionAmount'      =>  $settleDistributionAmount, //已结算分销佣金金额
-            'settleWithdrawalAmount'        =>  $settleWithdrawalAmount, //已结算入账金额
-            'settlePoundageAmount'          =>  $settlePoundageAmount, //已结算交易服务费
-        ];
-    }
-
-
-
-    /**
-     * @notes 导出商家结算Excel
-     * @param array $where
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function settlementExport($where)
-    {
-        try {
-            $model = new ShopSettlement();
-            $lists = $model->field([
-                'SL.id,SL.shop_id,S.name,S.type,S.logo',
-                'sum(SL.deal_order_count) AS deal_order_count',
-                'sum(SL.business_money) AS business_money',
-            ])->alias('SL')
-                ->join('shop S', 'S.id = SL.shop_id')
-                ->group('shop_id')
-                ->where($where)
-                ->select()
-                ->toArray();
-
-            foreach ($lists as &$item) {
-                $item['type'] = ShopEnum::getShopTypeDesc($item['type']);
-            }
-
-            $excelFields = [
-                'name' => '商家名称',
-                'type' => '商家类型',
-                'deal_order_count' => '已结算成交订单数',
-                'business_money' => '已结算营业额',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('商家结算');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-    
-}

+ 0 - 446
app/admin/logic/finance/ShopWithdrawalLogic.php

@@ -1,446 +0,0 @@
-<?php
-
-
-namespace app\admin\logic\finance;
-
-
-use app\common\basics\Logic;
-use app\common\enum\ShopEnum;
-use app\common\enum\ShopWithdrawEnum;
-use app\common\enum\WithdrawalEnum;
-use app\common\model\shop\Shop;
-use app\common\model\shop\ShopAccountLog;
-use app\common\model\shop\ShopAlipay;
-use app\common\model\shop\ShopBank;
-use app\common\model\shop\ShopWithdrawal;
-use app\common\server\ExportExcelServer;
-use app\common\server\UrlServer;
-use app\common\server\YansongdaAliPayTransferServer;
-
-class ShopWithdrawalLogic extends Logic
-{
-    /**
-     * @Notes: 申请提现记录列表
-     * @Author: 张无忌
-     * @param $get
-     * @return array
-     */
-    public static function lists($get, $is_export = false)
-    {
-        try {
-            $where[] = ['status', '=', $get['type'] ?? 0];
-
-            if (!empty($get['start_time']) and $get['start_time']) {
-                $where[] = ['create_time', '>=', strtotime($get['start_time'])];
-            }
-
-            if (!empty($get['end_time']) and $get['end_time']) {
-                $where[] = ['create_time', '<=', strtotime($get['start_time'])];
-            }
-
-            // 导出
-            if (true === $is_export) {
-                return self::withdrawalExport($where);
-            }
-
-            $model = new ShopWithdrawal();
-            $lists = $model->field(true)
-                ->where($where)
-                ->with(['shop'])
-                ->order('id desc')
-                ->paginate([
-                    'page'      => $get['page'],
-                    'list_rows' => $get['limit'],
-                    'var_page' => 'page'
-                ])->toArray();
-
-            foreach ($lists['data'] as &$item) {
-                $item['status_text'] = WithdrawalEnum::getStatusDesc($item['status']);
-            }
-
-            return ['count'=>$lists['total'], 'lists'=>$lists['data']];
-        } catch (\Exception $e) {
-            static::$error = $e->getMessage();
-            return ['error'=>$e->getMessage()];
-        }
-    }
-
-    /**
-     * @Notes: 统计
-     * @Author: 张无忌
-     * @return array
-     */
-    public static function statistics()
-    {
-        $model = new ShopWithdrawal();
-        $apply   = $model->where(['status'=>WithdrawalEnum::APPLY_STATUS])->count();
-        $handle  = $model->where(['status'=>WithdrawalEnum::HANDLE_STATUS])->count();
-        $success = $model->where(['status'=>WithdrawalEnum::SUCCESS_STATUS])->count();
-        $error   = $model->where(['status'=>WithdrawalEnum::ERROR_STATUS])->count();
-
-        return ['apply'=>$apply, 'handle'=>$handle, 'success'=>$success, 'error'=>$error];
-    }
-
-    /**
-     * @Notes: 数据汇总
-     * @Author: 张无忌
-     */
-    public static function summary()
-    {
-        $model = new ShopWithdrawal();
-        $successWithdrawn = $model->where(['status'=>WithdrawalEnum::SUCCESS_STATUS])->sum('apply_amount');
-        $handleWithdrawn = $model->where(['status'=>WithdrawalEnum::HANDLE_STATUS])->sum('apply_amount');
-        $totalWallet = (new Shop())->where(['del'=>0])->sum('wallet');
-
-        return ['successWithdrawn'=>$successWithdrawn, 'handleWithdrawn'=>$handleWithdrawn, 'totalWallet'=>$totalWallet];
-    }
-
-    /**
-     * @Notes: 提现详细
-     * @Author: 张无忌
-     * @param $id
-     * @return array
-     */
-    public static function detail($id)
-    {
-        $withdrawal = (new ShopWithdrawal())->findOrEmpty($id)->toArray();
-        $shop       = (new Shop())->with(['category'])->findOrEmpty($withdrawal['shop_id'])->toArray();
-        $bank       = (new ShopBank())->findOrEmpty($withdrawal['bank_id'])->toArray();
-        $alipay     = (new ShopAlipay())->findOrEmpty($withdrawal['alipay_id'])->toArray();
-
-        $shop['type'] = ShopEnum::getShopTypeDesc($shop['type']);
-        $withdrawal['status_text'] = WithdrawalEnum::getStatusDesc($withdrawal['status']);
-        $withdrawal['type_text'] = ShopWithdrawEnum::getTypeText($withdrawal['type']);
-    
-        return [ 'withdrawal' => $withdrawal, 'shop' => $shop, 'bank' => $bank, 'alipay' => $alipay ];
-    }
-
-    /**
-     * @Notes: 审核提现
-     * @Author: 张无忌
-     * @param $post
-     * @return bool
-     */
-    public static function examine($post)
-    {
-        try {
-            if ($post['is_examine']) {
-                // 同意提现
-                ShopWithdrawal::update([
-                    'explain'     => $post['explain'] ?? '',
-                    'status'      => WithdrawalEnum::HANDLE_STATUS,
-                    'update_time' => time()
-                ], ['id'=>$post['id']]);
-
-            } else {
-                // 拒绝提现
-                $withdrawal = (new ShopWithdrawal())->findOrEmpty($post['id'])->toArray();
-                ShopWithdrawal::update([
-                    'explain'     => $post['explain'] ?? '',
-                    'status'      => WithdrawalEnum::ERROR_STATUS,
-                    'update_time' => time()
-                ], ['id'=>$post['id']]);
-
-                Shop::update([
-                    'wallet'      => ['inc', $withdrawal['apply_amount']],
-                    'update_time' => time()
-                ], ['id'=>$withdrawal['shop_id']]);
-
-                (new ShopAccountLog())->where([
-                    'source_id' => $withdrawal['id'],
-                    'source_sn' => $withdrawal['sn']
-                ])->update([
-                    'change_type' => 1,
-                    'left_amount' => ['inc', $withdrawal['apply_amount']],
-                    'source_type' => ShopAccountLog::withdrawal_fail_money
-                ]);
-            }
-
-            return true;
-        } catch (\Exception $e) {
-            static::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-    /**
-     * @Notes: 审核提现转账
-     * @Author: 张无忌
-     * @param $post
-     * @return bool
-     */
-    public static function transfer($post)
-    {
-        try {
-            if ($post['is_examine']) {
-                // 转账成功
-                ShopWithdrawal::update([
-                    'transfer_content' => $post['transfer_content'] ?? '',
-                    'status'           => WithdrawalEnum::SUCCESS_STATUS,
-                    'transfer_voucher' => $post['image'] ?? '',
-                    'transfer_time'    => time(),
-                    'update_time'      => time()
-                ], ['id'=>(int)$post['id']]);
-
-                $withdrawal = (new ShopWithdrawal())->findOrEmpty($post['id'])->toArray();
-                (new ShopAccountLog())->where([
-                    'source_id' => $withdrawal['id'],
-                    'source_sn' => $withdrawal['sn']
-                ])->update([
-                    'change_type' => 2,
-                    'source_type' => ShopAccountLog::withdrawal_dec_money
-                ]);
-
-            } else {
-                // 转账失败
-                $withdrawal = (new ShopWithdrawal())->findOrEmpty($post['id'])->toArray();
-                ShopWithdrawal::update([
-                    'transfer_content' => $post['transfer_content'] ?? '',
-                    'status'           => WithdrawalEnum::ERROR_STATUS,
-                    'transfer_voucher' => $post['image'] ?? '',
-                    'transfer_time'    => time(),
-                    'update_time'      => time()
-                ], ['id'=>$post['id']]);
-
-                Shop::update([
-                    'wallet'      => ['inc', $withdrawal['apply_amount']],
-                    'update_time' => time()
-                ], ['id'=>$withdrawal['shop_id']]);
-
-                (new ShopAccountLog())->where([
-                    'source_id' => $withdrawal['id'],
-                    'source_sn' => $withdrawal['sn']
-                ])->update([
-                    'change_type' => 1,
-                    'left_amount' => ['inc', $withdrawal['apply_amount']],
-                    'source_type' => ShopAccountLog::withdrawal_fail_money
-                ]);
-            }
-
-            return true;
-        } catch (\Exception $e) {
-            static::$error = $e->getMessage();
-            return false;
-        }
-    }
-    
-    static function transfer_online($post) : bool
-    {
-        try {
-            
-            $detail = ShopWithdrawal::with([ 'alipay' ])->findOrEmpty($post['id']);
-            $result = (new YansongdaAliPayTransferServer())->shopWithdrawTransfer($detail);
-            if (true === $result) {
-                // 转账成功
-                ShopWithdrawal::update([
-                    'explain'          => '',
-                    'status'           => WithdrawalEnum::SUCCESS_STATUS,
-                    'transfer_voucher' => '',
-                    'transfer_time'    => time(),
-                    'update_time'      => time()
-                ], [ 'id' => (int) $post['id'] ]);
-    
-                $withdrawal = (new ShopWithdrawal())->findOrEmpty($post['id'])->toArray();
-                (new ShopAccountLog())->where([
-                    'source_id' => $withdrawal['id'],
-                    'source_sn' => $withdrawal['sn']
-                ])->update([
-                    'change_type' => 2,
-                    'source_type' => ShopAccountLog::withdrawal_dec_money
-                ]);
-            } else {
-                static::$error = (string) $result;
-    
-                // 转账失败
-                $withdrawal = (new ShopWithdrawal())->findOrEmpty($post['id'])->toArray();
-                ShopWithdrawal::update([
-                    'explain'          => '支付宝转账失败',
-                    'status'           => WithdrawalEnum::ERROR_STATUS,
-                    'transfer_voucher' => '',
-                    'transfer_time'    => time(),
-                    'update_time'      => time()
-                ], [ 'id' => $post['id'] ]);
-    
-                Shop::update([
-                    'wallet'      => ['inc', $withdrawal['apply_amount']],
-                    'update_time' => time()
-                ], [ 'id' => $withdrawal['shop_id'] ]);
-    
-                (new ShopAccountLog())->where([
-                    'source_id' => $withdrawal['id'],
-                    'source_sn' => $withdrawal['sn']
-                ])->update([
-                    'change_type' => 1,
-                    'left_amount' => ['inc', $withdrawal['apply_amount']],
-                    'source_type' => ShopAccountLog::withdrawal_fail_money
-                ]);
-            }
-            
-            return true;
-        } catch (\Throwable $e) {
-            static::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @Notes: 账户明细
-     * @Author: 张无忌
-     * @param $get
-     * @return array
-     */
-    public static function account($get, $is_export = false)
-    {
-        $where = [];
-        if (isset($get['shop_name']) && $get['shop_name']) { 
-            $where[] = ['S.name', 'like', '%' . $get['shop_name'] . '%'];
-        }
-        if (isset($get['search_key']) && $get['search_key']) {
-            switch($get['search_key']){
-                case 'settle':
-                    $where[] = ['SAL.source_type', '=', ShopAccountLog::settlement_add_money];
-                    break;
-                case 'withdrawal':
-                    $where[] = ['SAL.source_type', '=', ShopAccountLog::withdrawal_dec_money];
-                    break;
-                case 'withdrawal_stay':
-                    $where[] = ['SAL.source_type', '=', ShopAccountLog::withdrawal_stay_money];
-                    break;
-                case 'withdrawal_error':
-                    $where[] = ['SAL.source_type', '=', ShopAccountLog::withdrawal_fail_money];
-                    break;
-            }
-        }
-
-        if (!empty($get['start_time']) and $get['start_time']) {
-            $where[] = ['SAL.create_time', '>=', strtotime($get['start_time'])];
-        }
-
-        if (!empty($get['end_time']) and $get['end_time']) {
-            $where[] = ['SAL.create_time', '<=', strtotime($get['end_time'])];
-        }
-
-        // 导出
-        if (true === $is_export) {
-            return self::accountExport($where);
-        }
-
-        $model = new ShopAccountLog();
-        $lists = $model->alias('SAL')
-                    ->field(['SAL.*', 'S.name,S.logo,S.type'])
-                    ->join('shop S', 'S.id = SAL.shop_id')
-                    ->order('SAL.id desc')
-                    ->where($where)
-                    ->paginate([
-                        'page'      => $get['page'],
-                        'list_rows' => $get['limit'],
-                        'var_page'  => 'page'
-                    ])->toArray();
-
-
-        foreach ($lists['data'] as &$item) {
-            $item['logo'] = empty($item['logo']) ? '' : UrlServer::getFileUrl($item['logo']);
-            $item['type'] = ShopEnum::getShopTypeDesc($item['type']);
-            $item['source_type'] = ShopAccountLog::getSourceType($item['source_type']);
-            $item['change_amount'] = $item['change_type'] == 1 ? '+'.$item['change_amount'] : '-'.$item['change_amount'];
-            $item['logo'] = !empty($item['logo']) ? UrlServer::getFileUrl($item['logo']) : "";
-        }
-
-        return ['count'=>$lists['total'], 'lists'=>$lists['data']];
-    }
-
-    /**
-     * @notes 导出商家明细Excel
-     * @param array $where
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function withdrawalExport($where)
-    {
-        try {
-            $model = new ShopWithdrawal();
-            $lists = $model->field(true)
-                ->where($where)
-                ->with(['shop'])
-                ->select()->toArray();
-
-            foreach ($lists as &$item) {
-                $item['status_text'] = WithdrawalEnum::getStatusDesc($item['status']);
-                $item['shop_name'] = $item['shop']['name'];
-                $item['shop_type'] = ShopEnum::getShopTypeDesc($item['shop']['type']);
-            }
-
-            $excelFields = [
-                'shop_name' => '商家名称',
-                'shop_type' => '商家类型',
-                'sn' => '提现单号',
-                'apply_amount' => '提现金额',
-                'poundage_amount' => '提现手续费',
-                'left_amount' => '到账金额',
-                'status_text' => '提现状态',
-                'create_time' => '提现时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('商家提现');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 导出商家账户明细Excel
-     * @param array $where
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function accountExport($where)
-    {
-        try {
-            $model = new ShopAccountLog();
-            $lists = $model->alias('SAL')
-                ->field(['SAL.*', 'S.name,S.type'])
-                ->join('shop S', 'S.id = SAL.shop_id')
-                ->order('SAL.id desc')
-                ->where($where)
-                ->select()->toArray();
-
-            foreach ($lists as &$item) {
-                $item['type'] = ShopEnum::getShopTypeDesc($item['type']);
-                $item['source_type'] = ShopAccountLog::getSourceType($item['source_type']);
-                $item['change_amount'] = $item['change_type'] == 1 ? '+'.$item['change_amount'] : '-'.$item['change_amount'];
-            }
-
-            $excelFields = [
-                'name' => '商家名称',
-                'type' => '商家类型',
-                'log_sn' => '明细流水号',
-                'source_sn' => '来源单号',
-                'source_type' => '明细类型',
-                'change_amount' => '变动金额',
-                'left_amount' => '剩余金额',
-                'create_time' => '记录时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('商家账户明细');
-            $export->setExportNumber(['log_sn', 'source_sn']);
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-}

+ 0 - 929
app/admin/logic/finance/WithdrawLogic.php

@@ -1,929 +0,0 @@
-<?php
-
-namespace app\admin\logic\finance;
-
-use app\admin\logic\WechatMerchantTransferLogic;
-use app\common\basics\Logic;
-use app\common\model\RechargeOrder;
-use app\common\model\WithdrawApply;
-use app\common\enum\WithdrawEnum;
-use app\common\server\ConfigServer;
-use app\common\server\ExportExcelServer;
-use app\common\server\UrlServer;
-use app\common\model\user\User;
-use app\common\logic\AccountLogLogic;
-use app\common\model\AccountLog;
-use app\admin\logic\WechatCorporatePaymentLogic;
-use think\facade\Db;
-use think\Exception;
-
-/**
- * Class WithdrawLogic
- * @package app\admin\logic\finance
- */
-class WithdrawLogic extends Logic
-{
-    /**
-     * @notes 会员佣金提现列表
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:00 上午
-     */
-    public static function lists($get, $is_export = false)
-    {
-
-        $where = [];
-        // 会员信息
-        if (!empty($get['search_key']) && !empty($get['keyword'])) {
-            $keyword = $get['keyword'];
-            if ($get['search_key'] == 'user_sn') {
-                $where[] = ['u.sn', '=', $keyword];
-            } elseif ($get['search_key'] == 'nickname') {
-                $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
-            }
-        }
-
-        //提现单号
-        if (isset($get['withdraw_sn']) && $get['withdraw_sn'] != '') {
-            $where[] = ['w.sn', '=', $get['withdraw_sn']];
-        }
-
-        //提现方式
-        if (isset($get['type']) && $get['type'] != '') {
-            $where[] = ['w.type', '=', $get['type']];
-        }
-
-        //提现状态
-        if (isset($get['status']) && $get['status'] != '') {
-            $where[] = ['status', '=', $get['status']];
-        }
-
-        if (empty($get['start_time']) && empty($get['end_time'])) {
-            $where[] = ['w.create_time', '>=', strtotime(date("Y-m-d", time()))];
-            $where[] = ['w.create_time', '<=', strtotime(date("Y-m-d", time())) + 86399];
-        }
-
-        // 提现时间
-        if (isset($get['start_time']) && $get['start_time'] && isset($get['end_time']) && $get['end_time']) {
-            $where[] = ['w.create_time', 'between', [strtotime($get['start_time']), strtotime($get['end_time'])]];
-//        }else{
-////            $where[] = ['w.create_time', 'between', Time::today()];
-        }
-
-        // 导出
-        if (true === $is_export) {
-            return self::withdrawExport($where);
-        }
-
-
-        $lists = WithdrawApply::alias('w')
-            ->field('w.*, u.nickname,u.avatar, u.sn as user_sn, u.mobile, ul.name as user_level_name')
-            ->with('user')
-            ->leftJoin('user u', 'u.id = w.user_id')
-            ->leftJoin('user_level ul', 'ul.id = u.level')
-            ->where($where)
-            ->page($get['page'], $get['limit'])
-            ->order('w.id desc')
-            ->select();
-        $count = WithdrawApply::alias('w')
-            ->field('w.*, u.nickname,u.avatar, u.sn as user_sn, u.mobile, ul.name as user_level_name')
-            ->leftJoin('user u', 'u.id = w.user_id')
-            ->leftJoin('user_level ul', 'ul.id = u.level')
-            ->where($where)
-            ->order('w.id desc')
-            ->count();
-
-
-        foreach ($lists as &$item) {
-            if (empty($item['user'])) {
-                // 用户不存在
-                $user = [
-                    'avatar' => '',
-                    'sn' => '-',
-                    'nickname' => '-',
-                ];
-            } else {
-                $user  = $item['user'];
-            }
-            $item['type_text'] = WithdrawEnum::getTypeDesc($item['type']);
-            $item['status_text'] = WithdrawEnum::getStatusDesc($item['status']);
-            $item['avatar'] = UrlServer::getFileUrl($item['avatar']);
-            $user['avatar'] = UrlServer::getFileUrl($user['avatar']);
-            $item['user_level_name'] = $item['user_level_name'] ? $item['user_level_name'] : '无等级';
-            $user['user_level_name'] = $item['user_level_name'];
-            // 通过中间变量$user解决Indirect modification of overloaded element报错
-            $item['user'] = $user;
-        }
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 数据汇总
-     * @return array
-     * @author suny
-     * @date 2021/7/14 10:01 上午
-     */
-    public static function summary()
-    {
-
-        $model = new WithdrawApply();
-        $successWithdraw = $model->where(['status' => WithdrawEnum::STATUS_SUCCESS])->sum('money');
-        $handleWithdraw = $model->where(['status' => WithdrawEnum::STATUS_ING])->sum('money');
-        $totalEarnings = (new User())->where(['del' => 0])->sum('earnings');
-
-        return ['successWithdraw' => $successWithdraw, 'handleWithdraw' => $handleWithdraw, 'totalEarnings' => $totalEarnings];
-    }
-
-    /**
-     * @notes 佣金明细
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:01 上午
-     */
-    public static function commission($get, $is_export = false)
-    {
-
-        $where = [];
-
-        // 明细类型
-        $source_type = AccountLog::earnings_change;
-        if (isset($get['source_type']) && !empty($get['source_type'])) {
-            $where[] = ['a.source_type', '=', $get['source_type']];
-        } else {
-            $where[] = ['a.source_type', 'in', $source_type];
-        }
-
-        //明细搜索
-        if (!empty($get['search_key']) && !empty($get['keyword'])) {
-            $keyword = $get['keyword'];
-            switch ($get['search_key']) {
-                case  'user_sn' :
-                    $where[] = ['u.sn', '=', $keyword];
-                    break;
-                case  'nickname' :
-                    $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
-                    break;
-            }
-        }
-
-        if (empty($get['start_time']) && empty($get['end_time'])) {
-            $where[] = ['a.create_time', '>=', strtotime(date("Y-m-d", time()))];
-            $where[] = ['a.create_time', '<=', strtotime(date("Y-m-d", time())) + 86399];
-        }
-
-        //明细时间
-        if (isset($get['start_time']) && $get['start_time'] != '') {
-            $where[] = ['a.create_time', '>=', strtotime($get['start_time'])];
-        }
-
-        if (isset($get['end_time']) && $get['end_time'] != '') {
-            $where[] = ['a.create_time', '<=', strtotime($get['end_time'])];
-        }
-
-        // 导出
-        if (true === $is_export) {
-            return self::commissionExport($where);
-        }
-
-        $lists = AccountLog::alias('a')
-            ->field('a.*,u.nickname,u.sn as user_sn,u.mobile,w.sn as withdraw_sn')
-            ->join('user u', 'u.id = a.user_id')
-            ->leftjoin('withdraw_apply w', 'w.sn = a.source_sn')
-            ->where($where)
-            ->page($get['page'], $get['limit'])
-            ->order('a.id desc')
-            ->select();
-
-        $count = AccountLog::alias('a')
-            ->field('a.*,u.nickname,u.sn as user_sn,u.mobile,w.sn as withdraw_sn')
-            ->join('user u', 'u.id = a.user_id')
-            ->leftjoin('withdraw_apply w', 'w.sn = a.source_sn')
-            ->where($where)
-            ->order('a.id desc')
-            ->count();
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 账户明细
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:01 上午
-     */
-    public static function account($get, $is_export = false)
-    {
-
-        $where = [];
-
-        // 明细类型
-        $source_type = AccountLog::money_change;
-        if (isset($get['type']) && !empty($get['type'])) {
-            switch ($get['type']) {
-                case 'admin_add_money' :
-                    $type = AccountLog::admin_add_money;
-                    break;
-                case 'admin_reduce_money' :
-                    $type = AccountLog::admin_reduce_money;
-                    break;
-                case 'recharge_money' :
-                    $type = AccountLog::recharge_money;
-                    break;
-                case 'balance_pay_order' :
-                    $type = AccountLog::balance_pay_order;
-                    break;
-                case 'cancel_order_refund' :
-                    $type = AccountLog::cancel_order_refund;
-                    break;
-                case 'after_sale_refund' :
-                    $type = AccountLog::after_sale_refund;
-                    break;
-                case 'withdraw_to_balance' :
-                    $type = AccountLog::withdraw_to_balance;
-                    break;
-                case 'user_transfer_inc_balance' :
-                    $type = AccountLog::user_transfer_inc_balance;
-                    break;
-                case 'user_transfer_dec_balance' :
-                    $type = AccountLog::user_transfer_dec_balance;
-                    break;
-                case 'integral_order_inc_balance' :
-                    $type = AccountLog::integral_order_inc_balance;
-                    break;
-                case 'integral_order_dec_balance' :
-                    $type = AccountLog::integral_order_dec_balance;
-                    break;
-            }
-            $where[] = ['a.source_type', '=', $type];
-        } else {
-            $where[] = ['a.source_type', 'in', $source_type];
-        }
-
-        //明细搜索
-        if (!empty($get['search_key']) && !empty($get['keyword'])) {
-            $keyword = $get['keyword'];
-            switch ($get['search_key']) {
-                case  'user_sn' :
-                    $where[] = ['u.sn', '=', $keyword];
-                    break;
-                case  'nickname' :
-                    $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
-                    break;
-            }
-        }
-
-        if (empty($get['start_time']) && empty($get['end_time'])) {
-            $where[] = ['a.create_time', '>=', strtotime(date("Y-m-d", time()))];
-            $where[] = ['a.create_time', '<=', strtotime(date("Y-m-d", time())) + 86399];
-        }
-
-        //明细时间
-        if (isset($get['start_time']) && $get['start_time'] != '') {
-            $where[] = ['a.create_time', '>=', strtotime($get['start_time'])];
-        }
-
-        if (isset($get['end_time']) && $get['end_time'] != '') {
-            $where[] = ['a.create_time', '<=', strtotime($get['end_time'])];
-        }
-
-        // 导出
-        if (true === $is_export) {
-            return self::accountExport($where);
-        }
-
-        $lists = AccountLog::alias('a')
-            ->field('a.*,u.nickname,u.sn as user_sn,u.mobile')
-            ->join('user u', 'u.id = a.user_id')
-            ->where($where)
-            ->page($get['page'], $get['limit'])
-            ->order('a.id desc')
-            ->select();
-
-        $count = AccountLog::alias('a')
-            ->field('a.*,u.nickname,u.sn as user_sn,u.mobile')
-            ->join('user u', 'u.id = a.user_id')
-            ->where($where)
-            ->order('a.id desc')
-            ->count();
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 充值明细
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:01 上午
-     */
-    public static function recharge($get, $is_export = false)
-    {
-
-        $where = [];
-
-        //明细搜索
-        if (isset($get['search_key']) && !empty($get['search_key'])) {
-            $keyword = $get['keyword'];
-            switch ($get['search_key']) {
-                case  'nickname' :
-                    $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
-                    break;
-                case  'order_sn' :
-                    $where[] = ['order_sn', '=', $keyword];
-                    break;
-                case  'user_mobile' :
-                    $where[] = ['u.mobile', '=', $keyword];
-                    break;
-            }
-        }
-
-        //订单来源
-        if (isset($get['order_source']) && $get['order_source'] != '') {
-            $where[] = ['r.order_source', '=', $get['order_source']];
-        }
-
-        //订单状态
-        if (isset($get['pay_status']) && $get['pay_status'] != '') {
-            $where[] = ['r.pay_status', '=', $get['pay_status']];
-        }
-
-        //支付方式
-        if (isset($get['pay_way']) && $get['pay_way'] != '') {
-            $where[] = ['r.pay_way', '=', $get['pay_way']];
-        }
-
-        if (! empty($get['start_time']) && ! empty($get['end_time'])) {
-            $where[] = ['r.create_time', '>=', strtotime($get['start_time']) ];
-            $where[] = ['r.create_time', '<=', strtotime($get['end_time']) ];
-        }
-
-        // 导出
-        if (true === $is_export) {
-            return self::rechargeExport($where);
-        }
-
-        $lists = RechargeOrder::alias('r')
-            ->field('r.*,u.id,u.nickname,u.mobile')
-            ->join('user u', 'u.id = r.user_id')
-            ->where($where)
-            ->page($get['page'], $get['limit'])
-            ->order('r.id desc')
-            ->select();
-        foreach ($lists as $list) {
-            if (!empty($list['pay_time'])) {
-                $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
-            }
-        }
-
-        $count = RechargeOrder::alias('r')
-            ->field('r.*,u.id,u.nickname,u.mobile')
-            ->join('user u', 'u.id = r.user_id')
-            ->where($where)
-            ->order('r.id desc')
-            ->count();
-
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 会员佣金提现详情
-     * @param $id
-     * @return array|\think\Model|null
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:01 上午
-     */
-    public static function detail($id)
-    {
-
-        $detail = WithdrawApply::alias('w')
-            ->field('w.*,u.sn as user_sn, u.nickname, u.mobile')
-            ->leftJoin('user u', 'u.id=w.user_id')
-            ->where('w.id', $id)
-            ->find();
-        $detail['money_qr_code'] = UrlServer::getFileUrl($detail['money_qr_code'] ?? '');
-        $detail['typeDesc'] = WithdrawEnum::getTypeDesc($detail['type']);
-        $detail['statusDesc'] = WithdrawEnum::getStatusDesc($detail['status']);
-        $detail['transfer_time'] = $detail['transfer_time'] ? date('Y-m-d H:i:s', $detail['transfer_time']) : '';
-        $detail['payment_time'] = $detail['payment_time'] ? date('Y-m-d H:i:s', $detail['payment_time']) : '';
-        return $detail;
-    }
-
-    /**
-     * @notes 审核通过
-     * @param $post
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/14 10:02 上午
-     */
-    public static function confirm($post)
-    {
-        try {
-            $id = $post['id'];
-            $withdraw = WithdrawApply::where('id', $id)
-                ->find();
-            
-            // 判断提现单是否为待提现状态 1
-            if ($withdraw['status'] != 1) {
-                return [
-                    'code' => 0,
-                    'msg' => '不是待提现申请单'
-                ];
-            }
-            
-            //提现到钱包余额
-            if ($withdraw['type'] == WithdrawEnum::TYPE_BALANCE) {
-                $user = User::find($withdraw['user_id']);
-                $user->user_money = ['inc', $withdraw['left_money']];
-                $user->save();
-                AccountLogLogic::AccountRecord(
-                    $withdraw['user_id'],
-                    $withdraw['left_money'],
-                    1,
-                    AccountLog::withdraw_to_balance,
-                    '',
-                    $withdraw['id'],
-                    $withdraw['sn']
-                );
-                //更新提现申请单状态为提现成功
-                WithdrawApply::where('id', $id)
-                    ->update(['status' => WithdrawEnum::STATUS_SUCCESS, 'update_time' => time(), 'description' => $post['description']]);
-                
-                return [
-                    'code' => 1,
-                    'msg' => '提现至钱包余额成功'
-                ];
-            }
-            //提现到微信零钱
-            if ($withdraw['type'] == WithdrawEnum::TYPE_WECHAT_CHANGE) {
-                // 先更新审核备注
-                WithdrawApply::where('id', $id)
-                    ->update(['update_time' => time(), 'description' => $post['description']]);
-                
-                //微信零钱接口:1-企业付款到零钱;2-商家转账到零钱
-                $transfer_way = ConfigServer::get('withdraw', 'transfer_way',1);
-                if ($transfer_way == 1) {
-                    return WechatCorporatePaymentLogic::pay($withdraw);
-                }
-                if ($transfer_way == 2) {
-                    return WechatMerchantTransferLogic::transfer($withdraw);
-                }
-            }
-            
-            //提现到微信收款码、支付收款码
-            if ($withdraw['type'] == WithdrawEnum::TYPE_WECHAT_CODE || $withdraw['type'] == WithdrawEnum::TYPE_ALI_CODE || WithdrawEnum::TYPE_BANK) {
-                // 直接标识为提现中状态
-                WithdrawApply::where('id', $id)
-                    ->update(['status' => WithdrawEnum::STATUS_ING, 'update_time' => time(), 'description' => $post['description']]);
-                return [
-                    'code' => 1,
-                    'msg' => '审核通过,提现中'
-                ];
-            }
-            return [
-                'code' => 1,
-                'msg' => '审核通过,提现中'
-            ];
-        } catch(\Throwable $e) {
-            return [
-                'code' => 0,
-                'msg' => $e->getMessage(),
-            ];
-        }
-    }
-
-    /**
-     * @notes 审核拒绝
-     * @param $post
-     * @throws \think\exception\PDOException
-     * @author suny
-     * @date 2021/7/14 10:03 上午
-     */
-    public static function refuse($post)
-    {
-
-        Db::startTrans();
-        try {
-            $withdraw_apply = WithdrawApply::where('id', $post['id'])->find();
-            $withdraw_apply->status = WithdrawEnum::STATUS_FAIL; // 提现失败
-            $withdraw_apply->description = $post['description'];
-            $withdraw_apply->update_time = time();
-            $withdraw_apply->save();
-
-            //拒绝提现,回退佣金
-            $user = User::find($withdraw_apply['user_id']);
-            $user->earnings = ['inc', $withdraw_apply['money']];
-            $user->save();
-
-            //增加佣金变动记录
-            AccountLogLogic::AccountRecord(
-                $withdraw_apply['user_id'],
-                $withdraw_apply['money'],
-                1,
-                AccountLog::withdraw_back_earnings,
-                '',
-                $withdraw_apply['id'],
-                $withdraw_apply['sn']
-            );
-            Db::commit();
-        } catch (Exception $e) {
-            Db::rollback();
-        }
-    }
-
-    /**
-     * @notes 审核拒绝
-     * @param $post
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/14 10:03 上午
-     */
-    public static function transferFail($post)
-    {
-
-        if (empty($post['transfer_description'])) {
-            return [
-                'code' => 0,
-                'msg' => '请填写转账说明'
-            ];
-        }
-        // 标识提现失败
-        WithdrawApply::where('id', $post['id'])->update([
-            'status' => 4, // 提现失败
-            'transfer_voucher' => $post['transfer_voucher'] ? $post['transfer_voucher'] : '',
-            'transfer_description' => $post['transfer_description'],
-            'update_time' => time()
-        ]);
-
-        $withdraw_apply = WithdrawApply::where('id', $post['id'])->find();
-        // 退回佣金
-        $user = User::find($withdraw_apply['user_id']);
-        $user->earnings = ['inc', $withdraw_apply['money']];
-        $user->save();
-
-        //增加佣金变动记录
-        AccountLogLogic::AccountRecord(
-            $withdraw_apply['user_id'],
-            $withdraw_apply['money'],
-            1,
-            AccountLog::withdraw_back_earnings,
-            '',
-            $withdraw_apply['id'],
-            $withdraw_apply['sn']
-        );
-        return [
-            'code' => 1,
-            'msg' => '转账失败,提现金额已退回佣金账户'
-        ];
-    }
-
-    /**
-     * @notes 转账成功
-     * @param $post
-     * @return array
-     * @author suny
-     * @date 2021/7/14 10:03 上午
-     */
-    public static function transferSuccess($post)
-    {
-
-        if (empty($post['transfer_voucher'])) {
-            return [
-                'code' => 0,
-                'msg' => '请上传转账凭证'
-            ];
-        }
-
-        $post['transfer_voucher'] = UrlServer::getFileUrl($post['transfer_voucher']);
-
-        if (empty($post['transfer_description'])) {
-            return [
-                'code' => 0,
-                'msg' => '请填写转账说明'
-            ];
-        }
-        // 标识提现成功
-        WithdrawApply::where('id', $post['id'])->update([
-            'status' => 3, // 提现成功
-            'transfer_voucher' => $post['transfer_voucher'],
-            'transfer_description' => $post['transfer_description'],
-            'update_time' => time(),
-            'transfer_time' => time()
-        ]);
-
-        return [
-            'code' => 1,
-            'msg' => '转账成功'
-        ];
-    }
-
-    /**
-     * @notes 提现失败
-     * @param $id
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/14 10:03 上午
-     */
-    public static function withdrawFailed($id)
-    {
-
-        $withdraw_apply = WithdrawApply::where('id', $id)->find();
-        $withdraw_apply->status = WithdrawEnum::STATUS_FAIL; // 提现失败
-        $withdraw_apply->update_time = time();
-        $withdraw_apply->save();
-
-        //拒绝提现,回退佣金
-        $user = User::find($withdraw_apply['user_id']);
-        $user->earnings = ['inc', $withdraw_apply['money']];
-        $user->save();
-
-        //增加佣金变动记录
-        AccountLogLogic::AccountRecord(
-            $withdraw_apply['user_id'],
-            $withdraw_apply['money'],
-            1,
-            AccountLog::withdraw_back_earnings,
-            '',
-            $withdraw_apply['id'],
-            $withdraw_apply['sn']
-        );
-    }
-
-    /**
-     * @notes 搜索
-     * @param $id
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:03 上午
-     */
-    public static function search($id)
-    {
-
-        $withdraw = WithdrawApply::where('id', $id)
-            ->find();
-
-        // 判断提现单是否为提现中状态 2 且 提现方式为 微信零钱 2
-        if ($withdraw['status'] == 2 && $withdraw['type'] == 2) {
-            //微信零钱接口:1-企业付款到零钱;2-商家转账到零钱
-            $transfer_way = ConfigServer::get('withdraw', 'transfer_way',1);
-            if ($transfer_way == 1) {
-                return WechatCorporatePaymentLogic::search($withdraw);
-            }
-            if ($transfer_way == 2) {
-                $result = WechatMerchantTransferLogic::details($withdraw);
-                // 记录查询结果
-                WithdrawApply::update(['update_time'=>time(),'pay_search_desc'=>json_encode($result, JSON_UNESCAPED_UNICODE)],['id'=>$withdraw['id']]);
-                if(isset($result['state'])) {
-                    if ($result['state'] == 'SUCCESS') {
-                        // 转账成功,标记提现申请单为提现成功,记录支付信息
-                        WithdrawApply::update(['status'=>3,'payment_no'=>$result['transfer_bill_no'],'payment_time'=>strtotime($result['update_time'])],['id'=>$withdraw['id']]);
-                        return ['code' => 1, 'msg' => '提现成功'];
-                    }
-                    if ($result['state'] == 'FAIL') {
-                        // 转账失败
-                        WithdrawApply::update(['status'=>4],['id'=>$withdraw['id']]);
-                        //回退佣金
-                        $user = User::find($withdraw['user_id']);
-                        $user->earnings = ['inc', $withdraw['money']];
-                        $user->save();
-
-                        //增加佣金变动记录
-                        AccountLogLogic::AccountRecord(
-                            $withdraw['user_id'],
-                            $withdraw['money'],
-                            1,
-                            AccountLog::withdraw_back_earnings,
-                            '',
-                            $withdraw['id'],
-                            $withdraw['sn']
-                        );
-                        return ['code' => 1, 'msg' => '提现至微信零钱失败'];
-                    }
-                    if ($result['state'] == 'PROCESSING') {
-                        return ['code' => 0, 'msg' => '正在处理中'];
-                    }
-                }else{
-                    return ['code' => 0, 'msg' => $result['message'] ?? '商家转账到零钱查询失败'];
-                }
-            }
-        } else {
-            return [
-                'code' => 0,
-                'msg' => '不是提现中的微信零钱申请单,无法查询'
-            ];
-        }
-    }
-
-
-
-    /**
-     * @notes 导出Excel
-     * @param array $where
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function rechargeExport($where)
-    {
-        try {
-            $lists = RechargeOrder::alias('r')
-                ->field('r.*,u.id,u.nickname,u.mobile')
-                ->join('user u', 'u.id = r.user_id')
-                ->where($where)
-                ->order('r.id desc')
-                ->select()->toArray();
-
-            foreach ($lists as &$list) {
-                if (!empty($list['pay_time'])) {
-                    $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
-                }
-            }
-
-            $excelFields = [
-                'order_sn' => '订单编号',
-                'nickname' => '用户昵称',
-                'mobile' => '用户手机号',
-                'order_amount' => '充值金额',
-                'give_money' => '赠送金额',
-                'give_growth' => '赠送成长值',
-                'pay_way' => '支付方式',
-                'pay_time' => '支付时间',
-                'pay_status' => '订单状态',
-                'create_time' => '下单时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('充值明细');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @param array $where
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function accountExport($where)
-    {
-        try {
-            $lists = AccountLog::alias('a')
-                ->field('a.*,u.nickname,u.sn as user_sn,u.mobile')
-                ->join('user u', 'u.id = a.user_id')
-                ->where($where)
-                ->order('a.id desc')
-                ->select();
-
-            $excelFields = [
-                'nickname' => '会员昵称',
-                'user_sn' => '会员编号',
-                'mobile' => '手机号码',
-                'change_amount' => '变动金额',
-                'left_amount' => '剩余金额',
-                'source_type' => '明细类型',
-                'source_sn' => '来源单号',
-                'create_time' => '记录时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('账户明细');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @param array $condition
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function commissionExport($where)
-    {
-        try {
-            $lists = AccountLog::alias('a')
-                ->field('a.*,u.nickname,u.sn as user_sn,u.mobile,w.sn as withdraw_sn')
-                ->join('user u', 'u.id = a.user_id')
-                ->leftjoin('withdraw_apply w', 'w.sn = a.source_sn')
-                ->where($where)
-                ->order('a.id desc')
-                ->select();
-
-            $excelFields = [
-                'nickname' => '会员昵称',
-                'user_sn' => '会员编号',
-                'mobile' => '手机号码',
-                'change_amount' => '变动金额',
-                'left_amount' => '剩余佣金',
-                'source_type' => '明细类型',
-                'withdraw_sn' => '来源单号',
-                'create_time' => '记录时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('佣金明细');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @param array $condition
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function withdrawExport($where)
-    {
-        try {
-            $lists = WithdrawApply::alias('w')
-                ->field('w.*, u.nickname,u.avatar, u.sn as user_sn, u.mobile, ul.name as user_level_name')
-                ->with('user')
-                ->leftJoin('user u', 'u.id = w.user_id')
-                ->leftJoin('user_level ul', 'ul.id = u.level')
-                ->where($where)
-                ->order('w.id desc')
-                ->select();
-
-            foreach ($lists as &$item) {
-                $item['type_text'] = WithdrawEnum::getTypeDesc($item['type']);
-                $item['status_text'] = WithdrawEnum::getStatusDesc($item['status']);
-            }
-
-            $excelFields = [
-                'sn' => '提现单号',
-                'nickname' => '会员昵称',
-                'user_sn' => '会员编号',
-                'mobile' => '手机号码',
-                'left_money' => '提现金额',
-                'type_text' => '提现方式',
-                'status_text' => '提现状态',
-                'remark' => '提现说明',
-                'create_time' => '提现时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('佣金提现');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-}

+ 0 - 111
app/admin/logic/goods/BrandLogic.php

@@ -1,111 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\goods;
-
-
-use app\common\basics\Logic;
-use app\common\model\goods\GoodsBrand;
-
-
-/**
- * 商品品牌
- * Class GoodsBrandLogic
- * @package app\admin\logic
- */
-class BrandLogic extends Logic
-{
-
-    /**
-     * Notes: 列表
-     * @param $get
-     * @author 段誉(2021/4/15 10:53)
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public static function lists($get)
-    {
-        $where[] = ['del', '=', 0];
-        if(isset($get['name']) && $get['name']) {
-            $where[] = ['name','like','%'.$get['name'].'%'];
-        }
-
-        $lists = GoodsBrand::where($where)
-            ->order('sort')
-            ->paginate([
-                'list_rows'=> $get['limit'],
-                'page'=> $get['page'],
-            ]);
-        return ['count' => $lists->total(), 'lists' => $lists->getCollection()];
-    }
-
-
-    /**
-     * Notes: 添加
-     * @param $post
-     * @return GoodsBrand|\think\Model
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function add($post)
-    {
-        return GoodsBrand::create([
-            'name'     => $post['name'],
-            'initial'  => $post['initial'],
-            'image'    => $post['image'] ?? '',
-            'sort'     => $post['sort'] ?? 100,
-            'is_show'  => $post['is_show'],
-            'remark'   => $post['remark'] ?? '',
-        ]);
-    }
-
-
-    /**
-     * Notes: 编辑
-     * @param $post
-     * @return GoodsBrand
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function edit($post)
-    {
-        return GoodsBrand::update([
-            'name'     => $post['name'],
-            'initial'  => $post['initial'],
-            'image'    => $post['image'] ?? '',
-            'sort'     => $post['sort'] ?? 100,
-            'is_show'  => $post['is_show'],
-            'remark'   => $post['remark'] ?? '',
-        ], ['id' => $post['id']]);
-    }
-
-
-    /**
-     * Notes: 删除
-     * @param $id
-     * @return GoodsBrand
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function del($id)
-    {
-        return GoodsBrand::update(['del' => 1], ['id' => $id]);
-    }
-
-}

+ 0 - 229
app/admin/logic/goods/CategoryLogic.php

@@ -1,229 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\logic\goods;
-
-use app\common\model\goods\GoodsCategory as GoodsCategoryModel;
-use app\common\server\UrlServer;
-
-/**
- * 平台商品分类 逻辑层
- * Class CategoryLogic
- * @package app\admin\logic\goods
- */
-class CategoryLogic
-{
-  /**
-   *  获取分类列表(所有)
-   */
-  public static function lists()
-  {
-    $lists = GoodsCategoryModel::field('id,name,pid,is_show,level,image, bg_image, sort')
-      ->where('del', 0)
-      ->order('sort', 'asc')
-      ->select()
-      ->toArray();
-
-    foreach ($lists as $k => $item){
-      $lists[$k]['image'] = $lists[$k]['image'] ? UrlServer::getFileUrl($item['image']) : '';
-    }
-    // 线性结构转树形结构(顶级分类树)
-    $lists = linear_to_tree($lists);
-    return $lists;
-  }
-
-  /**
-   *  获取分类列表(二级)
-   */
-  public static function categoryTwoTree()
-  {
-    $cateogry_list = GoodsCategoryModel::with('sons')
-      ->field('id,name,pid,level')
-      ->where(['del' => 0, 'level' => 1])
-      ->select()
-      ->toArray();
-
-    return self::categoryToSelect($cateogry_list);
-  }
-
-  /**
-   * Desc:将树形结构数组输出
-   * @param $items  array 要输出的数组
-   * @param $select_id int 已选中项
-   * @return string
-   */
-  public static function categoryToSelect($lists, $select_id = 0)
-  {
-    $tree = [];
-    foreach ($lists as $val) {
-      $tree[$val['id']]['level'] = $val['level'];
-      $tree[$val['id']]['name'] = '|----' . $val['name'];
-      if ($val['sons']) {
-        foreach ($val['sons'] as $val_sons) {
-          $tree[$val_sons['id']]['level'] = $val_sons['level'];
-          $tree[$val_sons['id']]['name'] = '|--------' . $val_sons['name'];
-        }
-      }
-    }
-    return $tree;
-  }
-
-
-  /**
-   * 添加分类
-   */
-  public static function add($post)
-  {
-    $level = 0;
-    if ($post['pid']) {
-      $level = GoodsCategoryModel::where(['id' => $post['pid']], ['del' => 0])->value('level');
-    }
-
-    $data = [
-      'name'              => trim($post['name']),
-      'pid'               => $post['pid'],
-      'sort'              => $post['sort'],
-      'is_show'           => $post['is_show'],
-      'image'             => isset($post['image']) ? clearDomain($post['image']) : '',
-      'bg_image'          => isset($post['bg_image']) ? clearDomain($post['bg_image']) : '',
-      'level'             => $level + 1,
-      'remark'            => $post['remark'],
-      'create_time'       => time(),
-      'update_time'       => time(),
-    ];
-    return GoodsCategoryModel::create($data);
-  }
-
-  /**
-   * 删除分类
-   */
-  public static function del($post)
-  {
-    return GoodsCategoryModel::update([
-      'id' => $post['id'],
-      'del' => 1,
-      'update_time' => time(),
-    ]);
-  }
-
-
-  /**
-   * 分类详情
-   */
-  public static function getCategory($id)
-  {
-    $detail = GoodsCategoryModel::where([
-      'del' => 0,
-      'id' => $id
-    ])->find();
-    $detail['image'] = UrlServer::getFileUrl($detail['image']);
-    $detail['bg_image'] =  $detail['bg_image'] ? UrlServer::getFileUrl($detail['bg_image']) : '';
-    return $detail;
-  }
-
-  /**
-   * 获取叶子分类的级数
-   */
-  public static function getCategoryLevel($category)
-  {
-    $level = 1;
-    $two_ids = GoodsCategoryModel::where(['pid' => $category['id'], 'del' => 0])->column('id');
-    if ($two_ids) {
-      $level = 2;
-      $three_id = GoodsCategoryModel::where([
-        ['pid', 'in', $two_ids],
-        ['del', '=', 0]
-        ])->column('id');
-      if ($three_id) $level = 3;
-    }
-    return $level;
-  }
-
-  /**
-   *  编辑
-   */
-  public static function edit($post)
-  {
-    $level = 0;
-    if ($post['pid']) {
-      $level = GoodsCategoryModel::where(['id' => $post['pid']], ['del' => 0])->value('level');
-    }
-    $data = [
-        'name'              => $post['name'],
-        'sort'              => $post['sort'],
-        'is_show'           => $post['is_show'],
-        'image'             => isset($post['image']) ? clearDomain($post['image']) : '',
-        'bg_image'          => isset($post['bg_image']) ? clearDomain($post['bg_image']) : '',
-        'level'             => $level+1,
-        'pid'               => $post['pid'],
-        'remark'            => $post['remark'],
-        'update_time'       => time(),
-    ];
-    return GoodsCategoryModel::where(['id'=>$post['id']])->update($data);
-  }
-
-  // 修改分类显示状态
-  public static function switchStatus($post)
-  {
-    $update_data = [
-      'is_show'       => $post['status'],
-      'update_time'   => time(),
-    ];
-    return GoodsCategoryModel::where(['del' =>0,'id' =>$post['id']])->update($update_data);
-  }
-
-  /**
-   * 平台商品分类(三级)
-   */
-  public static function categoryTreeeTree()
-  {
-    $lists = GoodsCategoryModel::where(['del' => 0])->column('id,name,pid,level', 'id');
-    return self::cateToTree($lists, 0, '|-----', 1);
-  }
-
-  /**
-   * 转树形结构
-   */
-  public static function cateToTree($lists, $pid = 0, $html = '|-----', $level = 1, $clear = true)
-  {
-    static $tree = [];
-    if ($clear) $tree = [];
-    foreach ($lists as $k => $v) {
-        if ($v['pid'] == $pid) {
-            $v['html'] = str_repeat($html, $level);
-            $tree[] = $v;
-            unset($lists[$k]);
-            self::cateToTree($lists, $v['id'], $html, $level + 1, false);
-        }
-    }
-    return $tree;
-  }
-
-  /**
-   * 获取所有分类树形结构
-   */
-  public static function getAllTree()
-  {
-    $lists = GoodsCategoryModel::field(['name', 'id', 'pid', 'level'])
-        ->where(['del' => 0])
-        ->order(['sort' => 'desc'])
-        ->select();
-    return $lists;
-  }
-}

+ 0 - 111
app/admin/logic/goods/ColumnLogic.php

@@ -1,111 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\goods;
-
-
-use app\common\basics\Logic;
-use app\common\model\goods\Goods;
-use app\common\model\goods\GoodsColumn;
-
-/**
- * 商品栏目-逻辑
- * Class GoodsColumnLogic
- * @package app\admin\logic
- */
-class ColumnLogic extends Logic
-{
-
-    /**
-     * Notes: 列表
-     * @param $get
-     * @author 段誉(2021/4/15 10:53)
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public static function lists($get)
-    {
-        $result = GoodsColumn::where(['del' =>0])
-            ->order('sort')
-            ->paginate([
-                'list_rows'=> $get['limit'],
-                'page'=> $get['page']
-            ]);
-
-        return ['count' => $result->total(), 'lists' => $result->getCollection()];
-    }
-
-
-    /**
-     * Notes: 添加
-     * @param $post
-     * @return GoodsColumn|\think\Model
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function add($post)
-    {
-        return GoodsColumn::create([
-            'name'     => $post['name'],
-            'remark'   => $post['remark'] ?? '',
-            'status'   => isset($post['status']) && $post['status'] == 'on' ? 1 : 0,
-        ]);
-    }
-
-
-    /**
-     * Notes: 编辑
-     * @param $post
-     * @return GoodsColumn
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function edit($post)
-    {
-        return GoodsColumn::update([
-            'name'     => $post['name'],
-            'remark'   => $post['remark'] ?? '',
-            'status'   => isset($post['status']) && $post['status'] == 'on' ? 1 : 0,
-        ], ['id' => $post['id']]);
-    }
-
-
-    /**
-     * Notes: 删除
-     * @param $id
-     * @author 段誉(2021/6/24 2:51)
-     * @return bool
-     */
-    public static function del($id)
-    {
-        //栏目删除,则栏目商品都删除
-        GoodsColumn::update(['del' => 1], ['id' => $id]);
-        Goods::whereFindInSet('column_ids', $id)->update(['column_ids' => '']);
-        return true;
-    }
-
-    /**
-     * 列表(不分页)
-     */
-    public static function getList()
-    {
-        return GoodsColumn::where(['del' => 0])->order('sort', 'desc')->column('id,name');
-    }
-}

+ 0 - 163
app/admin/logic/goods/CommentLogic.php

@@ -1,163 +0,0 @@
-<?php
-namespace app\admin\logic\goods;
-
-use app\common\basics\Logic;
-use app\common\model\goods\GoodsComment;
-use app\common\model\user\UserLevel;
-use app\common\server\UrlServer;
-
-class CommentLogic extends Logic
-{
-    public static function lists($get)
-    {
-        $where = [
-            ['gc.del', '=', 0],
-        ];
-
-        if($get['type'] == 0) { // 待回复
-            $where[] = ['reply', '=', ''];
-        }else{ // 已回复
-            $where[] = ['reply', '<>', ''];
-        }
-
-        // 商家名称
-        if(isset($get['shop_name']) && !empty($get['shop_name'])) {
-            $where[] = ['s.name', 'like', '%'. trim($get['shop_name']) . '%'];
-        }
-
-        // 评价信息
-        if(isset($get['search_word']) && !empty($get['search_word'])) {
-            switch($get['search_type']) {
-                case 'name':
-                    $where[] = ['g.name', 'like', '%'. trim($get['search_word']) . '%'];
-                    break;
-                case 'sn':
-                    $where[] = ['u.sn', '=', trim($get['search_word'])];
-                    break;
-                case 'nickname':
-                    $where[] = ['u.nickname', '=', trim($get['search_word'])];
-                    break;
-            }
-        }
-
-        // 评价等级
-        if(isset($get['goods_comment']) && !empty($get['goods_comment'])) {
-            switch ($get['goods_comment']) {
-                case 1:
-                    $where[] = ['gc.goods_comment', '>', 3];
-                    break;
-                case 2:
-                    $where[] = ['gc.goods_comment', '=', 3];
-                    break;
-                case 3:
-                    $where[] = ['gc.goods_comment', '<', 3];
-                    break;
-            }
-        }
-
-        // 显示状态
-        if(isset($get['status']) && !empty($get['status'])) {
-            switch ($get['status']) {
-                case 1:
-                    $where[] = ['gc.status', '=', 1];
-                    break;
-                case 2: // 隐藏状态  前端不使用0的原因:empty()时0会被认为false
-                    $where[] = ['gc.status', '=', 0];
-                    break;
-            }
-        }
-
-        // 日期范围
-        if(isset($get['start_end']) && !empty($get['start_end'])) {
-            $arr = explode('~', $get['start_end']);
-            $start_time = strtotime($arr[0]);
-            $end_time = strtotime($arr[1]);
-            $where[] = ['gc.create_time', '>=', $start_time];
-            $where[] = ['gc.create_time', '<=', $end_time];
-        }
-
-        $lists = GoodsComment::alias('gc')
-            ->with(['goods_comment_image'])
-            ->field('gc.id,gc.goods_comment,gc.goods_comment as goods_comment_desc,gc.comment,gc.reply,gc.status,gc.status as status_desc,gc.create_time,u.sn,u.nickname,u.avatar,u.level,g.name as goods_name,g.image as goods_image,gi.image as item_image,gi.spec_value_str,s.id as shop_id,s.name as shop_name,s.type as shop_type,s.logo as shop_logo')
-            ->leftJoin('user u', 'u.id=gc.user_id')
-            ->leftJoin('goods g', 'g.id=gc.goods_id')
-            ->leftJoin('goods_item gi', 'gi.id=gc.item_id')
-            ->leftJoin('shop s', 's.id=gc.shop_id')
-            ->where($where)
-            ->order('gc.create_time', 'desc')
-            ->page($get['page'], $get['limit'])
-            ->select()
-            ->toArray();
-
-        $count = GoodsComment::alias('gc')
-            ->field('gc.id,gc.goods_comment,gc.goods_comment as goods_comment_desc,gc.comment,gc.reply,gc.status,gc.status as status_desc,gc.create_time,u.sn,u.nickname,u.avatar,u.level,g.name as goods_name,g.image as goods_image,gi.image as item_image,gi.spec_value_str')
-            ->leftJoin('user u', 'u.id=gc.user_id')
-            ->leftJoin('goods g', 'g.id=gc.goods_id')
-            ->leftJoin('goods_item gi', 'gi.id=gc.item_id')
-            ->leftJoin('shop s', 's.id=gc.shop_id')
-            ->where($where)
-            ->count();
-
-        $levelArr = UserLevel::where('del', 0)->column('name', 'id');
-        $shopTypeArr = [1=>'官方自营', 2=>'入驻商家'];
-        foreach($lists as &$item) {
-            // 头像
-            $item['type'] = $get['type'];
-            // 头像
-            $item['avatar'] = UrlServer::getFileUrl($item['avatar']);
-            // 商家图标
-            $item['shop_logo'] = empty($item['shop_logo']) ? '' : UrlServer::getFileUrl($item['shop_logo']);
-            $item['goods_image'] = empty($item['goods_image']) ? '' : UrlServer::getFileUrl($item['goods_image']);
-            $item['item_image'] = empty($item['item_image']) ? '' : UrlServer::getFileUrl($item['item_image']);
-
-            // 会员等级
-            $item['levelName'] = $levelArr[$item['level']] ?? '无等级';
-            // 评价图片
-            $item['comment_image'] = array_column($item['goods_comment_image'], 'uri');
-            foreach($item['comment_image'] as $key => $subItem) {
-                $item['comment_image'][$key] = UrlServer::getFileUrl($subItem);
-            }
-            // 商家类型
-            $item['shop_type_desc'] = $shopTypeArr[$item['shop_type']];
-        }
-
-        return [
-            'count' => $count,
-            'lists' => $lists
-        ];
-    }
-
-    public static function changeStatus($post)
-    {
-        try{
-            $goodsComment = GoodsComment::where('id', $post['id'])->findOrEmpty();
-            if($goodsComment->isEmpty()) {
-                throw new \think\Exception('评论不存在');
-            }
-            $goodsComment->status = $goodsComment->status ? 0 : 1;
-            $goodsComment->update_time = time();
-            $goodsComment->save();
-            return true;
-        }catch(\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-    public static function del($post)
-    {
-        try{
-            $goodsComment = GoodsComment::where('id', $post['id'])->findOrEmpty();
-            if($goodsComment->isEmpty()) {
-                throw new \think\Exception('评论不存在');
-            }
-            $goodsComment->del = 1;
-            $goodsComment->update_time = time();
-            $goodsComment->save();
-            return true;
-        }catch(\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-}

+ 0 - 371
app/admin/logic/goods/GoodsLogic.php

@@ -1,371 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\goods;
-
-
-use app\common\basics\Logic;
-use app\common\enum\GoodsEnum;
-use app\common\model\goods\Goods;
-use app\common\model\goods\GoodsColumn;
-use app\common\model\goods\GoodsImage;
-use app\common\model\goods\GoodsItem;
-use app\common\model\goods\GoodsSpec;
-use app\common\model\goods\GoodsSpecValue;
-use app\common\model\goods\Supplier;
-use app\common\server\UrlServer;
-use think\facade\Db;
-use app\common\model\seckill\SeckillGoods;
-
-
-/**
- * 商品管理-逻辑
- * Class GoodsLogic
- * @package app\shop\logic\goods
- */
-class GoodsLogic extends Logic
-{
-    /*
-     * 商品统计
-     */
-    public static function statistics($get = []) {
-        $where = [
-            ['del', '<>', GoodsEnum::DEL_TRUE]
-        ];
-
-        if(isset($get['goods_column_id']) && $get['goods_column_id'] != '') {
-            $where[] = ['column_ids', '=', $get['goods_column_id']];
-        }
-        
-        return [
-            // 销售中商品(含库存预警商品)
-            // 销售状态:上架中;删除状态:正常; 审核状态: 审核通过
-            'sell'      => Goods::where($where)
-                ->where('del', GoodsEnum::DEL_NORMAL)
-                ->where('status', GoodsEnum::STATUS_SHELVES)
-                ->where('audit_status', GoodsEnum::AUDIT_STATUS_OK)
-                ->count(),
-            // 仓库中商品
-            // 销售状态:仓库中;删除状态:正常; 审核状态: 审核通过
-            'warehouse' => Goods::where($where)
-                ->where('del', GoodsEnum::DEL_NORMAL)
-                ->where('status', GoodsEnum::STATUS_SOLD_OUT)
-                ->where('audit_status', GoodsEnum::AUDIT_STATUS_OK)
-                ->count(),
-            // 回收站商品
-            // 销售状态:任意;删除状态:回收站; 审核状态: 审核通过
-            'recycle'   => Goods::where($where)
-                ->where('del', GoodsEnum::DEL_RECYCLE)
-                ->where('audit_status', GoodsEnum::AUDIT_STATUS_OK)
-                ->count(),
-            // 待审核商品
-            // 销售状态:任意;删除状态:排除已删除; 审核状态: 待审核
-            'audit_stay' => Goods::where($where)
-                ->where('del', '<>', GoodsEnum::DEL_TRUE)
-                ->where('audit_status', GoodsEnum::AUDIT_STATUS_STAY)
-                ->count(),
-            // 审核未通过商品
-            // 销售状态:任意;删除状态:排除已删除; 审核状态: 审核未通过
-            'audit_refuse'=> Goods::where($where)
-                ->where('del', '<>', GoodsEnum::DEL_TRUE)
-                ->where('audit_status', GoodsEnum::AUDIT_STATUS_REFUSE)
-                ->count(),
-        ];
-    }
-
-    /**
-     * Notes: 列表
-     * @param $get
-     * @author 段誉(2021/4/15 10:53)
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public static function lists($get)
-    {
-        $where = [];
-        if(isset($get['shop_name']) && !($get['shop_name'] == '')) {
-            $where[] = ['s.name','like','%'.$get['shop_name'].'%'];
-        }
-
-        if(isset($get['goods_name']) && !($get['goods_name'] == '')) {
-            $where[] = ['g.name','like','%'.$get['goods_name'].'%'];
-        }
-        if(!empty($get['platform_cate_id'])) {
-            $where[] = ['g.first_cate_id|g.second_cate_id|g.third_cate_id','=', $get['platform_cate_id']];
-        }
-
-        if(isset($get['goods_type']) && $get['goods_type'] != '') {
-            $where[] = ['g.type','=', $get['goods_type']];
-        }
-
-        if(isset($get['goods_column_id']) && $get['goods_column_id'] != '') {
-            $where[] = ['g.column_ids', '=', $get['goods_column_id']];
-        }
-
-        $type = $get['type'] ?? 0;
-
-        switch ($type) {
-            case 1:     //销售中
-                $where[] = ['g.status', '=', GoodsEnum::STATUS_SHELVES];//上架
-                $where[] = ['g.del', '=', GoodsEnum::DEL_NORMAL];
-                $where[] = ['g.audit_status', '=', GoodsEnum::AUDIT_STATUS_OK];//审核通过
-                break;
-            case 2:      //仓库中
-                $where[] = ['g.status', '=', GoodsEnum::STATUS_SOLD_OUT];//下架
-                $where[] = ['g.del', '=', GoodsEnum::DEL_NORMAL];
-                $where[] = ['g.audit_status', '=', GoodsEnum::AUDIT_STATUS_OK];//审核通过
-                break;
-            case 3:     //回收站
-                $where[] = ['g.del', '=', GoodsEnum::DEL_RECYCLE];
-                $where[] = ['g.audit_status', '=', GoodsEnum::AUDIT_STATUS_OK];//审核通过
-                break;
-            case 4:  //待审核
-                $where[] = ['g.del', '<>', GoodsEnum::DEL_TRUE];
-                $where[] = ['g.audit_status', '=', GoodsEnum::AUDIT_STATUS_STAY];
-                break;
-            case 5: //审核未通过
-                $where[] = ['g.del', '<>', GoodsEnum::DEL_TRUE];
-                $where[] = ['g.audit_status', '=', GoodsEnum::AUDIT_STATUS_REFUSE];
-                break;
-            default:
-                $where[] = ['g.del', '=', GoodsEnum::DEL_NORMAL];
-        }
-
-        $lists = Goods::alias('g')
-            ->field('g.id, g.image, g.spec_type, g.name, g.min_price, g.max_price, g.sales_actual, g.stock, g.sort_weight, g.create_time, g.column_ids, g.audit_status, g.audit_remark,s.id as shop_id, s.name as shop_name, s.logo as shop_logo, s.type as shop_type')
-            ->leftJoin('Shop s', 's.id=g.shop_id')
-            ->where($where)
-            ->page($get['page'], $get['limit'])
-            ->order('g.create_time', 'desc')
-            ->select();
-        $count = Goods::alias('g')->leftJoin('shop s', 's.id = g.shop_id')->where($where)->count();
-        foreach($lists as &$item) {
-            $item['price'] = $item['spec_type'] == 1 ? $item["min_price"] : $item["min_price"] . " ~ " . $item["max_price"];
-            switch($item['shop_type']) {
-                case 1:
-                    $item['shop_type_desc'] = '官方自营';
-                    break;
-                case 2:
-                    $item['shop_type_desc'] = '入驻商家';
-                    break;
-            }
-            $item['shop_logo'] = empty($item['shop_logo']) ? '' : UrlServer::getFileUrl($item['shop_logo']);
-
-            if(!empty($item['column_ids'])) {
-                $columnArr = explode(',', $item['column_ids']);
-                $columnStr = '';
-                foreach($columnArr as $cloumnId) {
-                    $columnName = GoodsColumn::where('id', $cloumnId)->value('name');
-                    $columnStr = $columnStr . $columnName . ',';
-                }
-                $columnStr = substr($columnStr, 0, strlen($columnStr) -1);
-                $item['columnStr'] = $columnStr;
-            }
-        }
-        if($count) {
-            $lists = $lists->toArray();
-        }else{
-            $lists = [];
-        }
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * 获取商品信息
-     * @param $goods_id
-     * @return array
-     */
-    public static function info($goods_id)
-    {
-        // 商品主表
-        $info['base'] = Goods::where(['id' => $goods_id])
-            ->withAttr('abs_image', function ($value, $data) {
-                return UrlServer::getFileUrl($data['image']);
-            })
-            ->withAttr('content', function ($value){
-                $preg = '/(<img .*?src=")[^https|^http](.*?)(".*?>)/is';
-                $local_url = UrlServer::getFileUrl('/');
-                return  preg_replace($preg, "\${1}$local_url\${2}\${3}",$value);
-            })
-            ->withAttr('poster', function ($value){
-                return empty($value) ? '' : UrlServer::getFileUrl($value);
-            })
-            ->withAttr('abs_video',function ($value,$data){
-                if($data['video']){
-                    return UrlServer::getFileUrl($data['video']);
-                }
-                return '';
-            })->append(['abs_image','abs_video'])->find();
-        // 商品轮播图
-        $info['base']['goods_image'] = GoodsImage::where(['goods_id' => $goods_id])
-            ->withAttr('abs_image', function ($value, $data) {
-                return UrlServer::getFileUrl($data['uri']);})
-            ->append(['abs_image'])
-            ->select();
-        // 商品SKU
-        $info['item'] =GoodsItem::where(['goods_id' => $goods_id])
-            ->withAttr('abs_image', function ($value, $data) {
-                return $data['image'] ? UrlServer::getFileUrl($data['image']) : '';
-            })->append(['abs_image'])
-            ->select();
-        // 商品规格项
-        $info['spec'] = GoodsSpec::where(['goods_id' => $goods_id])->select();
-        // 商品规格值
-        $spec_value = GoodsSpecValue::where(['goods_id' => $goods_id])->select();
-
-        $data = [];
-        foreach ($spec_value as $k => $v) {
-            $data[$v['spec_id']][] = $v;
-        }
-        foreach ($info['spec'] as $k => $v) {
-            $info['spec'][$k]['values'] = isset($data[$v['id']]) ? $data[$v['id']] : [];
-        }
-        return $info;
-    }
-
-    /**
-     * 违规重审
-     * @param $params
-     */
-    public static function reAudit($params)
-    {
-        Db::startTrans();
-        try{
-            // 更新商品信息
-            $updateData = [
-                'id' => $params['goods_id'],
-                'audit_remark' => trim($params['reason']),
-                'audit_status' => GoodsEnum::AUDIT_STATUS_REFUSE
-            ];
-            Goods::update($updateData);
-            // 对应的秒杀商品同步更新为待审核
-            SeckillGoods::where([
-                'del' => 0,
-                'goods_id' => $params['goods_id']
-            ])->update([
-                'review_status' => 0,
-                'update_time' => time()
-            ]);
-
-            event('UpdateCollect', ['goods_id' => $params['goods_id']]);
-
-            Db::commit();
-            return true;
-        }catch(\Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-    /**
-     * 商品设置
-     */
-    public static function setInfo($params)
-    {
-        $updateData = [
-            'id' => $params['goods_id'],
-            'sales_virtual' => $params['sales_virtual'],
-            'clicks_virtual' => $params['clicks_virtual'],
-            'sort_weight' => $params['sort_weight'],
-            'column_ids' => $params['select']
-        ];
-        return Goods::update($updateData);
-    }
-
-    /**
-     * 审核
-     */
-    public static function audit($params)
-    {
-        $updateData = [
-            'id' => $params['goods_id'],
-            'audit_status' => $params['audit_status'],
-            'audit_remark' => $params['audit_remark'],
-        ];
-        return Goods::update($updateData);
-    }
-
-
-    /**
-     * @notes 批量下架
-     * @param $params
-     * @return bool
-     * @author ljj
-     * @date 2022/9/20 6:17 下午
-     */
-    public static function moreLower($params)
-    {
-        Db::startTrans();
-        try{
-            $ids = explode(',',$params['ids']);
-            foreach ($ids as $id) {
-                // 更新商品信息
-                $updateData = [
-                    'id' => $id,
-                    'audit_remark' => trim($params['reason']),
-                    'audit_status' => GoodsEnum::AUDIT_STATUS_REFUSE
-                ];
-                Goods::update($updateData);
-                // 对应的秒杀商品同步更新为待审核
-                SeckillGoods::where([
-                    'del' => 0,
-                    'goods_id' => $id
-                ])->update([
-                    'review_status' => 0,
-                    'update_time' => time()
-                ]);
-
-                event('UpdateCollect', ['goods_id' => $id]);
-            }
-
-            Db::commit();
-            return true;
-        }catch(\Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 批量审核
-     * @param $params
-     * @return bool
-     * @author ljj
-     * @date 2022/9/20 6:36 下午
-     */
-    public static function moreAudit($params)
-    {
-        $ids = explode(',',$params['ids']);
-        foreach ($ids as $id) {
-            $updateData = [
-                'id' => $id,
-                'audit_status' => $params['audit_status'],
-                'audit_remark' => $params['audit_remark'],
-            ];
-            Goods::update($updateData);
-        }
-        return true;
-    }
-}

+ 0 - 98
app/admin/logic/goods/UnitLogic.php

@@ -1,98 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\goods;
-
-
-use app\common\basics\Logic;
-use app\common\model\goods\GoodsUnit;
-
-/**
- * 商品单位逻辑
- * Class UnitLogic
- * @package app\admin\logic\goods
- */
-class UnitLogic extends Logic
-{
-
-    /**
-     * Notes: 列表
-     * @param $get
-     * @author 段誉(2021/4/15 10:53)
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public static function lists($get)
-    {
-        $result = GoodsUnit::where(['del' =>0])
-            ->order('sort')
-            ->paginate([
-                'list_rows'=> $get['limit'],
-                'page'=> $get['page']
-            ]);
-
-        return ['count' => $result->total(), 'lists' => $result->getCollection()];
-    }
-
-
-    /**
-     * Notes: 添加
-     * @param $post
-     * @return GoodsUnit|\think\Model
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function addUnit($post)
-    {
-        return GoodsUnit::create([
-            'name'     => $post['name'],
-            'sort'     => $post['sort'] ?? 100,
-        ]);
-    }
-
-
-    /**
-     * Notes: 编辑
-     * @param $post
-     * @return GoodsUnit
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function editUnit($post)
-    {
-        return GoodsUnit::update([
-            'name' => $post['name'],
-            'sort' => $post['sort'] ?? 100
-        ], ['id' => $post['id']]);
-    }
-
-
-    /**
-     * Notes: 删除
-     * @param $id
-     * @return GoodsUnit
-     *@author 段誉(2021/4/15 10:54)
-     */
-    public static function del($id)
-    {
-        return GoodsUnit::update(['del' => 1], ['id' => $id]);
-    }
-
-}

+ 0 - 199
app/admin/logic/integral/IntegralGoodsLogic.php

@@ -1,199 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\logic\integral;
-
-use app\common\basics\Logic;
-use app\common\enum\IntegralGoodsEnum;
-use app\common\model\integral\IntegralGoods;
-use app\common\server\UrlServer;
-
-
-/**
- * 积分商品
- * Class IntegralGoodsLogic
- * @package app\admin\logic\kefu
- */
-class IntegralGoodsLogic extends Logic
-{
-
-    public static function getLists($get)
-    {
-        $where = [
-            ['del', '=', 0]
-        ];
-        if (isset($get['type']) && is_numeric($get['type'])) {
-            $where[] = ['type', '=', $get['type']];
-        }
-        if (isset($get['status']) && is_numeric($get['status'])) {
-            $where[] = ['status', '=', $get['status']];
-        }
-        if (isset($get['name']) && $get['name'] != '') {
-            $where[] = ['name', 'like', '%' . $get['name'] . '%'];
-        }
-
-        $model = new IntegralGoods();
-        $lists = $model->field(true)
-            ->where($where)
-            ->order(['sort' => 'desc','id'=>'desc'])
-            ->paginate([
-                'page' => $get['page'],
-                'list_rows' => $get['limit'],
-                'var_page' => 'page'
-            ])
-            ->toArray();
-
-        foreach ($lists['data'] as &$item) {
-            $item['need'] = $item['need_integral'] . '积分+' . $item['need_money'] . '元';
-            if ($item['type'] == IntegralGoodsEnum::TYPE_BALANCE || $item['exchange_way'] == IntegralGoodsEnum::EXCHANGE_WAY_INTEGRAL) {
-                $item['need'] = $item['need_integral'] . '积分';
-            }
-            $item['type'] = IntegralGoodsEnum::getTypeDesc($item['type']);
-            $item['market_price'] = empty($item['market_price']) ? '-' : '¥' . $item['market_price'];
-        }
-
-        return ['count' => $lists['total'], 'lists' => $lists['data']];
-    }
-
-
-    /**
-     * @notes 添加商品
-     * @param $post
-     * @return bool
-     * @author 段誉
-     * @date 2022/2/25 18:27
-     */
-    public static function add($post)
-    {
-        try {
-            $storageUrl = UrlServer::getFileUrl();
-            $content = str_replace($storageUrl, '/', $post['content']);
-            IntegralGoods::create([
-                'name' => $post['name'],
-                'code' => $post['code'] ?? '',
-                'image' => $post['image'],
-                'type' => $post['type'],
-                'market_price' => $post['market_price'] ?? '',
-                'stock' => $post['stock'],
-                'status' => $post['status'],
-                'exchange_way' => $post['exchange_way'] ?? 1,
-                'need_integral' => $post['need_integral'],
-                'need_money' => $post['need_money'] ?? 0,
-                'delivery_way' => $post['delivery_way'] ?? 0,
-                'balance' => $post['balance'] ?? 0,
-                'express_type' => $post['express_type'] ?? 0,
-                'express_money' => $post['express_money'] ?? 0,
-                'content' => $content,
-                'sort' => $post['sort'] ?? 0,
-            ]);
-            return true;
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 编辑积分商品
-     * @param $post
-     * @return bool
-     * @author 段誉
-     * @date 2022/3/1 15:57
-     */
-    public static function edit($post)
-    {
-        try {
-            $storageUrl = UrlServer::getFileUrl();
-            $content = str_replace($storageUrl, '/', $post['content']);
-
-            // 包邮或无需快递,运费重置为0
-            if ($post['delivery_way'] == IntegralGoodsEnum::DELIVERY_NO_EXPRESS
-                || $post['express_type'] == IntegralGoodsEnum::EXPRESS_TYPE_FREE) {
-                $post['express_money'] = 0;
-                $post['express_type'] = IntegralGoodsEnum::EXPRESS_TYPE_FREE;
-            }
-
-            IntegralGoods::update([
-                'id'=>$post['id'],
-                'name' => $post['name'],
-                'code' => $post['code'] ?? '',
-                'image' => $post['image'],
-                'market_price' => $post['market_price'] ?? '',
-                'stock' => $post['stock'],
-                'status' => $post['status'],
-                'exchange_way' => $post['exchange_way'] ?? 1,
-                'need_integral' => $post['need_integral'],
-                'need_money' => $post['need_money'] ?? 0,
-                'delivery_way' => $post['delivery_way'] ?? 0,
-                'balance' => $post['balance'] ?? 0,
-                'express_type' => $post['express_type'],
-                'express_money' => $post['express_money'],
-                'content' => $content,
-                'sort' => $post['sort'] ?? 0,
-            ]);
-            return true;
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    public static function detail($id)
-    {
-        $detail = IntegralGoods::where(['id' => $id])->findOrEmpty();
-        return $detail;
-    }
-
-
-    /**
-     * @notes 切换状态
-     * @param $post
-     * @return IntegralGoods
-     * @author 段誉
-     * @date 2022/2/25 18:25
-     */
-    public static function switchStatus($post)
-    {
-         return IntegralGoods::update([
-             'status' => $post['status'],
-             'id' => $post['id']
-         ]);
-    }
-
-
-    /**
-     * @notes 删除商品
-     * @param $post
-     * @return IntegralGoods
-     * @author 段誉
-     * @date 2022/2/25 18:26
-     */
-    public static function del($post)
-    {
-        return IntegralGoods::update([
-            'id' => $post['id'],
-            'del' => 1,
-            'update_time' => time()
-        ]);
-    }
-
-
-}

+ 0 - 362
app/admin/logic/integral/IntegralOrderLogic.php

@@ -1,362 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\logic\integral;
-
-
-use app\common\basics\Logic;
-use app\common\enum\IntegralOrderEnum;
-use app\common\enum\NoticeEnum;
-use app\common\enum\OrderLogEnum;
-use app\common\enum\PayEnum;
-use app\common\logic\IntegralOrderRefundLogic;
-use app\common\logic\OrderLogLogic;
-use app\common\model\Express;
-use app\common\model\integral\IntegralDelivery;
-use app\common\model\integral\IntegralOrder;
-use app\common\model\order\Order;
-use app\common\server\ConfigServer;
-use app\common\server\UrlServer;
-use expressage\Kd100;
-use expressage\Kdniao;
-use think\facade\Db;
-
-class IntegralOrderLogic extends Logic
-{
-    /**
-     * @notes 兑换订单列表
-     * @param array $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author ljj
-     * @date 2022/3/3 10:38 上午
-     */
-    public static function lists($get = [])
-    {
-        $order = new IntegralOrder();
-
-        $where = [];
-        //列表状态
-        if (isset($get['status']) && $get['status'] != '') {
-            $where[] = ['order_status', '=', $get['status']];
-        }
-        //兑换单号
-        if (isset($get['order_sn']) && $get['order_sn'] != '') {
-            $where[] = ['order_sn', 'like', '%' . $get['order_sn'] . '%'];
-        }
-        //商品名称
-        if (isset($get['goods_name']) && $get['goods_name'] != '') {
-            $where[] = ['goods_snap->name', 'like', '%' . $get['goods_name'] . '%'];
-        }
-        //兑换类型
-        if (isset($get['type']) && $get['type'] != '') {
-            $where[] = ['exchange_type', '=', intval($get['type'])];
-        }
-        //订单状态
-        if (isset($get['order_status']) && $get['order_status'] != '') {
-            $where[] = ['order_status', '=', $get['order_status']];
-        }
-        //下单时间
-        if (isset($get['start_time']) && $get['start_time'] != '') {
-            $where[] = ['create_time', '>=', strtotime($get['start_time'])];
-        }
-        if (isset($get['end_time']) && $get['end_time'] != '') {
-            $where[] = ['create_time', '<=', strtotime($get['end_time'])];
-        }
-
-        $count = $order->where($where)->count();
-
-        $lists = $order
-            ->field('*')
-            ->with(['user'])
-            ->where($where)
-            ->append(['pay_status_text', 'delivery_address', 'order_status_desc', 'type_desc'])
-            ->page($get['page'], $get['limit'])
-            ->order('id', 'desc')
-            ->select()
-            ->toArray();
-
-        foreach ($lists as $key=>&$list) {
-            $list['pay_time'] = $list['pay_time'] == '0' ? '未支付' : date('Y-m-d H:i:s', $list['pay_time']);
-            $list['user']['avatar'] = UrlServer::getFileUrl($list['user']['avatar']);
-            $list['goods_snap']['image'] = UrlServer::getFileUrl($list['goods_snap']['image']);
-        }
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    /**
-     * @notes 兑换订单详情
-     * @param $id
-     * @return array
-     * @author ljj
-     * @date 2022/3/3 11:10 上午
-     */
-    public static function detail($id)
-    {
-        $result = (new IntegralOrder())
-            ->with(['user'])
-            ->where('id', $id)
-            ->append(['delivery_address', 'pay_status_desc', 'order_status_desc','type_desc','pay_way_desc'])
-            ->findOrEmpty()
-            ->toArray();
-
-        $result['pay_time'] = $result['pay_time'] == '0' ? '未支付' : date('Y-m-d H:i:s', $result['pay_time']);
-        $result['confirm_time'] = empty($result['confirm_time']) ? '-' : date('Y-m-d H:i:s', $result['confirm_time']);
-        $result['user']['avatar'] = UrlServer::getFileUrl($result['user']['avatar']);
-        $result['goods_snap']['image'] = UrlServer::getFileUrl($result['goods_snap']['image']);
-
-        return $result;
-    }
-
-    /**
-     * @notes 发货详情
-     * @param $id
-     * @return array
-     * @author ljj
-     * @date 2022/3/3 11:48 上午
-     */
-    public static function deliveryDetail($id)
-    {
-        $result = (new IntegralOrder())
-            ->where('id', $id)
-            ->append(['delivery_address'])
-            ->findOrEmpty()
-            ->toArray();
-
-        $result['goods_snap']['image'] = UrlServer::getFileUrl($result['goods_snap']['image']);
-
-        return $result;
-    }
-
-    /**
-     * @notes 快递公司列表
-     * @return array|\think\Collection
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author ljj
-     * @date 2022/3/3 11:35 上午
-     */
-    public static function express()
-    {
-        return Express::where('del', 0)->field('id,name')->select()->toArray();
-    }
-
-    /**
-     * @notes 发货操作
-     * @param $post
-     * @param $admin_id
-     * @author ljj
-     * @date 2022/3/3 2:53 下午
-     */
-    public static function deliveryHandle($post, $admin_id)
-    {
-        Db::startTrans();
-        try {
-            $order = IntegralOrder::where(['del'=>0,'id'=>$post['id']])->findOrEmpty()->toArray();
-
-            $shipping = Express::where('id',$post['shipping_id'])->findOrEmpty()->toArray();
-
-            //添加发货单
-            $delivery_data = [
-                'order_id' => $order['id'],
-                'order_sn' => $order['order_sn'],
-                'user_id' => $order['user_id'],
-                'admin_id' => $admin_id,
-                'consignee' => $order['consignee'],
-                'mobile' => $order['mobile'],
-                'province' => $order['province'],
-                'city' => $order['city'],
-                'district' => $order['district'],
-                'address' => $order['address'],
-                'invoice_no' => $post['invoice_no'],
-                'send_type' => 1,
-                'shipping_id' => $post['shipping_id'],
-                'shipping_name' => $shipping['name'],
-                'shipping_status' => 1,
-                'create_time' => time(),
-            ];
-            $delivery = IntegralDelivery::create($delivery_data);
-
-            //更新订单信息
-            IntegralOrder::update([
-                'update_time' => time(),
-                'shipping_time' => time(),
-                'shipping_status' => 1,
-                'order_status' => IntegralOrderEnum::ORDER_STATUS_GOODS,
-                'delivery_id' => $delivery->id,
-            ],['id'=>$order['id']]);
-
-            //通知用户发货
-            if (!empty($order['mobile'])) {
-                event('Notice', [
-                    'scene' => NoticeEnum::ORDER_DELIVERY_NOTICE,
-                    'mobile' => $order['mobile'],
-                    'params' => [
-                        'order_id' => $order['id'],
-                        'user_id' => $order['user_id'],
-                        'shipping_name' => $delivery_data['shipping_name'],
-                        'invoice_no' => $post['invoice_no'],
-                    ]
-                ]);
-            }
-
-            // 提交事务
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            // 回滚事务
-            Db::rollback();
-            return $e->getMessage();
-        }
-
-    }
-
-    /**
-     * @notes 物流信息
-     * @param $order_id
-     * @return array
-     * @author ljj
-     * @date 2022/3/3 3:31 下午
-     */
-    public static function shippingInfo($order_id)
-    {
-        $shipping = IntegralDelivery::where('order_id', $order_id)->findOrEmpty()->toArray();
-        $shipping['traces'] = self::getShipping($order_id);
-        return $shipping;
-    }
-
-    /**
-     * @notes 物流轨迹
-     * @param $order_id
-     * @return bool|string[]
-     * @author ljj
-     * @date 2022/3/3 3:31 下午
-     */
-    public static function getShipping($order_id)
-    {
-        $order = IntegralOrder::alias('o')
-            ->field('invoice_no,shipping_name,shipping_id,o.shipping_status,o.mobile')
-            ->join('integral_delivery d', 'd.order_id = o.id')
-            ->where(['o.id' => $order_id])
-            ->findOrEmpty()
-            ->toArray();
-
-        $express = ConfigServer::get('express', 'way', '', '');
-        $key = ConfigServer::get($express, 'appkey');
-        $app = ConfigServer::get($express, 'appsecret');
-
-        if (empty($express) || $order['shipping_status'] != 1 || empty($app) || empty($key)) {
-            return $traces[] = ['暂无物流信息'];
-        }
-        //快递配置设置为快递鸟时
-        if ($express === 'kdniao') {
-            $expressage = (new Kdniao($app, $key, true));
-            $shipping_field = 'codebird';
-        } else {
-            $expressage = (new Kd100($app, $key, true));
-            $shipping_field = 'code100';
-        }
-
-        //快递编码
-        $shipping_code = Db::name('express')
-            ->where(['id' => $order['shipping_id']])
-            ->value($shipping_field);
-
-        //获取物流轨迹
-        if ($shipping_code === 'SF' && $express === 'kdniao') {
-            $expressage->logistics($shipping_code, $order['invoice_no'], substr($order['mobile'],-4));
-        }else {
-            $expressage->logistics($shipping_code, $order['invoice_no']);
-        }
-        $traces = $expressage->logisticsFormat();
-        if ($traces == false) {
-            $traces[] = [$expressage->getError()];
-        } else {
-            foreach ($traces as &$item) {
-                $item = array_values(array_unique($item));
-            }
-        }
-        return $traces;
-    }
-
-    /**
-     * @notes 确认收货
-     * @param $order_id
-     * @param $admin_id
-     * @return bool
-     * @author ljj
-     * @date 2022/3/3 3:39 下午
-     */
-    public static function confirm($order_id, $admin_id)
-    {
-        IntegralOrder::update([
-            'order_status' => IntegralOrderEnum::ORDER_STATUS_COMPLETE,
-            'update_time' => time(),
-            'confirm_time' => time(),
-        ],['id'=>$order_id]);
-
-        return true;
-    }
-
-
-    /**
-     * @notes 取消订单
-     * @param $id
-     * @return bool
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/3/3 18:49
-     */
-    public static function cancel($id)
-    {
-        Db::startTrans();
-        try {
-            $order = IntegralOrder::findOrEmpty($id);
-
-            // 更新订单状态, 退回库存, 扣减销量
-            IntegralOrderRefundLogic::cancelOrder($id);
-
-            // 退回已支付积分
-            IntegralOrderRefundLogic::refundOrderIntegral($id);
-
-            // 退回订单已支付积分或已支付金额
-            if ($order['pay_status'] == PayEnum::ISPAID) {
-                IntegralOrderRefundLogic::refundOrderAmount($id);
-            }
-
-            Db::commit();
-            return true;
-
-        } catch (\Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-
-            IntegralOrderRefundLogic::addRefundLog(
-                $order, $order['order_amount'],
-                2, $e->getMessage()
-            );
-            return false;
-        }
-    }
-}

+ 0 - 102
app/admin/logic/kefu/KefuLangLogic.php

@@ -1,102 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\logic\kefu;
-
-use app\common\model\kefu\KefuLang;
-
-/**
- * 客服术语逻辑层
- * Class KefuLangLogic
- * @package app\admin\logic\kefu
- */
-class KefuLangLogic
-{
-
-    /**
-     * @notes 获取列表
-     * @param $limit
-     * @param $page
-     * @return array
-     * @throws \think\db\exception\DbException
-     * @author cjhao
-     * @date 2021/11/29 15:11
-     */
-    public static function lists(int $limit,int $page)
-    {
-        $list = KefuLang::where(['shop_id' => 0])->order('sort asc')->paginate([
-                'list_rows' => $limit,
-                'page'      => $page,
-            ]);
-        return ['count' => $list->total(), 'lists' => $list->getCollection()];
-    }
-
-
-    /**
-     * @notes 新增话术
-     * @param $post
-     * @return bool
-     * @author cjhao
-     * @date 2021/11/29 15:54
-     */
-    public static function add(array $post)
-    {
-        $kefu_lang = new KefuLang();
-        $kefu_lang->title   = $post['title'];
-        $kefu_lang->content = $post['content'];
-        $kefu_lang->sort    = $post['sort'];
-        return $kefu_lang->save();
-    }
-
-    /**
-     * @notes 编辑话术
-     * @param $post
-     * @return bool
-     * @author cjhao
-     * @date 2021/11/29 15:59
-     */
-    public static function edit(array $post){
-        return KefuLang::update($post);
-    }
-
-
-    /**
-     * @notes 获取话术
-     * @param $id
-     * @return array|\think\Model|null
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author cjhao
-     * @date 2021/11/29 16:02
-     */
-    public static function detail(int $id){
-        return KefuLang::where(['id'=>$id])->find();
-    }
-
-    /**
-     * @notes 删除话术
-     * @param int $id
-     * @return bool
-     * @author cjhao
-     * @date 2021/11/29 16:11
-     */
-    public static function del(int $id){
-        return KefuLang::destroy($id);
-    }
-}

+ 0 - 231
app/admin/logic/kefu/KefuLogic.php

@@ -1,231 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\logic\kefu;
-
-use app\common\basics\Logic;
-use app\common\logic\ChatLogic;
-use app\common\model\Admin;
-use app\common\model\Client_;
-use app\common\model\kefu\Kefu;
-use app\common\model\Role;
-use app\common\server\UrlServer;
-use app\kefuapi\logic\LoginLogic;
-
-/**
- * 客服逻辑
- * Class KefuLogic
- * @package app\admin\logic\index
- */
-class KefuLogic extends Logic
-{
-
-    /**
-     * @notes 客服列表
-     * @param $get
-     * @return array
-     * @author 段誉
-     * @date 2021/11/26 18:44
-     */
-    public static function getLists($get)
-    {
-        $result = (new Kefu())->alias('k')
-            ->field("k.*,a.account")
-            ->join('admin a', 'a.id = k.admin_id')
-            ->where(['a.del' => 0, 'k.del' => 0, 'shop_id' => 0])
-            ->order('sort asc')->paginate([
-                'list_rows' => $get['limit'],
-                'page' => $get['page'],
-            ]);
-
-        foreach ($result as $value) {
-            $value['avatar'] = empty($value['avatar']) ? "" : UrlServer::getFileUrl($value['avatar']);
-        }
-
-        return ['count' => $result->total(), 'lists' => $result->getCollection()];
-    }
-
-
-    /**
-     * @notes 添加客服
-     * @param $post
-     * @return Kefu|false|\think\Model
-     * @author 段誉
-     * @date 2021/11/27 10:43
-     */
-    public static function add($post)
-    {
-        try {
-            return (new Kefu())->insertKefu($post);
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 编辑客服
-     * @param $post
-     * @return Kefu|false
-     * @author 段誉
-     * @date 2021/11/27 10:44
-     */
-    public static function edit($post)
-    {
-        try {
-
-            if ($post['disable'] == 1) {
-                ChatLogic::setChatDisable(0, $post['id']);
-            }
-
-            return (new Kefu())->updateKefu($post['id'], $post);
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 详情
-     * @param $id
-     * @return mixed
-     * @author 段誉
-     * @date 2021/11/27 10:44
-     */
-    public static function detail($id)
-    {
-        $detail = (new Kefu())->alias('k')
-            ->field("k.*, a.account, a.name")
-            ->join('admin a', 'a.id = k.admin_id')
-            ->where(['k.id' => $id, 'k.shop_id' => 0])
-            ->findOrEmpty();
-
-        $detail['avatar'] = !empty($detail['avatar']) ? UrlServer::getFileUrl($detail['avatar']) : '';
-       return $detail;
-    }
-
-
-    /**
-     * @notes 删除客服
-     * @param $post
-     * @return Kefu
-     * @author 段誉
-     * @date 2021/11/27 10:48
-     */
-    public static function del($post)
-    {
-        return (new Kefu())->delKefu($post['id']);
-    }
-
-
-    /**
-     * @notes 管理员列表
-     * @param $get
-     * @return array
-     * @throws \think\db\exception\DbException
-     * @author 段誉
-     * @date 2021/11/26 18:00
-     */
-    public static function getAdminLists($get)
-    {
-        // 角色名称
-        $role_column = (new Role())->getNameColumn();
-
-        // 已有客服列表
-        $kefu = (new Kefu())->where(['del' => 0, 'shop_id' => 0])->column("admin_id");
-
-        // 查询条件
-        $where[] = ['del', '=', 0];
-        $where[] = ['id', 'not in', $kefu];
-        if (isset($get['role_id']) && $get['role_id'] != '') {
-            $where[] = ['role_id', '=', $get['role_id']];
-        }
-        if (isset($get['name']) && $get['name'] != '') {
-            $where[] = ['name', 'like', "%{$get['name']}%"];
-        }
-
-        $result = (new Admin())->where($where)
-            ->hidden(['password', 'salt'])
-            ->paginate([
-                'list_rows' => $get['limit'],
-                'page' => $get['page'],
-            ]);
-
-        foreach ($result as $k => $item) {
-            if ($item['root'] == 1) {
-                $role = '超级管理员';
-            } else {
-                $role = $role_column[$item['role_id']] ?? '';
-            }
-            $result[$k]['role'] = $role;
-        }
-        return ['count' => $result->total(), 'lists' => $result->getCollection()];
-    }
-
-
-    /**
-     * @notes 设置客服状态
-     * @param $post
-     * @return Kefu
-     * @author 段誉
-     * @date 2021/11/26 18:32
-     */
-    public static function setStatus($post)
-    {
-        if ($post['disable'] == 1) {
-            ChatLogic::setChatDisable(0, $post['id']);
-        }
-        return (new Kefu())->updateStatus($post['id'], $post['disable']);
-    }
-
-
-    /**
-     * @notes 返回登录链接
-     * @param $id
-     * @return bool|string
-     * @author 段誉
-     * @date 2021/12/15 19:52
-     */
-    public static function login($id)
-    {
-        try{
-            $kefu = (new Admin())->alias('a')
-                ->field(['k.id', 'k.nickname', 'k.avatar', 'k.shop_id', 'a.account'])
-                ->join('kefu k', 'a.id = k.admin_id')
-                ->where(['k.id' => $id, 'k.shop_id' => 0, 'k.del' => 0])
-                ->findOrEmpty()->toArray();
-
-            if(empty($kefu)) {
-                throw new \Exception('该客服信息缺失');
-            }
-
-            $token = LoginLogic::createSession($kefu['id'], $kefu['shop_id'], Client_::pc);
-
-            return request()->domain() . '/kefu?token='. $token;
-
-        } catch(\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-}

+ 0 - 219
app/admin/logic/live/LiveGoodsLogic.php

@@ -1,219 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\logic\live;
-
-use app\common\basics\Logic;
-use app\common\enum\LiveGoodsEnum;
-use app\common\model\live\LiveGoods;
-use app\common\server\UrlServer;
-use app\common\server\WxMnpLiveServer;
-use think\facade\Db;
-
-
-/**
- * 直播商品逻辑层
- * Class LiveGoodsLogic
- * @package app\admin\logic\live
- */
-class LiveGoodsLogic extends Logic
-{
-
-    /**
-     * @notes 查询条件
-     * @param $params
-     * @return array
-     * @author 段誉
-     * @date 2023/2/16 21:17
-     */
-    public static function listsQuery($params)
-    {
-        $where[] = ['del', '=', 0];
-        if (!empty($params['goods_name'])) {
-            $where[] = ['name', 'like', '%' . $params['goods_name'] . '%'];
-        }
-        if (!empty($params['shop_id'])) {
-            $where[] = ['shop_id', '=', $params['shop_id']];
-        }
-
-        if (!empty($params['status'])) {
-            if ($params['status'] == 'ing') {
-                $where[] = ['sys_audit_status', 'in', [
-                    LiveGoodsEnum::SYS_AUDIT_STATUS_WAIT_PLATFORM,
-                    LiveGoodsEnum::SYS_AUDIT_STATUS_WAIT_WECHAT
-                ]];
-            }
-            if ($params['status'] == 'success') {
-                $where[] = ['sys_audit_status', '=', LiveGoodsEnum::SYS_AUDIT_STATUS_SUCCESS];
-            }
-            if ($params['status'] == 'fail') {
-                $where[] = ['sys_audit_status', '=', LiveGoodsEnum::SYS_AUDIT_STATUS_FAIL];
-            }
-        }
-        return $where;
-    }
-
-
-    /**
-     * @notes 直播商品列表
-     * @param $params
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2023/2/15 19:00
-     */
-    public static function lists($params)
-    {
-        $where = self::listsQuery($params);
-
-        $count = LiveGoods::where($where)->count();
-        $lists = LiveGoods::with(['shop'])->where($where)
-            ->order(['id' => 'desc'])
-            ->page($params['page'], $params['limit'])
-            ->append(['audit_status_text', 'price_text'])
-            ->select()->toArray();
-
-        foreach ($lists as &$item) {
-            $item['cover_img'] = UrlServer::getFileUrl($item['cover_img']);
-        }
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-
-    /**
-     * @notes 添加直播商品
-     * @param array $params
-     * @return bool
-     * @throws \GuzzleHttp\Exception\GuzzleException
-     * @author 段誉
-     * @date 2023/2/15 18:26
-     */
-    public static function audit(array $params)
-    {
-        Db::startTrans();
-        try {
-            if ($params['status'] == LiveGoodsEnum::SYS_AUDIT_STATUS_FAIL && empty($params['audit_remark'])) {
-                throw new \Exception('审核不通过请填写审核原因');
-            }
-
-            $liveGoods = LiveGoods::findOrEmpty($params['id'])->toArray();
-            if ($liveGoods['sys_audit_status'] > LiveGoodsEnum::SYS_AUDIT_STATUS_WAIT_PLATFORM) {
-                throw new \Exception('当前商品待微信审核或已审核完成');
-            }
-
-            // 更新信息
-            $update_data = [
-                'sys_audit_status' => $params['status'],
-                'audit_remark' => $params['audit_remark'] ?? '',
-            ];
-
-            if ($params['status'] == LiveGoodsEnum::SYS_AUDIT_STATUS_WAIT_WECHAT) {
-                $goods_res = self::addWechatGoods($liveGoods);
-                $update_data['wx_goods_id'] = $goods_res['goodsId'];
-                $update_data['wx_audit_id'] = $goods_res['auditId'];
-            }
-
-            // 提交审核,通过则待微信审核
-            LiveGoods::where(['id' => $params['id']])->update($update_data);
-
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 提交微信审核
-     * @param $goods
-     * @return bool
-     * @author 段誉
-     * @date 2023/2/17 10:06
-     */
-    public static function addWechatGoods($goods)
-    {
-        $data = [
-            'coverImgUrl' => $goods['cover_img_url'],
-            'name' => $goods['name'],
-            'priceType' => $goods['price_type'],
-            'price' => $goods['price'],
-            'price2' => $goods['price2'],
-            'url' => $goods['url'],
-        ];
-        return (new WxMnpLiveServer())->handle('addAndAuditGoods', $data);
-    }
-
-
-    /**
-     * @notes 直播商品详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2023/2/16 10:42
-     */
-    public static function detail($id)
-    {
-        $detail = LiveGoods::where(['id' => $id])
-            ->append(['price_type_text', 'price_tips', 'source_type_text', 'audit_status_text'])
-            ->findOrEmpty()->toArray();
-        $detail['cover_img'] = UrlServer::getFileUrl($detail['cover_img']);
-        return $detail;
-    }
-
-
-    /**
-     * @notes 删除直播商品
-     * @param array $params
-     * @return bool|string
-     * @author 段誉
-     * @date 2023/2/16 10:37
-     */
-    public static function del(array $params)
-    {
-        Db::startTrans();
-        try {
-            $goods = LiveGoods::findOrEmpty($params['id'])->toArray();
-            if ($goods['sys_audit_status'] < LiveGoodsEnum::SYS_AUDIT_STATUS_WAIT_WECHAT) {
-                throw new \Exception('当前商品暂不可删除');
-            }
-
-            LiveGoods::where(['id' => $params['id']])->update([
-                'del' => 1,
-                'update_time' => time()
-            ]);
-
-            // 删除微信商品库
-            if (!empty($goods['wx_goods_id'])) {
-                (new WxMnpLiveServer())->handle('delGoods', $goods['wx_goods_id']);
-            }
-
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            Db::rollback();
-            return $e->getMessage();
-        }
-    }
-
-
-}

+ 0 - 240
app/admin/logic/live/LiveRoomLogic.php

@@ -1,240 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\logic\live;
-
-use app\common\basics\Logic;
-use app\common\enum\LiveRoomEnum;
-use app\common\exception\WechatException;
-use app\common\model\live\LiveRoom;
-use app\common\model\shop\Shop;
-use app\common\server\UrlServer;
-use app\common\server\WxMnpLiveServer;
-use think\facade\Db;
-
-/**
- * 直播间逻辑层
- * Class LiveRoomLogic
- * @package app\admin\logic\live
- */
-class LiveRoomLogic extends Logic
-{
-
-    /**
-     * @notes 列表条件
-     * @param $params
-     * @return array
-     * @author 段誉
-     * @date 2023/2/16 16:42
-     */
-    public static function listsQuery($params)
-    {
-        $where[] = ['del', '=', 0];
-        if (!empty($params['shop_id'])) {
-            $where[] = ['shop_id', '=', $params['shop_id']];
-        }
-        if (isset($params['status'])
-            && $params['status'] != ''
-            && in_array($params['status'], LiveRoomEnum::AUDIT_STATUS)) {
-            $where[] = ['audit_status', '=', $params['status']];
-        }
-        if (!empty($params['live_info'])) {
-            $where[] = ['name|anchor_name', 'like', '%' . $params['live_info'] . '%'];
-        }
-        if (!empty($params['live_status'])) {
-            $where[] = ['live_status', '=', $params['live_status']];
-        }
-        // 创建时间
-        if (isset($params['start_time']) && !empty($params['start_time'])) {
-            $where[] = ['start_time', '>=', strtotime($params['start_time'])];
-        }
-        if (isset($params['end_time']) && !empty($params['end_time'])) {
-            $where[] = ['end_time', '<=', strtotime($params['end_time'])];
-        }
-        return $where;
-    }
-
-
-    /**
-     * @notes 直播间列表
-     * @param $params
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2023/2/15 19:00
-     */
-    public static function lists($params)
-    {
-        $where = self::listsQuery($params);
-
-        $count = LiveRoom::where($where)->count();
-        $lists = LiveRoom::with(['shop'])->where($where)
-            ->order(['id' => 'desc'])
-            ->page($params['page'], $params['limit'])
-            ->append(['live_time_text', 'live_status_text', 'audit_status_text'])
-            ->select()->toArray();
-
-        foreach ($lists as &$item) {
-            $item['share_img'] = UrlServer::getFileUrl($item['share_img']);
-            $item['feeds_img'] = UrlServer::getFileUrl($item['feeds_img']);
-            $item['cover_img'] = UrlServer::getFileUrl($item['cover_img']);
-        }
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-
-
-    /**
-     * @notes 编辑
-     * @param array $params
-     * @return bool
-     * @throws \GuzzleHttp\Exception\GuzzleException
-     * @author 段誉
-     * @date 2023/2/16 10:34
-     */
-    public static function audit($params)
-    {
-        Db::startTrans();
-        try {
-            $room = LiveRoom::findOrEmpty($params['id']);
-            if ($room['status'] > LiveRoomEnum::AUDIT_STATUS_WAIT) {
-                throw new \Exception('该记录已审核');
-            }
-
-            if ($params['status'] == LiveRoomEnum::AUDIT_STATUS_FAIL && empty($params['audit_remark'])) {
-                throw new \Exception('审核不通过请填写审核原因');
-            }
-
-            $update_data = [
-                'audit_remark' => $params['audit_remark'] ?? '',
-                'audit_status' => $params['status'],
-            ];
-
-            // 如果是审核通过,把直播间数据提交到微信并更新本地直播数据
-            if ($params['status'] == LiveRoomEnum::AUDIT_STATUS_SUCCESS) {
-                $room_id = self::createWxLiveRoom($room);
-                $update_data['wx_room_id'] = $room_id;
-            }
-
-            // 直播间数据
-            LiveRoom::where(['id' => $params['id']])->update($update_data);
-
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            Db::rollback();
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-
-    /**
-     * @notes 创建直播间
-     * @param $room
-     * @return mixed
-     * @throws WechatException
-     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
-     * @throws \GuzzleHttp\Exception\GuzzleException
-     * @author 段誉
-     * @date 2023/2/16 16:25
-     */
-    public static function createWxLiveRoom($room)
-    {
-        $data = [
-            'name' => $room['name'],
-            'startTime' => $room['start_time'],
-            'endTime' => $room['end_time'],
-            'anchorName' => $room['anchor_name'],
-            'anchorWechat' => $room['anchor_wechat'],
-            'createrWechat' => $room['anchor_wechat'],
-            'shareImg' => $room['share_img_id'],
-            'feedsImg' => $room['feeds_img_id'],
-            'coverImg' => $room['cover_img_id'],
-            'type' => $room['type'],
-            'isFeedsPublic' => $room['is_feeds_public'],
-            'closeLike' => $room['close_like'],
-            'closeGoods' => $room['close_goods'],
-            'closeComment' => $room['close_comment'],
-            'closeReplay' => $room['close_replay'],
-            'closeShare' => $room['close_share'],
-            'closeKf' => $room['close_kf'],
-        ];
-        $result = (new WxMnpLiveServer())->handle('createLiveRoom', $data);
-        return $result['roomId'];
-    }
-
-
-    /**
-     * @notes 直播间详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2023/2/16 10:42
-     */
-    public static function detail($id)
-    {
-        $detail = LiveRoom::where(['id' => $id])
-            ->append(['audit_status_text'])
-            ->findOrEmpty()->toArray();
-        $detail['start_time'] = date('Y-m-d H:i:s', $detail['start_time']);
-        $detail['end_time'] = date('Y-m-d H:i:s', $detail['end_time']);
-        $detail['share_img'] = UrlServer::getFileUrl($detail['share_img']);
-        $detail['feeds_img'] = UrlServer::getFileUrl($detail['feeds_img']);
-        $detail['cover_img'] = UrlServer::getFileUrl($detail['cover_img']);
-        return $detail;
-    }
-
-
-    /**
-     * @notes 推荐值排序
-     * @param $params
-     * @return LiveRoom
-     * @author 段誉
-     * @date 2023/2/16 16:44
-     */
-    public static function recommend($params)
-    {
-        return LiveRoom::update([
-            'id' => $params['id'],
-            'sort' => $params['sort'],
-        ]);
-    }
-
-
-    /**
-     * @notes 商家信息
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2023/2/16 14:10
-     */
-    public static function shopLists()
-    {
-        return Shop::field(['id', 'name'])
-            ->where(['del' => 0])
-            ->select()
-            ->toArray();
-    }
-
-
-}

+ 0 - 172
app/admin/logic/order/InvoiceLogic.php

@@ -1,172 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\order;
-
-
-use app\common\basics\Logic;
-use app\common\enum\ShopEnum;
-use app\common\model\order\Order;
-use app\common\model\order\OrderInvoice;
-use app\common\server\ExportExcelServer;
-
-
-/**
- * 发票管理-逻辑
- * Class InvoiceLogic
- * @package app\shop\logic\order
- */
-class InvoiceLogic extends Logic
-{
-
-    /**
-     * @notes 发票列表
-     * @param $get
-     * @param $shop_id
-     * @return array
-     * @author 段誉
-     * @date 2022/4/12 17:56
-     */
-    public static function getInvoiceLists($get, $is_export = false)
-    {
-        $where = [];
-        if (isset($get['status']) && is_numeric($get['status']) && $get['status'] != '') {
-            $where[] = ['i.status', '=', (int)$get['status']];
-        }
-
-        if (!empty($get['order_sn']) && $get['order_sn'] != '') {
-            $where[] = ['order_sn', 'like', '%'.$get['order_sn'].'%'];
-        }
-
-        if (isset($get['order_status']) && $get['order_status'] != '') {
-            $where[] = ['order_status', '=', $get['order_status']];
-        }
-
-        // 创建时间
-        if(isset($get['start_time']) && !empty($get['start_time'])) {
-            $where[] = ['o.create_time', '>=', strtotime($get['start_time']) ];
-        }
-
-        if(isset($get['end_time']) && !empty($get['end_time'])) {
-            $where[] = ['o.create_time', '<=', strtotime($get['end_time']) ];
-        }
-
-        if (true === $is_export) {
-            return self::export($where);
-        }
-
-        $field = ['i.*', 'o.order_sn', 'o.order_amount', 'order_status','o.create_time' => 'order_create_time'];
-
-        $model = new OrderInvoice();
-        $lists = $model->alias('i')->field($field)
-            ->join('order o', 'o.id = i.order_id')
-            ->order('i.id desc')
-            ->where($where)
-            ->append(['type_text', 'header_type_text', 'status_text'])
-            ->paginate([
-                'page'      => $get['page'] ?? 1,
-                'list_rows' => $get['limit'] ?? 10,
-                'var_page'  => 'page'
-            ])->toArray();
-
-        foreach ($lists['data'] as &$item) {
-            $item['order_status'] = Order::getOrderStatus($item['order_status']);
-            $item['order_create_time'] = date('Y-m-d h:i:s', $item['order_create_time']);
-        }
-
-        return ['count'=>$lists['total'], 'lists'=>$lists['data']];
-    }
-
-
-    /**
-     * @notes 发票详情
-     * @param $id
-     * @return array
-     * @author 段誉
-     * @date 2022/4/12 18:55
-     */
-    public static function detail($id)
-    {
-        $invoice = OrderInvoice::with(['order_data'])
-            ->append(['type_text', 'header_type_text', 'status_text'])
-            ->findOrEmpty($id)
-            ->toArray();
-        return $invoice;
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @param array $condition
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function export($where)
-    {
-        try {
-            $field = ['i.*', 'o.order_sn', 'o.order_amount', 'order_status','o.create_time' => 'order_create_time',
-            's.name' => 'shop_name', 's.type' => 'shop_type'];
-
-            $lists = (new OrderInvoice())->alias('i')
-                ->field($field)
-                ->join('order o', 'o.id = i.order_id')
-                ->join('shop s', 's.id = i.shop_id')
-                ->order('i.id desc')
-                ->where($where)
-                ->append(['type_text', 'header_type_text', 'status_text'])
-                ->select()->toArray();
-
-            foreach ($lists as &$item) {
-                $item['order_status'] = Order::getOrderStatus($item['order_status']);
-                $item['order_create_time'] = date('Y-m-d h:i:s', $item['order_create_time']);
-                $item['shop_type'] = ShopEnum::getShopTypeDesc($item['shop_type']);
-            }
-
-            $excelFields = [
-                'shop_name' => '商家名称',
-                'shop_type' => '商家类型',
-                'order_sn' => '订单编号',
-                'order_amount' => '订单金额',
-                'order_status' => '订单状态',
-                'order_create_time' => '下单时间',
-                'type_text' => '发票类型',
-                'header_type_text' => '抬头类型',
-                'name' => '发票抬头',
-                'duty_number' => '税号',
-                'email' => '邮箱',
-                'status_text' => '开票状态',
-                'invoice_number' => '发票编号',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('发票');
-            $export->setExportNumber(['invoice_number']);
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-}

+ 0 - 539
app/admin/logic/order/OrderLogic.php

@@ -1,539 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-
-namespace app\admin\logic\order;
-
-
-use app\common\basics\Logic;
-use app\common\enum\OrderEnum;
-use app\common\enum\ShopEnum;
-use app\common\model\order\Order;
-use app\common\enum\OrderLogEnum;
-use app\common\enum\PayEnum;
-use app\common\logic\OrderRefundLogic;
-use app\common\model\Express;
-use app\common\model\user\UserLevel;
-use app\common\server\ExportExcelServer;
-use app\common\server\UrlServer;
-use expressage\Kd100;
-use expressage\Kdniao;
-use app\common\server\ConfigServer;
-use think\facade\Db;
-use think\facade\Validate;
-
-
-/**
- * 订单管理-逻辑
- * Class GoodsLogic
- * @package app\shop\logic\goods
- */
-class OrderLogic extends Logic
-{
-    /**
-     * @notes 订单统计
-     * @param array $get
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:04 上午
-     */
-    public static function statistics($get = [], $is_export = false)
-    {
-        $order  = new Order();
-        $where  = static::getWhere($get);
-        $page   = $get['page'] ?? 1;
-        $limit  = $get['limit'] ?? 10;
-
-        if (Validate::must($get['page'] ?? '')) {
-            $page = $get['page'];
-        }
-
-        if (Validate::must($get['limit'] ?? '')) {
-            $limit = $get['limit'];
-        }
-
-        // 导出excel
-        if (true === $is_export) {
-            return self::export($where);
-        }
-
-        $field = 'o.*,s.name as shop_name,u.level';
-
-        $count = $order
-            ->alias('o')
-            ->field($field)
-            ->join('shop s', 's.id = o.shop_id')
-            ->join('user u', 'u.id = o.user_id')
-            ->join('order_goods g', 'g.order_id = o.id')
-            ->with(['order_goods', 'user', 'shop'])
-            ->where($where)
-            ->group('o.id')
-            ->count();
-
-        $lists = $order
-            ->alias('o')
-            ->field($field)
-            ->join('shop s', 's.id = o.shop_id')
-            ->join('user u', 'u.id = o.user_id')
-            ->join('order_goods g', 'g.order_id = o.id')
-            ->with(['order_goods', 'user', 'shop'])
-            ->where($where)
-            ->append([
-                'delivery_address', 'pay_status_text', 'order_source_text',
-                'order_status_text', 'delivery_type_text','order_type_text',
-                'pay_way_text',
-            ])
-            ->page($page, $limit)
-            ->order('o.id desc')
-            ->group('o.id')
-            ->select();
-
-        $user_level = UserLevel::where(['del'=>0])->column('name','id');
-
-        foreach ($lists as &$list) {
-            $list['pay_time'] = $list['pay_time'] == '0' ? '未支付' : date('Y-m-d H:i:s', $list['pay_time']);
-            $list['user']['avatar'] = UrlServer::getFileUrl($list['user']['avatar']);
-            $list['shop']['logo'] = UrlServer::getFileUrl($list['shop']['logo']);
-            foreach ($list['order_goods'] as $order_good) {
-                $order_good['image'] = UrlServer::getFileUrl($order_good['image']);
-            }
-
-            // 会员等级
-            $list['user_level'] = '暂无等级';
-            if(isset($user_level[$list['level']])) {
-                $list['user_level'] = $user_level[$list['level']];
-            }
-
-            //会员优惠
-            $list['member_amount'] = $list['member_amount'] ?? 0.00;
-        }
-        return ['count' => $count, 'lists' => $lists];
-    }
-
-    static function getWhere($data)
-    {
-        $where = [];
-        $where[] = [ 'o.del', '=', 0 ];
-        $where[] = [ 'o.delete', '=', 0 ];
-        
-        //订单状态选项卡
-        if (Validate::must($data['type'] ?? '')) {
-            $where[] = [ 'order_status', '=', $data['type'] ];
-        }
-        
-        //订单搜素
-        if (! empty($data['search_key']) && ! empty($data['keyword'])) {
-            $keyword = $data['keyword'];
-            switch ($data['search_key']) {
-                case 'order_sn':
-                    $where[] = ['o.order_sn', '=', $keyword];
-                    break;
-                case 'user_sn':
-                    $where[] = ['u.sn', '=', $keyword];
-                    break;
-                case 'shop_name':
-                    $where[] = ['s.name', 'like', '%' . $keyword . '%'];
-                    break;
-                case 'goods_name':
-                    $where[] = ['g.goods_name', 'like', '%' . $keyword . '%'];
-                    break;
-                case 'user_id':
-                    $where[] = ['o.user_id', '=', $keyword];
-                    break;
-                case 'nickname':
-                    $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
-                    break;
-                case 'user_mobile':
-                    $where[] = ['u.mobile', '=', $keyword];
-                    break;
-                case 'consignee':
-                    $where[] = ['consignee', '=', $keyword];
-                    break;
-                case 'consignee_mobile':
-                    $where[] = ['o.mobile', '=', $keyword];
-                    break;
-            }
-        }
-        
-        //商家名称
-        if (Validate::must($data['shop_name'] ?? '')) {
-            $where[] = [ 's.name', 'like', '%' . $data['shop_name'] . '%' ];
-        }
-        
-        //商品名称
-        if (Validate::must($data['goods_name'] ?? '')) {
-            $where[] = ['g.goods_name', 'like', '%' . $data['goods_name'] . '%'];
-        }
-        
-        //配送方式
-        if (Validate::must($data['delivery_type'] ?? '')) {
-            $where[] = ['o.delivery_type', '=', $data['delivery_type']];
-        }
-        
-        //订单状态
-        if (Validate::must($data['order_status'] ?? '')) {
-            $where[] = [ 'o.order_status', '=', $data['order_status'] ];
-        }
-        
-        //订单类型
-        if (Validate::must($data['order_type'] ?? '')) {
-            $where[] = [ 'o.order_type', '=', $data['order_type'] ];
-        }
-        
-        //付款方式
-        if (Validate::must($data['pay_way'] ?? '')) {
-            $where[] = [ 'o.pay_way', '=', $data['pay_way'] ];
-        }
-        
-        //订单来源
-        if (Validate::must($data['order_source'] ?? '')) {
-            $where[] = ['o.order_source', '=', $data['order_source']];
-        }
-    
-        //下单时间
-        if (Validate::must($data['start_time'] ?? '')) {
-            $where[] = ['o.create_time', '>=', strtotime($data['start_time'])];
-        }
-    
-        if (Validate::must($data['end_time'] ?? '')) {
-            $where[] = ['o.create_time', '<=', strtotime($data['end_time'])];
-        }
-        
-        return $where;
-    }
-
-    /**
-     * @notes 订单详情
-     * @param $id
-     * @return array|\think\Model|null
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:04 上午
-     */
-
-    public static function getDetail($id)
-    {
-        $order = new Order();
-        $result = $order
-            ->with(['user', 'order_goods', 'invoice'])
-            ->where('id', $id)
-            ->append(['delivery_address', 'pay_status_text', 'order_status_text', 'pay_way_text', 'order_type_text'])
-            ->find();
-        $result['pay_time'] = $result['pay_time'] == '0' ? '未支付' : date('Y-m-d H:i:s', $result['pay_time']);
-        $result['user']['avatar'] = UrlServer::getFileUrl($result['user']['avatar']);
-        foreach ($result['order_goods'] as &$order_goods) {
-            $order_goods['goods_image'] = empty($order_goods['spec_image']) ?
-                UrlServer::getFileUrl($order_goods['image']) : UrlServer::getFileUrl($order_goods['spec_image']);
-        }
-
-        // 自提提货时间
-        if ($result['delivery_type'] == OrderEnum::DELIVERY_TYPE_SELF && $result['verification_status']) {
-            $result['confirm_take_time'] = date('Y-m-d H:i:s', $result['confirm_take_time']);
-        } else {
-            $result['confirm_take_time'] = '';
-        }
-
-        //会员优惠
-        $result['member_amount'] = $result['member_amount'] ?? 0.00;
-
-        return $result;
-    }
-
-    /**
-     * @notes 物流信息
-     * @param $order_id
-     * @return array|\PDOStatement|string|\think\Model|null
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @author suny
-     * @date 2021/7/14 10:05 上午
-     */
-    public static function shippingInfo($order_id)
-    {
-        $shipping = Db::name('delivery')->where('order_id', $order_id)->find();
-        $shipping['traces'] = [];
-        if ($shipping) {
-            $shipping['create_time_text'] = date('Y-m-d H:i:s', $shipping['create_time']);
-            if ($shipping['send_type'] == 1) {
-                $shipping['traces'] = self::getShipping($order_id);
-            }
-        }
-        
-        return $shipping;
-    }
-
-    /**
-     * @notes 物流轨迹
-     * @param $order_id
-     * @return bool|string[]
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:05 上午
-     */
-    public static function getShipping($order_id)
-    {
-        $orderModel = new Order();
-        $order = $orderModel->alias('o')
-            ->field('invoice_no,shipping_name,shipping_id,o.shipping_status,o.mobile')
-            ->join('delivery d', 'd.order_id = o.id')
-            ->where(['o.id' => $order_id])
-            ->find();
-        $express = ConfigServer::get('express', 'way', '', '');
-        $key = ConfigServer::get($express, 'appkey', '', '');
-        $app = ConfigServer::get($express, 'appsecret', '', '');
-
-        if (empty($express) || $order['shipping_status'] != 1 || empty($app) || empty($key)) {
-            return $traces[] = ['暂无物流信息'];
-        }
-        //快递配置设置为快递鸟时
-        if ($express === 'kdniao') {
-            $expressage = (new Kdniao($app, $key, true));
-            $shipping_field = 'codebird';
-        } else {
-            $expressage = (new Kd100($app, $key, true));
-            $shipping_field = 'code100';
-        }
-
-        //快递编码
-        $shipping_code = Db::name('express')
-            ->where(['id' => $order['shipping_id']])
-            ->value($shipping_field);
-
-        //获取物流轨迹
-        if (in_array(strtolower($shipping_code ), [ 'sf', 'shunfeng' ])) {
-            if ($express === 'kdniao') {
-                $expressage->logistics($shipping_code, $order['invoice_no'], substr($order['mobile'],-4));
-            } else {
-                $expressage->logistics($shipping_code, $order['invoice_no'], $order['mobile']);
-            }
-        }else {
-            $expressage->logistics($shipping_code, $order['invoice_no']);
-        }
-
-        $traces = $expressage->logisticsFormat();
-        if ($traces == false) {
-            $traces[] = [$expressage->getError()];
-        } else {
-            foreach ($traces as &$item) {
-                $item = array_values(array_unique($item));
-            }
-        }
-        return $traces;
-    }
-
-    /**
-     * @notes 获取物流
-     * @return \think\Collection
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author suny
-     * @date 2021/7/14 10:05 上午
-     */
-    public static function express()
-    {
-
-        return Express::where('del', 0)->select();
-    }
-
-
-    /**
-     * @notes 取消订单(返回商品规格表库存)
-     * @param $order_id
-     * @param $admin_id
-     * @return bool|string
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     * @author suny
-     * @date 2021/7/14 10:07 上午
-     */
-    public static function cancel($order_id, $admin_id)
-    {
-
-        Db::startTrans();
-        try {
-            $order = Order::where(['id' => $order_id], ['orderGoods'])->find();
-            //取消订单
-            OrderRefundLogic::cancelOrder($order_id, OrderLogEnum::TYPE_SHOP, $admin_id);
-            //已支付的订单,取消,退款
-            if ($order['pay_status'] == PayEnum::ISPAID) {
-                //更新订单状态
-                OrderRefundLogic::cancelOrderRefundUpdate($order);
-                //订单退款
-                OrderRefundLogic::refund($order, $order['order_amount'], $order['order_amount']);
-            }
-            Db::commit();
-
-            return true;
-
-        } catch (\Exception $e) {
-            Db::rollback();
-            //增加退款失败记录
-            OrderRefundLogic::addErrorRefund($order, $e->getMessage());
-            return $e->getMessage();
-        }
-    }
-
-
-    /**
-     * @notes 获取各列表数量
-     * @return int
-     * @author suny
-     * @date 2021/7/14 10:08 上午
-     */
-    public static function getAll()
-    {
-        $data = input();
-        
-        unset($data['type']);
-        
-        return Order::alias('o')
-            ->join('shop s', 's.id = o.shop_id')
-            ->join('user u', 'u.id = o.user_id')
-            ->join('order_goods g', 'g.order_id = o.id')
-            ->with(['order_goods', 'user', 'shop'])
-            ->where(static::getWhere($data))
-            ->group('o.id')
-            ->count();
-    }
-
-    /**
-     * @notes 拼装统计信息
-     * @param $order_status
-     * @return array
-     * @author suny
-     * @date 2021/7/14 10:08 上午
-     */
-    public static function getStat($order_status)
-    {
-        $data   = input();
-        
-        unset($data['type']);
-        
-        $result = [];
-        
-        foreach ($order_status as $status => $title) {
-            $num = Order::alias('o')
-                ->join('shop s', 's.id = o.shop_id')
-                ->join('user u', 'u.id = o.user_id')
-                ->join('order_goods g', 'g.order_id = o.id')
-                ->with(['order_goods', 'user', 'shop'])
-                ->where(static::getWhere($data))
-                ->where('o.order_status', $status)
-                ->group('o.id')
-                ->count();
-            
-            $result[] = [
-                'title'     => $title,
-                'status'    => $status,
-                'count'     => $num,
-            ];
-        }
-        
-        return $result;
-    }
-
-
-    /**
-     * @notes 导出Excel
-     * @param array $condition
-     * @return array|false
-     * @author 段誉
-     * @date 2022/4/24 10:10
-     */
-    public static function export($condition = [])
-    {
-        try {
-            $field = 'o.*,order_status as order_status_text,pay_way as pay_way_text,
-            o.delivery_type as delivery_type_text,order_type as order_type_text,
-            u.nickname,s.name as shop_name,s.type as shop_type';
-
-            $lists = Order::alias('o')
-                ->join('shop s', 's.id = o.shop_id')
-                ->join('user u', 'u.id = o.user_id')
-                ->join('order_goods g', 'g.order_id = o.id')
-                ->with(['order_goods'])
-                ->field($field)
-                ->where($condition)
-                ->append(['delivery_address', 'pay_status_text', 'order_source_text'])
-                ->order('o.id desc')
-                ->group('o.id')
-                ->select()
-                ->toArray();
-
-            foreach ($lists as &$item) {
-                $orderGoodsList = [];
-                $goodsItemList = [];
-                $goodsPriceList = [];
-                $goodsNumList = [];
-                foreach ($item['order_goods'] as $good) {
-                    $orderGoodsList[] = $good['goods_name'];
-                    $goodsItemList[] = $good['spec_value'];
-                    $goodsPriceList[] = $good['goods_price'];
-                    $goodsNumList[] = $good['goods_num'];
-                }
-                $item['order_goods_list'] = implode(';', $orderGoodsList);
-                $item['goods_item_list'] = implode(';', $goodsItemList);
-                $item['goods_price_list'] = implode(';', $goodsPriceList);
-                $item['goods_num_list'] = implode(';', $goodsNumList);
-                $item['shop_type'] = ShopEnum::getShopTypeDesc($item['shop_type']);
-            }
-
-            $excelFields = [
-                'shop_name' => '商家名称',
-                'shop_type' => '商家类型',
-                'order_sn' => '订单编号',
-                'order_type_text' => '订单类型',
-                'nickname' => '用户名称',
-                'order_goods_list' => '商品信息',
-                'goods_item_list' => '规格',
-                'goods_price_list' => '商品价格',
-                'goods_num_list' => '商品数量',
-                'order_amount' => '实付金额',
-                'consignee' => '收货人',
-                'mobile' => '收货人手机',
-                'delivery_address' => '收货地址',
-                'pay_status_text' => '支付状态',
-                'order_status_text' => '订单状态',
-                'create_time' => '下单时间',
-            ];
-
-            $export = new ExportExcelServer();
-            $export->setFileName('订单');
-            $result = $export->createExcel($excelFields, $lists);
-
-            return ['url' => $result];
-
-        } catch (\Exception $e) {
-            self::$error = $e->getMessage();
-            return false;
-        }
-    }
-
-}

+ 0 - 70
app/admin/validate/goods/BrandValidate.php

@@ -1,70 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\validate\goods;
-
-
-use app\common\basics\Validate;
-use app\common\model\goods\Goods;
-
-
-/**
- * 商品品牌
- * Class GoodsBrandValidate
- * @package app\admin\validate
- */
-class BrandValidate extends Validate
-{
-
-    protected $rule = [
-        'id'        => 'require',
-        'name'      => 'require|unique:goodsBrand,name&del',
-        'initial'   => 'require',
-        'image'     => 'require'
-    ];
-
-    protected $message = [
-        'id.require'        => '参数缺失',
-        'name.require'      => '参数缺失',
-        'name.unique'       => '该名称已被使用',
-        'initial.unique'    => '请选择品牌首字母',
-        'image.require'     => '请选择品牌图片',
-    ];
-
-    protected $scene = [
-        'add'  =>  ['name', 'initial', 'image'],
-        'edit' =>  ['id','name', 'initial', 'image'],
-    ];
-
-    public function sceneDel()
-    {
-        return $this->only(['id'])
-        ->append('id','checkDel');
-    }
-
-
-    protected function checkDel($value,$rule,$data)
-    {
-        $check = Goods::where('brand_id', $value)->find();
-        if ($check) {
-            return '品牌已经关联商品,无法删除品牌';
-        }
-        return true;
-    }
-}

+ 0 - 149
app/admin/validate/goods/CategoryValidate.php

@@ -1,149 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\validate\goods;
-
-use think\Validate;
-use app\common\model\goods\GoodsCategory as GoodsCategoryModel;
-use app\common\model\goods\Goods as GoodsModel;
-use app\admin\logic\goods\CategoryLogic;
-
-class CategoryValidate extends Validate
-{
-  protected $rule = [
-    'id'    => 'require|checkCategory',
-    'name'  => 'require|max: 30|checkName',
-    'pid'   => 'require|integer|addPid|editPid',
-  ];
-
-  protected $message = [
-    'id.require'  => 'id不能为空',
-    'name.require'  => '分类名称不能为空',
-    'name.max'  => '分类名称不能超过30个字符',
-    'pid.require'   => '请选择上级分类',
-    'pid.integer'   => '上级id必须为整型',
-  ];
-  
-  /**
-   * 添加场景
-   */
-  public function sceneAdd()
-  {
-    return $this->remove('id', ['require', 'checkCategory'])
-      ->remove('pid','editPid');
-  }
-
-  /**
-   * 删除场景
-   */
-  public function sceneDel()
-  {
-    return $this->only(['id']);
-  }
-
-  /**
-   * 编辑场景
-   */
-  public function sceneEdit()
-  {
-    return $this->remove('id', 'checkCategory')
-      ->remove('pid', 'addPid');
-  }
-
-  /*
-  * 校验分类名称(同一个上级分类下不允许出现相同分类名称)
-  */
-  protected function checkName($value,$rule,$data){
-    $where[] = ['del','=',0];
-    // 如果有id代表是编辑校验分类名称
-    if(isset($data['id'])){
-        $where[] = ['id','<>',$data['id']];
-    }
-    $where[] = ['name','=',$data['name']];
-    $where[] = ['pid','=',$data['pid']];
-
-    $name = GoodsCategoryModel::where($where)->value('name');
-    if($name){
-        return '分类名称已存在';
-    }
-    return true;
-  }
-
-  /*
-  * 添加时,校验上级
-  */
-  protected function addPid($value, $rule, $data){
-    // 顶级分类直接通过
-    if($value == 0) return true;
-
-    $goods_category = GoodsCategoryModel::where([
-      'id' => $value,
-      'del' => 0
-    ])->find();
-
-    if($goods_category)  return true;
-
-    return '上级分类不存在,请重新选择';
-  }
-
-  /*
-  * 验证分类
-  */
-  protected function checkCategory($value, $rule, $data){
-    $children = GoodsCategoryModel::where([
-      'del' => 0,
-      'pid' => $value
-    ])->find();
-    if($children) {
-      return '该分类下还有子分类不允许删除';
-    }
-    // 已经有商品绑定了该分类,不能删除
-    $goods = GoodsModel::where([
-      'del' => 0,
-      'third_cate_id' => $value
-    ])->find();
-    if($goods) {
-      return '已有商品绑定此分类不允许删除';
-    }
-
-    return true;
-  }
-
-  /*
-  * 编辑时,验证上级分类
-  */
-  protected function editPid($value, $rule, $data){
-    // 目标上级分类为顶部分类时,直接通过
-    if($value == 0 ) return true;
-    // 当前分类
-    $category = GoodsCategoryModel::where(['id'=>$data['id'],'del'=>0])->find();
-    // 目标上级分类
-    $partner = GoodsCategoryModel::where(['id'=>$value,'del'=>0])->find();
-    // 当前分类下的子分类
-    $level = CategoryLogic::getCategoryLevel($category);
-
-    if($category['id'] == $partner['id']) return '上级分类不能是自己';
-    // 限制分类不超过3级
-    if($level == 3 && $partner) return '该分类下有完整的子分类,不可修改上级分类';
-    if($partner['level'] == 2 && $level != 1) return '该分类下有子分类,请先调整该分类下的子分类';
-    if($partner['level'] == 3) return '父级分类不能是第三级';
-
-    return true;
-  }
-}

+ 0 - 50
app/admin/validate/goods/ColumnValidate.php

@@ -1,50 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\validate\goods;
-
-
-use app\common\basics\Validate;
-
-
-/**
- * 商品栏目
- * Class GoodsColumnValidate
- * @package app\admin\validate
- */
-class ColumnValidate extends Validate
-{
-
-    protected $rule = [
-        'id'    => 'require',
-        'name'  => 'require|unique:goodsColumn,name&del',
-    ];
-
-    protected $message = [
-        'id.require'    => '参数缺失',
-        'name.require'  => '参数缺失',
-        'name.unique'   => '该名称已被使用',
-    ];
-
-    protected $scene = [
-        'add'  =>  ['name'],
-        'edit' =>  ['name'],
-        'del'  =>  ['id'],
-    ];
-}

+ 0 - 45
app/admin/validate/goods/GoodsValidate.php

@@ -1,45 +0,0 @@
-<?php
-namespace  app\admin\validate\goods;
-
-use think\Validate;
-
-class GoodsValidate extends Validate
-{
-    protected $rule = [
-        'goods_id' => 'require|integer',
-        'reason' => 'require|length:1,200',
-        'sales_virtual' => 'integer|egt:0',
-        'clicks_virtual' => 'integer|egt:0',
-        'sort_weight' => 'integer|egt:0',
-        'audit_status' => 'require|integer|in:1,2',
-        'audit_remark' => 'require|length:1,200',
-        'ids' => 'require',
-    ];
-
-    protected  $message= [
-        'goods_id.require' => '商品id不能为空',
-        'goods_id.integer' => '商品id须为整型',
-        'reason.require' => '违规原因不能为空',
-        'reason.length' => '违规原因不能超过200个字符',
-        'sales_virtual.integer' => '虚拟销量须为整型',
-        'sales_virtual.egt' => '虚拟销量须大于或等于0',
-        'clicks_virtual.integer' => '虚拟浏览量须为整型',
-        'clicks_virtual.egt' => '虚拟浏览量须大于或等于0',
-        'sort_weight.integer' => '排序权重须为整型',
-        'sort_weight.egt' => '排序权重须大于或等于0',
-        'audit_status.require' => '审核状态不能为空',
-        'audit_status.integer' => '审核状态须为整型',
-        'audit_status.in' => '审核状态错误',
-        'audit_remark.require' => '审核说明不能为空',
-        'audit_remark.length' => '审核说明长度不能超过200个字符',
-        'ids.require' => '参数缺失',
-    ];
-
-    protected $scene = [
-        're_audit' => ['goods_id', 'reason'],
-        'set_info' => ['goods_id', 'sales_virtual', 'clicks_virtual','sort_weight'],
-        'audit' => ['goods_id', 'audit_status', 'audit_remark'],
-        'moreLower' => ['ids', 'reason'],
-        'moreAudit' => ['ids', 'audit_remark']
-    ];
-}

+ 0 - 65
app/admin/validate/goods/UnitValidate.php

@@ -1,65 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\validate\goods;
-
-
-use app\common\basics\Validate;
-use app\common\model\goods\Goods;
-
-/**
- * 商品单位验证
- * Class GoodsUnitValidate
- * @package app\admin\validate
- */
-class UnitValidate extends Validate
-{
-
-    protected $rule = [
-        'id'    => 'require',
-        'name'  => 'require|unique:goodsUnit,name&del'
-    ];
-
-    protected $message = [
-        'id.require'    => '参数缺失',
-        'name.unique'   => '该名称已被使用',
-    ];
-
-
-    protected $scene = [
-        'add'   => ['name'],
-        'edit'  => ['id','name'],
-    ];
-
-    public function sceneDel()
-    {
-        return $this->only(['id'])
-            ->append('id','CheckUnit');
-    }
-
-    protected function CheckUnit($value, $rule, $data)
-    {
-        $check = Goods::where('unit_id', $value)->find();
-        if ($check) {
-            return '当前商品单位已使用,无法删除';
-        }
-        return true;
-    }
-
-}

+ 0 - 137
app/admin/validate/integral/IntegralGoodsValidate.php

@@ -1,137 +0,0 @@
-<?php
-
-namespace app\admin\validate\integral;
-
-use app\common\basics\Validate;
-use app\common\enum\IntegralGoodsEnum;
-use app\common\model\integral\IntegralGoods;
-
-/**
- * 积分商品验证
- * Class IntegralGoodsValidate
- * @package app\admin\validate\kefu
- */
-class IntegralGoodsValidate extends Validate
-{
-    protected $rule = [
-        'id'=>'require|checkGoods',
-        'type' => 'require|in:1,2',
-        'name' => 'require',
-        'image' => 'require',
-        'market_price' => 'checkMarketPrice',
-        'stock' => 'require|integer',
-        'exchange_way' => 'requireIf:type,1',
-        'need_integral' => 'require|integer|checkNeedIntegral',
-        'need_money' => 'requireIf:exchange_way,2|checkNeedMoney',
-        'delivery_way' => 'requireIf:type,1',
-        'express_type' => 'requireIf:delivery_way,1',
-        'express_money' => 'requireIf:express_type,2|checkExpressMoney',
-        'balance' => 'requireIf:type,2|checkBalance',
-        'status' => 'require|in:0,1',
-    ];
-
-    protected $message = [
-        'id.require' => '参数缺失',
-        'type.require' => '请选择兑换类型',
-        'type.in' => '兑换类型错误',
-        'name.require' => '请填写商品名称',
-        'image.require' => '请上传商品封面',
-        'stock.require' => '请填写发放库存',
-        'stock.integer' => '请填写整数发放库存',
-        'exchange_way.requireIf' => '请选择兑换方式',
-        'need_integral.require' => '请填写兑换积分',
-        'need_integral.integer' => '请填写整数兑换积分',
-        'need_money.requireIf' => '请填写兑换金额',
-        'delivery_way.requireIf' => '请选择物流配送方式',
-        'express_type.requireIf' => '请选择物流方式',
-        'express_money.requireIf' => '请填写运费',
-        'balance.requireIf' => '请填写红包面值',
-        'status.require' => '请选择商品状态',
-        'status.in' => '商品状态参数错误',
-    ];
-
-
-    public function sceneAdd()
-    {
-        $this->remove('id', true);
-    }
-
-    public function sceneEdit()
-    {
-    }
-
-    public function sceneDel()
-    {
-        $this->only(['id']);
-    }
-
-    public function sceneDetail()
-    {
-        $this->only(['id']);
-    }
-
-
-    protected function checkGoods($value, $rule, $data)
-    {
-        $goods = IntegralGoods::where(['id' => $value])->findOrEmpty();
-        if ($goods->isEmpty()) {
-            return '积分商品不存在';
-        }
-        if ($goods['del'] == 1) {
-            return '积分商品已被删除';
-        }
-        return true;
-    }
-
-
-    // 验证统一运费时,运费不小于0
-    protected function checkExpressMoney($value, $rule, $data)
-    {
-        // 快递配送  统一运费 运费须大于0
-        if ($data['delivery_way'] == IntegralGoodsEnum::DELIVERY_EXPRESS
-            && $data['express_type'] == IntegralGoodsEnum::EXPRESS_TYPE_UNIFIED
-            && $value <= 0
-        ) {
-            return '请输入大于0的运费';
-        }
-        return true;
-    }
-
-
-    // 验证兑换积分需大于0
-    protected function checkNeedIntegral($value, $rule, $data)
-    {
-        if ($value <= 0) {
-            return '请输入大于0的兑换积分';
-        }
-        return true;
-    }
-
-    // 验证兑换方式为 积分+金额 时,金额不小于0
-    protected function checkNeedMoney($value, $rule, $data)
-    {
-        if ($data['exchange_way'] == IntegralGoodsEnum::EXCHANGE_WAY_HYBRID && $value <= 0) {
-            return '请输入大于0的兑换金额';
-        }
-        return true;
-    }
-
-    // 验证兑换类型为 红包时,红包面额不小于0
-    protected function checkBalance($value, $rule, $data)
-    {
-        if ($data['type'] == IntegralGoodsEnum::TYPE_BALANCE && $value <= 0) {
-            return '请输入大于0的红包面值';
-        }
-        return true;
-    }
-
-
-    protected function checkMarketPrice($value)
-    {
-        if (!empty($value) && $value < 0) {
-            return '请输入正确市场价';
-        }
-        return true;
-    }
-
-}

+ 0 - 144
app/admin/validate/integral/IntegralOrderValidate.php

@@ -1,144 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop开源商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
-// |  likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | likeshop团队版权所有并拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshop.cn.team
-// +----------------------------------------------------------------------
-
-namespace app\admin\validate\integral;
-
-
-use app\common\basics\Validate;
-use app\common\enum\IntegralGoodsEnum;
-use app\common\enum\IntegralOrderEnum;
-use app\common\model\integral\IntegralOrder;
-
-class IntegralOrderValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require',
-    ];
-
-    protected $message = [
-        'id.require' => '参数错误',
-    ];
-
-    public function sceneDeliveryHandle()
-    {
-        return $this->only(['id'])
-            ->append('id','checkDeliveryHandle');
-    }
-
-    public function sceneConfirm()
-    {
-        return $this->only(['id'])
-            ->append('id','checkConfirm');
-    }
-
-    public function sceneCancel()
-    {
-        return $this->only(['id'])
-            ->append('id','checkCancel');
-    }
-
-
-    /**
-     * @notes 检验订单能否发货
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author ljj
-     * @date 2022/3/3 12:06 下午
-     */
-    public function checkDeliveryHandle($value,$rule,$data)
-    {
-        $result = IntegralOrder::where(['id'=>$value,'del'=>0])->findOrEmpty()->toArray();
-        if (!$result) {
-            return '订单不存在';
-        }
-        if ($result['delivery_way'] == 0) {
-            return '订单无需快递';
-        }
-        if (!isset($data['shipping_id']) || $data['shipping_id'] == '') {
-            return '请选择快递';
-        }
-        if (!isset($data['invoice_no']) || $data['invoice_no'] == '') {
-            return '请输入快递单号';
-        }
-        if ($result['shipping_status'] == 1) {
-            return '订单已发货';
-        }
-        if ($result['order_status'] != IntegralOrderEnum::ORDER_STATUS_DELIVERY) {
-            return '订单状态不正确,无法发货';
-        }
-        return true;
-    }
-
-    /**
-     * @notes 检验订单能否确认收货
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author ljj
-     * @date 2022/3/3 3:37 下午
-     */
-    public function checkConfirm($value,$rule,$data)
-    {
-        $result = IntegralOrder::where(['id'=>$value,'del'=>0])->findOrEmpty()->toArray();
-        if (!$result) {
-            return '订单不存在';
-        }
-        if ($result['order_status'] != IntegralOrderEnum::ORDER_STATUS_GOODS) {
-            return '订单状态不正确,无法确认收货';
-        }
-        return true;
-    }
-
-
-
-
-    /**
-     * @notes 取消订单验证
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/3/3 17:58
-     */
-    public function checkCancel($value, $rule, $data)
-    {
-        $order = IntegralOrder::findOrEmpty($value);
-        $goods_snap = $order['goods_snap'];
-
-        if ($order->isEmpty()) {
-            return '订单不存在';
-        }
-
-        // 商品类型为红包的不可取消
-        if ($goods_snap['type'] == IntegralGoodsEnum::TYPE_BALANCE) {
-            return '类型为红包的订单不可取消';
-        }
-
-        if ($order['order_status'] >= IntegralOrderEnum::ORDER_STATUS_GOODS) {
-            return '已发货订单不可取消';
-        }
-
-        return true;
-    }
-
-}

+ 0 - 68
app/admin/validate/kefu/KefuLangValidate.php

@@ -1,68 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\validate\kefu;
-use app\common\basics\Validate;
-use app\common\model\kefu\KefuLang;
-
-/**
- *
- * Class KefuLangValidate
- * @package app\admin\validate\kefu
- */
-class KefuLangValidate extends Validate
-{
-    protected $rule = [
-        'id'            => 'require|checkLang',
-        'title'         => 'require|unique:'.KefuLang::class.',title',
-        'content'       => 'require|unique:'.KefuLang::class.',content',
-        'sort'          => 'gt:0',
-    ];
-
-    protected $message = [
-        'title.require'     => '请输入标题',
-        'title.unique'      => '标题已存在',
-        'content.require'   => '请输入内容',
-        'content.unique'    => '内容已存在',
-        'sort.gt'           => '排序不能小于零',
-
-    ];
-
-
-    public function sceneAdd()
-    {
-        $this->remove('id', true);
-    }
-
-    public function sceneDel()
-    {
-        $this->only(['id']);
-    }
-
-    public function checkLang($value,$rule,$data){
-        $lang = KefuLang::where(['id'=>$value])->find();
-        if($lang){
-            return true;
-        }
-        return '话术不存在';
-    }
-
-
-
-
-}

+ 0 - 98
app/admin/validate/kefu/KefuValidate.php

@@ -1,98 +0,0 @@
-<?php
-
-namespace app\admin\validate\kefu;
-
-use app\common\basics\Validate;
-use app\common\model\kefu\Kefu;
-
-/**
- * 客服验证逻辑
- * Class KefuValidate
- * @package app\admin\validate\content
- */
-class KefuValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require|number',
-        'admin_id' => 'require|number|checkIsKefu',
-        'avatar' => 'require',
-        'nickname' => 'require',
-        'disable' => 'require|in:0,1',
-        'sort' => 'gt:0'
-    ];
-
-    protected $message = [
-        'id.require' => 'id不可为空',
-        'id.number' => 'id必须为数字',
-        'admin_id.require' => '请选择管理员',
-        'admin_id.number' => '管理员选择异常',
-        'avatar.require' => '请选择头像',
-        'nickname.require' => '请填写客服昵称',
-        'disable.require' => '请选择状态',
-        'disable.in' => '状态错误',
-        'sort.gt' => '排序需大于0',
-    ];
-
-
-    public function sceneAdd()
-    {
-        $this->remove('id', true);
-    }
-
-    public function sceneEdit()
-    {
-        $this->remove('admin_id',true);
-    }
-
-    public function sceneDel()
-    {
-        $this->only(['id'])->append('id', 'checkIsDel');
-    }
-
-
-    /**
-     * @notes 选中管理员是否已为客服
-     * @param $value
-     * @param $rule
-     * @param array $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2021/11/26 18:56
-     */
-    protected function checkIsKefu($value, $rule, $data = [])
-    {
-        $check = Kefu::where([
-            'admin_id' => $value,
-            'shop_id' => 0,
-            'del' => 0
-        ])->findOrEmpty();
-
-        if (!$check->isEmpty()) {
-            return "该管理员已是客服";
-        }
-
-        return true;
-    }
-
-
-    /**
-     * @notes 客服是否存在
-     * @param $value
-     * @param $rule
-     * @param array $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2021/11/26 18:57
-     */
-    protected function checkIsDel($value, $rule, $data = [])
-    {
-        $check = Kefu::where(['id' => $value, 'del' => 0])->findOrEmpty();
-
-        if ($check->isEmpty()) {
-            return "该客服数据错误";
-        }
-
-        return true;
-    }
-
-}

+ 0 - 30
app/admin/validate/kefu/LoginValidate.php

@@ -1,30 +0,0 @@
-<?php
-
-namespace app\admin\validate\kefu;
-
-use app\common\basics\Validate;
-use app\common\logic\ChatLogic;
-
-
-class LoginValidate extends Validate
-{
-    protected $rule = [
-        'id' => 'require|number|checkConfig',
-    ];
-
-    protected $message = [
-        'id.require' => 'id不可为空',
-        'id.number' => 'id必须为数字',
-    ];
-
-
-    protected function checkConfig($value, $rule, $data = [])
-    {
-        if (false === ChatLogic::checkConfig()) {
-            return ChatLogic::getError() ?: '请联系管理员设置后台配置';
-        }
-        return true;
-    }
-
-
-}

+ 0 - 86
app/admin/validate/live/LiveGoodsValidate.php

@@ -1,86 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\validate\live;
-
-use app\common\basics\Validate;
-use app\common\enum\LiveGoodsEnum;
-use app\common\model\live\LiveGoods;
-
-/**
- * 直播商品验证器
- * Class LiveGoodsValidate
- * @package app\admin\validate\live
- */
-class LiveGoodsValidate extends Validate
-{
-
-    protected $rule = [
-        'id' => 'require|checkLiveGoods',
-        'status' => 'require|in:' . LiveGoodsEnum::SYS_AUDIT_STATUS_WAIT_WECHAT . ',' . LiveGoodsEnum::SYS_AUDIT_STATUS_FAIL,
-    ];
-
-
-    protected $message = [
-        'id.require' => '参数缺失',
-        'status.require' => '状态参数缺失',
-        'status.in' => '状态参数异常',
-    ];
-
-
-    protected function sceneAudit()
-    {
-        return $this->only(['id', 'status']);
-    }
-
-
-    protected function sceneDel()
-    {
-        return $this->only(['id']);
-    }
-
-
-    protected function sceneDetail()
-    {
-        return $this->only(['id']);
-    }
-    
-
-    /**
-     * @notes 校验直播商品
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2023/2/16 11:10
-     */
-    protected function checkLiveGoods($value, $rule, $data)
-    {
-        $room = LiveGoods::where([
-            'id' => $value,
-            'del' => 0
-        ])->findOrEmpty();
-
-        if ($room->isEmpty()) {
-            return '直播商品不存在';
-        }
-        return true;
-    }
-
-}

+ 0 - 83
app/admin/validate/live/LiveRoomValidate.php

@@ -1,83 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeshop100%开源免费商用商城系统
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | 商业版本务必购买商业授权,以免引起法律纠纷
-// | 禁止对系统程序代码以任何目的,任何形式的再发布
-// | gitee下载:https://gitee.com/likeshop_gitee
-// | github下载:https://github.com/likeshop-github
-// | 访问官网:https://www.likeshop.cn
-// | 访问社区:https://home.likeshop.cn
-// | 访问手册:http://doc.likeshop.cn
-// | 微信公众号:likeshop技术社区
-// | likeshop团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeshopTeam
-// +----------------------------------------------------------------------
-namespace app\admin\validate\live;
-
-use app\common\basics\Validate;
-use app\common\enum\LiveRoomEnum;
-use app\common\model\live\LiveRoom;
-
-/**
- * 直播间验证器
- * Class LiveRoomValidate
- * @package app\admin\validate\live
- */
-class LiveRoomValidate extends Validate
-{
-
-    protected $rule = [
-        'id' => 'require|checkLiveRoom',
-        'status' => 'require|in:' . LiveRoomEnum::AUDIT_STATUS_SUCCESS . ',' . LiveRoomEnum::AUDIT_STATUS_FAIL,
-        'sort' => 'require|integer|egt:0',
-    ];
-
-
-    protected $message = [
-        'id.require' => '参数缺失',
-        'status.require' => '审核参数缺失',
-        'status.in' => '审核参数异常',
-        'sort.require' => '请填写推荐值',
-        'sort.integer' => '推荐值需为整数',
-        'sort.egt' => '推荐值需大于或等于0',
-    ];
-
-
-    protected function sceneAudit()
-    {
-        return $this->only(['id', 'status']);
-    }
-
-    protected function sceneRecommend()
-    {
-        return $this->only(['id', 'sort']);
-    }
-
-
-    /**
-     * @notes 校验直播间
-     * @param $value
-     * @param $rule
-     * @param $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2023/2/16 11:10
-     */
-    protected function checkLiveRoom($value, $rule, $data)
-    {
-        $room = LiveRoom::where([
-            'id' => $value,
-            'del' => 0
-        ])->findOrEmpty();
-
-        if ($room->isEmpty()) {
-            return '直播间信息不存在';
-        }
-        return true;
-    }
-
-}

+ 0 - 50
app/admin/validate/order/OrderValidate.php

@@ -1,50 +0,0 @@
-<?php
-
-namespace app\admin\validate\order;
-
-use app\common\enum\OrderEnum;
-use app\common\model\team\TeamJoin;
-use think\Validate;
-use app\common\model\order\Order;
-use app\common\model\team\Team;
-
-class OrderValidate extends Validate
-{
-    /**
-     * @notes 发货操作验证
-     * @param $post
-     * @return bool|string
-     * @author suny
-     * @date 2021/7/14 10:10 上午
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\db\exception\DataNotFoundException
-     */
-    protected function checkDelivery($post)
-    {
-
-        $id = $post['id'];
-        $order = Order::where(['id' => $id])->find();
-
-        if (!$order) {
-            return '订单失效';
-        }
-
-        if ($order['del'] == 1) {
-            return '订单已删除';
-        }
-
-        if ($order['shipping_status'] == 1) {
-            return '此订单已发货';
-        }
-
-        if ($order['order_type'] == OrderEnum::TEAM_ORDER) {
-            $join = TeamJoin::where(['order_id' => $order['id']])->findOrEmpty();
-            if ($join['status'] != Team::STATUS_SUCCESS) {
-                return '已支付的拼团订单需要等待拼团成功后才能发货';
-            }
-        }
-
-        return true;
-    }
-}

+ 0 - 439
app/admin/view/finance/finance/center.html

@@ -1,439 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-form-label {
-        width: 120px;
-    }
-    .copy{
-        margin-left: 10px;
-    }
-    .tips{
-        color: red;
-    }
-    .layui-form-item .layui-input-inline{
-        width: 410px;
-    }
-    .layui-input{
-        display: inline-block;
-        width: 80%;
-    }
-    .layuiadmin-big-font {
-        font-size: 25px;
-    }
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body" pad15>
-            <div class="layui-form" lay-filter="">
-
-                    <!-- 平台汇总-->
-                    <div class="layui-form-item div-flex">
-                        <fieldset class="layui-elem-field layui-field-title">
-                            <legend>平台汇总</legend>
-                        </fieldset>
-                    </div>
-                
-                    
-                    <div class="layui-row layui-col-space15">
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    已结算交易服务费(平台收入)(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.shopAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    会员提现手续费(平台收入)(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.userPoundage}</p>
-                                </div>
-                            </div>
-                        </div>
-                        
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    商家提现手续费(平台收入)(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.commissionAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-<br>
-<br>
-
-                    <!-- 商家汇总-->
-                    <div class="layui-form-item div-flex">
-                        <fieldset class="layui-elem-field layui-field-title">
-                            <legend>商家汇总</legend>
-                        </fieldset>
-                    </div>
-
-
-                    <div class="layui-row layui-col-space15">
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    成交订单笔数
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.orderNum}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    营业额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.orderAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    退款订单金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.refundAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    待退款订单金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.refundAmountIng}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    售后退款金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.salesRefundAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    待售后退款金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.salesRefundAmountIng}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                    </div>
-
-
-
-
-
-                    <div class="layui-row layui-col-space15">
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    已结算成交订单数
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.settleOrederNum}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    已结算营业额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.settleOrederAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    待结算营业额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.settleOrederAmountWait}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    已结算分销佣金金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.settleDistributionAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    已结算入账金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.settleWithdrawalAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="layui-col-sm6 layui-col-md3">
-                            <div class="layui-card">
-                                <div class="layui-card-header">
-                                    已结算交易服务费(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list">
-                                    <p class="layuiadmin-big-font">{$shop.settlePoundageAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-
-
-
-
-
-
-                        <div class="layui-row layui-col-space15">
-                            <div class="layui-col-sm6 layui-col-md3" >
-                                <div class="layui-card" >
-                                    <div class="layui-card-header" >
-                                        已提现金额(元)
-                                    </div>
-                                    <div class="layui-card-body layuiadmin-card-list" >
-                                        <p class="layuiadmin-big-font">{$shop.withdrawaLeftamount}</p>
-                                    </div>
-                                </div>
-                            </div>
-    
-                            <div class="layui-col-sm6 layui-col-md3">
-                                <div class="layui-card">
-                                    <div class="layui-card-header">
-                                        提现中金额(元)
-                                    </div>
-                                    <div class="layui-card-body layuiadmin-card-list">
-                                        <p class="layuiadmin-big-font">{$shop.withdrawaLeftamountIng}</p>
-                                    </div>
-                                </div>
-                            </div>
-                            
-                            <div class="layui-col-sm6 layui-col-md3">
-                                <div class="layui-card">
-                                    <div class="layui-card-header">
-                                        可提现金额(元)
-                                    </div>
-                                    <div class="layui-card-body layuiadmin-card-list">
-                                        <p class="layuiadmin-big-font">{$shop.shopWallet}</p>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-<br>
-<br>
-
-
-                    <!-- 商家汇总-->
-                    <div class="layui-form-item div-flex">
-                        <fieldset class="layui-elem-field layui-field-title">
-                            <legend>会员汇总</legend>
-                        </fieldset>
-                    </div>
-
-
-                    <div class="layui-row layui-col-space15">
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    会员余额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.userMoney}</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-row layui-col-space15">
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    已结算分销佣金金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.userSettleDistributionAmount}</p>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    已提现佣金金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.userDistributionMoney}</p>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    提现中佣金金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.userDistributionMoneyIng}</p>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="layui-col-sm6 layui-col-md3" >
-                            <div class="layui-card" >
-                                <div class="layui-card-header" >
-                                    可提现佣金金额(元)
-                                </div>
-                                <div class="layui-card-body layuiadmin-card-list" >
-                                    <p class="layuiadmin-big-font">{$shop.userDistributionMoneyWait}</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-<br>
-<br>
-                <!-- 积分汇总-->
-                <div class="layui-form-item div-flex">
-                    <fieldset class="layui-elem-field layui-field-title">
-                        <legend>积分汇总</legend>
-                    </fieldset>
-                </div>
-
-
-                <div class="layui-row layui-col-space15">
-                    <div class="layui-col-sm6 layui-col-md3" >
-                        <div class="layui-card" >
-                            <div class="layui-card-header" >
-                                总积分
-                            </div>
-                            <div class="layui-card-body layuiadmin-card-list" >
-                                <p class="layuiadmin-big-font">{$shop.all_integral}</p>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-col-sm6 layui-col-md3">
-                        <div class="layui-card">
-                            <div class="layui-card-header">
-                                签到送出积分
-                            </div>
-                            <div class="layui-card-body layuiadmin-card-list">
-                                <p class="layuiadmin-big-font">{$shop.sign_in_integral}</p>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-col-sm6 layui-col-md3">
-                        <div class="layui-card">
-                            <div class="layui-card-header">
-                                使用积分
-                            </div>
-                            <div class="layui-card-body layuiadmin-card-list">
-                                <p class="layuiadmin-big-font">{$shop.use_integral}</p>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-col-sm6 layui-col-md3">
-                        <div class="layui-card">
-                            <div class="layui-card-header">
-                                下单赠送积分
-                            </div>
-                            <div class="layui-card-body layuiadmin-card-list">
-                                <p class="layuiadmin-big-font">{$shop.consume_award_integral}</p>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function () {
-        var $ = layui.$, form = layui.form
-
-        // 图片上传
-        $(document).on("click", "#qrimage", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "qr_code",
-                that: $(this)
-            });
-        })
-        // 删除图片
-        like.delUpload();
-        // 放大图片
-        $(document).on('click', 'img', function () {
-            var image = $(this).attr('src');
-            like.showImg(image,600);
-        });
-
-        //复制
-        $(document).on('click','.copy',function () {
-            var copyText = $(this).prev()
-            copyText.select()
-            document.execCommand("Copy");
-        })
-        // 提交表单
-        form.on('submit(setoa)', function (data) {
-            like.ajax({
-                url: '{:url("wechat.oa/setOa")}' //实际使用请改成服务端真实接口
-                , data: data.field
-                , type: 'post'
-                , success: function (res) {
-                    if (res.code == 1) {
-                        layer.msg(res.msg, {
-                            offset: '15px'
-                            , icon: 1
-                            , time: 1000
-                        });
-                    }
-
-                }
-            });
-        });
-    });
-
-</script>

+ 0 - 195
app/admin/view/finance/integral/integral.html

@@ -1,195 +0,0 @@
-
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        brecharge-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">用户信息:</label>
-                            <div class="layui-input-block">
-                                <input type="text" name="user_info" id="user_info" autocomplete="off" class="layui-input">
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">变动时间:</label>
-                            <div class="layui-input-inline">
-                                <div class="layui-input-inline">
-                                    <input type="text" name="start_time" class="layui-input" id="start_time"
-                                           placeholder="" autocomplete="off">
-                                </div>
-                            </div>
-                            <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                                <label class="layui-form-mid">至</label>
-                            </div>
-                            <div class="layui-input-inline">
-                                <input type="text" name="end_time" class="layui-input" id="end_time"
-                                       placeholder="" autocomplete="off">
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
-                                    lay-filter="recharge-search">查询
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="recharge-clear-search">重置
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="data-export">导出
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-tab-item layui-show">
-                <div class="layui-card">
-                    <div class="layui-card-body">
-                        <table id="recharge-lists" lay-filter="recharge-lists"></table>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-      layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$
-            , form = layui.form
-            , table = layui.table
-            , element = layui.element
-            , laydate = layui.laydate;
-
-        //监听搜索
-        form.on('submit(recharge-search)', function (data) {
-            var field = data.field;
-            //执行重载
-            table.reload('recharge-lists', {
-                where: field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-        //清空查询
-        form.on('submit(recharge-clear-search)', function () {
-            $('#user_info').val('');
-            $('#start_time').val('');
-            $('#end_time').val('');
-            //刷新列表
-            table.reload('recharge-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-          // 导出
-          form.on('submit(data-export)', function (data) {
-              var field = data.field;
-              like.ajax({
-                  url: '{:url("finance.integral/export")}'
-                  , data: field
-                  , type: 'get'
-                  , success: function (res) {
-                      if (res.code == 1) {
-                          window.location.href = res.data.url;
-                      }
-                  }
-              });
-          });
-
-
-          //日期时间范围
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-        });
-
-
-        //获取列表
-        getList('');
-
-        function getList() {
-            table.render({
-                elem: '#recharge-lists'
-                , url: '{:url("finance.integral/integral")}'
-                , cols: [[
-                      {field: 'user_sn', title: '用户编号', align: 'center',width:220}
-                    , {field: 'nickname', title: '会员信息', align: 'center',width:220}
-                    , {field: 'source_type', title: '事件', align: 'center',width:180}
-                    , {field: 'change_amount', title: '积分变动', align: 'center',width:180}
-                    , {field: 'left_amount', title: '剩余积分', align: 'center',width:120}
-                    , {field: 'remark', title: '备注', align: 'center',width:120}
-                    , {field: 'create_time', title: '变动时间', align: 'center',width:220}
-                ]]
-                , page: true
-                , text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1 
-                  } 
-                , parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists,
-                    };
-                }
-                ,done: function(res, curr, count){
-                    // 解决操作栏因为内容过多换行问题
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-    });
-</script>

+ 0 - 193
app/admin/view/finance/shop/account.html

@@ -1,193 +0,0 @@
-{layout name="layout1" /}
-
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" style="baccount:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*查看商家账户余额流水记录。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索 -->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-row">
-                    <div class="layui-inline">
-                        <label class="layui-form-label">商家名称:</label>
-                        <div class="layui-input-block">
-                            <input type="text" name="shop_name" id="shop_name" placeholder="请输入商家名称" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">明细类型:</label>
-                        <div class="layui-input-block">
-                            <select name="search_key" id="search_key">
-                                <option value="">全部</option>
-                                <option value="settle">结算入账</option>
-                                <option value="withdrawal">商家提现</option>
-                                <option value="withdrawal_stay">商家提现中</option>
-                                <option value="withdrawal_error">商家提现失败</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">记录时间:</label>
-                        <div class="layui-input-inline">
-                            <div class="layui-input-inline">
-                                <input type="text" id="start_time" name="start_time" class="layui-input"  autocomplete="off">
-                            </div>
-                        </div>
-                        <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                            <label class="layui-form-mid">至</label>
-                        </div>
-                        <div class="layui-input-inline">
-                            <input type="text" id="end_time" name="end_time" class="layui-input" autocomplete="off">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <div class="layui-btn-group">
-                            <button type="button" day="1" class="layui-btn layui-btn-sm layui-btn-primary day">今天</button>
-                            <button type="button" day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
-                            <button type="button" day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
-                            <button type="button" day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="account-search">查询</button>
-                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="account-clear-search">重置</button>
-                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="data-export">导出</button>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 列表 -->
-        <div class="layui-tab-item layui-show">
-            <div class="layui-card">
-                <div class="layui-card-body">
-                    <table id="like-table-lists" lay-filter="like-table-lists"></table>
-                    <script type="text/html" id="shop">
-                        <div style="text-align: left;">
-                            <img src="{{ d.logo }}" style="height:80px;width:80px;margin-right:5px;" class="layui-col-md4">
-                            <p>商家编号:{{d.id}}</p>
-                            <p>商家名称:{{d.name}}</p>
-                            <p>商家类型:{{d.type}}</p>
-                        </div>
-                    </script>
-                </div>
-            </div>
-        </div>
-
-    </div>
-</div>
-
-
-<script>
-    layui.use(['form'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,laydate = layui.laydate;
-
-        laydate.render({elem:'#start_time' ,type:'datetime', theme:'#1E9FFF'});
-        laydate.render({elem:'#end_time' ,type:'datetime', theme:'#1E9FFF'});
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field: 'shop', title: '商家信息', align: 'center',templet:'#shop',width:300}
-            ,{field: 'log_sn', title: '明细流水号', align: 'center',width:180}
-            ,{field: 'source_sn', title: '来源单号', align: 'center',width:180}
-            ,{field: 'source_type', title: '明细类型', align: 'center',width:120}
-            ,{field: 'change_amount', title: '变动金额', align: 'center',width:120}
-            ,{field: 'left_amount', title: '剩余金额', align: 'center',width:120}
-            ,{field: 'create_time', title: '记录时间', align: 'center',width:160}
-        ]);
-
-        /**
-         * 监听搜索
-         */
-        form.on('submit(account-search)', function (data) {
-            table.reload('like-table-lists', {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        /**
-         * 清空查询
-         */
-        form.on('submit(account-clear-search)', function () {
-            $('#shop_name').val('');
-            $('#start_time').val('');
-            $('#end_time').val('');
-            $('#search_key').val('');
-            form.render('select');
-            $(".day.layui-btn-normal").addClass("layui-btn-primary");
-            $("button.day.layui-btn-normal").removeClass("layui-btn-normal");
-            table.reload('like-table-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        // 导出
-        form.on('submit(data-export)', function (data) {
-            var field = data.field;
-            like.ajax({
-                url: '{:url("finance.Shop/accountExport")}'
-                , data: field
-                , type: 'get'
-                , success: function (res) {
-                    if (res.code == 1) {
-                        window.location.href = res.data.url;
-                    }
-                }
-            });
-        });
-
-
-        $(document).on("click", ".day", function () {
-            var day   = parseInt($(this).attr("day"));
-            var start_time = "";
-            var end_time   = "";
-
-            switch (day) {
-                case 1:
-                    start_time = "{$dateTime.today[0]}";
-                    end_time   = "{$dateTime.today[1]}";
-                    break;
-                case -1:
-                    start_time = "{$dateTime.yesterday[0]}";
-                    end_time   = "{$dateTime.yesterday[1]}";
-                    console.log(start_time);
-                    break;
-                case 7:
-                    start_time = "{$dateTime.days_ago7[0]}";
-                    end_time   = "{$dateTime.days_ago7[1]}";
-                    break;
-                case 30:
-                    start_time = "{$dateTime.days_ago30[0]}";
-                    end_time   = "{$dateTime.days_ago30[1]}";
-                    break;
-            }
-
-            $(this).siblings().removeClass('layui-btn-normal');
-            $(this).siblings().addClass('layui-btn-primary');
-            $(this).removeClass("layui-btn-primary");
-            $(this).addClass('layui-btn-normal');
-
-            $("#start_time").val(start_time);
-            $("#end_time").val(end_time);
-        })
-
-    });
-</script>

+ 0 - 215
app/admin/view/finance/shop/settlement.html

@@ -1,215 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        bsettlement-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" style="bsettlement:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*查看商家订单结算的情况。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 结算汇总 -->
-        <h2 style="margin: 20px;">结算汇总</h2>
-        <div style="margin: 0 20px">
-            <div class="layui-row layui-col-space15">
-                <div class="layui-col-sm6 layui-col-md3" >
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算成交订单数</div>
-                        <div class="layui-card-body"><p>{$statistics.settleOrederNum}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算营业额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleOrederAmount}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">待结算营业额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleOrederAmountWait}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算分销佣金金额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleDistributionAmount}</p></div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-row layui-col-space15">
-                <div class="layui-col-sm6 layui-col-md3" >
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算入账金额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleWithdrawalAmount}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算交易服务费</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settlePoundageAmount}</p></div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 结算记录 -->
-        <h2 style="margin: 20px;">结算记录</h2>
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="name" class="layui-form-label">商家名称:</label>
-                    <div class="layui-inline">
-                        <div class="layui-input-inline" >
-                            <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">结算时间:</label>
-                    <div class="layui-inline" style="margin-right:0;">
-                        <div class="layui-input-inline" >
-                            <input type="text" id="start_time" name="start_time" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                    <div class="layui-inline">至</div>
-                    <div class="layui-inline" style="margin-right:0;">
-                        <div class="layui-input-inline" style="margin-right:0;">
-                            <input type="text" id="end_time" name="end_time" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="data-export">导出</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体内容 -->
-        <div class="layui-card">
-            <div class="layui-card-body">
-                <table id="like-table-lists" lay-filter="like-table-lists"></table>
-                <script type="text/html" id="table-storeInfo">
-                    <img src="{{d.logo}}" alt="图标" style="width:60px;height:60px;margin-right:5px;">
-                    <div class="layui-inline" style="text-align:left;">
-                        <p>商家编号:{{d.shop_id}}</p>
-                        <p>商家名称:{{d.name}}</p>
-                        <p>商家类型:{{d.type}}</p>
-                    </div>
-                </script>
-                <script type="text/html" id="table-operation">
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="record">结算详细</a>
-                </script>
-            </div>
-        </div>
-
-    </div>
-</div>
-
-<script>
-    layui.use(["form"], function() {
-        var $ = layui.$;
-        var form = layui.form;
-        var table = layui.table;
-        var laydate = layui.laydate;
-
-        laydate.render({type:"datetime", elem:"#start_time", trigger:"click"});
-        laydate.render({type:"datetime", elem:"#end_time", trigger:"click"});
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field:"id", width:60, title:"ID"}
-            ,{field:"store", width:250, align:"center", title:"商家信息", templet:"#table-storeInfo"}
-            ,{field:"deal_order_count", width:150, align:"center", title:"已结算成交订单数"}
-            ,{field:"business_money", width:150, align:"center",title:"已结算营业额"}
-            ,{title:"操作", width:140, align:"center", fixed:"right", toolbar:"#table-operation"}
-        ]);
-
-        var active = {
-            record: function (obj) {
-                layer.open({
-                    type: 2
-                    ,title: "结算记录"
-                    ,content: "{:url('finance.Shop/settlementRecord')}?shop_id="+obj.data.shop_id
-                    ,area: ["90%", "90%"]
-                });
-            }
-        };
-        like.eventClick(active);
-
-        form.on("submit(search)", function(data){
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        form.on("submit(clear-search)", function(){
-            $("#start_time").val("");
-            $("#end_time").val("");
-            $("#name").val("");
-            table.reload("like-table-lists", {
-                where: {},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-
-        // 导出
-        form.on('submit(data-export)', function (data) {
-            var field = data.field;
-            like.ajax({
-                url: '{:url("finance.Shop/settlementExport")}'
-                , data: field
-                , type: 'get'
-                , success: function (res) {
-                    if (res.code == 1) {
-                        window.location.href = res.data.url;
-                    }
-                }
-            });
-        });
-
-    });
-</script>

+ 0 - 75
app/admin/view/finance/shop/settlement_detail.html

@@ -1,75 +0,0 @@
-{layout name="layout1" /}
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label class="layui-form-label">订单编号:</label>
-                    <div class="layui-inline" style="margin-right:0;">
-                        <div class="layui-input-inline" >
-                            <input type="text" id="order_sn" name="order_sn" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                </div>
-
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体区域 -->
-        <div class="layui-card-body">
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.use(["table", "form"], function(){
-        var table   = layui.table;
-        var form    = layui.form;
-
-        like.tableLists("#like-table-lists", "{:url()}?settle_id={$settle_id}", [
-            {field:"id", width:60, title:"ID"}
-            ,{field:"settle_sn", width:200, align:"center", title:"结算批次号"}
-            ,{field:"order_sn", width:180, align:"center",title:"订单编号"}
-            ,{field:"order_amount", width:160, align:"center", title:"订单金额"}
-            ,{field:"refund_amount", width:160, align:"center", title:"退款订单金额"}
-            ,{field:"after_sales_amount", width:160, align:"center", title:"售后退款金额"}
-            ,{field:"distribution_amount", width:160, align:"center", title:"已结算分销佣金金额"}
-            ,{field:"entry_account_amount", width:160, align:"center", title:"已结算入账金额"}
-            ,{field:"order_complete_time", width:160, align:"center", title:"订单完成时间"}
-        ]);
-
-
-        /**
-         * 立即搜索
-         */
-        form.on("submit(search)", function(data){
-            data.field['settle_id'] = '{$settle_id}';
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        /**
-         * 重置搜索
-         */
-        form.on("submit(clear-search)", function(){
-            $("#order_sn").val("");
-            table.reload("like-table-lists", {
-                where: {settle_id:'{$settle_id}'},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-    })
-</script>

+ 0 - 91
app/admin/view/finance/shop/settlement_record.html

@@ -1,91 +0,0 @@
-{layout name="layout1" /}
-
-<div class="wrapper">
-    <div class="layui-card">
-            
-        <!-- 结算汇总 -->
-        <h2 style="margin: 20px;">结算汇总</h2>
-        <div style="margin: 0 20px">
-            <div class="layui-row layui-col-space15">
-                <div class="layui-col-sm6 layui-col-md3" >
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算成交订单数</div>
-                        <div class="layui-card-body"><p>{$statistics.settleOrederNum}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算营业额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleOrederAmount}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">待结算营业额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleOrederAmountWait}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算分销佣金金额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleDistributionAmount}</p></div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-row layui-col-space15">
-                <div class="layui-col-sm6 layui-col-md3" >
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算入账金额</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settleWithdrawalAmount}</p></div>
-                    </div>
-                </div>
-                <div class="layui-col-sm6 layui-col-md3">
-                    <div class="layui-card" style="box-shadow:none;">
-                        <div class="layui-card-header" style="border-bottom:0;">已结算交易服务费</div>
-                        <div class="layui-card-body"><p>¥{$statistics.settlePoundageAmount}</p></div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-
-        <!-- 结算记录 -->
-        <h2 style="padding:20px;">结算记录</h2>
-        <!-- 主体区域 -->
-        <div class="layui-card-body">
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-            <script type="text/html" id="table-operation">
-                <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="detail">批次详情</a>
-            </script>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.use(["table"], function(){
-        like.tableLists("#like-table-lists", "{:url()}?shop_id={$shop_id}", [
-            {field:"id", width:60, title:"ID"}
-            ,{field:"settle_sn", width:200, align:"center", title:"结算批次号", templet:"#table-storeInfo"}
-            ,{field:"deal_order_count", width:160, align:"center",title:"已结算成交订单数"}
-            ,{field:"business_money", width:160, align:"center", title:"已结算营业额"}
-            ,{field:"refund_order_money", width:160, align:"center", title:"退款订单金额"}
-            ,{field:"after_sales_money", width:160, align:"center", title:"售后退款金额"}
-            ,{field:"distribution_money", width:160, align:"center", title:"已结算分销佣金金额"}
-            ,{field:"entry_account_money", width:160, align:"center", title:"已结算入账金额"}
-            ,{field:"create_time", width:160, align:"center", title:"结算时间"}
-            ,{title:"操作", width:100, align:"center", fixed:"right", toolbar:"#table-operation"}
-        ]);
-
-        var active = {
-            detail: function (obj) {
-                layer.open({
-                    type: 2
-                    ,title: "批次详情"
-                    ,content: "{:url('finance.Shop/settlementDetail')}?settle_id="+obj.data.id
-                    ,area: ["90%", "90%"]
-                });
-            }
-        };
-        like.eventClick(active);
-    })
-</script>

+ 0 - 305
app/admin/view/finance/shop/withdrawal.html

@@ -1,305 +0,0 @@
-{layout name="layout1" /}
-<div class="wrapper">
-    <div class="layui-card">
-        <!-- 操作提示 -->
-        <div class="layui-card-body">
-            <div class="layui-collapse" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*平台审核商家提交的提现申请。</p>
-                        <p>*提现转账失败后,提现金额会退回商家账户。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 提现汇总-->
-        <h2 style="margin:20px;">提现汇总</h2>
-        <div class="layui-row layui-col-space15">
-            <div class="layui-col-sm6 layui-col-md3" >
-                <div class="layui-card" style="box-shadow:none;">
-                    <div class="layui-card-header" style="border-bottom:0;">商家已提现金额</div>
-                    <div class="layui-card-body"><p id="count_user">¥{$summary.successWithdrawn}</p></div>
-                </div>
-            </div>
-            <div class="layui-col-sm6 layui-col-md3">
-                <div class="layui-card" style="box-shadow:none;">
-                    <div class="layui-card-header" style="border-bottom:0;">商家提现中金额</div>
-                    <div class="layui-card-body"><p id="add_user1">¥{$summary.handleWithdrawn}</p></div>
-                </div>
-            </div>
-            <div class="layui-col-sm6 layui-col-md3">
-                <div class="layui-card" style="box-shadow:none;">
-                    <div class="layui-card-header" style="border-bottom:0;">商家可提现金额</div>
-                    <div class="layui-card-body"><p id="T_add_user">¥{$summary.totalWallet}</p></div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 搜索区域 -->
-        <h2 style="margin:20px;">提现记录</h2>
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label for="name" class="layui-form-label">商家名称:</label>
-                    <div class="layui-inline">
-                        <div class="layui-input-inline" >
-                            <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">提现时间:</label>
-                    <div class="layui-inline" style="margin-right:0;">
-                        <div class="layui-input-inline" >
-                            <input type="text" id="start_time" name="start_time" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                    <div class="layui-inline">至</div>
-                    <div class="layui-inline" style="margin-right:0;">
-                        <div class="layui-input-inline" style="margin-right:0;">
-                            <input type="text" id="end_time" name="end_time" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
-                    <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="data-export">导出</a>
-                </div>
-            </div>
-        </div>
-
-        <!-- 主体内容 -->
-        <div class="layui-card-body">
-            <div class="layui-tab layui-tab-card" lay-filter="like-tab">
-                <ul class="layui-tab-title">
-                    <li lay-id="0" class="layui-this">待提现({$statistics.apply})</li>
-                    <li lay-id="1">提现中({$statistics.handle})</li>
-                    <li lay-id="2">提现成功({$statistics.success})</li>
-                    <li lay-id="3">提现失败({$statistics.error})</li>
-                </ul>
-                <div class="layui-tab-content" style="padding:20px;">
-                    <table id="like-table-lists" lay-filter="like-table-lists"></table>
-                    <script type="text/html" id="table-storeInfo">
-                        <img src="{{d.shop.logo}}" alt="图标" style="width:60px;height:60px;margin-right:5px;">
-                        <div class="layui-inline" style="text-align:left;">
-                            <p>商家编号:{{d.shop.id}}</p>
-                            <p>商家名称:{{d.shop.name}}</p>
-                            <p>商家类型:{{d.shop.type === 1 ? '官方自营' : '入驻商家'}}</p>
-                        </div>
-                    </script>
-                    <script type="text/html" id="table-poundage">
-                        <p>¥{{d.poundage_amount}}({{d.poundage_ratio}}%)</p>
-                    </script>
-                    <script type="text/html" id="table-operation">
-                        <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="detail">详情</a>
-                        {{#  if(d.status === 0){ }}
-                            <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="examine">审核</a>
-                        {{#  } }}
-                        {{#  if(d.status === 1){ }}
-                            <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="transfer">转账</a>
-                            {{#  if(d.type === 10){ }}
-                            <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="transfer_online">在线转账</a>
-                            {{#  } }}
-                        {{#  } }}
-                    </script>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-    layui.use(['form'], function(){
-        var $ = layui.$;
-        var form = layui.form;
-        var table = layui.table;
-        var element = layui.element;
-        var laydate = layui.laydate;
-
-        laydate.render({type:"datetime", elem:"#start_time", trigger:"click"});
-        laydate.render({type:"datetime", elem:"#end_time", trigger:"click"});
-
-        like.tableLists("#like-table-lists", "{:url()}", [
-            {field:"id", width:60, title:"ID"}
-            ,{field:"sn", width:250, align:"center", title:"商家信息", templet:"#table-storeInfo"}
-            ,{field:"sn", width:250, align:"center", title:"提现单号"}
-            ,{field:"apply_amount", width:100, align:"center",title:"提现金额"}
-            ,{field:"poundage", width:150, align:"center", title:"提现手续费", templet:"#table-poundage"}
-            ,{field:"left_amount", width:90, align:"center", title:"到账金额"}
-            ,{field:"status_text", width:90, align:"center", title:"提现状态"}
-            ,{field:"create_time", width:160, align:"center", title:"提现时间"}
-            ,{title:"操作", width:220, align:"center", fixed:"right", toolbar:"#table-operation"}
-        ]);
-
-
-        var active = {
-            examine: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "提现审核"
-                    ,content: "{:url('finance.Shop/WithdrawalExamine')}"
-                    ,area: ["480px", "400px"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            data.field['id'] = obj.data.id;
-                            like.ajax({
-                                url: "{:url('finance.Shop/WithdrawalExamine')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        active.statistics();
-                                        layui.layer.msg(res.msg);
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            transfer: function(obj) {
-                layer.open({
-                    type: 2
-                    ,title: "转账"
-                    ,content: "{:url('finance.Shop/WithdrawalTransfer')}?id="+obj.data.id
-                    ,area: ["480px", "500px"]
-                    ,btn: ["确定", "取消"]
-                    ,yes: function(index, layero){
-                        var iframeWindow = window["layui-layer-iframe" + index];
-                        var submit = layero.find("iframe").contents().find("#addSubmit");
-                        iframeWindow.layui.form.on("submit(addSubmit)", function(data){
-                            data.field['id'] = obj.data.id;
-                            like.ajax({
-                                url: "{:url('finance.Shop/WithdrawalTransfer')}",
-                                data: data.field,
-                                type: "POST",
-                                success:function(res) {
-                                    if(res.code === 1) {
-                                        active.statistics();
-                                        layui.layer.msg(res.msg);
-                                        layer.close(index);
-                                        table.reload("like-table-lists", {
-                                            where: {},
-                                            page: { cur: 1 }
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger("click");
-                    }
-                });
-            },
-            transfer_online : function (obj) {
-                const index = layer.confirm('确定在线转账?', {title: "提示"}, function (index) {
-
-                    layer.close(index);
-                    //do something
-                    like.ajax({
-                        url: "{:url('finance.Shop/WithdrawalTransferOnline')}",
-                        data: {
-                            id : obj.data.id
-                        },
-                        type: "POST",
-                        success:function(res) {
-                            if(res.code === 1) {
-                                active.statistics();
-                                layui.layer.msg(res.msg);
-                                layer.close(index);
-                                table.reload("like-table-lists", {
-                                    where: {},
-                                    page: { cur: 1 }
-                                });
-                            }
-                        }
-                    });
-                });
-            },
-            detail: function (obj) {
-                layer.open({
-                    type: 2
-                    ,title: "提现详细"
-                    ,content: "{:url('finance.Shop/WithdrawalDetail')}?id="+obj.data.id
-                    ,area: ["60%", "80%"]
-                });
-            },
-            statistics: function () {
-                like.ajax({
-                    url: "{:url('finance.Shop/withdrawalStatistics')}",
-                    type: "GET",
-                    success:function(res) {
-                        if(res.code === 1) {
-                            $(".layui-tab-title li[lay-id='0']").html("待提现("+res.data.apply+")");
-                            $(".layui-tab-title li[lay-id='1']").html("提现中("+res.data.handle+")");
-                            $(".layui-tab-title li[lay-id='2']").html("提现成功("+res.data.success+")");
-                            $(".layui-tab-title li[lay-id='3']").html("提现失败("+res.data.error+")");
-                        }
-                    }
-                });
-            }
-        };
-        like.eventClick(active);
-
-
-        element.on("tab(like-tab)", function(){
-            var type = this.getAttribute("lay-id");
-            table.reload("like-table-lists", {
-                where: {type: type},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-
-        form.on("submit(search)", function(data){
-            table.reload("like-table-lists", {
-                where: data.field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-
-        form.on("submit(clear-search)", function(){
-            $("#start_time").val("");
-            $("#end_time").val("");
-            $("#name").val("");
-            table.reload("like-table-lists", {
-                where: {},
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        // 导出
-        form.on('submit(data-export)', function (data) {
-            var field = data.field;
-            field.type = $(".layui-tab-title li.layui-this").attr("lay-id")
-            like.ajax({
-                url: '{:url("finance.Shop/withdrawalExport")}'
-                , data: field
-                , type: 'get'
-                , success: function (res) {
-                    if (res.code == 1) {
-                        window.location.href = res.data.url;
-                    }
-                }
-            });
-        });
-
-    });
-</script>

+ 0 - 154
app/admin/view/finance/shop/withdrawal_detail.html

@@ -1,154 +0,0 @@
-{layout name="layout2" /}
-
-<div class="layui-container">
-    <div class="layui-row" >
-        <div class="layui-col-xs12" style="margin: 5px;padding: 5px">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>商家信息</legend>
-            </fieldset>
-        </div>
-    </div>
-    <div class="layui-row">
-        <div class="layui-col-xs1">
-            &nbsp;
-        </div>
-        <div class="layui-col-xs11">
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                商家名称:{$detail.shop.name}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                商家ID:{$detail.shop.id}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                商家类型:{$detail.shop.type}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                主营类目:{$detail.shop.category.name}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                联系人名称:{$detail.shop.nickname}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                联系电话:{$detail.shop.mobile}
-            </div>
-        </div>
-    </div>
-
-    <div class="layui-row" >
-        <div class="layui-col-xs12" style="margin: 5px;padding: 5px">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>收款信息</legend>
-            </fieldset>
-        </div>
-    </div>
-
-    <?php if(isset($detail['withdrawal']['type']) && $detail['withdrawal']['type'] == 0): ?>
-    <div class="layui-row">
-        <div class="layui-col-xs1">
-            &nbsp;
-        </div>
-        <div class="layui-col-xs11">
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                收款方式:{$detail.withdrawal.type_text|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现银行:{$detail.bank.name|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                银行支行称:{$detail.bank.branch|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                开户名称:{$detail.bank.nickname|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                银行账号:{$detail.bank.account|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现金额:{$detail.withdrawal.apply_amount}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现手续费:{$detail.withdrawal.poundage_amount} ({$detail.withdrawal.poundage_ratio}%)
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                到账金额:<span style="color: red">{$detail.withdrawal.left_amount}</span>
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                申请时间:{$detail.withdrawal.create_time}
-            </div>
-        </div>
-    </div>
-    <?php endif; ?>
-
-    <?php if(isset($detail['withdrawal']['type']) && $detail['withdrawal']['type'] == 10): ?>
-    <div class="layui-row">
-        <div class="layui-col-xs1">
-            &nbsp;
-        </div>
-        <div class="layui-col-xs11">
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                收款方式:{$detail.withdrawal.type_text|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                认证姓名:{$detail.alipay.username|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                支付宝账号:{$detail.alipay.account|default=""}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现金额:{$detail.withdrawal.apply_amount}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现手续费:{$detail.withdrawal.poundage_amount} ({$detail.withdrawal.poundage_ratio}%)
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                到账金额:<span style="color: red">{$detail.withdrawal.left_amount}</span>
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                申请时间:{$detail.withdrawal.create_time}
-            </div>
-        </div>
-    </div>
-    <?php endif; ?>
-
-    <div class="layui-row" >
-        <div class="layui-col-xs12" style="margin: 5px;padding: 5px">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>审核信息</legend>
-            </fieldset>
-        </div>
-    </div>
-
-    <div class="layui-row">
-        <div class="layui-col-xs1">
-            &nbsp;
-        </div>
-        <div class="layui-col-xs11">
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现状态:{$detail.withdrawal.status_text}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                提现说明:{$detail.withdrawal.explain ?: '无'}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                转账时间:
-                {if $detail.withdrawal.transfer_time === 0}
-                无
-                {else}
-                {$detail.withdrawal.transfer_time|date='Y-m-d H:i'}
-                {/if}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                转账说明:{$detail.withdrawal.transfer_content ?: '无'}
-            </div>
-            <div class="layui-col-xs6" style="margin-top: 5px;margin-bottom: 5px;">
-                转账凭证:
-                {if $detail.withdrawal.transfer_voucher}
-                <img src="{$detail.withdrawal.transfer_voucher}" alt="img" style="max-width:200px; max-height:100px;">
-                {else}
-                无
-                {/if}
-            </div>
-        </div>
-    </div>
-
-</div>

+ 0 - 24
app/admin/view/finance/shop/withdrawal_examine.html

@@ -1,24 +0,0 @@
-{layout name="layout2" /}
-
-<div class="layui-card layui-form" style="box-shadow:none;">
-    <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>提现账号:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_examine" value="1" title="审核通过" checked>
-                <input type="radio" name="is_examine" value="0" title="审核拒绝">
-                <div class="layui-form-mid layui-word-aux">审核拒绝后,提现金额会全部退回佣金账户</div>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label">提现说明:</label>
-            <div class="layui-input-block">
-                <textarea name="explain" class="layui-textarea"></textarea>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>

+ 0 - 43
app/admin/view/finance/shop/withdrawal_transfer.html

@@ -1,43 +0,0 @@
-{layout name="layout2" /}
-
-<div class="layui-card layui-form" style="box-shadow:none;">
-    <div class="layui-card-body">
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span style="color:red;">*</span>转账状态:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="is_examine" value="1" title="转账成功" checked>
-                <input type="radio" name="is_examine" value="0" title="转账失败">
-                <div class="layui-form-mid layui-word-aux">转账失败后,提现金额会全部退回商家账户</div>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label">转账凭证:</label>
-            <div class="layui-input-block">
-                <div class="like-upload-image" switch-tab="0" lay-verType="tips">
-                    <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-                </div>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label">转账说明:</label>
-            <div class="layui-input-block">
-                <textarea name="transfer_content" class="layui-textarea">{$detail.withdrawal.transfer_content ?? ''}</textarea>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>
-
-<script>
-    like.delUpload();
-    $(document).on("click", ".add-upload-image", function () {
-        like.imageUpload({
-            limit: 1,
-            field: "image",
-            that: $(this)
-        });
-    });
-</script>

+ 0 - 478
app/admin/view/finance/user/account.html

@@ -1,478 +0,0 @@
-
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        bwithdrawal-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-        <div class="layui-collapse like-layui-collapse" lay-accordion="" style="bwithdrawal:1px dashed #c4c4c4">
-            <div class="layui-colla-item">
-                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                <div class="layui-colla-content layui-show">
-                    <p>*会员账户余额流水记录。</p>
-                </div>
-            </div>
-        </div>
-        </div>
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">会员信息:</label>
-                            <div class="layui-input-block">
-                                <select name="search_key">
-                                    <option value="user_sn">会员编号</option>
-                                    <option value="nickname">会员昵称</option>
-                                </select>
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
-                                   autocomplete="off" class="layui-input">
-                        </div>
-
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">明细类型:</label>
-                            <div class="layui-input-block">
-                                <select name="type" id="type">
-                                    <option value="">全部</option>
-                                    <option value="admin_add_money">系统增加余额</option>
-                                    <option value="admin_reduce_money">系统扣减余额</option>
-                                    <option value="recharge_money">用户充值余额</option>
-                                    <option value="balance_pay_order">下单扣减余额</option>
-                                    <option value="cancel_order_refund">取消订单退回余额</option>
-                                    <option value="after_sale_refund">售后退回余额</option>
-                                    <option value="withdraw_to_balance">佣金提现</option>
-                                    <option value="user_transfer_inc_balance">会员转账(收入方)</option>
-                                    <option value="user_transfer_dec_balance">会员转账(支出方)</option>
-                                    <option value="integral_order_inc_balance">积分商城订单</option>
-                                    <option value="integral_order_dec_balance">余额支付积分订单</option>
-                                </select>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">记录时间:</label>
-                            <div class="layui-input-inline">
-                                <div class="layui-input-inline">
-                                    <input type="text" name="start_time" class="layui-input" id="start_time"
-                                           placeholder="" autocomplete="off">
-                                </div>
-                            </div>
-                            <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                                <label class="layui-form-mid">至</label>
-                            </div>
-                            <div class="layui-input-inline">
-                                <input type="text" name="end_time" class="layui-input" id="end_time"
-                                       placeholder="" autocomplete="off">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <div class="layui-btn-group">
-                                <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
-                                <button type="button"  day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
-                                <button type="button"  day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
-                                <button type="button"  day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
-                                    lay-filter="withdrawal-search">查询
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="withdrawal-clear-search">重置
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="data-export">导出
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-tab-item layui-show">
-                <div class="layui-card">
-                    <div class="layui-card-body">
-                        <table id="withdrawal-lists" lay-filter="withdrawal-lists"></table>
-
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-      layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$
-            , form = layui.form
-            , table = layui.table
-            , element = layui.element
-            , laydate = layui.laydate;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,600);
-        });
-
-        //监听搜索
-        form.on('submit(withdrawal-search)', function (data) {
-            var field = data.field;
-            //执行重载
-            table.reload('withdrawal-lists', {
-                where: field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-        //清空查询
-        form.on('submit(withdrawal-clear-search)', function () {
-            $('#goods_name').val('');
-            $('#type').val('');
-            $('#keyword').val('');
-            $('#start_time').val('{$today[0]}');
-            $('#end_time').val('{$today[1]}');
-            $('#today').trigger("click");
-            form.render('select');
-            //刷新列表
-            table.reload('withdrawal-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-          // 导出
-          form.on('submit(data-export)', function (data) {
-              var field = data.field;
-              like.ajax({
-                  url: '{:url("finance.User/accountExport")}'
-                  , data: field
-                  , type: 'get'
-                  , success: function (res) {
-                      if (res.code == 1) {
-                          window.location.href = res.data.url;
-                      }
-                  }
-              });
-          });
-
-        //日期时间范围
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            , value: "{$today[0]}"
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            ,value: "{$today[1]}"
-        });
-
-
-        //获取列表
-        getList('');
-        //切换列表
-        element.on('tab(tab-all)', function (data) {
-            $('#keyword').val('');
-            $('#withdrawal_status').val('');
-            $('#type').val('');
-            $('#keyword').val('');
-            $('#goods_name').val('');
-            $('#pay_way').val('');
-            $('#withdrawal_type').val('');
-            $('#start_time').val('{$today[0]}');
-            $('#end_time').val('{$today[1]}');
-            $('#today').trigger("click");
-            $('#delivery_type').val('');
-            form.render('select');
-            var type = $(this).attr('data-type');
-            getList(type);
-            if (type !== ''){
-                $('.withdrawal_status').hide();
-            }else {
-                $('.withdrawal_status').show();
-            }
-        });
- 
-        function getList(type) {
-            table.render({
-                elem: '#withdrawal-lists'
-                , url: '{:url("finance.User/account")}'
-                , cols: [[
-                      {field: 'nickname', title: '会员昵称', align: 'center',width:240}
-                    , {field: 'user_sn', title: '会员编号', align: 'center',width:210}
-                    , {field: 'mobile', title: '手机号码', align: 'center',width:180}
-                    , {field: 'change_amount', title: '变动金额', align: 'center',width:180}
-                    , {field: 'left_amount', title: '剩余金额', align: 'center',width:180}
-                    , {field: 'source_type', title: '明细类型', align: 'center',width:210}
-                    , {field: 'source_sn', title: '来源单号', align: 'center',width:210}
-                    , {field: 'create_time', title: '记录时间', align: 'center',width:205}
-                ]]
-                , page: true
-                , text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1 
-                  } 
-                , parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists,
-                    };
-                }
-                ,done: function(res, curr, count){
-                    // 解决操作栏因为内容过多换行问题
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-
-        //监听工具条
-        table.on('tool(withdrawal-lists)', function (obj) {
-            var id = obj.data.id;
-            if(obj.event === 'detail'){
-                layer.open({
-                    type: 2
-                    ,title: '订单详情'
-                    ,content: '{:url("withdrawal.withdrawal/detail")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-                        table.reload('withdrawal-lists');
-                    }
-                })
-            }
-
-            //删除订单
-            if(obj.event === 'del'){
-                layer.confirm('删除后订单将消失,确认删除订单吗?', {
-                    btn: ['确认','取消'] //按钮
-                }, function(){
-                    like.ajax({
-                        url: '{:url("withdrawal.withdrawal/del")}'
-                        , data: {'withdrawal_id': id}
-                        , type: 'post'
-                        , success: function (res) {
-                            if (res.code == 1) {
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1100
-                                },function () {
-                                    table.reload('withdrawal-lists');
-                                });
-                            }
-                        },
-                    });
-                });
-            }
-
-            //取消订单
-            if(obj.event === 'cancel'){
-                layer.confirm('确认取消订单吗?', {
-                    btn: ['确认','取消'] //按钮
-                }, function(){
-                    like.ajax({
-                        url: '{:url("withdrawal.withdrawal/cancel")}'
-                        , data: {'withdrawal_id': id}
-                        , type: 'post'
-                        , success: function (res) {
-                            if (res.code == 1) {
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1100
-                                },function () {
-                                    table.reload('withdrawal-lists');
-                                });
-                            }
-                        },
-                    });
-                });
-            }
-
-            //发货
-            if(obj.event === 'delivery'){
-                layer.open({
-                    type: 2
-                    ,title: '订单发货'
-                    ,content: '{:url("withdrawal.withdrawal/delivery")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-
-                    }
-                })
-            }
-
-            //物流信息
-            if(obj.event === 'express'){
-                layer.open({
-                    type: 2
-                    ,title: '订单发货'
-                    ,content: '{:url("withdrawal.withdrawal/express")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-
-                    }
-                })
-            }
-
-
-            //确认收货
-            if(obj.event === 'confirm'){
-                layer.confirm('确认订单商家已收货吗?', {
-                    btn: ['确认','取消'] //按钮
-                }, function(){
-                    like.ajax({
-                        url: '{:url("withdrawal.withdrawal/confirm")}'
-                        , data: {'withdrawal_id': id}
-                        , type: 'post'
-                        , success: function (res) {
-                            if (res.code == 1) {
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1100
-                                },function () {
-                                    table.reload('withdrawal-lists');
-                                });
-                            }
-                        },
-                    });
-                });
-            }
-
-            //商家备注
-            if(obj.event === 'remarks') {
-
-                like.ajax({
-                    url: '{:url("withdrawal.withdrawal/remarks")}'
-                    , data: {'id': id}
-                    , type: 'get'
-                    , success: function (res) {
-                        if (res.code === 1) {
-                            layer.prompt({title: '备注信息', formType: 2, value: res.data.withdrawal_remarks}, function(value, index){
-                                layer.close(index);
-                                like.ajax({
-                                    url: '{:url("withdrawal.withdrawal/remarks")}'
-                                    , data: {'id': id, "withdrawal_remarks": value }
-                                    , type: 'post'
-                                    , success: function (res) {
-                                        if (res.code === 1) {
-                                            layui.layer.msg(res.msg, {
-                                                offset: '15px'
-                                                , icon: 1
-                                                , time: 1100
-                                            });
-                                        }
-                                    }
-                                });
-
-                            });
-                        }
-                    }
-                });
-
-            }
-
-
-            if(obj.event ==='print'){
-                layer.confirm('确定要打印订单吗?', function(index){
-                    like.ajax({
-                        url:'{:url("withdrawal.withdrawal/withdrawalPrint")}',
-                        data:{id:id},
-                        type:"post",
-                        success:function(res)
-                        {
-                            if(res.code == 1)
-                            {
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1100
-                                });
-                                layer.close(index); //关闭弹层
-                                table.reload('printer-lists'); //数据刷新
-                            }
-                        }
-                    });
-                    layer.close(index);
-
-
-                })
-
-            }
-        });
-        $('.day').click(function(){
-            $('.day').removeClass('layui-btn-normal');
-            $('.day').removeClass('layui-btn-primary');
-            $('.day').addClass('layui-btn-primary');
-            $(this).removeClass('layui-btn-primary');
-            $(this).addClass('layui-btn-normal');
-            var day = $(this).attr('day');
-            switch (day) {
-                case '-1':
-                    $('#start_time').val('{$yesterday[0]}');
-                    $('#end_time').val('{$yesterday[1]}');
-                    break;
-                case '1':
-                    $('#start_time').val('{$today[0]}');
-                    $('#end_time').val('{$today[1]}');
-                    break;
-                case '7':
-                    $('#start_time').val('{$days_ago7[0]}');
-                    $('#end_time').val('{$days_ago7[1]}');
-                    break;
-                case '30':
-                    $('#start_time').val('{$days_ago30[0]}');
-                    $('#end_time').val('{$days_ago30[1]}');
-                    break;
-            }
-        });
-    });
-</script>

+ 0 - 307
app/admin/view/finance/user/commission.html

@@ -1,307 +0,0 @@
-
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        bwithdrawal-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-        <div class="layui-collapse like-layui-collapse" lay-accordion="" style="bwithdrawal:1px dashed #c4c4c4">
-            <div class="layui-colla-item">
-                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                <div class="layui-colla-content layui-show">
-                    <p>*查看会员佣金钱包资金变动记录。</p>
-                </div>
-            </div>
-        </div>
-        </div>
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">会员信息:</label>
-                            <div class="layui-input-block">
-                                <select name="search_key">
-                                    <option value="user_sn">会员编号</option>
-                                    <option value="nickname">会员昵称</option>
-                                </select>
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
-                                   autocomplete="off" class="layui-input">
-                        </div>
-
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">明细类型:</label>
-                            <div class="layui-input-block">
-                                <select name="source_type" id="source_type">
-                                    <option value="">全部</option>
-                                    {foreach $source_type as $item => $val}
-                                        <option value="{$item}">{$val}</option>
-                                    {/foreach}
-                                </select>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">记录时间:</label>
-                            <div class="layui-input-inline">
-                                <div class="layui-input-inline">
-                                    <input type="text" name="start_time" class="layui-input" id="start_time"
-                                           placeholder="" autocomplete="off">
-                                </div>
-                            </div>
-                            <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                                <label class="layui-form-mid">至</label>
-                            </div>
-                            <div class="layui-input-inline">
-                                <input type="text" name="end_time" class="layui-input" id="end_time"
-                                       placeholder="" autocomplete="off">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <div class="layui-btn-group">
-                                <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
-                                <button type="button"  day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
-                                <button type="button"  day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
-                                <button type="button"  day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
-                            </div>
-                        </div>
-
-
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
-                                    lay-filter="withdrawal-search">查询
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="withdrawal-clear-search">重置
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="data-export">导出
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-tab-item layui-show">
-                <div class="layui-card">
-                    <div class="layui-card-body">
-                        <table id="withdrawal-lists" lay-filter="withdrawal-lists"></table>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-      layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$
-            , form = layui.form
-            , table = layui.table
-            , element = layui.element
-            , laydate = layui.laydate;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        //监听搜索
-        form.on('submit(withdrawal-search)', function (data) {
-            var field = data.field;
-            //执行重载
-            table.reload('withdrawal-lists', {
-                where: field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-        //清空查询
-        form.on('submit(withdrawal-clear-search)', function () {
-            $('#goods_name').val('');
-            $('#source_type').val('');
-            $('#keyword').val('');
-            $('#start_time').val('{$today[0]}');
-            $('#end_time').val('{$today[1]}');
-            $('#today').trigger("click");
-            form.render('select');
-            //刷新列表
-            table.reload('withdrawal-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-          // 导出
-          form.on('submit(data-export)', function (data) {
-              var field = data.field;
-              like.ajax({
-                  url: '{:url("finance.User/commissionExport")}'
-                  , data: field
-                  , type: 'get'
-                  , success: function (res) {
-                      if (res.code == 1) {
-                          window.location.href = res.data.url;
-                      }
-                  }
-              });
-          });
-
-        //日期时间范围
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            , value: "{$today[0]}"
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            ,value: "{$today[1]}"
-        });
-
-        //获取列表
-        getList('');
-        //切换列表
-        element.on('tab(tab-all)', function (data) {
-            $('#keyword').val('');
-            $('#withdrawal_status').val('');
-            $('#goods_name').val('');
-            $('#pay_way').val('');
-            $('#withdrawal_type').val('');
-            $('#start_time').val('{$today[0]}');
-            $('#end_time').val('{$today[1]}');
-            $('#today').trigger("click");
-            $('#delivery_type').val('');
-            form.render('select');
-            var type = $(this).attr('data-type');
-            getList(type);
-            if (type !== ''){
-                $('.withdrawal_status').hide();
-            }else {
-                $('.withdrawal_status').show();
-            }
-        });
-
-        function getList(type) {
-            table.render({
-                elem: '#withdrawal-lists'
-                , url: '{:url("finance.User/commission")}'
-                , cols: [[
-                      {field: 'nickname', title: '会员昵称', align: 'center',width:210}
-                    , {field: 'user_sn', title: '会员编号', align: 'center',width:210}
-                    , {field: 'mobile', title: '手机号码', align: 'center',width:160}
-                    , {field: 'change_amount', title: '变动金额', align: 'center',width:160}
-                    , {field: 'left_amount', title: '剩余佣金', align: 'center',width:160}
-                    , {field: 'source_type', title: '明细类型', align: 'center',width:210}
-                    , {field: 'withdraw_sn', title: '来源单号', align: 'center',width:240}
-                    , {field: 'create_time', title: '记录时间', align: 'center',width:240}
-                ]]
-                , page: true
-                , text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1 
-                  } 
-                , parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists,
-                    };
-                }
-                ,done: function(res, curr, count){
-                    // 解决操作栏因为内容过多换行问题
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-
-        //监听工具条
-        table.on('tool(withdrawal-lists)', function (obj) {
-            var id = obj.data.id;
-            if(obj.event === 'detail'){
-                layer.open({
-                    type: 2
-                    ,title: '订单详情'
-                    ,content: '{:url("withdrawal.withdrawal/detail")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-                        table.reload('withdrawal-lists');
-                    }
-                })
-            }
-        });
-        $('.day').click(function(){
-            $('.day').removeClass('layui-btn-normal');
-            $('.day').removeClass('layui-btn-primary');
-            $('.day').addClass('layui-btn-primary');
-            $(this).removeClass('layui-btn-primary');
-            $(this).addClass('layui-btn-normal');
-            var day = $(this).attr('day');
-            switch (day) {
-                case '-1':
-                    $('#start_time').val('{$yesterday[0]}');
-                    $('#end_time').val('{$yesterday[1]}');
-                    break;
-                case '1':
-                    $('#start_time').val('{$today[0]}');
-                    $('#end_time').val('{$today[1]}');
-                    break;
-                case '7':
-                    $('#start_time').val('{$days_ago7[0]}');
-                    $('#end_time').val('{$days_ago7[1]}');
-                    break;
-                case '30':
-                    $('#start_time').val('{$days_ago30[0]}');
-                    $('#end_time').val('{$days_ago30[1]}');
-                    break;
-            }
-        });
-    });
-</script>

+ 0 - 157
app/admin/view/finance/user/detail.html

@@ -1,157 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    .layui-input-block {
-        line-height: 38px;
-    }
-</style>
-<div style="margin-left: 50px;margin-top: 15px;margin-bottom:30px;">
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">会员编号:</label>
-    <div class="layui-input-block">{$detail.user_sn}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">会员昵称:</label>
-    <div class="layui-input-block">{$detail.nickname}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">手机号码:</label>
-    <div class="layui-input-block">{$detail.mobile}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">提现金额:</label>
-    <div class="layui-input-block">¥ {$detail.money}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">手续费:</label>
-    <div class="layui-input-block">¥ {$detail.poundage}({$detail.poundage/$detail.money*100}%)</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">到账金额:</label>
-    <div class="layui-input-block">¥ {$detail.left_money}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">提现方式:</label>
-    <div class="layui-input-block">{$detail.typeDesc}</div>
-  </div>
-  <!-- 银行卡 -->
-  {if $detail.type == 5}
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">提现银行:</label>
-    <div class="layui-input-block">{$detail.bank}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">银行支行:</label>
-    <div class="layui-input-block">{$detail.subbank}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">开户名称:</label>
-    <div class="layui-input-block">{$detail.real_name}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">银行账号:</label>
-    <div class="layui-input-block">{$detail.account}</div>
-  </div>
-  {/if}
-  <!-- 微信收款码 -->
-  {if $detail.type == 3 || $detail.type == 4}
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">
-      {if $detail.type == 3}
-        微信号:
-      {/if}
-      {if $detail.type == 4}
-        支付宝账号:
-      {/if}
-    </label>
-    <div class="layui-input-block">{$detail.account}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">真实姓名:</label>
-    <div class="layui-input-block">{$detail.real_name}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">收款码:</label>
-    <div class="layui-input-block">
-      <img class="image-show" src="{$detail.money_qr_code}" style="width:80px;height:80px;" alt="" />
-    </div>
-  </div>
-  {/if}
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">申请时间:</label>
-    <div class="layui-input-block">{$detail.create_time}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">申请备注:</label>
-    <div class="layui-input-block">{$detail.remark}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">审核备注:</label>
-    <div class="layui-input-block">{$detail.description}</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">提现状态:</label>
-    <div class="layui-input-block">{$detail.statusDesc}</div>
-  </div>
-  <!-- 除转入钱包余额,其他都有凭证记录 -->
-  {if $detail.type != 1}
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">转账凭证:</label>
-    {if $detail.type == 2}
-      <!-- 微信零钱 转账凭证为:支付单号 -->
-      <div class="layui-input-block">{$detail.payment_no}</div>
-    {elseif ($detail.type == 3 || $detail.type == 4 || $detail.type == 5) && $detail.status == 3 && $detail.transfer_voucher }
-      <!-- 银行卡、微信收款码、支付宝收款码 且 状态为提现成功 -->
-      <div class="layui-input-block">
-        <img class="image-show" src="{$detail.transfer_voucher}" style="width:80px;height:80px;" alt="" />
-      </div>
-    {/if}
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">转账时间:</label>
-    {if $detail.type == 2}
-      <!-- 微信零钱 转账时间为支付时间 -->
-      <div class="layui-input-block">{$detail.payment_time}</div>
-    {elseif $detail.type == 3 || $detail.type == 4 || $detail.type == 5}
-      <!-- 银行卡、微信收款码、支付宝收款码 -->
-      <div class="layui-input-block">{$detail.transfer_time}</div>
-    {/if}
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">转账备注:</label>
-    <div class="layui-input-block">{$detail.transfer_description}</div>
-  </div>
-  {/if}
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label"></label>
-    <div class="layui-input-block">
-      <a class="layui-btn layui-btn-normal layui-btn-sm">确 定</a>  
-      <a class="layui-btn layui-btn-primary layui-btn-sm">返 回</a>
-    </div>
-  </div>
-</div>
-
-<script>
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index','table','like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src, 600);
-        });
-
-        $('.layui-btn').click(function(){
-          var index = parent.layer.getFrameIndex(window.name); 
-          parent.layer.close(index);
-        });
-    });
-</script>

+ 0 - 322
app/admin/view/finance/user/recharge.html

@@ -1,322 +0,0 @@
-
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        brecharge-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-        <div class="layui-collapse like-layui-collapse" lay-accordion="" style="brecharge:1px dashed #c4c4c4">
-            <div class="layui-colla-item">
-                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                <div class="layui-colla-content layui-show">
-                    <p>*查看会员充值订单。</p>
-                </div>
-            </div>
-        </div>
-        </div>
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">订单搜索:</label>
-                            <div class="layui-input-block">
-                                <select name="search_key">
-                                    <option >全部</option>
-                                    <option value="order_sn">订单编号</option>
-                                    <option value="nickname">会员昵称</option>
-                                    <option value="user_mobile">会员手机号码</option>
-                                </select>
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
-                                   autocomplete="off" class="layui-input">
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">订单来源:</label>
-                            <div class="layui-input-block">
-                                <select name="order_source" id="order_source">
-                                    <option value="">全部</option>
-                                    {foreach $order_source as $item => $val}
-                                    <option value="{$item}">{$val}</option>
-                                    {/foreach}
-                                </select>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">订单状态:</label>
-                            <div class="layui-input-inline">
-                                <select name="pay_status" id="pay_status">
-                                    <option value="">全部</option>
-                                    <option value="0">待支付</option>
-                                    <option value="1">已完成</option>
-                                </select>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">付款方式:</label>
-                            <div class="layui-input-block">
-                                <select name="pay_way" id="pay_way">
-                                    <option value="">全部</option>
-                                    {foreach $pay_way as $item => $val}
-                                    <option value="{$item}">{$val}</option>
-                                    {/foreach}
-                                </select>
-                            </div>
-                        </div>
-
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">下单时间:</label>
-                            <div class="layui-input-inline">
-                                <div class="layui-input-inline">
-                                    <input type="text" name="start_time" class="layui-input" id="start_time"
-                                           placeholder="" autocomplete="off">
-                                </div>
-                            </div>
-                            <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                                <label class="layui-form-mid">至</label>
-                            </div>
-                            <div class="layui-input-inline">
-                                <input type="text" name="end_time" class="layui-input" id="end_time"
-                                       placeholder="" autocomplete="off">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <div class="layui-btn-group">
-                                <button type="button"  day="1" class="layui-btn layui-btn-sm layui-btn-primary day">今天</button>
-                                <button type="button"  day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
-                                <button type="button"  day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
-                                <button type="button"  day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
-                                    lay-filter="recharge-search">查询
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="recharge-clear-search">重置
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="data-export">导出
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-tab-item layui-show">
-                <div class="layui-card">
-                    <div class="layui-card-body">
-                        <table id="recharge-lists" lay-filter="recharge-lists"></table>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-      layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$
-            , form = layui.form
-            , table = layui.table
-            , element = layui.element
-            , laydate = layui.laydate;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        //监听搜索
-        form.on('submit(recharge-search)', function (data) {
-            var field = data.field;
-            //执行重载
-            table.reload('recharge-lists', {
-                where: field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-
-          // 导出
-          form.on('submit(data-export)', function (data) {
-              var field = data.field;
-              like.ajax({
-                  url: '{:url("finance.User/rechargeExport")}'
-                  , data: field
-                  , type: 'get'
-                  , success: function (res) {
-                      if (res.code == 1) {
-                          window.location.href = res.data.url;
-                      }
-                  }
-              });
-          });
-
-        //清空查询
-        form.on('submit(recharge-clear-search)', function () {
-            $('#keyword').val('');
-            $('#recharge_status').val('');
-            $('#pay_status').val('');
-            $('#pay_way').val('');
-            $('#order_source').val('');
-            $('#recharge_type').val('');
-            $('#delivery_type').val('');
-            $('#start_time').val('');
-            $('#end_time').val('');
-            $('.day').removeClass('layui-btn-normal').removeClass('layui-btn-primary').addClass('layui-btn-primary');
-            form.render('select');
-            //刷新列表
-            table.reload('recharge-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        //日期时间范围
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            , value: ""
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            ,value: ""
-        });
-
-
-        //获取列表
-        getList('');
-        //切换列表
-        element.on('tab(tab-all)', function (data) {
-            $('#keyword').val('');
-            $('#recharge_status').val('');
-            $('#goods_name').val('');
-            $('#pay_way').val('');
-            $('#order_status').val('');
-            $('#recharge_type').val('');
-            $('#start_time').val('');
-            $('#end_time').val('');
-            $('#delivery_type').val('');
-            form.render('select');
-            var type = $(this).attr('data-type');
-            getList(type);
-            if (type !== ''){
-                $('.recharge_status').hide();
-            }else {
-                $('.recharge_status').show();
-            }
-        });
-
-        function getList(type) {
-            table.render({
-                elem: '#recharge-lists'
-                , url: '{:url("finance.User/recharge")}'
-                , cols: [[
-                      {field: 'order_sn', title: '订单编号', align: 'center',width:220}
-                    , {field: 'nickname', title: '用户昵称', align: 'center',width:220}
-                    , {field: 'mobile', title: '用户手机号', align: 'center',width:180}
-                    , {field: 'order_amount', title: '充值金额', align: 'center',width:180}
-                    , {field: 'give_money', title: '赠送金额', align: 'center',width:120}
-                    , {field: 'give_growth', title: '赠送成长值', align: 'center',width:120}
-                    , {field: 'pay_way', title: '支付方式', align: 'center',width:115}
-                    , {field: 'pay_time', title: '支付时间', align: 'center',width:120}
-                    , {field: 'pay_status', title: '订单状态', align: 'center',width:120}
-                    , {field: 'create_time', title: '下单时间', align: 'center',width:220}
-                ]]
-                , page: true
-                , text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1 
-                  } 
-                , parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists,
-                    };
-                }
-                ,done: function(res, curr, count){
-                    // 解决操作栏因为内容过多换行问题
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-        $('.day').click(function(){
-            $('.day').removeClass('layui-btn-normal').removeClass('layui-btn-primary').addClass('layui-btn-primary');
-            $(this).removeClass('layui-btn-primary');
-            $(this).addClass('layui-btn-normal');
-            var day = $(this).attr('day');
-            switch (day) {
-                case '-1':
-                    $('#start_time').val('{$yesterday[0]}');
-                    $('#end_time').val('{$yesterday[1]}');
-                    break;
-                case '1':
-                    $('#start_time').val('{$today[0]}');
-                    $('#end_time').val('{$today[1]}');
-                    break;
-                case '7':
-                    $('#start_time').val('{$days_ago7[0]}');
-                    $('#end_time').val('{$days_ago7[1]}');
-                    break;
-                case '30':
-                    $('#start_time').val('{$days_ago30[0]}');
-                    $('#end_time').val('{$days_ago30[1]}');
-                    break;
-            }
-        });
-    });
-</script>

+ 0 - 92
app/admin/view/finance/user/review.html

@@ -1,92 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    .layui-input-block {
-        line-height: 38px;
-    }
-</style>
-<div class="layui-form" style="margin-left: 50px;margin-top: 15px;margin-bottom:30px;">
-  <input type="hidden" name="id" value="{$id}" />
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">提现审核:</label>
-    <div class="layui-input-block">
-      <input type="radio" name="review_status" value="1" title="审核通过">
-      <input type="radio" name="review_status" value="0" title="审核拒绝" checked>
-    </div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label"></label>
-    <div class=" layui-form-mid layui-word-aux" style="white-space: nowrap">审核拒绝后,提现金额会全部退回佣金账户</div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">审核备注:</label>
-    <div class="layui-input-block">
-      <textarea name="description" placeholder="请输入内容" class="layui-textarea" style="width:380px;height:120px;"></textarea>
-    </div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label"></label>
-    <div class="layui-input-block">
-      <button class="layui-btn layui-btn-sm layuiadmin-btn-withdraw layui-btn-normal }" lay-submit lay-filter="confirm">确 认</button>
-      <button class="layui-btn layui-btn-sm layuiadmin-btn-withdraw layui-btn-primary }" lay-submit lay-filter="cancel">返 回</button>
-    </div>
-  </div>
-</div>
-
-<script>
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index','table','like'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,like = layui.like;
-      // 确认
-      form.on('submit(confirm)', function(data){
-        console.log(data.field)
-        if(data.field.review_status == '0') {
-          // 审核拒绝
-          like.ajax({
-              url:'{:url("finance.User/refuse")}',
-              data:{'id':data.field.id, 'description': data.field.description},
-              type:"post",
-              success:function(res)
-              {
-                if(res.code == 1)
-                {
-                  layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                    parent.location.reload();
-                  });
-                }
-              }
-          });
-        }else if(data.field.review_status == '1') {
-          // 审核通过
-          like.ajax({
-              url:'{:url("finance.User/confirm")}',
-              data:{'id':data.field.id, 'description': data.field.description},
-              type:"post",
-              success:function(res)
-              {
-                if(res.code == 1)
-                {
-                  layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                    parent.location.reload();
-                  });
-                }
-              }
-          });
-        }
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-      });
-      // 返回
-      form.on('submit(cancel)', function(data){
-        var index = parent.layer.getFrameIndex(window.name); 
-        parent.layer.close(index);
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-      });
-    });
-</script>

+ 0 - 118
app/admin/view/finance/user/transfer.html

@@ -1,118 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell { height: auto; }
-    .layui-input-block {
-        line-height: 38px;
-    }
-</style>
-<div class="layui-form" style="margin-left: 50px;margin-top: 15px;margin-bottom:30px;">
-  <input type="hidden" name="id" value="{$id}" />
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">转账操作:</label>
-    <div class="layui-input-block">
-      <input type="radio" name="transfer_status" value="1" title="转账成功">
-      <input type="radio" name="transfer_status" value="0" title="转账失败" checked>
-    </div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label"></label>
-    <div class=" layui-form-mid layui-word-aux" style="white-space: nowrap">转账失败后,提现金额会全部退回佣金账户</div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">转账凭证:</label>
-    <div class="layui-input-block">
-      <div class="like-upload-image" switch-tab="0" lay-verType="tips">
-        <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-      </div>
-    </div>
-  </div>
-
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label">转账备注:</label>
-    <div class="layui-input-block">
-      <textarea name="transfer_description" placeholder="请输入内容" class="layui-textarea" style="width:380px;height:120px;"></textarea>
-    </div>
-  </div>
-  <div class="layui-form-item" style="margin-bottom:0;">
-    <label class="layui-form-label"></label>
-    <div class="layui-input-block">
-      <button class="layui-btn layui-btn-sm layuiadmin-btn-withdraw layui-btn-normal }" lay-submit lay-filter="confirm">确 认</button>
-      <button class="layui-btn layui-btn-sm layuiadmin-btn-withdraw layui-btn-primary }" lay-submit lay-filter="cancel">返 回</button>
-    </div>
-  </div>
-</div>
-
-<script>
-    layui.use(['table'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table;
-
-      like.delUpload();
-      $(document).on("click", ".add-upload-image", function () {
-        like.imageUpload({
-          limit: 1,
-          field: "transfer_voucher",
-          that: $(this)
-        });
-      });
-
-      // 确认
-      form.on('submit(confirm)', function(data){
-        // console.log(data.field)
-        if(data.field.transfer_status == '0') {
-          // 转账失败
-          like.ajax({
-              url:'{:url("finance.User/transferFail")}',
-              data: data.field,
-              type:"post",
-              success:function(res)
-              {
-                if(res.code == 1)
-                {
-                  layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                    parent.location.reload();
-                  });
-                }
-              }
-          });
-        }else if(data.field.transfer_status == '1') {
-          // 转账成功
-          like.ajax({
-              url:'{:url("finance.User/transferSuccess")}',
-              data:data.field,
-              type:"post",
-              success:function(res)
-              {
-                if(res.code == 1)
-                {
-                  layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                    parent.location.reload();
-                  });
-                }
-              }
-          });
-        }
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-      });
-      // 返回
-      form.on('submit(cancel)', function(data){
-        var index = parent.layer.getFrameIndex(window.name); 
-        parent.layer.close(index);
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-      });
-
-
-      //删除图片
-      $(document).on('click', '.goods-img-del-x', function () {
-            $(this).parent().siblings('input').val('');
-            $(this).parent().prev().css('display','block');
-            $(this).parent().remove();
-        });
-        //显示图片
-        $(document).on('click', '.goods-img', function () {
-            var image = $(this).attr('src');
-            like.showImg(image,600);
-        });
-    });
-</script>

+ 0 - 463
app/admin/view/finance/user/withdrawal.html

@@ -1,463 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        bcommission-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-        <div class="layui-collapse like-layui-collapse" lay-accordion="" style="bcommission:1px dashed #c4c4c4">
-            <div class="layui-colla-item">
-                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                <div class="layui-colla-content layui-show">
-                    <p>*审核会员的佣金提现申请。</p>
-                    <p>*佣金提现支持微信、支付宝转账。提现失败会退回全部金额。</p>
-                </div>
-            </div>
-        </div>
-        <!-- 提现汇总-->
-        <div class="layui-form-item div-flex">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>提现汇总</legend>
-            </fieldset>
-        </div>
-
-
-        <div class="layui-row layui-col-space15">
-            <div class="layui-col-sm6 layui-col-md3" >
-                <div class="layui-card" >
-                    <div class="layui-card-header" >
-                        已提现佣金金额
-                    </div>
-                    <div class="layui-card-body layuiadmin-card-list" >
-                        <p class="layuiadmin-big-font">¥{$summary.successWithdraw}</p>
-                    </div>
-                </div>
-            </div>
-
-            <div class="layui-col-sm6 layui-col-md3">
-                <div class="layui-card">
-                    <div class="layui-card-header">
-                        提现中佣金金额
-                    </div>
-                    <div class="layui-card-body layuiadmin-card-list">
-                        <p class="layuiadmin-big-font">¥{$summary.handleWithdraw}</p>
-                    </div>
-                </div>
-            </div>
-
-            <div class="layui-col-sm6 layui-col-md3">
-                <div class="layui-card">
-                    <div class="layui-card-header">
-                        可提现佣金金额
-                    </div>
-                    <div class="layui-card-body layuiadmin-card-list">
-                        <p class="layuiadmin-big-font" >¥{$summary.totalEarnings}</p>
-                    </div>
-                </div>
-            </div>
-
-        </div>
-        </div>
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-
-
-
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">会员信息:</label>
-                            <div class="layui-input-block">
-                                <select name="search_key">
-                                    <option value="user_sn">会员编号</option>
-                                    <option value="nickname">会员昵称</option>
-                                </select>
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
-                                   autocomplete="off" class="layui-input">
-                        </div>
-                        <div class="layui-inline">
-                            <label class="layui-form-label">提现单号:</label>
-                            <div class="layui-input-block">
-                                <input type="text" name="withdraw_sn" id="withdraw_sn" placeholder="请输入提现单号"
-                                       autocomplete="off" class="layui-input">
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">提现方式:</label>
-                            <div class="layui-input-block">
-                                <select name="type" id="type">
-                                    <option value="">全部</option>
-                                    <option value="1">钱包余额</option>
-                                    <option value="2">微信零钱</option>
-                                    <option value="3">微信收款码</option>
-                                    <option value="4">支付宝收款码</option>
-                                    <option value="5">银行卡</option>
-                                </select>
-                            </div>
-                        </div>
-
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">提现时间:</label>
-                            <div class="layui-input-inline">
-                                <div class="layui-input-inline">
-                                    <input type="text" name="start_time" class="layui-input" id="start_time"
-                                           placeholder="" autocomplete="off">
-                                </div>
-                            </div>
-                            <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                                <label class="layui-form-mid">至</label>
-                            </div>
-                            <div class="layui-input-inline">
-                                <input type="text" name="end_time" class="layui-input" id="end_time"
-                                       placeholder="" autocomplete="off">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <div class="layui-btn-group">
-                                <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
-                                <button type="button"  day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
-                                <button type="button"  day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
-                                <button type="button"  day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
-                                    lay-filter="commission-search">查询
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="commission-clear-search">重置
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="data-export">导出
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-tab-item layui-show">
-                <div class="layui-card">
-                    <ul class="layui-tab-title">
-                        <li data-status='' class="layui-this">全部</li>
-                        <li data-status='1'>待提现</li>
-                        <li data-status="2">提现中</li>
-                        <li data-status="3">提现成功</li>
-                        <li data-status="4">提现失败</li>
-                    </ul>
-                    <div class="layui-card-body">
-                        <table id="commission-lists" lay-filter="commission-lists"></table>
-
-
-                        <!--会员信息-->
-                        <script type="text/html" id="user">
-                            <img src="{{d.user.avatar}}" style="height:60px;width: 60px" class="image-show">
-                            <div class="layui-input-inline"  style="text-align: left;">
-                                <p>会员编号:{{d.user.sn}}</p>
-                                <p>会员昵称:{{d.user.nickname}}</p>
-                                <p>用户等级:{{d.user.user_level_name}}</p>
-                            </div>
-                        </script>
-
-                        <!--操作-->
-                        <script type="text/html" id="withdraw-operation">
-                            <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="detail">详情</a>
-                            <!-- 待提现的才能审核 -->
-                            {{#  if(d.status == 1){ }}
-                            <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="review">审核</a>
-                            {{#  } }}
-                            <!-- 提现中的微信零钱申请单才能查询结果 -->
-                            {{#  if(d.status == 2 && d.type == 2){ }}
-                            <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="search">查询结果</a>
-                            <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="withdraw_failed">提现失败</a>
-                            {{#  } }}
-                            <!-- 提现中的收款码申请单才能转账操作 -->
-                            {{#  if(d.status == 2 && (d.type == 3 || d.type == 4 || d.type == 5)){ }}
-                            <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="transfer">转账</a>
-                            {{#  } }}
-                        </script>
-
-
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-      layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$
-            , form = layui.form
-            , table = layui.table
-            , element = layui.element
-            , laydate = layui.laydate;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        //监听搜索
-        form.on('submit(commission-search)', function (data) {
-            var field = data.field;
-            //执行重载
-            table.reload('commission-lists', {
-                where: field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-        //清空查询
-        form.on('submit(commission-clear-search)', function () {
-            $('#withdraw_sn').val('');
-            $('#type').val('');
-            $('#keyword').val('');
-            $('#start_time').val('{$today[0]}');
-            $('#end_time').val('{$today[1]}');
-            $('#today').trigger("click");
-            form.render('select');
-            //刷新列表
-            table.reload('commission-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-          // 导出
-          form.on('submit(data-export)', function (data) {
-              var field = data.field;
-              field.status = $(".layui-tab-title li.layui-this").attr("data-status")
-              like.ajax({
-                  url: '{:url("finance.User/withdrawalExport")}'
-                  , data: field
-                  , type: 'get'
-                  , success: function (res) {
-                      if (res.code == 1) {
-                          window.location.href = res.data.url;
-                      }
-                  }
-              });
-          });
-
-        //日期时间范围
-        laydate.render({
-            elem: '#start_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            , value: "{$today[0]}"
-        });
-
-        laydate.render({
-            elem: '#end_time'
-            , type: 'datetime'
-            ,theme: '#1E9FFF'
-            ,value: "{$today[1]}"
-        });
-
-        //获取列表
-        getList('');
-        //切换列表
-        element.on('tab(tab-all)', function (data) {
-            $('#keyword').val('');
-            $('#commission_status').val('');
-            $('#goods_name').val('');
-            $('#pay_way').val('');
-            $('#pay_status').val('');
-            $('#commission_type').val('');
-            $('#start_time').val('{$today[0]}');
-            $('#end_time').val('{$today[1]}');
-            $('#today').trigger("click");
-            $('#delivery_type').val('');
-            form.render('select');
-            var type = $(this).attr('data-status');
-            getList(type);
-            if (type !== ''){
-                $('.commission_status').hide();
-            }else {
-                $('.commission_status').show();
-            }
-        });
-
-        function getList(type) {
-            table.render({
-                elem: '#commission-lists'
-                , url: '{:url("finance.User/withdrawal")}?status=' + type
-                , cols: [[
-                      {field: 'sn', title: '提现单号', align: 'center',width:180}
-                    , {field: 'user', title: '会员信息', align: 'center',templet:'#user',width:300}
-                    , {field: 'mobile', title: '手机号码', align: 'center',width:160}
-                    , {field: 'left_money', title: '提现金额', align: 'center',width:110}
-                    , {field: 'type_text', title: '提现方式', align: 'center',width:110}
-                    , {field: 'status_text', title: '提现状态', align: 'center',width:110}
-                    , {field: 'remark', title: '提现说明', align: 'center',width:180}
-                    , {field: 'create_time', title: '提现时间', align: 'center',width:220}
-                    ,{fixed: 'right' ,title: '操作', align: 'center',width:250, toolbar: '#withdraw-operation'}
-                ]]
-                , page: true
-                , text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1
-                  }
-                , parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists,
-                    };
-                }
-                ,done: function(res, curr, count){
-                    // 解决操作栏因为内容过多换行问题
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-
-        //监听工具条
-        table.on('tool(commission-lists)', function (obj) {
-            var id = obj.data.id;
-
-            // 详情
-            if(obj.event === 'detail') {
-                layer.open({
-                    type: 2
-                    , title: '提现详情'
-                    , content: '{:url("finance.User/withdraw_detail")}?id=' + id
-                    , area: ['90%', '90%']
-                });
-            }
-
-            // 审核
-            if(obj.event === 'review') {
-                layer.open({
-                    type: 2
-                    , title: '提现审核'
-                    , content: '{:url("finance.User/withdraw_review")}?id=' + id
-                    , area: ['60%', '60%']
-                });
-            }
-
-            // 查询结果
-            if(obj.event === 'search') {
-                like.ajax({
-                    url:'{:url("finance.User/search")}',
-                    data:{'id':id},
-                    type:"post",
-                    success:function(res)
-                    {
-                        if(res.code == 1)
-                        {
-                            layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}, function(){
-                                location.reload();
-                            });
-                        }
-                    }
-                });
-            }
-
-            // 提现失败
-            if(obj.event === 'withdraw_failed') {
-                layer.confirm('提现失败将退回佣金,确定要操作吗?', {icon: 3, title:'提示'}, function(index){
-                    like.ajax({
-                        url:'{:url("finance.User/withdrawFailed")}',
-                        data:{'id':id},
-                        type:"post",
-                        success:function(res)
-                        {
-                            if(res.code == 1)
-                            {
-                                layui.layer.msg('提现失败退回佣金', {offset: '15px', icon: 1, time: 1000},function(){
-                                    // 关闭对话框
-                                    layer.close(index);
-                                    location.reload();
-                                });
-                            }
-                        }
-                    });
-
-                });
-            }
-
-            // 转账
-            if(obj.event === 'transfer') {
-                layer.open({
-                    type: 2
-                    , title: '转账'
-                    , content: '{:url("finance.User/transfer")}?id=' + id
-                    , area: ['90%', '90%']
-                });
-            }
-        });
-
-
-        $('.day').click(function(){
-            $('.day').removeClass('layui-btn-normal');
-            $('.day').removeClass('layui-btn-primary');
-            $('.day').addClass('layui-btn-primary');
-            $(this).removeClass('layui-btn-primary');
-            $(this).addClass('layui-btn-normal');
-            var day = $(this).attr('day');
-            switch (day) {
-                case '-1':
-                    $('#start_time').val('{$yesterday[0]}');
-                    $('#end_time').val('{$yesterday[1]}');
-                    break;
-                case '1':
-                    $('#start_time').val('{$today[0]}');
-                    $('#end_time').val('{$today[1]}');
-                    break;
-                case '7':
-                    $('#start_time').val('{$days_ago7[0]}');
-                    $('#end_time').val('{$days_ago7[1]}');
-                    break;
-                case '30':
-                    $('#start_time').val('{$days_ago30[0]}');
-                    $('#end_time').val('{$days_ago30[1]}');
-                    break;
-            }
-        });
-    });
-</script>

+ 0 - 71
app/admin/view/goods/brand/add.html

@@ -1,71 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-form" lay-filter="layui-form" id="layui-form" style="padding: 20px 30px 0 0;">
-    <!--品牌名称-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><font color="red">*</font>品牌名称</label>
-        <div class="layui-input-inline">
-            <input type="text" name="name" lay-verify="required" lay-verType="tips" placeholder="请输入品牌名称" autocomplete="off" class="layui-input">
-        </div>
-    </div>
-    <!--品牌首字母-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><font color="red">*</font>品牌首字母</label>
-        <div class="layui-input-inline">
-            <select name="initial" id="initial" >
-                {foreach $capital as $val}
-                <option value="{$val}">{$val}</option>
-                {/foreach}
-            </select>
-        </div>
-    </div>
-    <!--品牌图片-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color:red;">*</span>品牌图片:</label>
-        <div class="layui-input-block">
-            <div class="like-upload-image">
-                <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-            </div>
-            <div class="layui-form-mid layui-word-aux">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</div>
-        </div>
-    </div>
-    <!--品牌排序-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">品牌排序</label>
-        <div class="layui-input-inline">
-            <input type="number"  name="sort" value="255"  placeholder="请输入品牌排序" class="layui-input">
-        </div>
-    </div>
-    <!--是否显示-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">显示状态</label>
-        <div class="layui-input-inline">
-            <input type="radio" name="is_show" value="1" title="显示" checked>
-            <input type="radio" name="is_show" value="0" title="不显示">
-        </div>
-    </div>
-    <!--品牌描述-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">品牌描述</label>
-        <div class="layui-input-inline">
-            <textarea name="remark"  placeholder="请输入品牌描述" class="layui-textarea"></textarea>
-        </div>
-    </div>
-
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="add-submit" id="add-submit" value="确认">
-    </div>
-</div>
-
-
-<script>
-    layui.use(function () {
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "image",
-                that: $(this)
-            });
-        })
-    });
-</script>

+ 0 - 81
app/admin/view/goods/brand/edit.html

@@ -1,81 +0,0 @@
-{layout name="layout2" /}
-
-<div class="layui-form" lay-filter="layui-form" id="layui-form" style="padding: 20px 30px 0 0;">
-    <input type="hidden" value="{$detail.id}" name="id">
-    <!--品牌名称-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><font color="red">*</font>品牌名称</label>
-        <div class="layui-input-inline">
-            <input type="text" name="name" value="{$detail.name}" lay-verify="required" lay-verType="tips" placeholder="请输入品牌名称" autocomplete="off" class="layui-input">
-        </div>
-    </div>
-    <!--品牌首字母-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><font color="red">*</font>品牌首字母</label>
-        <div class="layui-input-inline">
-            <select name="initial" id="initial">
-                {foreach $capital as $val}
-                <option value="{$val}" {if condition="$detail.initial eq $val" }selected{/if}>{$val}</option>
-                {/foreach}
-            </select>
-        </div>
-    </div>
-    <!--品牌图片-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">品牌图片</label>
-        <div class="layui-input-block">
-            <div class="like-upload-image">
-                {if $detail.image}
-                <div class="upload-image-div">
-                    <img src="{$detail.image}" alt="img">
-                    <input type="hidden" name="image" value="{$detail.image}">
-                    <div class="del-upload-btn">x</div>
-                </div>
-                <div class="upload-image-elem" style="display:none;"><a class="add-upload-image"> + 添加图片</a></div>
-                {else}
-                <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-                {/if}
-            </div>
-            <div class="layui-form-mid layui-word-aux">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</div>
-        </div>
-    </div>
-    <!--品牌排序-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">品牌排序</label>
-        <div class="layui-input-inline">
-            <input type="number"  name="sort" value="{$detail.sort}"  placeholder="请输入品牌排序" class="layui-input">
-        </div>
-    </div>
-    <!--是否显示-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">显示状态</label>
-        <div class="layui-input-inline">
-            <input type="radio" name="is_show" value="1" title="显示" {if condition="$detail.is_show eq 1" }checked{/if}>
-            <input type="radio" name="is_show" value="0" title="不显示" {if condition="$detail.is_show eq 0" }checked{/if}>
-        </div>
-    </div>
-    <!--品牌描述-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">品牌描述</label>
-        <div class="layui-input-inline">
-            <textarea name="remark"  placeholder="请输入品牌描述" class="layui-textarea">{$detail.remark}</textarea>
-        </div>
-    </div>
-
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="edit-submit" id="edit-submit" value="确认">
-    </div>
-</div>
-
-<script>
-    layui.use([], function () {
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "image",
-                that: $(this)
-            });
-        })
-    });
-</script>

+ 0 - 232
app/admin/view/goods/brand/lists.html

@@ -1,232 +0,0 @@
-{layout name="layout1" /}
-<!-- 样式 -->
-<style>
-    .layui-table-cell {
-        height: auto;
-    }
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!--操作提示-->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*平台维护商品品牌。</p>
-                        <p>*商家发布商品时可以选择对应的品牌,用户可以根据商品品牌搜索商品。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-card-body">
-            <!--搜索条件-->
-            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
-                <div class="layui-form-item">
-                    <div class="layui-inline">
-                        <label class="layui-form-label">品牌名称</label>
-                        <div class="layui-input-block">
-                            <input type="text" name="name" id="keyword" placeholder="请输入品牌名称" autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <button class="layui-btn layui-btn-sm layuiadmin-btn-goods_brand {$view_theme_color}" lay-submit lay-filter="goods_brand-search">
-                            <i class="layui-icon  layuiadmin-button-btn"></i>查询
-                        </button>
-                    </div>
-                    <div class="layui-inline">
-                        <button class="layui-btn layui-btn-sm  layui-btn-primary layuiadmin-btn-goods_brand  " lay-submit lay-filter="goods_brand-clear-search">清空查询</button>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-card-body">
-            <!--添加按钮-->
-            <div style="padding-bottom: 10px;">
-                <button class="layui-btn layui-btn-sm  {$view_theme_color} layEvent"  lay-event="add">新增品牌</button>
-            </div>
-
-            <!--表格-->
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-
-            <script type="text/html" id="statusTpl">
-                <input type="checkbox"  lay-filter="switch-status" data-id={{d.id}} lay-skin="switch"
-                       lay-text="显示|隐藏" {{#  if(d.is_show){ }} checked  {{#  } }} />
-            </script>
-
-            <script type="text/html" id="goodsBrand-operation">
-                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
-                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
-            </script>
-
-            <script type="text/html" id="image">
-                <img src="{{d.image}}" style="height:80px;width: 80px" class="image-show">
-            </script>
-        </div>
-
-    </div>
-</div>
-
-<script>
-
-    layui.use(['table'], function(){
-        var form = layui.form
-            ,table = layui.table;
-
-        //监听搜索
-        form.on('submit(goods_brand-search)', function(data){
-            var field = data.field;
-            //执行重载
-            table.reload('like-table-lists', {
-                where: field,
-                page: {curr: 1},
-            });
-        });
-
-        //清空查询
-        form.on('submit(goods_brand-clear-search)', function () {
-            $('#keyword').val('');
-            //刷新列表
-            table.reload('like-table-lists', {
-                where: [],
-                page: {curr: 1},
-            });
-        });
-
-        //切换状态
-        form.on('switch(switch-status)',function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var is_show = 0;
-            if(this.checked) {
-                is_show = 1;
-            }
-            like.ajax({
-                url:'{:url("goods.brand/switchStatus")}',
-                data:{id:id,is_show:is_show},
-                type:'post',
-                success:function (res) {
-                    if(res.code == 1) {
-                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                    }
-                }
-            });
-        });
-
-        //事件
-        var active = {
-            add: function(){
-                layer.open({
-                    type: 2
-                    ,title: '新增商品品牌'
-                    ,content: '{:url("goods.brand/add")}'
-                    ,area: ['90%', '90%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero) {
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'add-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data) {
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.brand/add")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                   if(res.code == 1) {
-                                       layui.layer.msg(res.msg, {
-                                           offset: '15px'
-                                           , icon: 1
-                                           , time: 1000
-                                       });
-                                       layer.close(index);
-                                       table.reload('like-table-lists');
-                                   }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                });
-            },
-            del: function (obj) {
-                var unitName = "<span style='color: red;'>"+obj.data.name+"</span>";
-                layer.confirm('确定删除商品品牌: '+unitName, function(index) {
-                    like.ajax({
-                        url:'{:url("goods.brand/del")}',
-                        data:{'id':obj.data.id},
-                        type:"post",
-                        success:function(res)
-                        {
-                            if(res.code == 1) {
-                                obj.del();
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1000
-                                });
-                                layer.close(index);
-                                table.reload('like-table-lists');
-                            }
-                        }
-                    });
-                });
-            },
-            edit: function (obj) {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '编辑商品品牌'
-                    ,content: '{:url("goods.brand/edit")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'edit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.brand/edit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1) {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        });
-                                        layer.close(index);
-                                        table.reload('like-table-lists');
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                })
-            }
-        };
-        like.eventClick(active);
-
-
-        //列表
-        like.tableLists('#like-table-lists', '{:url("goods.brand/lists")}', [
-            {field: 'id', width: 60, title: 'ID', sort: true}
-            ,{field: 'name', title: '品牌名称', align:"center"}
-            ,{field: 'image', title: '图片', align:"center", templet: "#image"}
-            ,{field: 'initial', title: '品牌首字母', align:"center"}
-            ,{field: 'status', title: '显示状态', align:"center", templet:'#statusTpl'}
-            ,{field: 'sort', title: '排序', align:"center"}
-            ,{title: '操作', align: 'center', fixed: 'right', toolbar: '#goodsBrand-operation'}
-        ]);
-
-    });
-</script>

+ 0 - 129
app/admin/view/goods/category/add.html

@@ -1,129 +0,0 @@
-
-
-{layout name="layout2" /}
-<style>
-  .layui-form-label {
-    color: #6a6f6c;
-    width: 140px;
-  }
-  .layui-input-block{
-    margin-left:170px;
-  }
-  .reqRed::before {
-    content: '*';
-    color: red;
-  }
-</style>
-<div class="layui-form" style="padding: 20px 30px 0 0;">
-  <div class="layui-form-item">
-    <label class="layui-form-label reqRed">分类名称:</label>
-    <div class="layui-input-inline">
-      <input type="text" name="name" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label reqRed">上级分类:</label>
-    <div class="layui-input-inline">
-      <select name="pid" lay-verify="required" placeholder="请选择" lay-filter="search_pid">
-        <option value="0" data-level="1">顶级分类</option>
-        {foreach $category_list as $item => $val}
-        <option value="{$item}" data-level={$val.level}>{$val.name}</option>
-        {/foreach}
-      </select>
-    </div>
-  </div>
-  <div class="layui-form-item" id="bg_image">
-    <label class="layui-form-label">首页分类背景图:</label>
-    <div class="layui-input-inline">
-      <div class="like-upload-image">
-        <div class="upload-image-elem"><a class="add-upload-image" id="bgimage"> + 添加图片</a></div>
-      </div>
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label"></label>
-    <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片。顶级类可以设置首页分类背景图</span>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">分类图标:</label>
-    <div class="layui-input-inline">
-      <div class="like-upload-image">
-        <div class="upload-image-elem"><a class="add-upload-image" id="image"> + 添加图片</a></div>
-      </div>
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label"></label>
-    <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</span>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">排序:</label>
-    <div class="layui-input-inline">
-      <input type="number" name="sort" value="255" class="layui-input">
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label"></label>
-    <span style="color: #a3a3a3;font-size: 9px">排序值必须为整数;数值越小,越靠前</span>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">显示状态:</label>
-    <div class="layui-input-inline">
-      <input type="radio" name="is_show" value="1" title="显示" checked>
-      <input type="radio" name="is_show" value="0" title="不显示">
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">分类描述:</label>
-    <div class="layui-input-inline">
-      <textarea name="remark" autocomplete="off" class="layui-textarea"></textarea>
-    </div>
-  </div>
-  <div class="layui-form-item layui-hide">
-      <input type="button" lay-submit lay-filter="add-goods_category-submit" id="add-goods_category-submit" value="确认">
-  </div>
-</div>
-<script>
-  layui.config({
-    version:"{$front_version}",
-    base: '/static/lib' //静态资源所在路径
-  }).use(['form'], function(){
-    var $ = layui.$
-    ,form = layui.form;
-
-    //监听上级分类选择
-    form.on('select(search_pid)', function(data){
-      if(data.value != 0) {
-        // 只有顶级类才可以设置首页分类背景图,,其它级别分类隐藏上传设置
-        $('#bg_image').addClass('layui-hide');
-        // 先存值至data-img属性中
-        $("input[name='bg_image']").attr('data-img', $("input[name='bg_image']").val());
-        $("input[name='bg_image']").val('');
-      }else{
-        // 显示图片上传
-        $('#bg_image').removeClass('layui-hide');
-        // 还原值隐藏字段值
-        $("input[name='bg_image']").val($("input[name='bg_image']").attr('data-img'));
-      }
-    });
-
-    // 图片上传
-    like.delUpload();
-    // 分类图标
-    $(document).on("click", "#image", function () {
-        like.imageUpload({
-            limit: 1,
-            field: "image",
-            that: $(this)
-        });
-    })
-    // 首页分类背景图
-    $(document).on("click", "#bgimage", function () {
-        like.imageUpload({
-            limit: 1,
-            field: "bg_image",
-            that: $(this)
-        });
-    })
-  })
-</script>

+ 0 - 141
app/admin/view/goods/category/edit.html

@@ -1,141 +0,0 @@
-{layout name="layout2" /}
-<style>
-  .layui-form-label {
-    color: #6a6f6c;
-    width: 140px;
-  }
-  .layui-input-block{
-    margin-left:170px;
-  }
-  .reqRed::before {
-    content: '*';
-    color: red;
-  }
-</style>
-<div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
-  <input type="hidden" name="id" value="{$detail.id}" />
-  <div class="layui-form-item">
-    <label class="layui-form-label reqRed">分类名称:</label>
-    <div class="layui-input-inline">
-      <input type="text" name="name" value="{$detail.name}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label reqRed">上级分类:</label>
-    <div class="layui-input-inline">
-      <select name="pid" lay-verify="required" placeholder="请选择" lay-filter="search_pid">
-        <option value="0" data-level="1">顶级分类</option>
-        {foreach $category_list as $item => $val}
-        <option value="{$item}" data-level="{$val.level}" {if $detail.pid == $item}selected{/if}>{$val.name}</option>
-        {/foreach}
-      </select>
-    </div>
-  </div>
-  <div class="layui-form-item {if $detail.pid !=0}layui-hide{/if}" id="bg_image">
-    <label class="layui-form-label">首页分类背景图:</label>
-    <div class="layui-input-inline">
-      <div class="like-upload-image">
-        {if $detail.bg_image}
-            <div class="upload-image-div">
-                <img src="{$detail.bg_image}" alt="img">
-                <input type="hidden" name="bg_image" value="{$detail.bg_image}">
-                <div class="del-upload-btn">x</div>
-            </div>
-            <div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="bgimage"> + 添加图片</a></div>
-        {else}
-            <div class="upload-image-elem"><a class="add-upload-image" id="bgimage"> + 添加图片</a></div>
-        {/if}
-      </div>
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label"></label>
-    <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片。顶级类可以设置首页分类背景图</span>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">分类图标:</label>
-    <div class="layui-input-inline">
-      <div class="like-upload-image">
-        {if $detail.image}
-            <div class="upload-image-div">
-                <img src="{$detail.image}" alt="img">
-                <input type="hidden" name="image" value="{$detail.image}">
-                <div class="del-upload-btn">x</div>
-            </div>
-            <div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="image"> + 添加图片</a></div>
-        {else}
-            <div class="upload-image-elem"><a class="add-upload-image" id="image"> + 添加图片</a></div>
-        {/if}
-      </div>
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label"></label>
-    <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</span>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">排序:</label>
-    <div class="layui-input-inline">
-      <input type="number" name="sort" value="{$detail.sort}" class="layui-input">
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label"></label>
-    <span style="color: #a3a3a3;font-size: 9px">排序值必须为整数;数值越小,越靠前</span>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">显示状态:</label>
-    <div class="layui-input-inline">
-      <input type="radio" name="is_show" value="1" title="显示" {if $detail.is_show==1}checked{/if} />
-      <input type="radio" name="is_show" value="0" title="不显示" {if $detail.is_show==0}checked{/if}>
-    </div>
-  </div>
-  <div class="layui-form-item">
-    <label class="layui-form-label">分类描述:</label>
-    <div class="layui-input-inline">
-      <textarea name="remark" autocomplete="off" class="layui-textarea">{$detail.remark}</textarea>
-    </div>
-  </div>
-  <div class="layui-form-item layui-hide">
-      <input type="button" lay-submit lay-filter="edit-goods_category-submit" id="edit-goods_category-submit" value="确认">
-  </div>
-</div>
-<script>
-  layui.config({
-    version:"{$front_version}",
-    base: '/static/lib' //静态资源所在路径
-  }).use(['form'], function(){
-    var $ = layui.$
-    ,form = layui.form;
-        
-    //监听上级分类选择
-    form.on('select(search_pid)', function(data){
-      if(data.value != 0) {
-        // 只有顶级类才可以设置首页分类背景图,,其它级别分类隐藏上传设置
-        $('#bg_image').addClass('layui-hide');
-      }else{
-        $('#bg_image').removeClass('layui-hide');
-      }
-    });
-
-    // 图片上传
-    like.delUpload();
-    // 分类图标
-    $(document).on("click", "#image", function () {
-        like.imageUpload({
-            limit: 1,
-            field: "image",
-            that: $(this)
-        });
-    })
-    // 首页分类背景图
-    $(document).on("click", "#bgimage", function () {
-        like.imageUpload({
-            limit: 1,
-            field: "bg_image",
-            that: $(this)
-        });
-    })
-
-  })
-</script>

+ 0 - 268
app/admin/view/goods/category/lists.html

@@ -1,268 +0,0 @@
-{layout name="layout1" /}
-<!-- 样式 -->
-<style>
-  .layui-table-cell {
-    height: auto;
-  }
-</style>
-<!-- 操作提示 -->
-<div class="layui-fluid">
-  <div class="layui-card" style="margin-top: 15px;">
-    <div class="layui-card-body">
-      <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-        <div class="layui-colla-item">
-          <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-          <div class="layui-colla-content layui-show">
-            <p>*平台商品分类,商家发布商品的时候需要选择对应的平台商品分类,用户可以根据商品分类搜索商品。</p>
-          </div>
-        </div>
-      </div>
-    </div>
-    <!-- 功能按钮 -->
-    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
-      <div class="layui-form-item">
-        <div class="layui-btn-container" style="display: inline-block;">
-          <div class="layui-btn-group">
-            <button class="layui-btn layui-btn-sm layui-btn-goods_category {$view_theme_color}"
-              id="goods_category-add">新增商品分类</button>
-            <button class="layui-btn layui-btn-sm  layui-btn-goods_category {$view_theme_color}"
-              id="expand-all">全部展开</button>
-            <button class="layui-btn layui-btn-sm  layui-btn-goods_category {$view_theme_color}"
-              id="fold-all">全部折叠</button>
-          </div>
-        </div>
-        <input type="text" id="search-value" placeholder="分类名称" autocomplete="off" class="layui-input"
-          style="display: inline-block;width: 140px;height: 30px;padding: 0 5px;margin-right: 5px;">
-        <div class="layui-btn-container" style="display: inline-block;">
-          <button id="search" class="layui-btn layui-btn-sm  layui-btn-goods_category {$view_theme_color}">
-            <i class="layui-icon">&#xe615;</i>搜索
-          </button>
-        </div>
-      </div>
-    </div>
-    
-    <div class="layui-card-body">
-      <!-- 树形表格 -->
-      <table id="goods_category-lists" lay-filter="goods_category-lists"></table>
-      <!-- 分类图标 -->
-      <script type="text/html" id="image">
-        {{#  if(d.image != ''){ }}
-          <img src="{{d.image}}" style="height:80px;width:80px" class="image-show">
-        {{#  } }} 
-      </script>
-      <!-- 是否显示 -->
-      <script type="text/html" id="is_show">
-        <input type="checkbox"  lay-filter="switch-is_show" data-id={{d.id}} data-field='is_show'   lay-skin="switch" lay-text="显示|隐藏" {{#  if(d.is_show){ }} checked  {{# } }} />
-      </script>
-      <!-- 操作列 -->
-      <script type="text/html" id="goods_category-operation">
-        <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
-        <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
-      </script>
-    </div>
-  </div>
-</div>
-
-<script>
-  layui.config({
-    version: "{$front_version}",
-    base: '/static/lib/'
-  }).extend({
-    treeTable: 'treetable/treeTable'
-  }).use(['layer', 'treeTable', 'form', 'element'], function () {
-    var $ = layui.jquery;
-    var layer = layui.layer;
-    var form = layui.form;
-    var treeTable = layui.treeTable;
-
-    // 渲染树形表格
-    var insTb = treeTable.render({
-      elem: '#goods_category-lists',
-      tree: {
-        iconIndex: 0, // 折叠图标显示在第几列
-        childName: 'sub', // 设定children的字段名,pid形式数据不需要
-        getIcon: function (d) {  // 自定义图标
-          return '<i class="ew-tree-icon layui-icon layui-icon-spread-left "></i>';
-        }
-      },
-      cols: [
-        { field: 'name', title: '分类名称', width: 320},
-        { title: '分类图标', width: 120, align: 'center', templet: '#image'},
-        { title: '显示', width: 100, align: 'center', templet: '#is_show' },
-        { field: 'sort', title: '排序', width: 80, align: 'center', event: 'tips', sort: true },
-        { fixed: 'right', align: 'center', toolbar: '#goods_category-operation', title: '操作'}
-      ],
-      reqData: function(data, callback) {
-        // 在这里写ajax请求,通过callback方法回调数据
-        like.ajax({
-          url:'{:url("goods.category/lists")}',
-          type:'get',
-          success:function (res) {
-            // 转json对象
-            jsonObj = JSON.parse(res.data);
-            if(res.code==0) callback(jsonObj);
-            else callback(res.msg);
-          }
-        })
-      }
-    });
-
-    // 新增商品分类
-    $('#goods_category-add').click(function () {
-      layer.open({
-        type: 2
-        , title: '新增商品分类'
-        , content: '{:url("goods.category/add")}'
-        , area: ['90%', '90%']
-        , btn: ['确认', '返回']
-        , btnAlign: 'c'
-        , yes: function (index, layero) {
-          var iframeWindow = window['layui-layer-iframe' + index]
-          , submitID = 'add-goods_category-submit'
-          , submit = layero.find('iframe').contents().find('#' + submitID);
-
-          //监听提交
-          iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
-            var field = data.field; 
-            console.log(data);
-            like.ajax({
-              url: '{:url("goods.category/add")}',
-              data: field,
-              type: "post",
-              success: function (res) {
-                if (res.code == 1) {
-                  layui.layer.msg(res.msg, {
-                    offset: '15px'
-                    , icon: 1
-                    , time: 1000
-                  });
-                  layer.close(index); //关闭弹层
-                  location.reload();//刷新
-                }
-              }
-            });
-          });
-          // 触发子窗口表单提交事件
-          submit.trigger('click');
-        }
-      })
-    });
-
-    // 监听行工具条事件
-    treeTable.on('tool(goods_category-lists)', function (obj) {
-      var event = obj.event;
-      if (event === 'del') {
-        layer.confirm('确定删除商品分类:' + '<span style="color: red">' + obj.data.name + '</span>', function (index) {
-          like.ajax({
-            url: '{:url("goods.category/del")}',
-            data: { id: obj.data.id },
-            type: 'post',
-            dataType: 'json',
-            success: function (res) {
-              if (res.code === 1) {
-                layui.layer.msg(res.msg, {
-                  offset: '15px'
-                  , icon: 1
-                  , time: 1000
-                },function() {
-                  layer.close(index); //关闭弹层
-                  location.reload();//刷新
-                });
-              }
-            }
-          })
-        })
-      }
-
-      if (event === 'edit') {
-        layer.open({
-          type: 2
-          , title: '编辑商品分类'
-          , content: '{:url("goods.category/edit")}?id=' + obj.data.id
-          , area: ['90%', '90%']
-          , btn: ['确定', '取消']
-          , btnAlign: 'c'
-          , yes: function (index, layero) {
-            var iframeWindow = window['layui-layer-iframe' + index]
-              , submitID = 'edit-goods_category-submit'
-              , submit = layero.find('iframe').contents().find('#' + submitID);
-
-            //监听提交
-            iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
-              var field = data.field; //获取提交的字段
-              like.ajax({
-                url: '{:url("goods.category/edit")}',
-                data: field,
-                type: "post",
-                success: function (res) {
-                  if (res.code == 1) {
-                    layui.layer.msg(res.msg, {
-                      offset: '15px'
-                      , icon: 1
-                      , time: 1000
-                    }, function() {
-                      layer.close(index); //关闭弹层
-                      location.reload();//刷新
-                    });
-                  }
-                }
-              });
-            });
-            submit.trigger('click');
-          }
-        })
-      }
-    });
-
-    // 显示与隐藏
-    form.on('switch(switch-is_show)', function (obj) {
-      var id = obj.elem.attributes['data-id'].nodeValue
-      var status = 0;
-      if (this.checked) {
-        status = 1;
-      }
-      like.ajax({
-        url: '{:url("goods.category/switchStatus")}',
-        data: { id: id, status: status },
-        type: 'post',
-        success: function (res) {
-          if (res.code == 1) {
-            layui.layer.msg(res.msg, {
-              offset: '15px'
-              , icon: 1
-              , time: 1000
-            });
-          }else{
-            layui.layer.msg(res.msg, {
-              offset: '15px'
-              , icon: 2
-              , time: 1000
-            }, function() {
-              location.reload();//刷新
-            });
-          }
-        }
-      })
-    })
-
-    // 全部展开
-    $('#expand-all').click(function () {
-      insTb.expandAll();
-    });
-
-    // 全部折叠
-    $('#fold-all').click(function () {
-      insTb.foldAll();
-    });
-
-    //搜索
-    $('#search').click(function () {
-      var keywords = $('#search-value').val();
-      if (keywords) {
-        insTb.filterData(keywords);
-      } else {
-        insTb.clearFilter();
-      }
-    });
-  });
-</script>

+ 0 - 31
app/admin/view/goods/column/add.html

@@ -1,31 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-form" lay-filter="layuiadmin-form-goodsColumn" id="layuiadmin-form-goodsColumn" style="padding: 20px 30px 0 0;">
-    <!--栏目名称-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color: red">*</span>栏目名称:</label>
-        <div class="layui-input-inline">
-            <input type="text" name="name" lay-verify="required" lay-vertype="tips" autocomplete="off" class="layui-input">
-        </div>
-    </div>
-
-    <!--栏目简介-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color: red">*</span>栏目简介:</label>
-        <div class="layui-input-inline">
-            <textarea name="remark" lay-verify="required"  class="layui-textarea"></textarea>
-        </div>
-    </div>
-
-    <!--状态-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">状态</label>
-        <div class="layui-input-inline">
-            <input type="checkbox" lay-filter="disable" name="status" lay-skin="switch" lay-text="显示|隐藏">
-            <div class=" layui-form-mid layui-word-aux">显示或者隐藏商品栏目</div>
-        </div>
-    </div>
-
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="goodsColumn-submit" id="goodsColumn-submit" value="确认">
-    </div>
-</div>

+ 0 - 32
app/admin/view/goods/column/edit.html

@@ -1,32 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-form" lay-filter="layuiadmin-form-goodsColumn" id="layuiadmin-form-goodsColumn" style="padding: 20px 30px 0 0;">
-    <input type="hidden" value="{$detail.id}" name="id">
-    <!--栏目名称-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color: red">*</span>栏目名称:</label>
-        <div class="layui-input-inline">
-            <input type="text" name="name" value="{$detail.name}" lay-verify="required" lay-vertype="tips" autocomplete="off" class="layui-input">
-        </div>
-    </div>
-
-    <!--栏目简介-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color: red">*</span>栏目简介:</label>
-        <div class="layui-input-inline">
-            <textarea name="remark" lay-verify="required"  class="layui-textarea">{$detail.remark}</textarea>
-        </div>
-    </div>
-
-    <!--状态-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">状态</label>
-        <div class="layui-input-inline">
-            <input type="checkbox" lay-filter="disable" name="status" lay-skin="switch" lay-text="显示|隐藏" {if condition="$detail.status eq 1" }checked{/if}>
-            <div class=" layui-form-mid layui-word-aux">显示或者隐藏商品栏目</div>
-        </div>
-    </div>
-
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="goodsColumn-submit-edit" id="goodsColumn-submit-edit" value="确认">
-    </div>
-</div>

+ 0 - 184
app/admin/view/goods/column/lists.html

@@ -1,184 +0,0 @@
-{layout name="layout1" /}
-<div class="wrapper">
-    <div class="layui-card">
-        <!--操作提示-->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*商品栏目能很方便的聚合商品荐列表。</p>
-                        <p>*商品栏目在首页、购物车、个人中心显示,可任意删除,请谨慎操作。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-card-body">
-            <!--添加按钮-->
-            <div style="padding-bottom: 10px;">
-                <button class="layui-btn layui-btn-sm layuiadmin-btn-goodsColumn {$view_theme_color}" data-type="add">新增商品栏目</button>
-            </div>
-
-            <!--表格-->
-            <table id="goodsColumn-lists" lay-filter="goodsColumn-lists"></table>
-
-            <script type="text/html" id="statusTpl">
-                <input type="checkbox"  lay-filter="switch-status" data-id={{d.id}} data-field='status'   lay-skin="switch"
-                       lay-text="显示|隐藏" {{#  if(d.status){ }} checked  {{#  } }} />
-            </script>
-
-            <script type="text/html" id="goodsColumn-operation">
-                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
-                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
-            </script>
-        </div>
-    </div>
-</div>
-
-<script>
-
-    layui.use(['table'], function(){
-        var form = layui.form
-            ,table = layui.table;
-
-        //事件
-        var active = {
-            add: function(){
-                layer.open({
-                    type: 2
-                    ,title: '新增商品栏目'
-                    ,content: '{:url("goods.column/add")}'
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'goodsColumn-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.column/add")}',
-                               data:field,
-                               type:"post",
-                               success:function(res)
-                               {
-                                   if(res.code == 1) {
-                                       layui.layer.msg(res.msg, {
-                                           offset: '15px'
-                                           , icon: 1
-                                           , time: 1000
-                                       });
-                                       layer.close(index);
-                                       table.reload('goodsColumn-lists');
-                                   }
-                               }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                });
-            }
-        };
-        $('.layui-btn.layuiadmin-btn-goodsColumn').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-
-
-        like.tableLists('#goodsColumn-lists', '{:url("goods.column/lists")}', [
-            {field: 'id', width: 60, title: 'ID', sort: true}
-            ,{field: 'name', title: '栏目名称', align:"center"}
-            ,{field: 'remark', title: '栏目简介', align:"center"}
-            ,{field: 'status', title: '栏目状态', align:"center", templet:'#statusTpl'}
-            ,{title: '操作', align: 'center', fixed: 'right', toolbar: '#goodsColumn-operation'}
-        ]);
-
-
-        form.on('switch(switch-status)',function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var status = 0;
-            if(this.checked){
-                status = 1;
-            }
-            like.ajax({
-                url:'{:url("goods.column/switchStatus")}',
-                data:{id:id,status:status},
-                type:'post',
-                success:function (res) {
-                    if(res.code == 1) {
-                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                    }
-                }
-            });
-        });
-
-
-        //监听工具条
-        table.on('tool(goodsColumn-lists)', function(obj){
-            if(obj.event === 'del'){
-                var id = obj.data.id;
-                var unitName = "<span style='color: red;'>"+obj.data.name+"</span>";
-                layer.confirm('确定删除商品栏目: '+unitName, function(index){
-                    like.ajax({
-                        url:'{:url("goods.column/del")}',
-                        data:{'id':id},
-                        type:"post",
-                        success:function(res)
-                        {
-                            if(res.code == 1) {
-                                obj.del();
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1000
-                                });
-                                layer.close(index);
-                            }
-                        }
-                    });
-                });
-
-            }else if(obj.event === 'edit'){
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '编辑商品栏目'
-                    ,content: '{:url("goods.column/edit")}?id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'goodsColumn-submit-edit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.column/edit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1) {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        });
-                                        layer.close(index);
-                                        table.reload('goodsColumn-lists');
-                                    }
-                                }
-                            });
-                        });
-
-                        submit.trigger('click');
-                    }
-                })
-            }
-        });
-    });
-</script>

+ 0 - 284
app/admin/view/goods/comment/lists.html

@@ -1,284 +0,0 @@
-{layout name="layout1" /}
-<!-- 样式 -->
-<style>
-    .layui-table-cell {
-        height: auto;
-    }
-</style>
-<!-- 操作提示 -->
-<div class="layui-fluid">
-    <div class="layui-card" style="margin-top: 15px;">
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*商家可以对会员的商品评价进行回复,平台拥有评价显示、隐藏和删除权限;</p>
-                        <p>*商品评价会在商城的商品详情中进行显示;</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="layui-card-body">
-            <div class="layui-tab layui-tab-card" lay-filter="tabContainer">
-                <ul class="layui-tab-title">
-                    <li data-type="1" class="layui-this">已回复评价</li>
-                    <li data-type="0">待回复评价</li>
-                </ul>
-                <div class="layui-tab-content">
-                    <!-- 搜索 -->
-                    <div class="layui-form">
-                        <div class="layui-form-item layui-row">
-                            <div class="layui-inline">
-                                <label class="layui-form-label">商家名称:</label>
-                                <div class="layui-input-inline">
-                                    <input type="text" name="shop_name" class="layui-input" />
-                                </div>
-                                <label class="layui-form-label">评价信息:</label>
-                                <div class="layui-input-inline">
-                                    <select name="search_type">
-                                        <option value="name">商品名称</option>
-                                        <option value="sn">会员编号</option>
-                                        <option value="nickname">会员昵称</option>
-                                    </select>
-                                </div>
-                                <div class="layui-input-inline">
-                                    <input type="text" name="search_word" class="layui-input" />
-                                </div>
-                            </div>
-                            <div class="layui-inline">
-                                <label class="layui-form-label">评价等级:</label>
-                                <div class="layui-input-inline">
-                                    <select name="goods_comment">
-                                        <option value="">全部</option>
-                                        <option value="1">好评</option>
-                                        <option value="2">中评</option>
-                                        <option value="3">差评</option>
-                                    </select>
-                                </div>
-                                <div class="layui-inline">
-                                    <label class="layui-form-label">显示状态:</label>
-                                    <div class="layui-input-inline">
-                                        <select name="status">
-                                            <option value="">全部</option>
-                                            <option value="1">显示</option>
-                                            <option value="2">隐藏</option>
-                                        </select>
-                                    </div>
-                                </div>
-                            </div>
-                            <div class="layui-inline">
-                                <label class="layui-form-label">评价时间:</label>
-                                <div class="layui-input-inline" style="width: 390px">
-                                    <input type="text" class="layui-input" name="start_end" id="start_end">
-                                </div>
-                            </div>
-                            <div class="layui-inline">
-                                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="search">查询</button>
-                                <button class="layui-btn layui-btn-primary" lay-submit lay-filter="clear-search">重置</button>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <!-- 数据表格 -->
-            <table id="comment-lists" lay-filter="comment-lists"></table>
-        </div>
-    </div>
-</div>
-</div>
-<script type="text/html" id="shop-info">
-    <img src="{{d.shop_logo}}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
-    <div class="layui-input-inline" style="text-align:left;width: 240px">
-        <p>商家编号:{{d.shop_id}}</p>
-        <p style="width: 180px;text-overflow:ellipsis;overflow: hidden">商家名称:{{d.shop_name}}</p>
-        <p>商家类型:{{d.shop_type_desc}}</p>
-    </div>
-</script>
-<script type="text/html" id="user-info">
-    <img src="{{d.avatar}}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
-    <div class="layui-input-inline" style="text-align:left;width: 240px">
-        <p>会员编号:{{d.sn}}</p>
-        <p style="width: 180px;text-overflow:ellipsis;overflow: hidden">昵称:{{d.nickname}}</p>
-        <p>会员等级:{{d.levelName}}</p>
-    </div>
-</script>
-<script type="text/html" id="goods-info">
-    <img src="{{d.item_image}}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
-    <div class="layui-input-inline" style="text-align:left;width: 240px">
-        <p>{{d.goods_name}}</p>
-        <p style="width: 180px;text-overflow:ellipsis;overflow: hidden">{{d.spec_value_str}}</p>
-    </div>
-</script>
-<script type="text/html" id="image-lists">
-    {{#  layui.each(d.comment_image, function(index, item){ }}
-    <img src="{{item}}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
-    {{#  }); }}
-</script>
-<script type="text/html" id="operate">
-    <button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="changeStatus">
-        {{# if( d.status == 0 ){ }}
-        显示
-        {{# } else { }}
-        隐藏
-        {{# } }}
-    </button>
-    <button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</button>
-</script>
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).use(['layer', 'table', 'form', 'element', 'laydate'], function () {
-        var $ = layui.jquery;
-        var layer = layui.layer;
-        var form = layui.form;
-        var laydate = layui.laydate;
-        var table = layui.table;
-        var element = layui.element;
-
-        // 日期范围选择器
-        laydate.render({
-            elem: '#start_end',
-            type: 'datetime',
-            range: '~'
-        });
-
-        // 监听选项卡切换
-        element.on('tab(tabContainer)', function(data) {
-            // 获取类型
-            var type = $(this).attr('data-type');
-            // 重置搜索
-            $('input[name=shop_name]').val('');
-            $('input[name=search_word]').val('');
-            $('input[name=start_end]').val('');
-            $('select[name=search_type]').val('name');
-            $('select[name=goods_comment]').val('');
-            $('select[name=status]').val('');
-            form.render('select');
-            // 重新加载数据表格
-            getList(type);
-        });
-
-        // 监听查询
-        form.on('submit(search)', function(data){
-            var field = data.field;
-            // 执行重载
-            table.reload('comment-lists', {
-                where: field,
-                page: {curr: 1}
-            });
-        });
-
-        // 重置查询
-        form.on('submit(clear-search)', function(data){
-            // 重置搜索
-            $('input[name=shop_name]').val('');
-            $('input[name=search_word]').val('');
-            $('input[name=start_end]').val('');
-            $('select[name=search_type]').val('name');
-            $('select[name=goods_comment]').val('');
-            $('select[name=status]').val('');
-            form.render('select');
-            // 重新加载数据表格
-            table.reload('comment-lists', {
-                where: {},
-                page: {curr: 1}
-            });
-        });
-
-        // 首次进入
-        getList(1); // 1 已回复列表
-
-        function getList(type) {
-            table.render({
-                id: 'comment-lists'
-                ,elem: '#comment-lists'
-                ,url: "{:url('goods.comment/lists')}?type=" + type
-                , parseData: function(res) { // res 原始返回数据
-                    return {
-                        'code' : res.code  // 0 代表正常返回
-                        , 'msg' : res.msg  // 提示消息
-                        , 'count' : res.data.count // 数据长度
-                        , 'data' : res.data.lists  // 数据列表
-                    }
-                }
-                , response: { // 重新设定返回的数据格式
-                    statusCode: 1, // 成功的状态码,默认0
-                }
-                , page: true // 开启分页
-                , limit: 10
-                , limits: [10, 20, 30, 40, 50]
-                , text: {
-                    none: '暂无数据'
-                }
-                , cols: [[ // 设置表头,二维数组,方法渲染必填
-                    { title: '商家信息', width: 250, align: 'center', templet: '#shop-info' },
-                    { title: '会员信息', width: 250, align: 'center', templet: '#user-info' },
-                    { title: '商品信息', width: 250, align: 'center', templet: '#goods-info' },
-                    { field: 'goods_comment_desc', title: '评分等级', width: 100,align: 'center' },
-                    { field: 'comment', title: '买家评价', width: 200, align: 'center' },
-                    { title: '评论图片', width: 250, align: 'center',templet: '#image-lists' },
-                    { field: 'reply', title: '商家回复', width: 200, align: 'center' },
-                    { field: 'status_desc', title: '显示状态', width: 100, align: 'center' },
-                    { field: 'create_time', title: '评价时间', width: 180, align: 'center' },
-                    { fixed: 'right' ,title: '操作',width: 160, align: 'center', toolbar: '#operate' }
-                ]], done: function () {
-                    setTimeout(function () {
-                        $(".layui-table-main tr").each(function (index, val) {
-                            $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                            $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                        });
-                    }, 200);
-                }
-            });
-        }
-
-        table.on('tool(comment-lists)', function(obj) {
-            if(obj.event == 'changeStatus') { // 修改显示状态
-                if(obj.data.status == 0) {
-                    var tips = '确定显示此条评论吗?';
-                }else{
-                    var tips = '确定隐藏此条评论吗?';
-                }
-                layer.confirm(tips, {icon: 3, title:'提示'}, function(index){
-                    like.ajax({
-                        url: '{:url("goods.comment/changeStatus")}',
-                        data: {'id': obj.data.id},
-                        type: "post",
-                        success: function (res) {
-                            if(res.code == 1) {
-                                layer.msg(res.msg);
-                            }
-                            table.reload('comment-lists', {
-                                where: {},
-                                page: {curr: 1}
-                            });
-                        }
-                    });
-                    layer.close(index);
-                });
-            }
-
-            if(obj.event == 'del') { // 删除
-                layer.confirm('确定要删除此条评论吗?', {icon: 3, title:'提示'}, function(index){
-                    like.ajax({
-                        url: '{:url("goods.comment/del")}',
-                        data: {'id': obj.data.id},
-                        type: "post",
-                        success: function (res) {
-                            if(res.code == 1) {
-                                layer.msg(res.msg);
-                            }
-                            table.reload('comment-lists', {
-                                where: {},
-                                page: {curr: 1}
-                            });
-                        }
-                    });
-                    layer.close(index);
-                });
-            }
-        });
-    });
-</script>

+ 0 - 884
app/admin/view/goods/goods/add.html

@@ -1,884 +0,0 @@
-{layout name="layout2" /}
-
-<link rel="stylesheet" href="/static/admin/css/goods.css" media="all">
-<link href="__PUBLIC__/static/lib/layui/layeditor/layedit.css" rel="stylesheet"/>
-<script src="__PUBLIC__/static/lib/layui/layeditor/index.js"></script>
-<script src="__PUBLIC__/static/lib/layui/layeditor/ace/ace.js"></script>
-
-<div class="layui-tab layui-tab-card">
-    <!--顶部切换页-->
-    <ul class="layui-tab-title">
-        <li class="goods-tab layui-this" style="color: #6a6f6c">基础设置</li>
-        <li class="goods-tab" style="color: #6a6f6c">规格型号</li>
-        <li class="goods-tab" style="color: #6a6f6c">商品详情</li>
-        <li class="goods-tab" style="color: #6a6f6c">销售设置</li>
-<!--        <li class="goods-tab" style="color: #6a6f6c">分销设置</li>-->
-    </ul>
-
-    <!--切换内容-->
-    <div class="layui-tab-content layui-form">
-        <!--基础信息-->
-        {include file="goods/goods/goods_base" /}
-        <!--规格型号-->
-        {include file="goods/goods/goods_spec" /}
-        <!--商品详情-->
-        {include file="goods/goods/goods_content" /}
-        <!--销售设置-->
-        {include file="goods/goods/goods_sale_setting" /}
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="goods-submit" id="goods-submit" value="确认">
-        </div>
-    </div>
-</div>
-
-<script src="__PUBLIC__/static/common/js/array.js"></script>
-
-<script>
-    var dragstart = 0;
-    var swop_element_ed = -1;
-    var create_table_by_spec = null;
-    var spec_table_data = [];
-    var spec_value_temp_id_number = 0;
-
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/'
-    }).extend({
-        likeedit: 'likeedit/likeedit'
-    }).use(['table', 'form', 'element', 'likeedit'], function() {
-        var form = layui.form
-            ,$ = layui.$
-            , element = layui.element
-            , layEditor = layui.layEditor;
-        //---------------------------------------平台分类联动 begin ----------------------------------
-        var categorys = {$category_lists | raw};
-        setSelectFirst();
-
-        function setSelectFirst(default_id) {
-            var category_select_html = '<option value="">请选择分类</option>';
-            for (var i in categorys) {
-                if (categorys[i]['pid'] == 0) {
-                    category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
-                }
-            }
-            $('select[name="first_cate_id"]').html(category_select_html);
-            $('select[name="first_cate_id"]').val(default_id);
-            form.render('select');
-        }
-
-        function setSelectSecond(default_id, pid) {
-            pid = pid === undefined ? $('select[name="first_cate_id"]').val() : pid;
-            $('select[name="second_cate_id"]').html('<option value="">请选择分类</option>');
-            $('select[name="third_cate_id"]').html('<option value="">请选择分类</option>');
-            var category_select_html = '<option value="">请选择分类</option>';
-            for (var i in categorys) {
-                if (categorys[i]['pid'] == pid) {
-                    category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
-                }
-            }
-            $('select[name="second_cate_id"]').html(category_select_html);
-            $('select[name="second_cate_id"]').val(default_id);
-            form.render('select');
-        }
-
-        function setSelectThird(default_id, pid) {
-            pid = pid === undefined ? $('select[name="second_cate_id"]').val() : pid;
-            $('select[name="third_cate_id"]').html('<option value="">请选择分类</option>');
-            var first_cate_id = $('select[name="first_cate_id"]').val();
-            var category_select_html = '<option value="">请选择分类</option>';
-            for (var i in categorys) {
-                if (categorys[i]['pid'] == pid) {
-                    category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
-                }
-            }
-            $('select[name="third_cate_id"]').html(category_select_html);
-            $('select[name="third_cate_id"]').val(default_id);
-            form.render('select');
-        }
-        // 监听一级分类选择
-        form.on('select(first_category)', function (data) {
-            setSelectSecond('', data.value);
-        });
-        // 监听二级分类选择
-        form.on('select(second_category)', function (data) {
-            setSelectThird('', data.value);
-        });
-        //---------------------------------------平台分类联动 end ----------------------------------
-
-        // -------------------------------------- 下拉菜单渲染 begin -------------------------------
-        var shop_category_lists = {$shop_category_lists | raw}; // 店铺商品分类
-        var unit = {$unit_lists | raw};
-        var brands = {$brand_lists | raw};
-        var supplier = {$supplier_lists | raw};
-        var freight = {$freight_lists | raw};
-
-        //渲染商家分类
-        like.setSelect('', shop_category_lists, "shop_cate_id", '分类');
-        //渲染单位
-        like.setSelect('', unit, "unit_id", '单位');
-        //渲染品牌
-        like.setSelect('', brands, "brand_id", '品牌');
-        //渲染供应商
-        like.setSelect('', supplier, "supplier_id", '供应商');
-        //渲染运费模板
-        like.setSelect('', freight, "express_template_id", '运费模板');
-        // -------------------------------------- 下拉菜单渲染 end ---------------------------------
-
-        // ----------------------------------------图片/视频上传 begin -----------------------------
-        // // 监听图片删除
-        // like.delUpload();
-        // // 商品封面图
-        // $(document).on("click", "#image", function () {
-        //     like.imageUpload({
-        //         limit: 1,
-        //         field: "image",
-        //         that: $(this),
-        //         content: '{:url("file/lists")}?type=10'
-        //     });
-        // })
-        // // 商品分享海报
-        // $(document).on("click", "#poster", function () {
-        //     like.imageUpload({
-        //         limit: 1,
-        //         field: "poster",
-        //         that: $(this),
-        //         content: '{:url("file/lists")}?type=10'
-        //     });
-        // })
-        // // 商品轮播图
-        // $(document).on("click", "#goodsimage", function () {
-        //     like.imageUpload({
-        //         limit: 5,
-        //         field: "goods_image[]",
-        //         that: $(this),
-        //         content: '/shop/file/lists?type=10'
-        //     });
-        // })
-        // // 商品视频
-        // $(document).on("click", "#video", function () {
-        //     like.videoUpload({
-        //         limit: 1,
-        //         field: "video",
-        //         that: $(this),
-        //         content: '/shop/file/videoList'
-        //     });
-        // })
-        // // 统一规格-规格图片
-        // $(document).on("click", "#one_spec_image", function () {
-        //     like.imageUpload({
-        //         limit: 1,
-        //         field: "one_spec_image",
-        //         that: $(this),
-        //         content: '/shop/file/lists?type=10'
-        //     });
-        // })
-        // // 多规格-规格图片
-        // $(document).on("click", ".more_spec_image", function () {
-        //     like.imageUpload({
-        //         limit: 1,
-        //         field: "spec_image[]",
-        //         that: $(this),
-        //         content: '/shop/file/lists?type=10'
-        //     });
-        // })
-        // // 监听编辑时多规格图片删除按钮
-        // $(document).on('mouseenter', '.goods-spec-img-div', function () {
-        //     $(this).find('.goods-spec-img-del-x').show();
-        // });
-        // $(document).on('mouseleave', '.goods-spec-img-div', function () {
-        //     $(this).find('.goods-spec-img-del-x').hide();
-        // });
-        // $(document).on('click', '.goods-spec-img-del-x', function () {
-        //     var key = 'spec_image[]' + $(this).parent().parent().parent().attr('spec-value-temp-ids');
-        //     $(this).parent().html('<div class="like-upload-image goods-spec-img-div"><div class="upload-image-elem"><a class="add-upload-image more_spec_image"> + 添加图片</a></div></div>');
-        //     spec_table_data[key] = '';
-        //
-        // });
-        // 放大图片
-        $(document).on('click', 'img',function(){
-            like.showImg($(this).attr('src'),600);
-        });
-        // 查看视频
-        $(document).on('click', 'video',function(){
-            var src = $(this).attr('src');
-            layer.open({
-                type: 1,
-                title: '查看视频',
-                content: '<div style="text-align:center;"><video style="width:60%;margin:15px auto;" src="'+ src +'" autoplay controls></video></div>',
-                area: ['60%', '60%']
-            });
-        });
-        // ----------------------------------------图片/视频上传 end -----------------------------
-
-        //------------------------------------------数据验证 begin -------------------------------
-        function switchTab(number) {
-            $('.goods-tab').removeClass('layui-this');
-            $('.goods-content').removeClass('layui-show');
-            $('.goods-tab').eq(number).addClass('layui-this');
-            $('.goods-content').eq(number).addClass('layui-show');
-        }
-
-        form.verify({
-            custom_required: function (value, item) {
-                if (!$.trim(value)) {
-                    switchTab($(item).attr('switch-tab'));
-                    return $(item).attr('verify-msg');
-                }
-            },
-            status:function(value,item){
-                if(!$('input[name="status"]:checked').val()){
-                    return $(item).attr('verify-msg');
-                }
-            },
-            one_spec_required: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 1) {
-                    if (!value) {
-                        switchTab($(item).attr('switch-tab'));
-                        return $(item).attr('verify-msg');
-                    }
-                }
-            },
-            add_more_spec: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if ($('#more-spec-lists-table tbody tr').length == 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return $(item).attr('verify-msg');
-                    }
-                }
-            },
-            more_spec_required: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (!value) {
-                        switchTab($(item).attr('switch-tab'));
-                        return $(item).attr('verify-msg');
-                    }
-                }
-            },
-            one_volume: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 1) {
-                    if (value && value < 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '体积必须大于0';
-                    }
-                }
-            },
-            one_weight: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 1) {
-                    if (value && value < 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '重量必须大于0';
-                    }
-                }
-            },
-            one_market_price: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 1) {
-                    if (value && value <= 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '市场价必须大于0';
-                    }
-                }
-            },
-            one_price: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value <= 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '价格必须大于0';
-                    }
-                }
-            },
-            one_chengben_price: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value <= 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '成本价必须大于0';
-                    }
-                }
-            },
-            more_market_price:function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value <= 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '市场价必须大于0';
-                    }
-                }
-            },
-            more_price:function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value < 0.01) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '价格必须大于或等于0.01';
-                    }
-                }
-            },
-            more_chengben_price:function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value <= 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '成本价格必须大于0';
-                    }
-                }
-            },
-            more_stock: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value < 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '库存必须大于0';
-                    }
-                }
-            },
-            more_weight: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value < 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '重量必须大于0';
-                    }
-                }
-            },
-            more_volume: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    if (value && value < 0) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '体积必须大于0';
-                    }
-                }
-            },
-            repetition_spec_name: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    var spec_names = [];
-                    $('.spec_name').each(function () {
-                        spec_names.push($(this).val());
-                    });
-                    if ((new Set(spec_names)).size != spec_names.length) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '规格名称重复';
-                    }
-                }
-            },
-            repetition_spec_value: function (value, item) {
-                if ($('input[name="spec_type"]:checked').val() == 2) {
-                    var spec_values = [];
-                    $(item).find('.goods-spec-value-input').each(function () {
-                        spec_values.push($(this).val());
-                    });
-                    if ((new Set(spec_values)).size != spec_values.length) {
-                        switchTab($(item).attr('switch-tab'));
-                        return '同一规格中,规格值不能重复';
-                    }
-                }
-            },
-            distribution:function (value,item) {
-                var first_ratio = parseFloat($('.first_ratio').val());
-                var second_ratio = parseFloat($('.second_ratio').val());
-                var three_ratio = parseFloat(value);
-                if(first_ratio + second_ratio + three_ratio > 100){
-                    return '分销比例不可超过100';
-                }
-
-            }
-        });
-        //------------------------------------------数据验证 end ----------------------------------
-        //------------------------------------------规格型号 begin --------------------------------
-        //监听多规格/单规格按钮
-        form.on('radio(spec-type)', function (data) {
-            switchSpecType(data.value);
-        });
-
-        // 统一规格与多规格切换事件
-        function switchSpecType(value) {
-            var goods_spec_project = $('#goods-spec-project'); // 规格项区域
-
-            if (value == 2) { // 多规格
-                $('#add-spec').parent().show(); // 显示添加规格项目按钮
-
-                if (goods_spec_project.children().length > 0) { // 判断规格项区域是否有子元素
-                    goods_spec_project.parent().show(); // 显示规格项区域
-                    $('#more-spec-lists').show(); // 显示多规格明细
-                }
-                $('#one-spec-lists').hide(); // 隐藏统一规格规格明细
-            } else {
-                $('#add-spec').parent().hide(); // 隐藏 添加规格项目 按钮
-                goods_spec_project.parent().hide(); // 隐藏规格项区域
-                $('#more-spec-lists').hide(); // 隐藏多规格明细
-                $('#one-spec-lists').show(); // 显示单规格明细
-            }
-        }
-
-        //监听添加规格项按钮
-        // $(document).on('click', '#add-spec', function () {
-        //     addSpec();
-        // });
-
-        //添加规格项
-        function addSpec(value) {
-            value = value === undefined ? ' ' : value;
-            var element_spec = $('#goods-spec-project'); // 规格项区域
-            var count = $('.goods-spec').length; // 规格项数量
-            if (count > 2) {
-                layer.msg('最多添加3个规格项目');
-                return;
-            }
-            var template_spec = $('#template-spec').html(); // 获取规格项目模板
-            // 使用value值替换规格项目模板中{value}占位符,并追加至规格项区域中
-            element_spec.append(template_spec.replace('{value}', value));
-            $('#goods-spec-project').parent().show();
-            form.render('checkbox');
-        }
-
-        // 鼠标移入显示删除规格项按钮
-        // $(document).on('mouseenter', '.goods-spec', function () {
-        //     $(this).find('.goods-spec-del-x').show();
-        // });
-
-        // 鼠标移出隐藏删除规格项按钮
-        $(document).on('mouseleave', '.goods-spec', function () {
-            $(this).find('.goods-spec-del-x').hide();
-        });
-
-        // 监听删除规格项目按钮
-        $(document).on('click', '.goods-spec-del-x', function () {
-            $(this).parent().remove(); // 移除当前规格项目
-            var goods_spec_project = $('#goods-spec-project');
-            if (goods_spec_project.children().length == 0) { // 规格项区域中若没有子元素则隐藏
-                goods_spec_project.parent().hide();
-            }
-            // 触发生成表格函数
-            triggerCreateTableBySepc();
-        });
-
-        // 监听规格项输入
-        $(document).on('input', '.goods-spec input', function () {
-            triggerCreateTableBySepc();
-            specValueLater();
-        });
-
-        // 触发生成规格明细表格
-        function triggerCreateTableBySepc() {
-            clearTimeout(create_table_by_spec);
-            create_table_by_spec = setTimeout(createTableBySepc, 1000);
-        }
-
-        // 生成规格明细表格
-        function createTableBySepc() {
-            if ($('.goods-spec').length <= 0) { // 没有规格项目,隐藏多规格明细
-                $('#more-spec-lists').hide();
-                return;
-            }
-            $('#more-spec-lists').show(); // 显示多规格明细
-            var table_title = []; // 用于保存 规格项的值
-            var table_data = [];  // 规格项数据
-            var spec_value_temp_arr = []; // 规格值临时数组
-            var i = 0;
-            var table_html = '';
-            var th_html = $('#template-spec-table-th').html(); // 多规格表头模板
-            var tr_html = $('#template-spec-table-tr').html(); // 多规格行模板
-
-            //遍历规格项目
-            $('.goods-spec').each(function () {
-                var spec_name = $(this).find('.spec_name').first().val(); // 规格项的值 例:颜色
-                if (isEmptyString(spec_name)) {
-                    return true;
-                }
-                table_title[i] = spec_name; // 保存 规格项的值  例:['颜色']
-                table_data[i] = []; // 例: [[]]
-                spec_value_temp_arr[i] = []; // 例:[[]]
-                var j = 0;
-                // 遍历 当前规格项目 下的所有 规格值
-                $(this).find('.goods-spec-value .goods-spec-value-input').each(function () {
-                    var spec_value = $(this).val(); // 规格值 例:
-                    var spec_value_temp_id = $(this).attr('spec-value-temp-id'); // 规格值临时id
-                    if (isEmptyString(spec_value)) {
-                        return true;
-                    }
-                    table_data[i][j] = spec_value; // 将 规格值 保存至 规格项 中
-                    spec_value_temp_arr[i][j] = spec_value_temp_id; // 将 规格值临时id 保存至 规格值临时数组 中
-                    j++;
-                });
-                i++;
-            });
-
-            //表格头部组装
-            spec_th_html = '';
-            for (var i in table_title) {
-                spec_th_html += '<th>' + table_title[i] + '</th>';
-            }
-            table_html = th_html.replace('{spec_th}', spec_th_html);
-            // 笛卡尔积, 组装SKU 例:[['颜色', 'S码'], ['颜色', 'M码']]
-            spec_value_temp_arr = cartesianProduct(spec_value_temp_arr);
-            table_data = cartesianProduct(table_data);
-            for (var i in table_data) {
-                var spec_tr_html = '';
-                var tr_name_arr = [];
-                var specs = '';
-                if (Array.isArray(table_data[i])) {
-                    //根据规格创建tr
-                    var spec_value_temp_ids = '';
-                    for (var j in spec_value_temp_arr[i]) {
-                        spec_value_temp_ids += spec_value_temp_arr[i][j] + ',';
-                    }
-                    spec_value_temp_ids = spec_value_temp_ids.substring(0, spec_value_temp_ids.lastIndexOf(','));
-                    spec_tr_html += '<tr spec-value-temp-ids="' + spec_value_temp_ids + '">';
-
-                    for (var j in table_data[i]) {
-                        spec_tr_html += '<td>' + table_data[i][j] + '</td>';
-                        tr_name_arr[j] = table_data[i][j];
-                        specs += table_data[i][j].replace(',', '') + ',';
-                    }
-                } else {
-                    var spec_value_temp_ids = spec_value_temp_arr[i];
-                    spec_tr_html = '<tr spec-value-temp-ids="' + spec_value_temp_ids + '">';
-                    spec_tr_html += '<td>' + table_data[i] + '</td>';
-                    specs += table_data[i].replace(',', '') + ',';
-                }
-                specs = specs.substring(0, specs.lastIndexOf(','));
-                spec_table_data["spec_value_str[]" + spec_value_temp_ids] = specs;
-                spec_tr_html += '<td style="display: none"><input type="hidden" name="spec_value_str[]" value="' + specs + '"><input type="hidden" name="item_id[]" value=""></td>';
-                table_html += tr_html.replace('{spec_td}', spec_tr_html);
-            }
-
-            $('#more-spec-lists-table').html(table_html);
-            setTableValue();
-        };
-
-        //动态渲染已保存的值
-        function setTableValue() {
-            $('#more-spec-lists-table').find('input').each(function () {
-                var key = $(this).attr('name') + $(this).parent().parent().attr('spec-value-temp-ids');
-                if (spec_table_data[key] !== undefined) {
-                    $(this).val(spec_table_data[key]);
-                }
-            });
-            $('.goods-spec-img-div').each(function () {
-                var key = $(this).parent().parent().attr('spec-value-temp-ids');
-                if (spec_table_data["spec_image[]" + key]) {
-                    $(this).html('<input name="spec_image[]" type="hidden" value="' + spec_table_data["spec_image[]" + key] + '"><a class="goods-spec-img-del-x">x</a><img class="goods-spec-img" src="' + spec_table_data["spec_image[]" + key] + '">');
-                }
-            });
-        }
-
-        // 监听添加规格值链接被点击: 弹出多行输出框,处理输入的规格值数据,遍历每个规格值并生成相应的html
-        // $(document).on('click', '.add-spec-value', function () {
-        //     var add_spec_value = $(this);
-        //     layer.prompt({title: '输入规格值,多个请换行', formType: 2}, function (text, index) {
-        //         layer.close(index);
-        //         var specs = text.split('\n');
-        //         for (var i in specs) {
-        //             specs[i] = specs[i].trim();
-        //         }
-        //         specs = unique(specs);
-        //         var added_specs = [];
-        //         add_spec_value.parent().parent().find('.goods-spec-value-input').each(function () {
-        //             added_specs.push($(this).val().trim());
-        //         });
-        //         for (var i in specs) {
-        //             var spec = specs[i].trim();
-        //             if (spec == '' || in_array(spec, added_specs)) {
-        //                 //已存或为空的不添加
-        //                 continue;
-        //             }
-        //             addSpecvalue(add_spec_value, spec, 0);
-        //         }
-        //         specValueLater();
-        //     });
-        // });
-
-        // 添加规格值: 将【数据】填充至【规格值模板】,并将【规格值模板】追加至【添加规格值】链接前
-        function addSpecvalue(add_spec_value, spec, spec_id) {
-            var template_spec_value = $('#template-spec-value').html();
-            var template_spec_value_html = template_spec_value.replace('{spec_value_temp_id}', spec_value_temp_id_number--);
-            template_spec_value_html = template_spec_value_html.replace('{spec_value_id}', spec_id);
-            template_spec_value_html = template_spec_value_html.replace('{spec_value}', spec)
-            add_spec_value.parent().before(template_spec_value_html);
-        }
-
-        //处理每项规格值
-        function specValueLater() {
-            $('.add-spec-value').each(function () {
-                add_spec_value = $(this);
-                var spec_values = '';
-                add_spec_value.parent().parent().find('.goods-spec-value-input').each(function () {
-                    spec_values += $(this).val() + ',';
-                });
-                add_spec_value.parent().find('.spec_values').val(spec_values.substring(0, spec_values.lastIndexOf(',')));
-
-                var spec_value_ids = '';
-                add_spec_value.parent().parent().find('.goods-sepc-value-id-input').each(function () {
-                    spec_value_ids += $(this).val() + ',';
-                });
-                add_spec_value.parent().find('.spec_value_ids').val(spec_value_ids.substring(0, spec_value_ids.lastIndexOf(',')));
-                triggerCreateTableBySepc();
-            });
-        }
-
-        // 显示或隐藏 规格值删除按钮
-        $(document).on('mouseenter', '.goods-spec-value', function () {
-            $(this).find('.goods-spec-value-del-x').show();
-        });
-
-        $(document).on('mouseleave', '.goods-spec-value', function () {
-            $(this).find('.goods-spec-value-del-x').hide();
-        });
-
-        //删除规格值
-        $(document).on('click', '.goods-spec-value-del-x', function () {
-            var add_spec_value = $(this).parent().parent().find('.add-spec-value').first();
-            $(this).parent().remove();
-            specValueLater();
-            triggerCreateTableBySepc();
-        });
-
-        // 监听规格明细输入,规格数据本地保存
-        $(document).on('input', '#more-spec-lists-table input', function () {
-            var key = $(this).attr('name') + $(this).parent().parent().attr('spec-value-temp-ids');
-            spec_table_data[key] = $(this).val();
-        });
-
-        //批量填充
-        $(document).on('click', '.batch-spec-content', function () {
-            var title = $(this).text();
-            var input_name = $(this).attr('input-name');
-            layer.prompt({
-                formType: 3
-                , title: '批量填写' + title
-            }, function (value, index, elem) {
-                $('input[name="' + input_name + '[]"]').val(value);
-                //保存值到本地
-                $('#more-spec-lists-table input').each(function () {
-                    var key = $(this).attr('name') + $(this).parent().parent().attr('spec-value-temp-ids');
-                    spec_table_data[key] = $(this).val();
-                });
-                layer.close(index);
-            });
-        });
-        //------------------------------------------规格型号 end ------------------------------------
-
-        //------------------------------------------富文本编辑器 begin --------------------------------
-        layEditor.set({
-            uploadImage: {
-                url: '{:url("file/lists")}?type=10'
-            },
-        })
-        var ieditor = layEditor.build('content')
-        form.verify({
-            content: function(value) {
-                return layEditor.sync(ieditor);
-            }
-        });
-        //------------------------------------------富文本编辑器 end --------------------------------
-
-
-        //------------------------------------------切换商品类型 begin --------------------------------
-        // 切换商品类型
-        function switchGoodsType(type) {
-            if(type == '1') {
-                // 虚拟商品
-                $('.virtual-goods-data').show();
-                $('.actual-goods-data').hide();
-                // 配送方式
-                $('.delivery_virtual').show();
-                $('.delivery_express').hide();
-            } else {
-                // 实物商品
-                $('.virtual-goods-data').hide();
-                $('.actual-goods-data').show();
-                // 配送方式
-                $('.delivery_virtual').hide();
-                $('.delivery_express').show();
-            }
-        }
-
-        // 初始选中配送方式
-        function initDeliveryType(type) {
-            if(type == '1') {
-                $('input[name="delivery_type[]"][value=1]').prop("checked", false);
-                $('input[name="delivery_type[]"][value=2]').prop("checked", true);
-            } else {
-                $('input[name="delivery_type[]"][value=1]').prop("checked", true);
-                $('input[name="delivery_type[]"][value=2]').prop("checked", false);
-            }
-            form.render();
-        }
-
-        // 渲染
-        function renderDeliveryType(delivery_type, goods_type) {
-            delivery_type = delivery_type.split(',');
-            if (delivery_type == 'null' || delivery_type == '' ||  delivery_type.length <= 0) {
-                console.log('delivery_type是空的');
-                return initDeliveryType(goods_type);
-            }
-            for (var i = 0; i < delivery_type.length; i++) {
-                console.log("input[name=delivery_type][value=" + delivery_type[i] + "]");
-                $('input[name="delivery_type[]"][value=' + delivery_type[i] + ']').prop("checked", true);
-            }
-            form.render();
-        }
-        //------------------------------------------切换商品类型 end --------------------------------
-
-        //------------------------------------ -----编辑页面 begin --------------------------------
-        {notempty name='info'}
-        var goods_info= {$info|raw|default=''};
-
-        // 商品类型
-        $("input[name=type][value="+goods_info['base']['type']+"]").prop("checked",true);
-        switchGoodsType(goods_info['base']['type']);
-        // 买家付款后 发货后 发货内容
-        $("input[name=after_pay][value="+goods_info['base']['after_pay']+"]").prop("checked",true);
-        $("input[name=after_delivery][value="+goods_info['base']['after_delivery']+"]").prop("checked",true);
-        $('textarea[name="delivery_content"]').val(goods_info['base']['delivery_content']);
-        // 配送方式
-        renderDeliveryType(goods_info['base']['delivery_type'], goods_info['base']['type']);
-
-        $('input[name="goods_id"]').val(goods_info['base']['id']);
-        $('input[name="name"]').val(goods_info['base']['name']);
-        $('input[name="code"]').val(goods_info['base']['code']);
-        setSelectFirst(goods_info['base']['first_cate_id']);
-        setSelectSecond(goods_info['base']['second_cate_id']);
-        setSelectThird(goods_info['base']['third_cate_id']);
-        like.setSelect(goods_info['base']['shop_cate_id'], shop_category_lists, "shop_cate_id", '分类');
-        $('input[name="remark"]').val(goods_info['base']['remark']);
-        like.setSelect(goods_info['base']['unit_id'], unit, "unit_id", '单位');
-        like.setSelect(goods_info['base']['brand_id'], brands, "brand_id", '品牌');
-        like.setSelect(goods_info['base']['supplier_id'], supplier, "supplier_id", '供应商');
-
-        //渲染商品主图
-        if(goods_info['base']['image']){
-            var html = '' +
-                '<div class="upload-image-div">' +
-                '<img src="' + goods_info['base']['image'] + '" alt="img" />' +
-                '<input type="hidden" name="image" value="' + goods_info['base']['image'] + '">' +
-                // '<div class="del-upload-btn">x</div>' +
-                '</div>' +
-                '<div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="image"> + 添加图片</a></div>';
-            $('#imageContainer').html(html);
-        }
-
-        //渲染分享海报
-        if(goods_info['base']['poster']){
-            var html = '' +
-                '<div class="upload-image-div">' +
-                '<img src="' + goods_info['base']['poster'] + '" alt="img" />' +
-                '<input type="hidden" name="poster" value="' + goods_info['base']['poster'] + '">' +
-                // '<div class="del-upload-btn">x</div>' +
-                '</div>' +
-                '<div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="image"> + 添加图片</a></div>';
-            $('#posterContainer').html(html);
-        }
-
-        // 渲染视频
-        if(goods_info['base']['video']){
-            var html = '' +
-                '<div class="upload-video-div">' +
-                '<video src="' + goods_info['base']['video'] + '"></video>' +
-                '<input type="hidden" name="video" value="' + goods_info['base']['video'] + '">' +
-                // '<div class="del-upload-btn">x</div>' +
-                '</div>' +
-                '<div class="upload-image-elem" style="display:none;"><a class="add-upload-video" id="video"> + 添加视频</a></div>';
-            $('#videoContainer').html(html);
-        }
-
-        //渲染商品轮播图
-        if(goods_info['base']['goods_image']){
-            var html = '';
-            for(j = 0; j < goods_info['base']['goods_image'].length; j++) {
-                html = html +
-                    '<div class="upload-image-div">' +
-                    '<img src="' + goods_info['base']['goods_image'][j]['abs_image'] + '" alt="img" />' +
-                    '<input type="hidden" name="goods_image[]" value="' + goods_info['base']['goods_image'][j]['abs_image'] + '">' +
-                    // '<div class="del-upload-btn">x</div>' +
-                    '</div>';
-            }
-            html = html + '<div class="upload-image-elem"><a class="add-upload-image" id="goodsimage"> + 添加图片</a></div>';
-            $('#goodsImageContainer').html(html);
-        }
-
-        // 规格类型
-        $("input[name=spec_type][value="+goods_info['base']['spec_type']+"]").prop('checked',"true");
-
-        $('input[name="stock_warn"]').val(goods_info['base']['stock_warn']);
-        $("input[name=is_show_stock][value="+goods_info['base']['is_show_stock']+"]").prop("checked",true);  //是否显示库存
-        $("input[name=express_type][value="+goods_info['base']['express_type']+"]").prop("checked",true);
-        $('input[name="express_money"]').val(goods_info['base']['express_money']);
-        like.setSelect(goods_info['base']['express_template_id'], freight, "express_template_id", '运费模板');
-        $("input[name=is_member][value="+goods_info['base']['is_member']+"]").prop("checked",true);   //会员价是否开启
-        $('input[name="sort"]').val(goods_info['base']['sort']);  //商品排序
-        $("input[name=is_recommend][value="+goods_info['base']['is_recommend']+"]").prop("checked",true); // 是否推荐
-        $("input[name=status][value="+goods_info['base']['status']+"]").prop("checked",true);   //销售状态
-
-        $("input[name=is_distribution][value="+goods_info['base']['is_distribution']+"]").prop("checked",true);
-        $('input[name="first_ratio"]').val(goods_info['base']['first_ratio']);  //一级分销
-        $('input[name="second_ratio"]').val(goods_info['base']['second_ratio']); //二级分销
-        $('input[name="third_ratio"]').val(goods_info['base']['third_ratio']); //三级分销
-
-        form.render();
-
-        switchSpecType(goods_info['base']['spec_type']);
-
-        if(goods_info['base']['spec_type'] == 1){ // 单规格
-            var html = '' +
-                '<div class="upload-image-div">' +
-                '<img src="' + goods_info['item'][0]['image'] + '" alt="img" />' +
-                '<input type="hidden" name="one_spec_image" value="' + goods_info['item'][0]['image'] + '">' +
-                '<div class="del-upload-btn">x</div>' +
-                '</div>' +
-                '<div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="one_spec_image"> + 添加图片</a></div>';
-            if(goods_info['item'][0]['image']){
-                $('#one_spec_image').parent().parent().html(html);
-            }
-            $('input[name="one_market_price"]').val(goods_info['item'][0]['market_price']);
-            $('input[name="one_price"]').val(goods_info['item'][0]['price']);
-            $('input[name="one_chengben_price"]').val(goods_info['item'][0]['chengben_price']);
-            $('input[name="one_stock"]').val(goods_info['item'][0]['stock']);
-            $('input[name="one_volume"]').val(goods_info['item'][0]['volume']);
-            $('input[name="one_weight"]').val(goods_info['item'][0]['weight']);
-            $('input[name="one_bar_code"]').val(goods_info['item'][0]['bar_code']);
-        }
-        if(goods_info['base']['spec_type'] == 2) { // 多规格
-            for(var i in goods_info['spec']){
-                addSpec(goods_info['spec'][i]['name']);
-                var spes_values = goods_info['spec'][i]['values'];
-                for(var j in  spes_values){
-                    addSpecvalue($('.add-spec-value').eq(i),spes_values[j]['value'],spes_values[j]['id']);
-                }
-
-            }
-            for(var i in goods_info['spec']){
-                $('input[name="spec_id[]"]').eq(i).val(goods_info['spec'][i]['id']);
-            }
-            specValueLater();
-            createTableBySepc();
-            for(var i in goods_info['item']){
-                $('#more-spec-lists-table tbody tr').each(function() {
-                    var spec_value_str = $(this).find('input[name="spec_value_str[]"]').first().val();
-                    if(spec_value_str == goods_info['item'][i]['spec_value_str']){
-                        spec_value_temp_ids = $(this).attr('spec-value-temp-ids');
-                        spec_table_data["spec_image[]"+spec_value_temp_ids] = goods_info['item'][i]['abs_image'];
-                        spec_table_data["price[]"+spec_value_temp_ids] = goods_info['item'][i]['price'];
-                        spec_table_data["chengben_price[]"+spec_value_temp_ids] = goods_info['item'][i]['chengben_price'];
-                        spec_table_data["market_price[]"+spec_value_temp_ids] = goods_info['item'][i]['market_price'];
-                        spec_table_data["stock[]"+spec_value_temp_ids] = goods_info['item'][i]['stock'];
-                        spec_table_data["volume[]"+spec_value_temp_ids] = goods_info['item'][i]['volume'];
-                        spec_table_data["weight[]"+spec_value_temp_ids] = goods_info['item'][i]['weight'];
-                        spec_table_data["bar_code[]"+spec_value_temp_ids] = goods_info['item'][i]['bar_code'];
-                        spec_table_data["item_id[]"+spec_value_temp_ids] = goods_info['item'][i]['id'];
-                        spec_table_data["spec_value_str[]"+spec_value_temp_ids] = goods_info['item'][i]['spec_value_str'];
-                        return false;
-                    }
-                });
-            }
-            setTableValue();
-        }
-        layEditor.setContent(ieditor,goods_info['base']['content']);
-        form.render();
-
-        // 页面所有元素设置为只读
-        setTimeout(function(){
-            $("input").attr('readonly', true);
-            $("textarea").attr('readonly', true);
-            $(':radio').attr('disabled', true);
-            $(':checkbox').attr('disabled', true);
-            $(':button').attr('disabled', true);
-            $('a').removeAttr('onclick');
-        }, 1500);
-        {/notempty}
-            //-----------------------------------------编辑页面 end --------------------------------
-        });
-</script>

+ 0 - 31
app/admin/view/goods/goods/audit.html

@@ -1,31 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .redReq::before {
-        content: '*';
-        color: red;
-        margin-right: 5px;
-    }
-</style>
-<div class="layui-form">
-    <input type="hidden" name="goods_id" value="{$goods_id}" />
-    <div class="layui-form-item" style="margin-top: 15px;">
-        <label class="layui-form-label redReq">审核状态</label>
-        <div class="layui-input-block">
-            <input type="radio" name="audit_status" value="1" title="审核通过">
-            <input type="radio" name="audit_status" value="2" title="审核不通过" checked>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label redReq">审核说明</label>
-        <div class="layui-input-block" style="width: 500px;">
-            <textarea name="audit_remark" class="layui-textarea" style="height: 150px;"></textarea>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">商家可以查看审核说明</span>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="audit-submit" id="audit-submit" value="确认">
-    </div>
-</div>

+ 0 - 151
app/admin/view/goods/goods/goods_base.html

@@ -1,151 +0,0 @@
-<div class="layui-tab-item goods-content layui-show">
-    <div class="layui-card-body" pad15>
-        <div>
-            <!-- 商品类型 -->
-            <div class="layui-form-item">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品类型:</label>
-                <div class="layui-input-block">
-                    <input type="radio" name="type" value="0" title="实物商品" class="layui-input"/>
-                    <input type="radio" name="type" value="1" title="虚拟商品" class="layui-input"  />
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <span style="color: #a3a3a3;font-size: 9px">选择好商品类型之后,编辑时不能修改类型。请谨慎选择</span>
-            </div>
-            <!--商品名称-->
-            <div class="layui-form-item">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品名称:</label>
-                <div class="layui-input-block">
-                    <input name="goods_id" type="hidden">
-                    <input type="text" name="name" lay-verify="custom_required" lay-verType="tips"
-                           autocomplete="off" maxlength="64"
-                           switch-tab="0" verify-msg="请输入商品名称,最多64个字符" placeholder="请输入商品名称,最少3个字符,最多64个字符"
-                           class="layui-input">
-                </div>
-            </div>
-            <!--商品编码-->
-            <div class="layui-form-item">
-                <label class="layui-form-label">商品编码:</label>
-                <div class="layui-input-block">
-                    <input type="text" name="code" lay-verType="tips" autocomplete="off" switch-tab="0" class="layui-input">
-                </div>
-            </div>
-            <!--平台分类-->
-            <div class="layui-form-item">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>平台分类:</label>
-                <div class="layui-input-inline">
-                    <select disabled name="first_cate_id" lay-filter="first_category" lay-verify="custom_required"
-                            lay-verType="tips" switch-tab="0" verify-msg="请选择分类">
-                        <option value="">请选择分类</option>
-                    </select>
-                </div>
-                <div class="layui-input-inline">
-                    <select disabled name="second_cate_id" lay-filter="second_category" switch-tab="0" verify-msg="请选择分类">
-                        <option value="">请选择分类</option>
-                    </select>
-                </div>
-                <div class="layui-input-inline">
-                    <select disabled name="third_cate_id" lay-filter="third_category" switch-tab="0" verify-msg="请选择分类">
-                        <option value="">请选择分类</option>
-                    </select>
-                </div>
-            </div>
-            <!--商家分类-->
-            <div class="layui-form-item">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>商家分类:</label>
-                <div class="layui-input-inline">
-                    <select disabled name="shop_cate_id" lay-filter="shop_cate_id" lay-verify="custom_required"
-                            lay-verType="tips" switch-tab="0" verify-msg="请选择分类">
-                    </select>
-                </div>
-            </div>
-            <!--商品卖点-->
-            <div class="layui-form-item">
-                <label class="layui-form-label">商品卖点:</label>
-                <div class="layui-input-block">
-                    <input type="text" maxlength="60" name="remark"  autocomplete="off" class="layui-input">
-                </div>
-            </div>
-            <!--商品单位-->
-            <div class="layui-form-item">
-                <label class="layui-form-label">商品单位:</label>
-                <div class="layui-input-inline">
-                    <select disabled name="unit_id"  switch-tab="0" verify-msg="请选择分类">
-                        <option value="">请选择单位</option>
-                    </select>
-                </div>
-            </div>
-            <!--商品品牌-->
-            <div class="layui-form-item">
-                <label class="layui-form-label">商品品牌:</label>
-                <div class="layui-input-inline">
-                    <select disabled name="brand_id" lay-verType="tips" switch-tab="0" verify-msg="请选择商品品牌">
-                        <option value="">请选择品牌</option>
-                    </select>
-                </div>
-            </div>
-            <!--供货商-->
-            <div class="layui-form-item">
-                <label class="layui-form-label">供货商:</label>
-                <div class="layui-input-inline">
-                    <select disabled name="supplier_id" lay-verType="tips" switch-tab="0" verify-msg="请选择供货商">
-                        <option value="">请选择供货商</option>
-                    </select>
-                </div>
-            </div>
-            <!--商品主图-->
-            <div class="layui-form-item" style="margin-bottom: 0px">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品封面图:</label>
-                <div class="layui-input-block" id="imageContainer">
-                    <div class="like-upload-image">
-                        <div class="upload-image-elem"><a class="add-upload-image" id="image"> + 添加图片</a></div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <span style="color: #a3a3a3;font-size: 9px">建议尺寸:800*800像素</span>
-            </div>
-            <!--自定义分享海报-->
-            <div class="layui-form-item" style="margin-bottom: 0px">
-                <label class="layui-form-label">分享海报:</label>
-                <div class="layui-input-block" id="posterContainer">
-                    <div class="like-upload-image">
-                        <div class="upload-image-elem"><a class="add-upload-image" id="poster"> + 添加图片</a></div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <span style="color: #a3a3a3;font-size: 9px">建议尺寸:800*800像素</span>
-            </div>
-            <!--商品轮播图-->
-            <div class="layui-form-item" style="margin-bottom: 0px">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品轮播图:</label>
-                <div class="layui-input-block" id="goodsImageContainer">
-                    <div class="like-upload-image">
-                        <div class="upload-image-elem"><a class="add-upload-image" id="goodsimage"> + 添加图片</a></div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <span style="color: #a3a3a3;font-size: 9px">建议尺寸:800*800像素,最多上传5张</span>
-            </div>
-            <!--商品视频-->
-            <div class="layui-form-item">
-                <label class="layui-form-label">商品视频:</label>
-                <div class="layui-input-block" id="videoContainer">
-                    <div class="like-upload-video">
-                        <div class="upload-image-elem"><a class="add-upload-video" id="video"> + 添加视频</a></div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-form-item">
-                <label class="layui-form-label"></label>
-                <span style="color: #a3a3a3;font-size: 9px">商品视频,在商品详情页面播放</span>
-            </div>
-        </div>
-    </div>
-</div>

+ 0 - 8
app/admin/view/goods/goods/goods_content.html

@@ -1,8 +0,0 @@
-<div class="layui-tab-item goods-content">
-    <div class="layui-form-item">
-        <label class="layui-form-label">商品详情</label>
-        <div class="layui-input-block">
-            <textarea name="content" id="content" lay-verify="content"></textarea>
-        </div>
-    </div>
-</div>

+ 0 - 45
app/admin/view/goods/goods/goods_distribution.html

@@ -1,45 +0,0 @@
-<div class="layui-tab-item">
-    <!-- 分销设置 -->
-    <div class="layui-form-item">
-        <label class="layui-form-label">分销推广</label>
-        <div class="layui-input-block">
-            <input type="radio" name="is_distribution" value="1" title="开启"  class="layui-input" />
-            <input type="radio" name="is_distribution" value="0" title="不开启" class="layui-input" checked />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">开启后商品可以参与分销推广</span>
-    </div>
-    <!--分销比例-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">一级分销比例:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="first_ratio" autocomplete="off" class="layui-input"  value="">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">一级分销佣金=商品实付金额*一级分销比例</span>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label">二级分销比例:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="second_ratio" autocomplete="off" class="layui-input"  value="">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">二级分销佣金=商品实付金额*二级分销比例</span>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label">三级分销比例:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="third_ratio" autocomplete="off" class="layui-input" />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">三级分销佣金=商品实付金额*三级分销比例</span>
-    </div>
-</div>

+ 0 - 131
app/admin/view/goods/goods/goods_sale_setting.html

@@ -1,131 +0,0 @@
-<div class="layui-tab-item">
-    <!--库存预警-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">库存预警:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="stock_warn" autocomplete="off" class="layui-input"  value="">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">设置最低库存预警值,当库存低于预警值时会出现在库存预警商品列表页,0为不预警</span>
-    </div>
-    <!-- 库存显示 -->
-    <div class="layui-form-item">
-        <label class="layui-form-label">库存显示</label>
-        <div class="layui-input-block">
-            <input type="radio" name="is_show_stock" value="1" title="显示"  class="layui-input" />
-            <input type="radio" name="is_show_stock" value="0" title="不显示" class="layui-input" checked />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">商品详情显示剩余库存数量</span>
-    </div>
-
-    <!--配送方式-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">配送方式:</label>
-        <div class="layui-input-block">
-            <div class="delivery_express">
-                <input type="checkbox" name="delivery_type[]" value="1" lay-skin="primary" title="快递发货"/>
-                <input type="checkbox" name="delivery_type[]" value="3" lay-skin="primary" title="线下自提"/>
-            </div>
-            <div class="delivery_virtual" style="display: none">
-                <input type="checkbox" name="delivery_type[]" value="2" lay-skin="primary" title="虚拟发货"/>
-            </div>
-        </div>
-    </div>
-
-    <!--虚拟商品内容-->
-    <div class="layui-form-item virtual-goods-data" style="display: none">
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span class="form-label-asterisk">*</span>买家付款后:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="after_pay" value="1" title="自动发货"  class="layui-input" checked/>
-                <input type="radio" name="after_pay" value="2" title="手动发货" class="layui-input" />
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span class="form-label-asterisk">*</span>发货后:</label>
-            <div class="layui-input-block">
-                <input type="radio" name="after_delivery" value="1" title="自动完成订单"  class="layui-input" checked/>
-                <input type="radio" name="after_delivery" value="2" title="需要买家确认收货" class="layui-input" />
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"><span class="form-label-asterisk">*</span>发货内容:</label>
-            <div class="layui-input-block" style="width: 50%">
-                <textarea name="delivery_content" autocomplete="off" class="layui-textarea" placeholder="多行输入"></textarea>
-            </div>
-        </div>
-    </div>
-
-    <!--快递运费-->
-    <div class="layui-form-item actual-goods-data">
-        <label class="layui-form-label"><span class="form-label-asterisk">*</span>快递运费:</label>
-        <div class="layui-input-inline">
-            <input type="radio"  name="express_type" value="1" title="包邮" checked>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-inline" style="margin-right: 0px;width: auto">
-                <input type="radio" name="express_type" value="2" title="统一运费">
-            </div>
-            <div class="layui-input-inline" style="width: 180px">
-                <input type="number" name="express_money" class="layui-input">
-            </div>
-            <div class="unit-tips">元</div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-inline" style="margin-right: 0px;width: auto">
-                <input type="radio" name="express_type" value="3" title="运费模板">
-            </div>
-            <div class="layui-input-inline" style="width: 180px">
-                <select disabled name="express_template_id">
-                    <option value=""></option>
-                </select>
-            </div>
-        </div>
-    </div>
-    <!-- 会员价 -->
-    <div class="layui-form-item">
-        <label class="layui-form-label">会员价</label>
-        <div class="layui-input-block">
-            <input type="radio" name="is_member" value="0" title="不参与会员价"  class="layui-input" />
-            <input type="radio" name="is_member" value="1" title="参与会员价" class="layui-input" checked />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">根据会员等级设置的会员折扣自动打折,拼团和秒杀等营销活动不参与会员折扣</span>
-    </div>
-    <!--商品排序-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">商品排序:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="sort" autocomplete="off" class="layui-input"  value="">
-        </div>
-    </div>
-    <!--店内推荐-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">店内推荐:</label>
-        <div class="layui-input-block">
-            <input type="radio" name="is_recommend" value="1" title="推荐" lay-verify="is_recommend" >
-            <input type="radio" name="is_recommend" value="0" title="不推荐"lay-verify="is_recommend" checked>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">勾选店内推荐后,推荐商品会在相关推荐位显示</span>
-    </div>
-    <!--销售状态-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span class="form-label-asterisk">*</span>销售状态:</label>
-        <div class="layui-input-block">
-            <input type="radio" name="status" value="1" title="立即上架" verify-msg="选择销售状态" lay-verify="status" >
-            <input type="radio" name="status" value="0" title="放入仓库" verify-msg="选择销售状态" lay-verify="status" checked>
-        </div>
-    </div>
-</div>

+ 0 - 191
app/admin/view/goods/goods/goods_spec.html

@@ -1,191 +0,0 @@
-<div class="layui-tab-item goods-content">
-    <!--规格型号-->
-    <div class="layui-card-body" pad15>
-        <div lay-filter="">
-            <div class="layui-form-item">
-                <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品规格:</label>
-                <div class="layui-input-block">
-                    <input type="radio" name="spec_type" lay-filter="spec-type" value="1" title="统一规格" checked>
-                    <input type="radio" name="spec_type" lay-filter="spec-type" value="2" title="多规格">
-                </div>
-            </div>
-            <!-- 规格项 -->
-            <div class="layui-form-item" style="display: none">
-                <label class="layui-form-label"></label>
-                <div class="layui-input-block goods-spec-div" id="goods-spec-project">
-                </div>
-            </div>
-            <!-- 添加规格项目按钮 -->
-            <div class="layui-form-item" style="display: none">
-                <label class="layui-form-label"></label>
-                <button class="layui-btn layui-btn-normal layui-btn-sm" id="add-spec" lay-verify="add_more_spec"
-                        lay-verType="tips" autocomplete="off" switch-tab="1" verify-msg="至少添加一个规格">添加规格项目
-                </button>
-                <br>
-                <span style="color: #a3a3a3;font-size: 9px;margin-left:130px;">最多支持3个规格项</span>
-            </div>
-            <!-- 统一规格 -->
-            <div class="layui-form-item" id="one-spec-lists">
-                <label class="layui-form-label">规格明细:</label>
-                <div class="layui-input-block goods-spec-div">
-                    <table id="one-spec-lists-table" class="layui-table spec-lists-table" lay-size="sm">
-                        <colgroup>
-                            <col width="60px">
-                        </colgroup>
-                        <thead>
-                        <tr style="background-color: #f3f5f9">
-                            <th>规格图片</th>
-                            <th><span class="form-label-asterisk">*</span>市场价(元)</th>
-                            <th><span class="form-label-asterisk">*</span>价格(元)</th>
-                            <th><span class="form-label-asterisk">*</span>成本价(元)</th>
-                            <th><span class="form-label-asterisk">*</span>库存</th>
-                            <th><span class="form-label-asterisk">*</span>重量(kg)</th>
-                            <th><span class="form-label-asterisk">*</span>体积(m3)</th>
-                            <th>条码</th>
-                        </tr>
-                        </thead>
-                        <tbody>
-                        <tr>
-                            <td>
-                                <div class="like-upload-image goods-spec-img-div">
-                                    <div class="upload-image-elem"><a class="add-upload-image" id="one_spec_image"> + 添加图片</a></div>
-                                </div>
-                            </td>
-                            <td><input type="number" class="layui-input"
-                                       lay-verify="one_spec_required|one_market_price"
-                                       lay-verType="tips"
-                                       autocomplete="off" switch-tab="1" verify-msg="请输入市场价"
-                                       name="one_market_price"></td>
-                            <td><input type="number" class="layui-input"
-                                       lay-verify="one_spec_required|one_price"
-                                       lay-verType="tips"
-                                       autocomplete="off" switch-tab="1" verify-msg="请输入价格"
-                                       name="one_price"></td>
-                            <td><input type="number" class="layui-input"
-                                       lay-verify="one_spec_required|one_chengben_price"
-                                       lay-verType="tips"
-                                       autocomplete="off" switch-tab="1" verify-msg="请输入成本价"
-                                       name="one_chengben_price"></td>
-                            <td><input type="number" class="layui-input" lay-verify="one_spec_required|one_stock"
-                                       lay-verType="tips"
-                                       autocomplete="off" switch-tab="1" verify-msg="请输入库存" name="one_stock">
-                            </td>
-                            <td><input type="number" class="layui-input"
-                                       lay-verify="one_spec_required|one_weight" name="one_weight"
-                                       lay-verType="tips" autocomplete="off" switch-tab="1" verify-msg="请输入重量"></td>
-                            <td><input type="number" class="layui-input" lay-verify="one_spec_required|one_volume" lay-verType="tips"
-                                       name="one_volume" autocomplete="off" switch-tab="1" verify-msg="请输入体积"></td>
-                            <td><input type="number" name="one_bar_code" class="layui-input"
-                                       lay-verType="tips" autocomplete="off" switch-tab="1" verify-msg="请输入条码"></td>
-                        </tr>
-                        </tbody>
-                    </table>
-                </div>
-            </div>
-            <!-- 多规格 -->
-            <div class="layui-form-item" id="more-spec-lists" style="display: none">
-                <label class="layui-form-label">规格明细:</label>
-                <div class="layui-input-block goods-spec-div">
-<!--                    <div class="batch-div"><span class="batch-spec-title">批量设置:</span>-->
-<!--                        <div>-->
-<!--                            <span class="batch-spec-content click-a" input-name="market_price">市场价</span>-->
-<!--                            <span class="batch-spec-content click-a" input-name="price">价格</span>-->
-<!--                            <span class="batch-spec-content click-a" input-name="chengben_price">成本价</span>-->
-<!--                            <span class="batch-spec-content click-a" input-name="stock">库存</span>-->
-<!--                            <span class="batch-spec-content click-a" input-name="weight">重量</span>-->
-<!--                            <span class="batch-spec-content click-a" input-name="volume">体积</span>-->
-<!--                            <span class="batch-spec-content click-a" input-name="bar_code">条码</span>-->
-<!--                        </div>-->
-<!--                    </div>-->
-                    <table id="more-spec-lists-table" class="layui-table spec-lists-table" lay-size="sm">
-                    </table>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-
-<!--规格项模板-->
-<script type="text/html" id="template-spec">
-    <div class="goods-spec-div goods-spec" lay-verify="add_more_spec|repetition_spec_name" lay-verType="tips"
-         autocomplete="off"
-         switch-tab="1" verify-msg="至少添加一个规格,且规格需要规格值">
-        <a class="goods-spec-del-x" style="display: none;">x</a>
-        <div class="layui-form-item"><label class="layui-form-label">规格项:</label>
-            <div class="layui-input-block" style="width: 500px">
-                <div class="layui-input-inline">
-                    <input type="hidden" name="spec_id[]" value="0">
-                    <input type="text" name="spec_name[]" lay-verify="more_spec_required" lay-verType="tips"
-                           switch-tab="1"
-                           verify-msg="规格项不能为空"
-                           placeholder="请填写规格名" autocomplete="off" class="layui-input spec_name" value="{value}">
-                </div>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label"></label>
-            <div class="layui-input-block goods-spec-value-dev" lay-verify="repetition_spec_value" lay-verType="tips"
-                 switch-tab="1">
-                <div class="layui-input-inline">
-                    <input type="hidden" class="spec_values" name="spec_values[]" value="">
-                    <input type="hidden" class="spec_value_ids" name="spec_value_ids[]" value="">
-                    <a href="#" class="add-spec-value">+ 添加规格值</a>
-                </div>
-            </div>
-        </div>
-    </div>
-</script>
-
-<!--规格值模板-->
-<script type="text/html" id="template-spec-value">
-    <div class="layui-input-inline goods-spec-value" style="width: 90px">
-<!--        <a class="goods-spec-value-del-x" style="display: none;">x</a>-->
-        <input value="{spec_value}" spec-value-temp-id="{spec_value_temp_id}" class="layui-input goods-spec-value-input"
-               placeholder="规格值"
-               lay-verify="more_spec_required" lay-verType="tips" switch-tab="1" verify-msg="规格值不能为空">
-        <input type="hidden" class="goods-sepc-value-id-input" value="{spec_value_id}">
-    </div>
-</script>
-<!-- 多规格表头模板 -->
-<script type="text/html" id="template-spec-table-th">
-    <colgroup>
-        <col width="60px">
-    </colgroup>
-    <thead>
-    <tr style="background-color: #f3f5f9">
-        {spec_th}
-        <th>规格图片</th>
-        <th><span class="form-label-asterisk">*</span>市场价(元)</th>
-        <th><span class="form-label-asterisk">*</span>价格(元)</th>
-        <th><span class="form-label-asterisk">*</span>成本价(元)</th>
-        <th><span class="form-label-asterisk">*</span>库存</th>
-        <th><span class="form-label-asterisk">*</span>重量(kg)</th>
-        <th><span class="form-label-asterisk">*</span>体积(m3)</th>
-        <th>条码</th>
-    </tr>
-    </thead>
-</script>
-<!--多规格行模板-->
-<script type="text/html" id="template-spec-table-tr">
-    {spec_td}
-    <td>
-        <div class="like-upload-image goods-spec-img-div">
-            <div class="upload-image-elem"><a class="add-upload-image more_spec_image"> + 添加图片</a></div>
-        </div>
-    </td>
-    <td><input type="number" class="layui-input" lay-verify="more_spec_required|more_market_price" lay-verType="tips"
-               autocomplete="off" switch-tab="1" verify-msg="请输入市场价" name="market_price[]"></td>
-    <td><input type="number" class="layui-input" lay-verify="more_spec_required|more_price" lay-verType="tips"
-               autocomplete="off" switch-tab="1" verify-msg="请输入价格" name="price[]"></td>
-    <td><input type="number" class="layui-input" lay-verify="more_spec_required|more_chengben_price" lay-verType="tips"
-               autocomplete="off" switch-tab="1" verify-msg="请输入成本价" name="chengben_price[]"></td>
-    <td><input type="number" class="layui-input" lay-verify="more_spec_required|more_stock" lay-verType="tips"
-               autocomplete="off" switch-tab="1" verify-msg="请输入库存" name="stock[]"></td>
-    <td><input type="number" class="layui-input" lay-verify="more_spec_required|more_weight" lay-verType="tips"
-               name="weight[]" autocomplete="off" switch-tab="1" verify-msg="请输入重量"></td>
-    <td><input type="number" class="layui-input" lay-verify="more_spec_required|more_volume" lay-verType="tips"
-               name="volume[]" autocomplete="off" switch-tab="1" verify-msg="请输入体积"></td>
-    <td><input type="number" name="bar_code[]" class="layui-input"
-               lay-verType="tips" autocomplete="off" switch-tab="1"></td>
-    </tr>
-</script>

+ 0 - 529
app/admin/view/goods/goods/lists.html

@@ -1,529 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height: auto;
-    }
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!--操作提示-->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*平台审核商家发布的商品,当商品审核通过并且处于销售中状态时,商家可以销售该商品</p>
-                        <p>*平台可通过“违规重审”,下架违规商品并标记为审核未通过。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!--搜索条件-->
-        <div class="layui-card-body layui-form">
-            <div class="layui-form-item">
-                <div class="layui-inline">
-                    <label class="layui-form-label">商家名称:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" name="shop_name" id="shop_name" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">商品名称:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" name="goods_name" id="goods_name" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">商品类型:</label>
-                    <div class="layui-input-block">
-                        <select name="goods_type" id="goods_type" >
-                            <option value="">全部</option>
-                            {foreach $goods_type as $key => $val }
-                            <option value="{$key}">{$val}</option>
-                            {/foreach}
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">平台分类:</label>
-                    <div class="layui-input-block">
-                        <select name="platform_cate_id" id="platform_cate_id"  placeholder="请选择平台商品分类" >
-                            <option value="0">全部</option>
-                            {foreach $cate_list as $val }
-                            <option value="{$val.id}">{$val.html}{$val.name}</option>
-                            {/foreach}
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <label class="layui-form-label">商品栏目:</label>
-                    <div class="layui-input-block">
-                        <select name="goods_column_id" id="goods_column_id"  placeholder="请选择商品栏目" >
-                            <option value="">全部</option>
-                            {foreach $column_list as $val }
-                            <option value="{$val.id}">{$val.name}</option>
-                            {/foreach}
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-inline">
-                    <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">查询</button>
-                    <button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</button>
-                </div>
-            </div>
-        </div>
-
-        <!-选项卡-->
-        <div class="layui-tab layui-tab-card" lay-filter="like-tabs">
-            <ul class="layui-tab-title">
-                <li data-type='1' class="layui-this">销售中商品({$statistics.sell})</li>
-                <li data-type='2' >仓库中商品({$statistics.warehouse})</li>
-                <li data-type='3' >回收站商品({$statistics.recycle})</li>
-                <li data-type='4' >待审核商品({$statistics.audit_stay})</li>
-                <li data-type='5' >审核未通过商品({$statistics.audit_refuse})</li>
-            </ul>
-
-            <div class="layui-tab-content" style="padding: 0 15px;">
-                <div class="layui-btn-container" style="margin-top: 10px">
-                    <button class="layui-btn layui-btn-sm layEvent layui-btn-primary" lay-event="more_audit" id="more_audit" style="display: none">批量审核</button>
-                    <button class="layui-btn layui-btn-sm layEvent layui-btn-primary" lay-event="more_lower" id="more_lower">批量下架</button>
-                </div>
-
-                <table id="goods-lists" lay-filter="goods-lists"></table>
-
-                <script type="text/html" id="shop-info">
-                    <img src="{{d.shop_logo}}" style="height:60px;width: 60px" class="image-show">
-                    <div class="layui-input-inline"  style="text-align: left;">
-                        <p>商家编号:{{d.shop_id}}</p>
-                        <p style="width: 180px;text-overflow:ellipsis;overflow: hidden">商家名称:{{d.shop_name}}</p>
-                        <p>商家类型:{{d.shop_type_desc}}</p>
-                    </div>
-                </script>
-
-                <script type="text/html" id="goods-info">
-                    <img src="{{d.image}}" style="height:60px;width: 60px;margin-right: 5px;" class="image-show"> {{d.name}}
-                </script>
-
-                <script type="text/html" id="price-info">
-                   {{d.min_price}} ~ {{d.max_price}}
-                </script>
-
-                <script type="text/html" id="ratio">
-                    一级分销比例:{{d.first_ratio}}% <br />
-                    二级分销比例:{{d.second_ratio}}% <br />
-                    三级分销比例:{{d.third_ratio}}% <br />
-                </script>
-
-                <script type="text/html" id="goods-operation">
-                    <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="view">查看</a>
-                    <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="set">设置</a>
-                    {{# if( (d.audit_status == 1) ){ }}
-                    <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="re_audit">违规重审</a>
-                    {{# } }}
-                    {{# if( (d.audit_status == 0) ){ }}
-                    <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
-                    {{# } }}
-                </script>
-            </div>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.use(['table', 'form', 'element'], function(){
-        var $ = layui.$
-            ,form = layui.form
-            ,table = layui.table
-            ,element = layui.element;
-
-        //监听搜索
-        form.on('submit(search)', function(data){
-            var field = data.field;
-            //执行重载
-            table.reload('goods-lists', {
-                where: field,
-                page: {curr: 1}
-            });
-            updateTabNumber();
-        });
-
-        //清空查询
-        form.on('submit(clear-search)', function(){
-            $('#shop_name').val('');
-            $('#goods_name').val('');
-            $('#goods_type').val('');
-            $('#platform_cate_id').val('');
-            $('#shop_cate_id').val('');
-            $('#goods_column_id').val('');
-            form.render('select');
-            //刷新列表
-            table.reload('goods-lists', {
-                where: [], page: {curr: 1}
-            });
-            updateTabNumber();
-        });
-
-
-        $('.layui-btn.layuiadmin-btn-goods').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-
-        //获取列表
-        getList(1); // 初始加载获取销售中的商品
-        //切换列表
-        element.on('tab(like-tabs)', function (data) {
-            var type = $(this).attr('data-type');
-            // 重置搜索模块
-            $('#shop_name').val('');
-            $('#goods_name').val('');
-            $('#platform_cate_id').val('');
-            $('#shop_cate_id').val('');
-            $('#goods_column_id').val('');
-            form.render('select');
-
-            if (type == 4) {
-                $("#more_audit").show();
-            }else {
-                $("#more_audit").hide();
-            }
-            if (type == 1 || type == 2 || type == 3) {
-                $("#more_lower").show();
-            }else {
-                $("#more_lower").hide();
-            }
-            // 重新获取商品列表
-            getList(type);
-        });
-
-        //监听工具条
-        table.on('tool(goods-lists)', function(obj){
-            var id = obj.data.id;
-            var name = obj.data.name;
-
-            if(obj.event === 'view') {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '查看'
-                    ,content: '{:url("goods.goods/view")}?goods_id='+id
-                    ,area: ['90%', '90%']
-                    ,btn: ['确定', '返回']
-                    ,maxmin: true
-                    ,yes: function(index, layero){
-                        layer.close(index);
-                    }
-                    ,cancel: function(index, layero){
-                        layer.close(index);
-                    }
-                });
-            }
-            if(obj.event === 're_audit') {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '违规重审'
-                    ,content: '{:url("goods.goods/reAudit")}?goods_id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '返回']
-                    ,scrollbar: false
-                    ,maxmin: true
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'reaudit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.goods/reAudit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1)
-                                    {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        },function () {
-                                            // window.location.href = window.location.href;
-                                            updateTabNumber();
-                                            table.reload('goods-lists');
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                        layer.close(index);
-                    }
-                    ,cancel: function(index, layero){
-                        layer.close(index);
-                    }
-                });
-            }
-            if(obj.event === 'set') {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '设置'
-                    ,content: '{:url("goods.goods/setInfo")}?goods_id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '返回']
-                    ,scrollbar: false
-                    ,maxmin: true
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'setinfo-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.goods/setInfo")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1)
-                                    {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        },function () {
-                                            // window.location.href = window.location.href;
-                                            layer.close(index);
-                                            updateTabNumber();
-                                            table.reload('goods-lists');
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                    ,cancel: function(index, layero){
-                        layer.close(index);
-                    }
-                });
-            }
-            if(obj.event === 'audit') {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '审核'
-                    ,content: '{:url("goods.goods/audit")}?goods_id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '返回']
-                    ,scrollbar: false
-                    ,maxmin: true
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'audit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.goods/audit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1)
-                                    {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        },function () {
-                                            // window.location.href = window.location.href;
-                                            layer.close(index);
-                                            updateTabNumber();
-                                            table.reload('goods-lists');
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                    ,cancel: function(index, layero){
-                        layer.close(index);
-                    }
-                });
-            }
-        });
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,600);
-        });
-
-        function getList(type) {
-            like.tableLists('#goods-lists', '{:url("goods.goods/lists")}?type='+type, [
-                {type: 'checkbox', fixed: 'left'}
-                ,{title: '商家信息',width:280, templet: '#shop-info'}
-                ,{title: '商品信息',width:280, templet: '#goods-info'}
-                ,{field: 'columnStr', title: '商品栏目',width:220}
-                ,{field: 'price',title: '价格区间(元)', width: 180, align: 'center'}
-                ,{field: 'sales_actual',width: 80,title: '总销售', align: 'center'}
-                ,{field: 'stock',width: 80,title: '总库存', align: 'center'}
-                // ,{field: 'is_distribution_desc',width: 120,title: '分销商品', align: 'center'}
-                // ,{width: 220,title: '分销比例', templet: '#ratio', align: 'center'}
-                ,{field: 'sort_weight',width: 120, title:'排序权重', align: 'center'}
-                ,{field: 'audit_remark', width: 220, title: '审核说明', align: 'center'}
-                ,{field: 'create_time', width: 220,  title:'发布日期', align: 'center'}
-                ,{fixed: 'right', title: '操作', width: 280, align: 'center', toolbar: '#goods-operation'}
-            ]);
-            // if(type == 5) { // 审核未通过,显示审核说明列(注意计时器时间控制,先让动态表格渲染完成,再去移除layui-hide)
-            //     setTimeout(function() {
-            //         $('.layui-table .layui-hide').removeClass('layui-hide');
-            //     }, 1500);
-            // }
-        }
-
-        /**
-         * 更新选项卡 统计数据
-         */
-        function updateTabNumber() {
-            var goods_column = $('#goods_column_id[name=goods_column_id]').val();
-            like.ajax({
-                url: '{:url("goods.goods/totalCount")}',
-                data: {"goods_column_id" : goods_column},
-                type: "GET",
-                success: function (res) {
-                    if (res.code === 1) {
-                        $(".layui-tab-title li[data-type=1]").html("销售中商品(" + res.data.sell + ")");
-                        $(".layui-tab-title li[data-type=2]").html("仓库中商品(" + res.data.warehouse + ")");
-                        $(".layui-tab-title li[data-type=3]").html("回收站商品(" + res.data.recycle + ")");
-                        $(".layui-tab-title li[data-type=4]").html("待审核商品(" + res.data.audit_stay + ")");
-                        $(".layui-tab-title li[data-type=5]").html("审核未通过商品(" + res.data.audit_refuse + ")");
-                    }
-                }
-            });
-        }
-
-
-        //事件
-        var active = {
-            more_audit: function(){
-                var checkStatus = table.checkStatus('goods-lists');
-                var checkData = checkStatus.data;
-                var ids = [];
-                // 取出选中的行ID
-                checkData.forEach(function (item) {
-                    ids.push(parseInt(item['id']));
-                });
-                if (ids.length <= 0) {
-                    layui.layer.msg('请选择商品', {time: 1000});
-                    return false;
-                }
-                layer.open({
-                    type: 2
-                    ,title: '批量审核'
-                    ,content: '{:url("goods.goods/moreAudit")}?ids='+ids
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '返回']
-                    ,scrollbar: false
-                    ,maxmin: true
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'audit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.goods/moreAudit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1)
-                                    {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        },function () {
-                                            layer.close(index);
-                                            updateTabNumber();
-                                            table.reload('goods-lists');
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                    ,cancel: function(index, layero){
-                        layer.close(index);
-                    }
-                });
-            },
-            more_lower: function() {
-                var checkStatus = table.checkStatus('goods-lists');
-                var checkData = checkStatus.data;
-                var ids = [];
-                // 取出选中的行ID
-                checkData.forEach(function (item) {
-                    ids.push(parseInt(item['id']));
-                });
-                if (ids.length <= 0) {
-                    layui.layer.msg('请选择商品', {time: 1000});
-                    return false;
-                }
-                layer.open({
-                    type: 2
-                    ,title: '批量下架'
-                    ,content: '{:url("goods.goods/moreLower")}?ids='+ids
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '返回']
-                    ,scrollbar: false
-                    ,maxmin: true
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'reaudit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.goods/moreLower")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1)
-                                    {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        },function () {
-                                            updateTabNumber();
-                                            table.reload('goods-lists');
-                                        });
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                        layer.close(index);
-                    }
-                    ,cancel: function(index, layero){
-                        layer.close(index);
-                    }
-                });
-            },
-        };
-        like.eventClick(active);
-
-    });
-</script>

+ 0 - 31
app/admin/view/goods/goods/more_audit.html

@@ -1,31 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .redReq::before {
-        content: '*';
-        color: red;
-        margin-right: 5px;
-    }
-</style>
-<div class="layui-form">
-    <input type="hidden" name="ids" value="{$ids}" />
-    <div class="layui-form-item" style="margin-top: 15px;">
-        <label class="layui-form-label redReq">审核状态</label>
-        <div class="layui-input-block">
-            <input type="radio" name="audit_status" value="1" title="审核通过">
-            <input type="radio" name="audit_status" value="2" title="审核不通过" checked>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label redReq">审核说明</label>
-        <div class="layui-input-block" style="width: 500px;">
-            <textarea name="audit_remark" class="layui-textarea" style="height: 150px;"></textarea>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">商家可以查看审核说明</span>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="audit-submit" id="audit-submit" value="确认">
-    </div>
-</div>

+ 0 - 24
app/admin/view/goods/goods/more_lower.html

@@ -1,24 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .redReq::before {
-        content: '*';
-        color: red;
-        margin-right: 5px;
-    }
-</style>
-<div class="layui-form">
-    <input type="hidden" name="ids" value="{$ids}" />
-    <div class="layui-form-item" style="margin-top: 15px;">
-        <label class="layui-form-label redReq">违规原因</label>
-        <div class="layui-input-block" style="width: 800px;">
-            <textarea name="reason" class="layui-textarea" style="height: 150px;"></textarea>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">违规重审会标记为审核未通过,商家可以查看审核说明</span>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="reaudit-submit" id="reaudit-submit" value="确认">
-    </div>
-</div>

+ 0 - 24
app/admin/view/goods/goods/re_audit.html

@@ -1,24 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .redReq::before {
-        content: '*';
-        color: red;
-        margin-right: 5px;
-    }
-</style>
-<div class="layui-form">
-    <input type="hidden" name="goods_id" value="{$goods_id}" />
-    <div class="layui-form-item" style="margin-top: 15px;">
-        <label class="layui-form-label redReq">违规原因</label>
-        <div class="layui-input-block" style="width: 800px;">
-            <textarea name="reason" class="layui-textarea" style="height: 150px;"></textarea>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">违规重审会标记为审核未通过,商家可以查看审核说明</span>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="reaudit-submit" id="reaudit-submit" value="确认">
-    </div>
-</div>

+ 0 - 61
app/admin/view/goods/goods/set_info.html

@@ -1,61 +0,0 @@
-{layout name="layout1" /}
-<div class="layui-form">
-    <input type="hidden" name="goods_id" value="{$goods_id}" />
-    <div class="layui-form-item" style="margin-top: 15px;">
-        <label class="layui-form-label">商品栏目</label>
-        <div class="layui-input-block" style="width: 380px;">
-            <div id="clomunList"></div>
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">勾选商品栏目后,商品会在首页对应栏目展示,可多选</span>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label">虚拟销量</label>
-        <div class="layui-input-block" style="width: 380px;">
-            <input type="number" name="sales_virtual" value="{$goods_detail.sales_virtual}" min="0" class="layui-input" />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label">虚拟浏览量</label>
-        <div class="layui-input-block" style="width: 380px;">
-            <input type="number" name="clicks_virtual" value="{$goods_detail.clicks_virtual}" min="0" class="layui-input" />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label">排序权重</label>
-        <div class="layui-input-block" style="width: 380px;">
-            <input type="number" name="sort_weight" value="{$goods_detail.sort_weight}" min="0" class="layui-input" />
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label"></label>
-        <span style="color: #a3a3a3;font-size: 9px">商品排序权重,数字越小排序越前,权重越大</span>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="setinfo-submit" id="setinfo-submit" value="确认">
-    </div>
-</div>
-<script>
-    layui.config({
-        base: '/static/lib/'
-    }).extend({
-        xmSelect: 'xmSelect/xm-select'
-    }).use(['xmSelect', 'jquery'], function (){
-        var xmSelect = layui.xmSelect;
-        var $ = layui.jquery;
-        var column_list = '{$column_list|raw}';
-        var initValue = '{$goods_detail.column_ids | raw}';
-
-        var xmIns = xmSelect.render({
-            el: '#clomunList',
-            language: 'zn',
-            data: JSON.parse(column_list),
-            prop: {
-                value: 'id'
-            },
-            initValue: JSON.parse(initValue)
-        })
-    });
-</script>

+ 0 - 21
app/admin/view/goods/unit/add.html

@@ -1,21 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-form" lay-filter="layuiadmin-form-unit" id="layuiadmin-form-unit" style="padding: 20px 30px 0 0;">
-    <!--单位名称-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color: red">*</span>单位名称:</label>
-        <div class="layui-input-inline">
-            <input type="text" name="name" lay-verify="required" lay-vertype="tips" autocomplete="off" class="layui-input">
-        </div>
-    </div>
-    <!--排序-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">排序:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="sort" autocomplete="off" class="layui-input" lay-vertype="tips" value="255">
-            <div class=" layui-form-mid layui-word-aux" style="white-space: nowrap">排序值必须为整数;数值越小,越靠前</div>
-        </div>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="unit-submit" id="unit-submit" value="确认">
-    </div>
-</div>

+ 0 - 22
app/admin/view/goods/unit/edit.html

@@ -1,22 +0,0 @@
-{layout name="layout2" /}
-<div class="layui-form" lay-filter="layuiadmin-form-unit" id="layuiadmin-form-unit" style="padding: 20px 30px 0 0;">
-    <input type="hidden" value="{$detail.id}" name="id">
-    <!--单位名称-->
-    <div class="layui-form-item">
-        <label class="layui-form-label"><span style="color: red">*</span>单位名称:</label>
-        <div class="layui-input-inline">
-            <input type="text" name="name" value="{$detail.name}" lay-verify="required" lay-vertype="tips" autocomplete="off" class="layui-input">
-        </div>
-    </div>
-    <!--排序-->
-    <div class="layui-form-item">
-        <label class="layui-form-label">排序:</label>
-        <div class="layui-input-inline">
-            <input type="number" name="sort" value="{$detail.sort}" autocomplete="off" class="layui-input"  lay-vertype="tips">
-            <div class=" layui-form-mid layui-word-aux" style="white-space: nowrap">排序值必须为整数;数值越小,越靠前</div>
-        </div>
-    </div>
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="unit-submit-edit" id="unit-submit-edit" value="确认">
-    </div>
-</div>

+ 0 - 159
app/admin/view/goods/unit/lists.html

@@ -1,159 +0,0 @@
-{layout name="layout1" /}
-<div class="wrapper">
-    <div class="layui-card">
-
-        <!--操作提示-->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*平台商品单位,商家发布商品的时候需要选择对应的商品单位。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-card-body">
-            <!--添加按钮-->
-            <div style="padding-bottom: 10px;">
-                <button class="layui-btn layui-btn-sm layuiadmin-btn-unit {$view_theme_color}" data-type="add">新增商品单位</button>
-            </div>
-
-            <!--表格-->
-            <table id="unit-lists" lay-filter="unit-lists"></table>
-            
-            <script type="text/html" id="unit-operation">
-                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
-                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
-            </script>
-        </div>
-    </div>
-</div>
-
-<script>
-
-    layui.use(['table'], function(){
-        var form = layui.form
-            ,table = layui.table;
-
-        //事件
-        var active = {
-            add: function(){
-                layer.open({
-                    type: 2
-                    ,title: '新增商品单位'
-                    ,content: '{:url("goods.unit/add")}'
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'unit-submit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.unit/add")}',
-                               data:field,
-                               type:"post",
-                               success:function(res)
-                               {
-                                   if(res.code == 1) {
-                                       layui.layer.msg(res.msg, {
-                                           offset: '15px'
-                                           , icon: 1
-                                           , time: 1000
-                                       });
-                                       layer.close(index);
-                                       table.reload('unit-lists');
-                                   }
-                               }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                });
-            }
-        };
-        $('.layui-btn.layuiadmin-btn-unit').on('click', function(){
-            var type = $(this).data('type');
-            active[type] ? active[type].call(this) : '';
-        });
-
-
-        like.tableLists('#unit-lists', '{:url("goods.unit/lists")}', [
-            {field: 'id', width: 60, title: 'ID', sort: true}
-            ,{field: 'name', title: '单位名称', align:"center"}
-            ,{field: 'sort', title: '排序', align:"center", sort:true}
-            ,{title: '操作', align: 'center', fixed: 'right', toolbar: '#unit-operation'}
-        ]);
-
-
-        //监听工具条
-        table.on('tool(unit-lists)', function(obj){
-            if(obj.event === 'del'){
-                var id = obj.data.id;
-                var unitName = "<span style='color: red;'>"+obj.data.name+"</span>";
-                layer.confirm('确定删除商品单位: '+unitName, function(index){
-                    like.ajax({
-                        url:'{:url("goods.unit/del")}',
-                        data:{'id':id},
-                        type:"post",
-                        success:function(res)
-                        {
-                            if(res.code == 1) {
-                                obj.del();
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1000
-                                });
-                                layer.close(index);
-                            }
-                        }
-                    });
-                });
-
-            }else if(obj.event === 'edit'){
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '编辑编辑商品单位'
-                    ,content: '{:url("goods.unit/edit")}?unit_id='+id
-                    ,area: ['60%', '60%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'unit-submit-edit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("goods.unit/edit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1) {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        });
-                                        layer.close(index);
-                                        table.reload('unit-lists');
-                                    }
-                                }
-                            });
-                        });
-
-                        submit.trigger('click');
-                    }
-                })
-            }
-        });
-    });
-</script>

+ 0 - 257
app/admin/view/integral/integral_goods/add.html

@@ -1,257 +0,0 @@
-{layout name="layout2" /}
-<link href="__PUBLIC__/static/lib/layui/layeditor/layedit.css" rel="stylesheet"/>
-<script src="__PUBLIC__/static/lib/layui/layeditor/index.js"></script>
-<script src="__PUBLIC__/static/lib/layui/layeditor/ace/ace.js"></script>
-<style>
-    .layui-form-item .layui-form-label {
-        width: 95px;
-    }
-
-    .layui-form-item .layui-input-inline {
-        width: 240px;
-    }
-
-    .hide-div {
-        display: none;
-    }
-</style>
-
-<div class="layui-card layui-form" style="box-shadow:none;">
-    <div class="layui-tab layui-tab-card" lay-filter="like-tabs">
-        <ul class="layui-tab-title">
-            <li lay-id="1" class="layui-this">基本信息</li>
-            <li lay-id="2">商品详情</li>
-        </ul>
-        <div class="layui-tab-content">
-            <!-- 1、基础设置 -->
-            <div class="layui-tab-item layui-show">
-                <!-- 兑换类型 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>兑换类型:</label>
-                    <div class="layui-input-inline">
-                        <input type="radio" name="type" value="1" title="商品" lay-filter="type" checked>
-                        <input type="radio" name="type" value="2" title="红包" lay-filter="type">
-                    </div>
-                </div>
-
-                <!-- 商家名称 -->
-                <div class="layui-form-item">
-                    <label for="name" class="layui-form-label"><span style="color:red;">*</span>商品名称:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" name="name" id="name" lay-verType="tips"
-                               autocomplete="off" class="layui-input" placeholder="请输入名称">
-                    </div>
-                </div>
-
-                <!-- 商品编号 -->
-                <div class="layui-form-item code">
-                    <label for="name" class="layui-form-label">商品编号:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" name="code" id="code" lay-verType="tips"
-                               autocomplete="off" class="layui-input" placeholder="请输入编号">
-                    </div>
-                </div>
-
-                <!-- 商品封面 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>商品封面:</label>
-                    <div class="layui-input-block">
-                        <div class="like-upload-image">
-                            <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-                        </div>
-                        <div class="layui-form-mid layui-word-aux">建议尺寸:800*800像素</div>
-                    </div>
-                </div>
-
-                <!-- 市场价 -->
-                <div class="layui-form-item">
-                    <label for="market_price" class="layui-form-label">市场价:</label>
-                    <div class="layui-input-inline">
-                        <input type="number" name="market_price" id="market_price" lay-verType="tips" min="0"
-                               autocomplete="off" class="layui-input" placeholder="请输入价格">
-                    </div>
-                </div>
-
-                <!-- 库存 -->
-                <div class="layui-form-item">
-                    <label for="stock" class="layui-form-label"><span style="color:red;">*</span>发放库存:</label>
-                    <div class="layui-input-inline">
-                        <input type="number" name="stock" id="stock" lay-verType="tips" min="0"
-                               onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
-                               autocomplete="off" class="layui-input" placeholder="请输入发放库存">
-                    </div>
-                </div>
-
-                <!-- 兑换方式 -->
-                <div class="layui-form-item exchange_way">
-                    <label class="layui-form-label"><span style="color:red;">*</span>兑换方式:</label>
-                    <div class="layui-input-inline">
-                        <input type="radio" name="exchange_way" value="1" title="积分" lay-filter="exchange_way" checked>
-                        <input type="radio" name="exchange_way" value="2" title="积分+余额" lay-filter="exchange_way">
-                    </div>
-                </div>
-
-                <!-- 兑换积分 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>兑换积分:</label>
-                    <div class="layui-input-inline" style="margin-right: 0px;">
-                        <input type="number" name="need_integral" id="need_integral" autocomplete="off"
-                               onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
-                               placeholder="请输入积分" class="layui-input" value="1" min="1">
-                    </div>
-                    <span class="layui-form-mid">积分</span>
-                    <span class="layui-form-mid need_money hide-div">+</span>
-                    <div class="layui-input-inline need_money hide-div" style="margin-right: 0px;">
-                        <input type="number" name="need_money" id="need_money" autocomplete="off" placeholder="请输入金额"
-                               class="layui-input" min="0">
-                    </div>
-                    <div class="layui-input-inline">
-                        <span class="layui-form-mid need_money hide-div">元</span>
-                    </div>
-                </div>
-
-                <!-- 物流配送 -->
-                <div class="layui-form-item delivery">
-                    <label class="layui-form-label"><span style="color:red;">*</span>物流配送:</label>
-                    <div class="layui-input-block">
-                        <input type="radio" name="delivery_way" value="1" title="快递" lay-filter="delivery_way" checked>
-                        <input type="radio" name="delivery_way" value="0" title="无需物流" lay-filter="delivery_way">
-                    </div>
-                    <div class="layui-form-mid layui-word-aux ">修改后的配送状态仅对后面的订单生效,对前面已经付款的订单没影响,会按照订单当时的的设置来进行操作</div>
-                </div>
-
-                <!-- 快递运费 -->
-                <div class="layui-form-item delivery express">
-                    <label class="layui-form-label"><span style="color:red;">*</span>快递运费:</label>
-                    <div class="layui-input-inline">
-                        <input type="radio" name="express_type" value="1" title="包邮" checked>
-                    </div>
-                    <div class="layui-form-item">
-                        <label class="layui-form-label"></label>
-                        <div class="layui-input-inline" style="margin-right: 0px;width: auto">
-                            <input type="radio" name="express_type" value="2" title="统一运费" >
-                        </div>
-                        <div class="layui-input-inline" style="width: 110px">
-                            <input type="number" name="express_money" class="layui-input" min="0">
-                        </div>
-                        <span class="layui-form-mid">元</span>
-                    </div>
-                </div>
-
-                <!-- 红包面值 -->
-                <div class="layui-form-item balance hide-div">
-                    <label for="stock" class="layui-form-label"><span style="color:red;">*</span>红包面值:</label>
-                    <div class="layui-input-inline">
-                        <input type="number" name="balance" id="balance" lay-verType="tips"
-                               autocomplete="off" class="layui-input" min="0">
-                        <div class="layui-form-mid layui-word-aux">兑换的红包会以余额的形式发放</div>
-                    </div>
-                </div>
-
-                <!-- 排序 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label">排序:</label>
-                    <div class="layui-input-inline input-inline-width">
-                        <input type="number" name="sort" autocomplete="off" class="layui-input" min="0" value="0">
-                        <label class="layui-form-mid layui-word-aux">默认值为0,数值越大越排前</label>
-                    </div>
-                </div>
-
-                <!-- 商品状态 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>商品状态:</label>
-                    <div class="layui-input-inline">
-                        <input type="checkbox" name="status" lay-skin="switch" lay-text="上架|下架" checked>
-                    </div>
-                </div>
-            </div>
-            <!-- 2、商品详情 -->
-            <div class="layui-tab-item">
-                <div class="layui-form-item">
-                    <label class="layui-form-label">商品详情:</label>
-                    <div class="layui-input-block">
-                        <textarea name="content" id="content" lay-verify="content"></textarea>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-    </div>
-</div>
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).extend({
-        likeedit: 'likeedit/likeedit'
-    }).use(["form", "laydate", "layEditor"], function () {
-        var $ = layui.$;
-        var form = layui.form;
-        var layEditor = layui.layEditor;
-
-
-        // 兑换类型 [商品, 红包]
-        form.on('radio(type)', function (data) {
-            let value = data.value;
-            if (value === '1') {
-                typeGoods();
-            }
-            if (value === '2') {
-                typeBalance();
-            }
-        })
-
-        // 兑换方式 [积分, 积分+余额]
-        form.on('radio(exchange_way)', function (data) {
-            data.value === '1' ? $('.need_money').hide() : $('.need_money').show();
-        })
-
-        // 物流配送 [快递 无需物流]
-        form.on('radio(delivery_way)', function (data) {
-            data.value === '1' ? $('.express').show() : $('.express').hide();
-        })
-
-        // 兑换类型为商品时
-        function typeGoods() {
-            $('.balance').hide();
-            $('.code, .exchange_way, .need_integral, .delivery').show();
-            let exchange_way = $('input[name="exchange_way"]:checked').val();
-            exchange_way === '1' ? $('.need_money').hide() : $('.need_money').show();
-        }
-
-        // 兑换类型为红包时
-        function typeBalance() {
-            $('.balance').show();
-            $('.code, .exchange_way, .need_integral, .need_money, .delivery').hide();
-        }
-
-
-        // 富文本
-        layEditor.set({
-            uploadImage: {
-                url: '{:url("file/lists")}?type=10'
-            },
-        })
-        var ieditor = layEditor.build('content')
-        form.verify({
-            content: function(value) {
-                return layEditor.sync(ieditor);
-            }
-        });
-
-
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "image",
-                that: $(this)
-            });
-        });
-
-    })
-</script>

+ 0 - 285
app/admin/view/integral/integral_goods/edit.html

@@ -1,285 +0,0 @@
-{layout name="layout2" /}
-<link href="__PUBLIC__/static/lib/layui/layeditor/layedit.css" rel="stylesheet"/>
-<script src="__PUBLIC__/static/lib/layui/layeditor/index.js"></script>
-<script src="__PUBLIC__/static/lib/layui/layeditor/ace/ace.js"></script>
-<style>
-    .layui-form-item .layui-form-label {
-        width: 95px;
-    }
-
-    .layui-form-item .layui-input-inline {
-        width: 240px;
-    }
-
-    .hide-div {
-        display: none;
-    }
-</style>
-
-<div class="layui-card layui-form" style="box-shadow:none;">
-    <div class="layui-tab layui-tab-card" lay-filter="like-tabs">
-        <ul class="layui-tab-title">
-            <li lay-id="1" class="layui-this">基本信息</li>
-            <li lay-id="2">商品详情</li>
-        </ul>
-        <div class="layui-tab-content">
-            <input type="hidden" name="id" value="{$detail.id}">
-            <input type="hidden" name="type" value="{$detail.type}">
-            <!-- 1、基础设置 -->
-            <div class="layui-tab-item layui-show">
-                <!-- 兑换类型 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>兑换类型:</label>
-                    <div class="layui-input-inline">
-                        <div class="layui-form-mid ">
-                            {if condition="$detail.type eq 1"}
-                                商品
-                            {else/}
-                                红包
-                            {/if}
-                        </div>
-                    </div>
-                </div>
-
-                <!-- 商家名称 -->
-                <div class="layui-form-item">
-                    <label for="name" class="layui-form-label"><span style="color:red;">*</span>商品名称:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" name="name" id="name" lay-verType="tips" value="{$detail.name}"
-                               autocomplete="off" class="layui-input" placeholder="请输入名称">
-                    </div>
-                </div>
-
-                <!-- 商品编号 -->
-                <div class="layui-form-item code">
-                    <label for="name" class="layui-form-label">商品编号:</label>
-                    <div class="layui-input-inline">
-                        <input type="text" name="code" id="code" lay-verType="tips" value="{$detail.code|default=''}"
-                               autocomplete="off" class="layui-input" placeholder="请输入编号">
-                    </div>
-                </div>
-
-                <!-- 商品封面 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>商品封面:</label>
-                    <div class="layui-input-block">
-                        <div class="like-upload-image">
-                            {if $detail.image}
-                            <div class="upload-image-div">
-                                <img src="{$detail.image}" alt="img">
-                                <input type="hidden" name="image" value="{$detail.image}">
-                                <div class="del-upload-btn">x</div>
-                            </div>
-                            <div class="upload-image-elem" style="display:none;"><a class="add-upload-image"> + 添加图片</a>
-                            </div>
-                            {else}
-                            <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
-                            {/if}
-                        </div>
-                        <div class="layui-form-mid layui-word-aux">建议尺寸:800*800像素</div>
-                    </div>
-                </div>
-
-                <!-- 市场价 -->
-                <div class="layui-form-item">
-                    <label for="market_price" class="layui-form-label">市场价:</label>
-                    <div class="layui-input-inline">
-                        <input type="number" name="market_price" id="market_price" lay-verType="tips" min="0"
-                               value="{$detail.market_price|default='0'}"
-                               autocomplete="off" class="layui-input" placeholder="请输入价格">
-                    </div>
-                </div>
-
-                <!-- 库存 -->
-                <div class="layui-form-item">
-                    <label for="stock" class="layui-form-label"><span style="color:red;">*</span>发放库存:</label>
-                    <div class="layui-input-inline">
-                        <input type="number" name="stock" id="stock" lay-verType="tips" value="{$detail.stock}" min="0"
-                               onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
-                               autocomplete="off" class="layui-input" placeholder="请输入发放库存">
-                    </div>
-                </div>
-
-                <!-- 兑换方式 -->
-                <div class="layui-form-item exchange_way">
-                    <label class="layui-form-label"><span style="color:red;">*</span>兑换方式:</label>
-                    <div class="layui-input-inline">
-                        <input type="radio" name="exchange_way" value="1" title="积分" lay-filter="exchange_way" {if
-                               condition="$detail.exchange_way eq 1" }checked{/if}>
-                        <input type="radio" name="exchange_way" value="2" title="积分+余额" lay-filter="exchange_way" {if
-                               condition="$detail.exchange_way eq 2" }checked{/if}>
-                    </div>
-                </div>
-
-                <!-- 兑换积分 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>兑换积分:</label>
-                    <div class="layui-input-inline" style="margin-right: 0px;">
-                        <input type="number" name="need_integral" id="need_integral" autocomplete="off" min="1"
-                               value="{$detail.need_integral}" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
-                               placeholder="请输入积分" class="layui-input">
-                    </div>
-                    <span class="layui-form-mid">积分</span>
-                    <span class="layui-form-mid need_money hide-div">+</span>
-                    <div class="layui-input-inline need_money hide-div" style="margin-right: 0px;">
-                        <input type="number" name="need_money" id="need_money" autocomplete="off" placeholder="请输入金额" min="0"
-                               value="{$detail.need_money}" class="layui-input">
-                    </div>
-                    <div class="layui-input-inline">
-                        <span class="layui-form-mid need_money hide-div">元</span>
-                    </div>
-                </div>
-
-                <!-- 物流配送 -->
-                <div class="layui-form-item delivery">
-                    <label class="layui-form-label"><span style="color:red;">*</span>物流配送:</label>
-                    <div class="layui-input-block">
-                        <input type="radio" name="delivery_way" value="1" title="快递" lay-filter="delivery_way" {if
-                               condition="$detail.delivery_way eq 1" }checked{/if}>
-                        <input type="radio" name="delivery_way" value="0" title="无需物流" lay-filter="delivery_way" {if
-                               condition="$detail.delivery_way eq 0" }checked{/if}>
-                    </div>
-                    <div class="layui-form-mid layui-word-aux ">修改后的配送状态仅对后面的订单生效,对前面已经付款的订单没影响,会按照订单当时的的设置来进行操作</div>
-                </div>
-
-                <!-- 快递运费 -->
-                <div class="layui-form-item delivery express">
-                    <label class="layui-form-label"><span style="color:red;">*</span>快递运费:</label>
-                    <div class="layui-input-inline">
-                        <input type="radio" name="express_type" value="1" title="包邮" {if condition="$detail.express_type eq 1" }checked{/if}>
-                    </div>
-                    <div class="layui-form-item">
-                        <label class="layui-form-label"></label>
-                        <div class="layui-input-inline" style="margin-right: 0px;width: auto">
-                            <input type="radio" name="express_type" value="2" title="统一运费" {if condition="$detail.express_type eq 2" }checked{/if}>
-                        </div>
-                        <div class="layui-input-inline" style="width: 110px">
-                            <input type="number" name="express_money" class="layui-input" value="{$detail.express_money}" min="0">
-                        </div>
-                        <span class="layui-form-mid">元</span>
-                    </div>
-                </div>
-
-                <!-- 红包面值 -->
-                <div class="layui-form-item balance hide-div">
-                    <label for="stock" class="layui-form-label"><span style="color:red;">*</span>红包面值:</label>
-                    <div class="layui-input-inline">
-                        <input type="number" name="balance" id="balance" lay-verType="tips" min="0"
-                               value="{$detail.balance|default=''}"
-                               autocomplete="off" class="layui-input">
-                        <div class="layui-form-mid layui-word-aux">兑换的红包会以余额的形式发放</div>
-                    </div>
-                </div>
-
-                <!-- 排序 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label">排序:</label>
-                    <div class="layui-input-inline input-inline-width">
-                        <input type="number" name="sort" autocomplete="off" class="layui-input" min="0" value="{$detail.sort}">
-                        <label class="layui-form-mid layui-word-aux">默认值为0,数值越大越排前</label>
-                    </div>
-                </div>
-
-                <!-- 商品状态 -->
-                <div class="layui-form-item">
-                    <label class="layui-form-label"><span style="color:red;">*</span>商品状态:</label>
-                    <div class="layui-input-inline">
-                        <input type="checkbox" name="status" lay-skin="switch" lay-text="上架|下架"
-                               {if condition="$detail.status eq 1" }checked{/if}>
-                    </div>
-                </div>
-            </div>
-            <!-- 2、商品详情 -->
-            <div class="layui-tab-item">
-                <div class="layui-form-item">
-                    <label class="layui-form-label">商品详情:</label>
-                    <div class="layui-input-block">
-                        <textarea name="content" id="content" lay-verify="content">{$detail.content}</textarea>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <div class="layui-form-item layui-hide">
-        <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-    </div>
-</div>
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/'
-    }).extend({
-        likeedit: 'likeedit/likeedit'
-    }).use(["form", "laydate", "layEditor"], function () {
-        var $ = layui.$;
-        var form = layui.form;
-        var layEditor = layui.layEditor;
-
-        var type = {$detail.type};
-        var delivery_way = {$detail.delivery_way};
-
-        if (type === 1) {
-            typeGoods();
-        } else {
-            typeBalance();
-        }
-
-        deliveryWay(delivery_way);
-
-        // 兑换类型为商品时
-        function typeGoods() {
-            $('.balance').hide();
-            $('.code, .exchange_way, .need_integral, .delivery').show();
-            let exchange_way = $('input[name="exchange_way"]:checked').val();
-            exchange_way === '1' ? $('.need_money').hide() : $('.need_money').show();
-        }
-
-        // 兑换类型为红包时
-        function typeBalance() {
-            $('.balance').show();
-            $('.code, .exchange_way, .need_integral, .need_money, .delivery').hide();
-        }
-
-        // 物流配送类型
-        function deliveryWay(way) {
-            (way === 1 && type === 1) ? $('.express').show() : $('.express').hide();
-        }
-
-
-        // 兑换方式 [积分, 积分+余额]
-        form.on('radio(exchange_way)', function (data) {
-            data.value === '1' ? $('.need_money').hide() : $('.need_money').show();
-        })
-
-        // 物流配送 [快递 无需物流]
-        form.on('radio(delivery_way)', function (data) {
-            data.value === '1' ? $('.express').show() : $('.express').hide();
-        })
-
-        // 富文本
-        layEditor.set({
-            uploadImage: {
-                url: '{:url("file/lists")}?type=10'
-            },
-        })
-        var ieditor = layEditor.build('content')
-        form.verify({
-            content: function(value) {
-                return layEditor.sync(ieditor);
-            }
-        });
-
-
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "image",
-                that: $(this)
-            });
-        });
-
-    })
-</script>

+ 0 - 267
app/admin/view/integral/integral_goods/lists.html

@@ -1,267 +0,0 @@
-{layout name="layout1" /}
-<!-- 样式 -->
-<style>
-    .layui-table-cell {
-        height: auto;
-    }
-</style>
-<div class="wrapper">
-    <div class="layui-card">
-        <!--操作提示-->
-        <div class="layui-card-body">
-            <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-                <div class="layui-colla-item">
-                    <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                    <div class="layui-colla-content layui-show">
-                        <p>*添加积分商城商品。</p>
-                        <p>*兑换类型为"红包"时,无需物流配送,付完款直接是已完成状态。</p>
-                        <p>*兑换类型为"商品"时,可以做发货操作。</p>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="layui-card-body">
-            <!--添加按钮-->
-            <div style="padding-bottom: 10px;">
-                <button class="layui-btn layui-btn-sm  {$view_theme_color} layEvent"  lay-event="add">添加积分商品</button>
-            </div>
-
-            <!--搜索条件-->
-            <div class="layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-inline">
-                        <label class="layui-form-label">礼品名称:</label>
-                        <div class="layui-input-block">
-                            <input type="text" name="name" id="name" placeholder="请输入礼品名称"
-                                   autocomplete="off" class="layui-input">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">兑换类型</label>
-                        <div class="layui-input-block">
-                            <select name="type" id="search_type">
-                                <option value="">全部</option>
-                                <option value="1">商品</option>
-                                <option value="2">红包</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">商品状态</label>
-                        <div class="layui-input-block">
-                            <select name="status" id="search_status">
-                                <option value="">全部</option>
-                                <option value="1">上架</option>
-                                <option value="0">下架</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <button class="layui-btn layui-btn-sm layuiadmin-btn-goods_brand {$view_theme_color}" lay-submit lay-filter="like-search">
-                            <i class="layui-icon  layuiadmin-button-btn"></i>查询
-                        </button>
-                    </div>
-                    <div class="layui-inline">
-                        <button class="layui-btn layui-btn-sm  layui-btn-primary layuiadmin-btn-goods_brand  " lay-submit lay-filter="like-clear-search">清空查询</button>
-                    </div>
-                </div>
-            </div>
-
-            <!--表格-->
-            <table id="like-table-lists" lay-filter="like-table-lists"></table>
-
-            <script type="text/html" id="statusTpl">
-                <input type="checkbox"  lay-filter="switch-status" data-id={{d.id}} lay-skin="switch"
-                       lay-text="上架|下架" {{#  if(d.status){ }} checked  {{#  } }} />
-            </script>
-
-            <script type="text/html" id="goodsBrand-operation">
-                <a class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
-                <a class="layui-btn layui-btn-danger layui-btn-sm layEvent" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
-            </script>
-
-            <script type="text/html" id="nameTpl">
-                <div style="text-align: left">
-                    <img src="{{d.image}}" style="height:80px;width: 80px" class="image-show">
-                    <div class="layui-input-inline" style="text-align:left;width: 240px">
-                        <p>{{d.name}}</p>
-                    </div>
-                </div>
-            </script>
-
-            <script type="text/html" id="stockTpl">
-                {{#  if(d.stock == '0'){ }}
-                    <span style="color: red">{{d.stock}}</span>
-                {{#  } else { }}
-                    <span>{{d.stock}}</span>
-                {{#  } }}
-            </script>
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.use(['table'], function(){
-        var form = layui.form
-            ,table = layui.table;
-
-        //监听搜索
-        form.on('submit(like-search)', function(data){
-            var field = data.field;
-            //执行重载
-            table.reload('like-table-lists', {
-                where: field,
-                page: {curr: 1},
-            });
-        });
-
-        //清空查询
-        form.on('submit(like-clear-search)', function () {
-            $('#name').val("");
-            $('#search_type').val("");
-            $('#search_status').val("");
-            form.render('select');
-            //刷新列表
-            table.reload('like-table-lists', {
-                where: [],
-                page: {curr: 1},
-            });
-        });
-
-        //切换状态
-        form.on('switch(switch-status)',function (obj) {
-            var id = obj.elem.attributes['data-id'].nodeValue;
-            var status = this.checked ? 1 : 0;
-            like.ajax({
-                url:'{:url("integral.IntegralGoods/switchStatus")}',
-                data:{id:id,status:status},
-                type:'post',
-                success:function (res) {
-                    if(res.code == 1) {
-                        layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000});
-                    }
-                }
-            });
-        });
-
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        //事件
-        var active = {
-            add: function(){
-                layer.open({
-                    type: 2
-                    ,title: '添加商品'
-                    ,content: '{:url("integral.IntegralGoods/add")}'
-                    ,area: ['90%', '90%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero) {
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'addSubmit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data) {
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("integral.IntegralGoods/add")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                   if(res.code == 1) {
-                                       layui.layer.msg(res.msg, {
-                                           offset: '15px'
-                                           , icon: 1
-                                           , time: 1000
-                                       });
-                                       layer.close(index);
-                                       table.reload('like-table-lists');
-                                   }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                });
-            },
-            edit: function (obj) {
-                var id = obj.data.id;
-                layer.open({
-                    type: 2
-                    ,title: '编辑商品'
-                    ,content: '{:url("integral.IntegralGoods/edit")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,btn: ['确定', '取消']
-                    ,yes: function(index, layero){
-                        var iframeWindow = window['layui-layer-iframe'+ index]
-                            ,submitID = 'addSubmit'
-                            ,submit = layero.find('iframe').contents().find('#'+ submitID);
-                        //监听提交
-                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
-                            var field = data.field;
-                            like.ajax({
-                                url:'{:url("integral.IntegralGoods/edit")}',
-                                data:field,
-                                type:"post",
-                                success:function(res)
-                                {
-                                    if(res.code == 1) {
-                                        layui.layer.msg(res.msg, {
-                                            offset: '15px'
-                                            , icon: 1
-                                            , time: 1000
-                                        });
-                                        layer.close(index);
-                                        table.reload('like-table-lists');
-                                    }
-                                }
-                            });
-                        });
-                        submit.trigger('click');
-                    }
-                })
-            },
-            del: function (obj) {
-                var unitName = "<span style='color: red;'>"+obj.data.name+"</span>";
-                layer.confirm('确定删除商品品牌: '+unitName, function(index) {
-                    like.ajax({
-                        url:'{:url("integral.IntegralGoods/del")}',
-                        data:{'id':obj.data.id},
-                        type:"post",
-                        success:function(res)
-                        {
-                            if(res.code == 1) {
-                                obj.del();
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1000
-                                });
-                                layer.close(index);
-                            }
-                        }
-                    });
-                });
-            }
-        };
-        like.eventClick(active);
-
-
-        //列表
-        like.tableLists('#like-table-lists', '{:url("integral.IntegralGoods/lists")}', [
-            {field: 'id', width: 60, title: 'ID', sort: true}
-            ,{field: 'name', title: '商品名称', width: 260, align:"center", templet: "#nameTpl"}
-            ,{field: 'type', title: '兑换类型', align:"center", templet: "#image"}
-            ,{field: 'stock', title: '库存', align:"center", templet: "#stockTpl"}
-            ,{field: 'need', title: '兑换积分', align:"center"}
-            ,{field: 'sort', title: '排序', align:"center"}
-            ,{field: 'status', title: '商品状态', align:"center", templet:'#statusTpl'}
-            ,{title: '操作', align: 'center',  width: 260, fixed: 'right', toolbar: '#goodsBrand-operation'}
-        ]);
-
-    });
-</script>

+ 0 - 207
app/admin/view/integral/integral_order/delivery.html

@@ -1,207 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .div-flex {
-        display: flex;
-        align-items: center;
-        justify-content: left;
-    }
-
-    .layui-form-label {
-        width: 100px;
-    }
-
-    .width-160 {
-        width: 200px;
-    }
-
-    .layui-table th {
-        text-align: center;
-    }
-
-    .table-margin {
-        margin-left: 50px;
-        margin-right: 50px;
-        text-align: center;
-    }
-
-    .image {
-        height: 80px;
-        width: 80px;
-    }
-
-</style>
-
-<div class="layui-card-body" >
-    <!--基本信息-->
-    <div class="layui-form" lay-filter="layuiadmin-form-express" id="layuiadmin-form-express" >
-        <input type="hidden" name="id" value="{$detail.id}">
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>收货信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item div-flex">
-            <label class="layui-form-label ">收货人:</label>
-            <div class="width-160">{$detail.consignee}</div>
-            <label class="layui-form-label ">手机号:</label>
-            <div class="width-160">{$detail.mobile}</div>
-            <label class="layui-form-label ">收货地址:</label>
-            <div class="width-160">{$detail.delivery_address}</div>
-        </div>
-
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>商品信息</legend>
-            </fieldset>
-        </div>
-
-        <div class="layui-form-item table-margin">
-            <table class="layui-table">
-                <colgroup>
-                    <col width="250">
-                    <col width="100">
-                    <col width="200">
-                    <col width="100">
-                    <col width="100">
-                    <col width="200">
-                </colgroup>
-                <thead>
-                <tr>
-                    <th>商品名称</th>
-                    <th>市场价</th>
-                    <th>兑换积分</th>
-                    <th>数量</th>
-                    <th>运费</th>
-                    <th>实付</th>
-                </tr>
-                </thead>
-                <tbody>
-                <tr>
-                    <td>
-                        <div style="text-align: left">
-                            <div class="layui-col-md4">
-                                <img src="{$detail.goods_snap.image}" class="image-show image" >
-                            </div>
-                            <div class="layui-col-md8">
-                                <p style="margin-top: 10px; margin-left: 10px">{$detail.goods_snap.name}</p>
-                            </div>
-                        </div>
-                    </td>
-                    <td>¥{$detail.goods_snap.market_price}</td>
-                    <td>{$detail.goods_snap.need_integral}积分{if $detail.goods_snap.exchange_way == 2}+{$detail.goods_snap.need_money}元{/if}</td>
-                    <td>{$detail.total_num}</td>
-                    <td>¥{$detail.shipping_price}</td>
-                    <td>{$detail.order_integral}积分{if $detail.order_amount > 0}+{$detail.order_amount}元{/if}</td>
-                </tr>
-                </tbody>
-            </table>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>快递配送</legend>
-            </fieldset>
-        </div>
-
-<!--        <div class="layui-form-item div-flex">-->
-<!--            <label class="layui-form-label ">配送方式:</label>-->
-<!--            <div>-->
-<!--                <input type="radio" name="send_type" lay-filter="express" value="1" title="快递配送" checked>-->
-<!--                <input type="radio" name="send_type" lay-filter="express" value="2" title="无需快递">-->
-<!--            </div>-->
-<!--        </div>-->
-
-        <div class="layui-form-item div-flex select-express">
-            <label class="layui-form-label ">选择快递:</label>
-            <div>
-                <select name="shipping_id" lay-verify="required">
-                    {foreach $express as $k => $v}
-                    <option value="{$v.id}">{$v.name}</option>
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-form-item div-flex select-express" >
-            <label class="layui-form-label ">快递单号:</label>
-            <div>
-                <input type="text" name="invoice_no" placeholder="请输入快递单号" autocomplete="off"
-                       class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item div-flex ">
-            <div class="layui-input-block ">
-                <input type="button" class="layui-btn layui-btn-sm layui-btn-normal width_160" lay-submit lay-filter="send" id="send" value="发货">
-                <button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
-            </div>
-        </div>
-    </div>
-</div>
-
-
-<script type="text/javascript">
-    //注意:选项卡 依赖 element 模块,否则无法进行功能性操作
-
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
-    }).extend({
-        index: 'lib/index' //主入口模块
-    }).use(['index', 'element', 'jquery', 'like', 'form'], function () {
-        var $ = layui.$
-            , form = layui.form;
-        var like = layui.like;
-
-        //主图放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,600);
-        });
-
-
-        form.on('radio(express)', function (data) {
-            var checked = data.value;
-            if (checked == 1) {
-                $('.select-express').show();
-            } else {
-                $('.select-express').hide();
-            }
-        });
-
-        $('#back').click(function () {
-            var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
-            parent.layer.close(index);
-            parent.layui.table.reload('order-lists');
-            return true;
-        });
-
-
-        //发货
-        form.on('submit(send)', function (data) {
-            var field = data.field;
-            like.ajax({
-                url: '{:url("integral.IntegralOrder/deliveryHandle")}'
-                , data: field
-                , type: 'post'
-                , success: function (res) {
-                    if (res.code == 1) {
-                        layui.layer.msg(res.msg, {
-                            offset: '15px'
-                            , icon: 1
-                            , time: 1000
-                        },function () {
-                            var index = parent.layer.getFrameIndex(window.name);
-                            parent.location.reload();
-                            parent.layer.close(index);
-                        });
-                    }
-                },
-            });
-        })
-
-    });
-</script>

+ 0 - 249
app/admin/view/integral/integral_order/detail.html

@@ -1,249 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .div-flex {
-        display: flex;
-        align-items: center;
-        justify-content: left;
-    }
-
-    .width-160 {
-        width: 200px;
-    }
-    .layui-table th {
-        text-align: center;
-    }
-    .table-margin{
-        margin-left: 50px;
-        margin-right: 50px;
-        text-align: center;
-    }
-    .image{
-        height:80px;
-        width: 80px;
-    }
-
-    .mt50{
-        margin-left: 50px;
-    }
-
-</style>
-
-<div class="layui-card-body" >
-    <!--基本信息-->
-    <div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order" >
-    <input type="hidden" class="id" name="id" value="{$detail.id}">
-
-    <div class="layui-form-item">
-        <fieldset class="layui-elem-field layui-field-title">
-            <legend>订单信息</legend>
-        </fieldset>
-    </div>
-
-    <div class="layui-form-item div-flex">
-        <label class="layui-form-label ">订单编号:</label>
-        <div class="width-160">{$detail.order_sn}</div>
-        <label class="layui-form-label ">兑换类型:</label>
-        <div class="width-160">{$detail.type_desc}</div>
-        <label class="layui-form-label ">下单时间:</label>
-        <div class="width-160">{$detail.create_time}</div>
-    </div>
-
-    <div class="layui-form-item div-flex">
-        <label class="layui-form-label ">支付状态:</label>
-        <div class="width-160">{$detail.pay_status_desc}</div>
-        <label class="layui-form-label ">订单状态:</label>
-        <div class="width-160">{$detail.order_status_desc}</div>
-        <label class="layui-form-label ">支付方式:</label>
-        <div class="width-160">{$detail.pay_way_desc}</div>
-    </div>
-
-    <div class="layui-form-item div-flex">
-        <label class="layui-form-label ">支付时间:</label>
-        <div class="width-160">{$detail.pay_time}</div>
-        <label class="layui-form-label ">完成时间:</label>
-        <div class="width-160">{$detail.confirm_time}</div>
-    </div>
-
-    <div class="layui-form-item">
-        <fieldset class="layui-elem-field layui-field-title">
-            <legend>会员信息</legend>
-        </fieldset>
-    </div>
-
-    <div class="layui-form-item div-flex">
-        <label class="layui-form-label ">会员编号:</label>
-        <div class="width-160">{$detail.user.sn}</div>
-        <label class="layui-form-label ">会员昵称:</label>
-        <div class="width-160">{$detail.user.nickname}</div>
-        <label class="layui-form-label ">手机号码:</label>
-        <div class="width-160">{$detail.user.mobile}</div>
-    </div>
-
-    <div class="layui-form-item div-flex">
-        <label class="layui-form-label ">性别:</label>
-        <div class="width-160">{$detail.user.sex}</div>
-        <label class="layui-form-label ">注册时间:</label>
-        <div class="width-160">{$detail.user.create_time}</div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <fieldset class="layui-elem-field layui-field-title">
-            <legend>收货信息</legend>
-        </fieldset>
-    </div>
-
-    <div class="layui-form-item div-flex">
-        <label class="layui-form-label ">收货人:</label>
-        <div class="width-160">{$detail.consignee}</div>
-        <label class="layui-form-label ">手机号:</label>
-        <div class="width-160">{$detail.mobile}</div>
-        <label class="layui-form-label ">收货地址:</label>
-        <div class="width-160">{$detail.delivery_address}</div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <fieldset class="layui-elem-field layui-field-title">
-            <legend>商品信息</legend>
-        </fieldset>
-    </div>
-
-    <div class="layui-form-item table-margin">
-        <table class="layui-table">
-                <colgroup>
-                    <col width="250">
-                    <col width="100">
-                    <col width="200">
-                    <col width="100">
-                    <col width="100">
-                    <col width="200">
-                </colgroup>
-                <thead>
-                <tr>
-                    <th>商品名称</th>
-                    <th>市场价</th>
-                    <th>兑换积分</th>
-                    <th>数量</th>
-                    <th>运费</th>
-                    <th>实付</th>
-                </tr>
-                </thead>
-                <tbody>
-                <tr>
-                    <td>
-                        <div style="text-align: left">
-                            <div class="layui-col-md4" >
-                                <img src="{$detail.goods_snap.image}" class="image-show image" >
-                            </div>
-                            <div class="layui-col-md8" >
-                                <p style="margin-top: 10px; margin-left: 10px">{$detail.goods_snap.name}</p>
-                            </div>
-                        </div>
-                    </td>
-                    <td>¥{$detail.goods_snap.market_price}</td>
-                    <td>{$detail.goods_snap.need_integral}积分{if $detail.goods_snap.exchange_way == 2}+{$detail.goods_snap.need_money}元{/if}</td>
-                    <td>{$detail.total_num}</td>
-                    <td>¥{$detail.shipping_price}</td>
-                    <td>{$detail.order_integral}积分{if $detail.order_amount > 0}+{$detail.order_amount}元{/if}</td>
-                </tr>
-                </tbody>
-            </table>
-    </div>
-
-    <div class="layui-form-item">
-        <fieldset class="layui-elem-field layui-field-title">
-            <legend>买家留言</legend>
-        </fieldset>
-    </div>
-
-    <div class="layui-form-item table-margin">
-        <textarea class="layui-textarea" disabled>{$detail.user_remark}</textarea>
-    </div>
-
-
-    <div class="layui-form-item">
-        <fieldset class="layui-elem-field layui-field-title">
-            <legend>订单操作</legend>
-        </fieldset>
-    </div>
-
-    <div class="layui-form-item div-flex ">
-        <div class="layui-input-block ">
-            {if $detail.order_status == 1 && $detail.delivery_way == 1}
-            <button type="button" class="layui-btn layui-btn-sm layui-btn-normal width_160 " id="delivery">发货</button>
-            {/if}
-            {if $detail.order_status == 2 && $detail.delivery_way == 1}
-            <button type="button" class="layui-btn layui-btn-sm layui-btn-normal width_160 " id="confirm">确认收货</button>
-            {/if}
-            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
-        </div>
-    </div>
-
-
-</div>
-</div>
-
-<script type="text/javascript">
-    //注意:选项卡 依赖 element 模块,否则无法进行功能性操作
-
-    layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$;
-
-        //主图放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-
-        $('#back').click(function () {
-            var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
-            parent.layer.close(index);
-            parent.layui.table.reload('order-lists');
-            return true;
-        });
-
-        //发货
-        $('#delivery').click(function () {
-            var id = $('.id').val();
-            layer.open({
-                type: 2
-                ,title: '订单发货'
-                ,content: '{:url("integral.IntegralOrder/delivery")}?id='+id
-                ,area: ['90%', '90%']
-                ,yes: function(index, layero){
-                }
-            })
-        });
-
-        //确认收货
-        $('#confirm').click(function () {
-            var id = $('.id').val();
-            layer.confirm('确认订单商品已收货吗??', {
-                btn: ['确认','取消'] //按钮
-            }, function(){
-                like.ajax({
-                    url: '{:url("integral.IntegralOrder/confirm")}'
-                    , data: {'id': id}
-                    , type: 'post'
-                    , success: function (res) {
-                        if (res.code == 1) {
-                            layui.layer.msg(res.msg, {
-                                offset: '15px'
-                                , icon: 1
-                                , time: 1000
-                            },function () {
-                                location.reload();
-                            });
-                        }
-                    },
-                });
-            });
-        });
-
-    });
-</script>

+ 0 - 172
app/admin/view/integral/integral_order/express.html

@@ -1,172 +0,0 @@
-{layout name="layout2" /}
-<style>
-    .div-flex {
-        display: flex;
-        align-items: center;
-        justify-content: left;
-    }
-
-    .width-160 {
-        width: 200px;
-    }
-
-    .layui-table th {
-        text-align: center;
-    }
-
-    .table-margin {
-        margin-left: 50px;
-        margin-right: 50px;
-        text-align: center;
-    }
-
-    .image {
-        height: 80px;
-        width: 80px;
-    }
-
-    .mt50 {
-        margin-left: 50px;
-    }
-
-</style>
-<div class="layui-card-body" >
-    <!--基本信息-->
-    <div class="layui-form" lay-filter="layuiadmin-form-express" id="layuiadmin-form-express" >
-        <input type="hidden" name="order_id" value="{$detail.id}">
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>快递信息</legend>
-            </fieldset>
-        </div>
-
-
-        {empty name="$detail.shipping"}
-            <div class="layui-form-item div-flex">
-                <label class="layui-form-label"></label>
-                <div class="width-160">暂无物流信息</div>
-            </div>
-        {else/}
-            <div class="layui-form-item div-flex">
-                <label class="layui-form-label ">发货时间:</label>
-                <div class="width-160">{$detail.shipping.create_time | default= "--"}</div>
-                <label class="layui-form-label ">快递方式:</label>
-                <div class="width-160">{$detail.shipping.shipping_name | default="--"}</div>
-                <label class="layui-form-label ">快递单号:</label>
-                <div class="width-160">{$detail.shipping.invoice_no | default= "--"}</div>
-            </div>
-        {/empty}
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>商品信息</legend>
-            </fieldset>
-        </div>
-
-
-        <div class="layui-form-item table-margin">
-            <table class="layui-table">
-                <colgroup>
-                    <col width="250">
-                    <col width="100">
-                    <col width="200">
-                    <col width="100">
-                    <col width="200">
-                </colgroup>
-                <thead>
-                <tr>
-                    <th>商品名称</th>
-                    <th>市场价</th>
-                    <th>兑换积分</th>
-                    <th>数量</th>
-                    <th>运费</th>
-                    <th>实付</th>
-                </tr>
-                </thead>
-                <tbody>
-                <tr>
-                    <td>
-                        <div style="text-align: left">
-                            <div class="layui-col-md3">
-                                <img src="{$detail.goods_snap.image}" class="image-show image" >
-                            </div>
-                            <div class="layui-col-md9">
-                                <p style="margin-top: 10px">{$detail.goods_snap.name}</p>
-                            </div>
-                        </div>
-                    </td>
-                    <td>¥{$detail.goods_snap.market_price}</td>
-                    <td>{$detail.goods_snap.need_integral}积分{if $detail.goods_snap.exchange_way == 2}+{$detail.goods_snap.need_money}元{/if}</td>
-                    <td>{$detail.total_num}</td>
-                    <td>¥{$detail.shipping_price}</td>
-                    <td>{$detail.order_integral}积分{if $detail.order_amount > 0}+{$detail.order_amount}元{/if}</td>
-                </tr>
-                </tbody>
-            </table>
-        </div>
-
-        <div class="layui-form-item">
-            <fieldset class="layui-elem-field layui-field-title">
-                <legend>物流轨迹</legend>
-            </fieldset>
-        </div>
-
-
-        <div class="layui-form-item table-margin">
-            <table class="layui-table">
-                <colgroup>
-                    <col>
-                </colgroup>
-                <thead>
-                <tr >
-                    <th colspan="3">轨迹</th>
-                </tr>
-                </thead>
-                <tbody>
-                {foreach $detail.shipping.traces as $k => $item}
-                <tr>
-                    {if is_array($item)}
-                        {foreach $item as $k1 => $value}
-                            <td>{$value}</td>
-                        {/foreach}
-                    {else /}
-                        <td>{$item}</td>
-                    {/if}
-                </tr>
-                {/foreach}
-                </tbody>
-            </table>
-        </div>
-
-
-        <div class="layui-form-item div-flex ">
-            <div class="layui-input-block ">
-                <button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
-            </div>
-        </div>
-    </div>
-</div>
-
-
-<script type="text/javascript">
-    //注意:选项卡 依赖 element 模块,否则无法进行功能性操作
-    layui.use(['element', 'jquery','form'], function () {
-        var $ = layui.$
-            , form = layui.form;
-
-        //主图放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-
-        $('#back').click(function () {
-            var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
-            parent.layer.close(index);
-            parent.layui.table.reload('order-lists');
-            return true;
-        });
-    });
-</script>

+ 0 - 437
app/admin/view/integral/integral_order/lists.html

@@ -1,437 +0,0 @@
-{layout name="layout1" /}
-<style>
-    .layui-table-cell {
-        height:auto;
-    }
-    .goods-content>div:not(:last-of-type) {
-        border-bottom:1px solid #DCDCDC;
-    }
-    .goods-data::after{
-        display: block;
-        content: '';
-        clear: both;
-    }
-    .goods_name_hide{
-        overflow:hidden;
-        white-space:nowrap;
-        text-overflow: ellipsis;
-    }
-    .operation-btn {
-        margin: 5px;
-    }
-    .table-operate{
-        text-align: left;
-        font-size:14px;
-        padding:0 5px;
-        height:auto;
-        overflow:visible;
-        text-overflow:inherit;
-        white-space:normal;
-        word-break: break-all;
-    }
-</style>
-
-<div class="wrapper">
-    <div class="layui-card">
-        <div class="layui-card-body">
-        <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
-            <div class="layui-colla-item">
-                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
-                <div class="layui-colla-content layui-show">
-                    <p>*会员在商城下单的列表。</p>
-                    <p>*订单状态有待付款,待发货,待收货,已完成,已关闭;不做售后流程。</p>
-                    <p>*待付款订单取消后则为已关闭。待付款订单支付后则为待发货。待发货订单发货后则为待收货。待收货订单收货后则为已完成。红包类型的订单一付款就变成已完成状态。</p>
-                </div>
-            </div>
-        </div>
-        </div>
-        <div class="layui-tab layui-tab-card" lay-filter="tab-all">
-
-            <ul class="layui-tab-title">
-                <li data-type='' class="layui-this">全部</li>
-                {foreach $order_status as $item => $val}
-                <li data-type="{$item}">{$val}</li>
-                {/foreach}
-            </ul>
-            <div class="layui-card-body layui-form">
-                <div class="layui-form-item">
-                    <div class="layui-row">
-                        <div class="layui-inline">
-                            <label class="layui-form-label">兑换单号:</label>
-                            <div class="layui-input-block">
-                                <input type="text" name="order_sn" id="order_sn" placeholder="请输入兑换单号"
-                                       autocomplete="off" class="layui-input">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <label class="layui-form-label">商品名称:</label>
-                            <div class="layui-input-block">
-                                <input type="text" name="goods_name" id="goods_name" placeholder="请输入商品名称"
-                                       autocomplete="off" class="layui-input">
-                            </div>
-                        </div>
-                        <div class="layui-inline">
-                            <label class="layui-form-label">兑换类型:</label>
-                            <div class="layui-input-block">
-                                <select name="type" id="type">
-                                    <option value="">全部</option>
-                                    {foreach $type as $item => $val}
-                                    <option value="{$item}">{$val}</option>
-                                    {/foreach}
-                                </select>
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">订单状态:</label>
-                            <div class="layui-input-block">
-                                <select name="order_status" id="order_status">
-                                    <option value="">全部</option>
-                                    {foreach $order_status as $item => $val}
-                                    <option value="{$item}">{$val}</option>
-                                    {/foreach}
-                                </select>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-row">
-
-                        <div class="layui-inline">
-                            <label class="layui-form-label">下单时间:</label>
-                            <div class="layui-input-inline">
-                                <div class="layui-input-inline">
-                                    <input type="text" name="start_time" class="layui-input" id="start_time"
-                                           placeholder="" autocomplete="off">
-                                </div>
-                            </div>
-                            <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
-                                <label class="layui-form-mid">至</label>
-                            </div>
-                            <div class="layui-input-inline">
-                                <input type="text" name="end_time" class="layui-input" id="end_time"
-                                       placeholder="" autocomplete="off">
-                            </div>
-                        </div>
-
-                        <div class="layui-inline">
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
-                                    lay-filter="order-search">查询
-                            </button>
-                            <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
-                                    lay-filter="order-clear-search">清空查询
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="layui-tab-item layui-show">
-                <div class="layui-card">
-                    <div class="layui-card-body">
-                        <table id="order-lists" lay-filter="order-lists"></table>
-
-                        <script type="text/html" id="order-operation" >
-                            <div class="table-operate">
-
-                                <a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="detail">订单详情</a>
-                                {{#  if(d.order_status == 1 && d.delivery_way == 1){ }}
-                                <a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="delivery">发货</a>
-                                {{#  } }}
-                                {{#  if(d.order_status == 2 && d.delivery_way == 1 ){ }}
-                                <a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="confirm">确认收货</a>
-                                {{#  } }}
-                                {{#  if(d.order_status == 2 && d.shipping_status == 1 ){ }}
-                                <a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
-                                {{#  } }}
-                                {{#  if(d.order_status == 3 && d.shipping_status == 1 ){ }}
-                                <a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
-                                {{#  } }}
-                                {{#  if(d.order_status <= 2 && d.exchange_type == 1){ }}
-                                <a class="layui-btn layui-btn-danger layui-btn-sm operation-btn" lay-event="cancel">取消订单</a>
-                                {{#  } }}
-                            </div>
-                        </script>
-
-                        <script type="text/html" id="image">
-                            <img src="{{d.image}}" style="height:80px;width: 80px" class="image-show">
-                        </script>
-
-                        <!--订单信息-->
-                        <script type="text/html" id="order">
-                            <div style="text-align: left">
-                                <p>订单编号:{{d.order_sn}}</p>
-                                <p>下单时间:{{d.create_time}}</p>
-                                <p>支付时间:{{d.pay_time}}</p>
-                            </div>
-                        </script>
-
-                        <!--会员信息-->
-                        <script type="text/html" id="user">
-                            <img src="{{d.user.avatar}}" style="height:80px;width: 80px" class="image-show">
-                            <div class="layui-input-inline"  style="text-align: left;">
-                                <p>会员编号:{{d.user.sn}}</p>
-                                <p style="width: 180px;text-overflow:ellipsis;overflow: hidden">会员昵称:{{d.user.nickname}}</p>
-                            </div>
-                        </script>
-
-                        <!--收货信息-->
-                        <script type="text/html" id="delivery">
-                            <div style="text-align: left">
-                                <p>收货人:{{d.consignee}}</p>
-                                <p>手机号码:{{d.mobile}}</p>
-                                <p>收货地址:{{d.delivery_address}}</p>
-                            </div>
-                        </script>
-
-                        <!--商品信息-->
-                        <script type="text/html" id="goods">
-                            <div class="goods-content">
-                                <div style="text-align: left;" class="goods-data">
-                                    <img src="{{d.goods_snap.image}}" style="height:80px;width: 80px;" class="image-show layui-col-md4">
-                                    <div class="layui-input-inline layui-col-md8" style="margin-left: 10px">
-                                        <span class="layui-col-md7 goods_name_hide">{{d.goods_snap.name}}</span>
-                                        <br>
-                                        <span class="layui-col-md7 goods_name_hide" style="width: 100%">积分金额:{{d.goods_snap.need_integral}}积分{{# if(d.goods_snap.exchange_way == 2){ }}+{{d.goods_snap.need_money}}元{{#  } }}</span>
-                                        <br>
-                                        <span class="layui-col-md5">数量:{{d.total_num}}</span>
-                                    </div>
-                                </div>
-                            </div>
-                        </script>
-
-                        <!--实际支付-->
-                        <script type="text/html" id="order_amount">
-                            <div style="text-align: left">
-                                <p>{{d.order_integral}}积分{{# if(d.order_amount > 0){ }}+{{d.order_amount}}元{{#  } }}</p>
-                            </div>
-                        </script>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<script>
-      layui.config({
-        version:"{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function(){
-        var $ = layui.$
-            , form = layui.form
-            , table = layui.table
-            , element = layui.element
-            , laydate = layui.laydate;
-
-        //图片放大
-        $(document).on('click', '.image-show', function () {
-            var src = $(this).attr('src');
-            like.showImg(src,400);
-        });
-
-        //监听搜索
-        form.on('submit(order-search)', function (data) {
-            var field = data.field;
-            //执行重载
-            table.reload('order-lists', {
-                where: field,
-                page: {
-                    curr: 1
-                }
-            });
-        });
-        //清空查询
-        form.on('submit(order-clear-search)', function () {
-            $('#order_sn').val('');
-            $('#goods_name').val('');
-            $('#type').val('');
-            $('#order_status').val('');
-            $('#start_time').val('');
-            $('#end_time').val('');
-            form.render('select');
-            //刷新列表
-            table.reload('order-lists', {
-                where: [],
-                page: {
-                    curr: 1
-                }
-            });
-        });
-
-        //日期时间范围
-        laydate.render({
-            elem: '#start_time'
-            ,type: 'datetime'
-            ,trigger: 'click'
-            ,done: function (value, date, endDate) {
-                var startDate = new Date(value).getTime();
-                var endTime = new Date($('#end_time').val()).getTime();
-                if (endTime < startDate) {
-                    layer.msg('结束时间不能小于开始时间');
-                    $('#start_time').val($('#end_time').val());
-                }
-            }
-        });
-
-
-        laydate.render({
-            elem: '#end_time'
-            ,type: 'datetime'
-            ,trigger: 'click'
-            ,done: function (value, date, endDate) {
-                var startDate = new Date($('#start_time').val()).getTime();
-                var endTime = new Date(value).getTime();
-                console.log(startDate);
-                if (endTime < startDate) {
-                    layer.msg('结束时间不能小于开始时间');
-                    $('#end_time').val($('#start_time').val());
-                }
-            }
-        });
-
-        //获取列表
-        getList('');
-        //切换列表
-        element.on('tab(tab-all)', function (data) {
-            $('#order_sn').val('');
-            $('#goods_name').val('');
-            $('#type').val('');
-            $('#order_status').val('');
-            $('#start_time').val('');
-            $('#end_time').val('');
-            form.render('select');
-            var status = $(this).attr('data-type');
-            getList(status);
-        });
-
-        function getList(status) {
-            table.render({
-                elem: '#order-lists'
-                , url: '{:url("integral.IntegralOrder/lists")}?status=' + status
-                , cols: [[
-                    {field: 'order', title: '兑换单号', align: 'center',templet:'#order',width:230}
-                    , {field: 'order_goods', title: '商品信息', align: 'center',templet:'#goods',width:350}
-                    , {field: 'type_desc', title: '兑换类型', align: 'center',width:100}
-                    , {field: 'user', title: '会员信息', templet:'#user',width:300}
-                    , {field: 'order_amount', title: '实际支付', align: 'center',templet:'#order_amount',width:150}
-                    , {field: 'delivery', title: '收货信息', align: 'center',templet:'#delivery',width:200}
-                    , {field: 'order_status_desc', title: '订单状态', align: 'center',width:100}
-                    , {fixed: 'right', title: '操作', width: 300, align: 'center', toolbar: '#order-operation'}
-                ]]
-                , page: true
-                , text: {none: '暂无数据!'}
-                ,response: {
-                    statusCode: 1 
-                  } 
-                , parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        "count": res.data.count,
-                        "data": res.data.lists,
-                    };
-                }
-                ,done: function(res, curr, count){
-                    // 解决操作栏因为内容过多换行问题
-                    $(".layui-table-main tr").each(function (index, val) {
-                        $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
-                        $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
-                    });
-                }
-            });
-        }
-
-        //监听工具条
-        table.on('tool(order-lists)', function (obj) {
-            var id = obj.data.id;
-            //订单详情
-            if(obj.event === 'detail'){
-                layer.open({
-                    type: 2
-                    ,title: '订单详情'
-                    ,content: '{:url("integral.IntegralOrder/detail")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-                        table.reload('order-lists');
-                    }
-                })
-            }
-
-            //发货
-            if(obj.event === 'delivery'){
-                layer.open({
-                    type: 2
-                    ,title: '订单发货'
-                    ,content: '{:url("integral.IntegralOrder/delivery")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-
-                    }
-                })
-            }
-
-            //物流信息
-            if(obj.event === 'express'){
-                layer.open({
-                    type: 2
-                    ,title: '物流信息'
-                    ,content: '{:url("integral.IntegralOrder/express")}?id='+id
-                    ,area: ['90%', '90%']
-                    ,yes: function(index, layero){
-
-                    }
-                })
-            }
-
-            //确认收货
-            if(obj.event === 'confirm'){
-                layer.confirm('确认订单商品已收货吗?', {
-                    btn: ['确认','取消'] //按钮
-                }, function(){
-                    like.ajax({
-                        url: '{:url("integral.IntegralOrder/confirm")}'
-                        , data: {'id': id}
-                        , type: 'post'
-                        , success: function (res) {
-                            if (res.code == 1) {
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1000
-                                },function () {
-                                    table.reload('order-lists');
-                                });
-                            }
-                        },
-                    });
-                });
-            }
-
-
-            //取消订单
-            if (obj.event === 'cancel') {
-                layer.confirm('确认取消订单吗?', {
-                    btn: ['确认', '取消'] //按钮
-                }, function () {
-                    like.ajax({
-                        url: '{:url("integral.IntegralOrder/cancel")}'
-                        , data: {'id': id}
-                        , type: 'post'
-                        , success: function (res) {
-                            if (res.code == 1) {
-                                layui.layer.msg(res.msg, {
-                                    offset: '15px'
-                                    , icon: 1
-                                    , time: 1000
-                                }, function () {
-                                    table.reload('order-lists');
-                                });
-                            }
-                        },
-                    });
-                });
-            }
-
-
-        });
-    });
-</script>

+ 0 - 98
app/admin/view/kefu/kefu/add.html

@@ -1,98 +0,0 @@
-{layout name="layout2" /}
-
-<style>
-    .input-inline-width {
-        width: 250px;
-    }
-</style>
-
-<div class="layui-card layui-form">
-    <div class="layui-card-body">
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">管理员:</label>
-            <div class="layui-inline">
-                <button class="layui-btn layui-btn-sm layui-bg-blue" id="show-admin">选择管理员</button>
-            </div>
-            <div class="layui-inline">
-                <span id="admin_selected"></span>
-            </div>
-            <input type="hidden" name="admin_id" id="admin_id">
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">客服头像:</label>
-            <div class="layui-input-block">
-                <div class="like-upload-image" switch-tab="0" lay-verType="tips">
-                    <div class="upload-image-elem"><a class="add-upload-image"> + 添加</a></div>
-                </div>
-                <div class="layui-form-mid layui-word-aux">建议尺寸:500*500像</div>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label for="nickname" class="layui-form-label">客服昵称:</label>
-            <div class="layui-input-inline input-inline-width">
-                <input type="text" id="nickname" name="nickname" lay-verify="required" autocomplete="off"
-                       class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">排序:</label>
-            <div class="layui-input-inline input-inline-width">
-                <input type="number" name="sort" autocomplete="off" class="layui-input" value="1">
-                <label class="layui-form-mid layui-word-aux">排序值越小越靠前,默认值为1</label>
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">状态:</label>
-            <div class="layui-input-block">
-                <input type="checkbox" name="disable" lay-skin="switch" lay-text="开启|关闭" checked>
-            </div>
-            <label class="layui-form-mid layui-word-aux">客服账号状态,默认开启,关闭后禁止登录客服工作台</label>
-        </div>
-
-        <div class="layui-form-item layui-hide">
-            <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
-        </div>
-    </div>
-</div>
-
-<script>
-    layui.config({
-        version: "{$front_version}",
-        base: '/static/lib/' //静态资源所在路径
-    }).use(['form'], function () {
-        var form = layui.form;
-
-
-        $('#show-admin').click(function () {
-            layer.open({
-                type: 2
-                , title: "选择管理员"
-                , content: "{:url('kefu.kefu/adminLists')}"
-                , area: ["90%", "90%"]
-                , btn: ["确定", "取消"]
-                , yes: function (index, layero) {
-                    var iframeWindow = window["layui-layer-iframe" + index];
-                    let admin_selected = iframeWindow.admin_selected();
-                    $('#admin_selected').html(admin_selected.name + '(' + admin_selected.account + ')');
-                    $('#admin_id').val(admin_selected.id);
-                    layer.close(index);
-                }
-            });
-            return false;
-        });
-
-        like.delUpload();
-        $(document).on("click", ".add-upload-image", function () {
-            like.imageUpload({
-                limit: 1,
-                field: "avatar",
-                that: $(this)
-            });
-        });
-    });
-</script>

Неке датотеке нису приказане због велике количине промена