wupengfei 3 years ago
parent
commit
87907bca8f
100 changed files with 1 additions and 8542 deletions
  1. 0 70
      application/order/controller/CrystalCash.php
  2. 0 77
      application/order/controller/CrystalOrder.php
  3. 0 92
      application/order/controller/GoodsOrder.php
  4. 0 97
      application/order/controller/IntegralOrder.php
  5. 0 87
      application/order/controller/Order.php
  6. 0 46
      application/order/view/crystal_order/index.html
  7. 0 28
      application/order/view/crystal_order/index_search.html
  8. 0 50
      application/order/view/goods_order/deliver.html
  9. 0 84
      application/order/view/goods_order/detail.html
  10. 0 47
      application/order/view/goods_order/index.html
  11. 0 50
      application/order/view/goods_order/index_search.html
  12. 0 79
      application/order/view/integral_order/deliver.html
  13. 0 125
      application/order/view/integral_order/detail.html
  14. 0 36
      application/order/view/integral_order/form.html
  15. 0 44
      application/order/view/integral_order/index.html
  16. 0 50
      application/order/view/integral_order/index_search.html
  17. 0 50
      application/order/view/order/deliver.html
  18. 0 109
      application/order/view/order/detail.html
  19. 0 36
      application/order/view/order/form.html
  20. 0 44
      application/order/view/order/index.html
  21. 0 50
      application/order/view/order/index_search.html
  22. 0 196
      application/store/command/AutoRun.php
  23. 0 139
      application/store/controller/Banner.php
  24. 0 63
      application/store/controller/Config.php
  25. 0 139
      application/store/controller/ExchangeCode.php
  26. 0 169
      application/store/controller/Goods.php
  27. 0 161
      application/store/controller/IntegralGoods.php
  28. 0 38
      application/store/controller/api/Data.php
  29. 0 38
      application/store/controller/api/Express.php
  30. 0 122
      application/store/controller/api/Goods.php
  31. 0 80
      application/store/controller/api/Member.php
  32. 0 74
      application/store/controller/api/Notify.php
  33. 0 92
      application/store/controller/api/Wechat.php
  34. 0 128
      application/store/controller/api/member/Address.php
  35. 0 122
      application/store/controller/api/member/Center.php
  36. 0 313
      application/store/controller/api/member/Order.php
  37. 0 84
      application/store/service/ExpressService.php
  38. 0 423
      application/store/service/ExtendService.php
  39. 0 71
      application/store/service/GoodsService.php
  40. 0 67
      application/store/service/OrderService.php
  41. 0 19
      application/store/sys.php
  42. 0 51
      application/store/view/banner/form.html
  43. 0 64
      application/store/view/banner/index.html
  44. 0 15
      application/store/view/banner/index_search.html
  45. 0 18
      application/store/view/config/index-about-us.html
  46. 0 18
      application/store/view/config/index-agreement.html
  47. 0 40
      application/store/view/config/index.html
  48. 0 18
      application/store/view/config/platform-agreement.html
  49. 0 18
      application/store/view/config/platform-notice.html
  50. 0 104
      application/store/view/config/platform-set.html
  51. 0 18
      application/store/view/config/privacy.html
  52. 0 18
      application/store/view/config/purchase-notice.html
  53. 0 18
      application/store/view/config/self.html
  54. 0 18
      application/store/view/config/service.html
  55. 0 28
      application/store/view/exchange_code/form.html
  56. 0 61
      application/store/view/exchange_code/index.html
  57. 0 25
      application/store/view/exchange_code/index_search.html
  58. 0 479
      application/store/view/goods/form.html
  59. 0 111
      application/store/view/goods/index.html
  60. 0 16
      application/store/view/goods/index_search.html
  61. 0 115
      application/store/view/integral_goods/form.html
  62. 0 108
      application/store/view/integral_goods/index.html
  63. 0 16
      application/store/view/integral_goods/index_search.html
  64. 0 53
      application/user/controller/Crystal.php
  65. 0 148
      application/user/controller/Gift.php
  66. 0 103
      application/user/controller/GiftLog.php
  67. 0 167
      application/user/controller/GoodsCollect.php
  68. 0 60
      application/user/controller/Invite.php
  69. 1 27
      application/user/controller/Member.php
  70. 0 68
      application/user/view/crystal/form.html
  71. 0 58
      application/user/view/crystal/index.html
  72. 0 17
      application/user/view/crystal/index_search.html
  73. 0 55
      application/user/view/gift/form.html
  74. 0 51
      application/user/view/gift/index.html
  75. 0 33
      application/user/view/gift/index_search.html
  76. 0 64
      application/user/view/gift_log/index.html
  77. 0 55
      application/user/view/goods_collect/form.html
  78. 0 79
      application/user/view/goods_collect/index.html
  79. 0 40
      application/user/view/goods_collect/index_search.html
  80. 0 40
      application/user/view/invite/index.html
  81. 0 34
      application/user/view/invite/index_search.html
  82. 0 53
      application/user/view/member/crystal.html
  83. 0 14
      application/user/view/member/index.html
  84. 0 134
      application/wechat/command/Fans.php
  85. 0 35
      application/wechat/command/fans/FansAll.php
  86. 0 35
      application/wechat/command/fans/FansBlack.php
  87. 0 36
      application/wechat/command/fans/FansList.php
  88. 0 35
      application/wechat/command/fans/FansTags.php
  89. 0 107
      application/wechat/controller/Config.php
  90. 0 140
      application/wechat/controller/Fans.php
  91. 0 60
      application/wechat/controller/Index.php
  92. 0 224
      application/wechat/controller/Keys.php
  93. 0 170
      application/wechat/controller/Menu.php
  94. 0 180
      application/wechat/controller/News.php
  95. 0 60
      application/wechat/controller/api/Js.php
  96. 0 338
      application/wechat/controller/api/Push.php
  97. 0 108
      application/wechat/controller/api/Review.php
  98. 0 254
      application/wechat/controller/api/Tools.php
  99. 0 79
      application/wechat/queue/WechatQueue.php
  100. 0 62
      application/wechat/service/FansService.php

+ 0 - 70
application/order/controller/CrystalCash.php

@@ -1,70 +0,0 @@
-<?php
-namespace app\order\controller;
-use library\Controller;
-use think\Db;
-/**
- * 元石提现管理
- * Class CrystalCash
- * @package app\order\controller
- */
-class CrystalCash extends Controller
-{
-    protected $table = 'CrystalOrder';
-    /**
-     * 充值订单
-     * @auth true
-     * @menu true
-     */
-    public function index()
-    {
-        $this->title = '充值订单';
-        $this->order_status = ['待支付','已支付'];
-        $query = $this->_query($this->table);
-        $where = [];
-        if($this->request->request('tel'))$where[]= ['u.phone','like','%'.$this->request->request('tel').'%'];
-        if($this->request->request('user_name'))$where[]= ['u.name','like','%'.$this->request->request('user_name').'%'];
-        if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
-        if($this->request->request('order_status') > -1) $where[]= ['o.status','=',$this->request->request('order_status')];
-        $query->alias('o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT');
-        if(!empty($where)) $query->where($where);
-        $query ->order('o.id desc')->page();
-    }
-
-    /**
-     * 订单详情
-     * @auth true
-     * @menu true
-     */
-    public function detail()
-    {
-        $this->title = '订单详情';
-        $order_id = input('id');
-        $detail = Db::table('crystal_order o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT')
-            ->where('o.id',$order_id)
-            ->find();
-        $this->assign('detail',$detail);
-        $this->fetch('detail');
-    }
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if ($this->request->isPost() && $this->request->action() == 'deliver') {
-            $express_company =  Db::table('store_express_company')->field('id,express_title')->find($data['express_company_id']);
-            $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
-            $data['express_send_at'] = date("Y-m-d H:i:s");
-            $data['express_state'] = 1;
-        }
-    }
-
-}

+ 0 - 77
application/order/controller/CrystalOrder.php

@@ -1,77 +0,0 @@
-<?php
-namespace app\order\controller;
-use library\Controller;
-use think\Db;
-/**
- * 元石充值订单管理
- * Class CrystalOrder
- * @package app\order\controller
- */
-class CrystalOrder extends Controller
-{
-    protected $table = 'CrystalOrder';
-    /**
-     * 充值订单
-     * @auth true
-     * @menu true
-     */
-    public function index()
-    {
-        $this->title = '充值订单';
-        $this->order_status = ['待支付','已支付'];
-        $order_stat = Db::table('crystal_order')
-            ->where('status',1)
-            ->field('price_total')
-            ->select();
-        $this->order_num = empty($order_stat) ? 0: count($order_stat);
-        $this->total_money = empty($order_stat) ? 0: array_sum(array_column($order_stat,'price_total'));
-
-        $query = $this->_query($this->table);
-        $where = [];
-        if($this->request->request('tel'))$where[]= ['u.phone','like','%'.$this->request->request('tel').'%'];
-        if($this->request->request('user_name'))$where[]= ['u.name','like','%'.$this->request->request('user_name').'%'];
-        if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
-        $where[]= ['o.status','=',1];
-        $query->alias('o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT');
-        if(!empty($where)) $query->where($where);
-        $query ->order('o.id desc')->page();
-    }
-
-    /**
-     * 订单详情
-     * @auth true
-     * @menu true
-     */
-    public function detail()
-    {
-        $this->title = '订单详情';
-        $order_id = input('id');
-        $detail = Db::table('crystal_order o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT')
-            ->where('o.id',$order_id)
-            ->find();
-        $this->assign('detail',$detail);
-        $this->fetch('detail');
-    }
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if ($this->request->isPost() && $this->request->action() == 'deliver') {
-            $express_company =  Db::table('store_express_company')->field('id,express_title')->find($data['express_company_id']);
-            $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
-            $data['express_send_at'] = date("Y-m-d H:i:s");
-            $data['express_state'] = 1;
-        }
-    }
-
-}

+ 0 - 92
application/order/controller/GoodsOrder.php

@@ -1,92 +0,0 @@
-<?php
-namespace app\order\controller;
-use library\Controller;
-use think\Db;
-/**
- * 商品订单
- * Class Order
- * @package app\order\controller
- */
-class GoodsOrder extends Controller
-{
-    protected $table = 'GoodsOrder';
-    /**
-     * 订单列表
-     * @auth true
-     * @menu true
-     */
-    public function index()
-    {
-        $this->title = '订单管理';
-        $this->order_status = ['待支付','已支付'];
-        $order_stat = Db::table('goods_order')
-            ->where('status',1)
-            ->field('price_total')
-            ->select();
-        $this->order_num = empty($order_stat) ? 0: count($order_stat);
-        $this->total_money = empty($order_stat) ? 0: array_sum(array_column($order_stat,'price_total'));
-        $query = $this->_query($this->table);
-        $where = [];
-        if($this->request->request('tel'))$where[]= ['u.phone','like','%'.$this->request->request('tel').'%'];
-        if($this->request->request('user_name'))$where[]= ['u.name','like','%'.$this->request->request('user_name').'%'];
-        if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
-        if($this->request->request('order_status') > -1) $where[]= ['o.status','=',$this->request->request('order_status')];
-        $query->alias('o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT');
-        if(!empty($where)) $query->where($where);
-        $query ->order('o.id desc')->page();
-    }
-
-
-    /**
-     * 订单详情
-     * @auth true
-     * @menu true
-     */
-    public function detail()
-    {
-        $this->title = '订单详情';
-        $order_id = input('id');
-        $detail = Db::table('goods_order o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT')
-            ->where('o.id',$order_id)
-            ->find();
-        $this->assign('detail',$detail);
-        $this->fetch('detail');
-    }
-
-    /**
-     * 订单发货
-     * @auth true
-     * @menu true
-     */
-
-    public function deliver()
-    {
-        $this->title = '发货';
-        $this->express_company = Db::table('store_express_company')->field('id,express_title')->select();
-        $this->_form($this->table,'deliver');
-    }
-
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if ($this->request->isPost() && $this->request->action() == 'deliver') {
-            $express_company =  Db::table('store_express_company')->field('id,express_title')->find($data['express_company_id']);
-            $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
-            $data['express_send_at'] = date("Y-m-d H:i:s");
-            $data['express_state'] = 1;
-        }
-    }
-
-
-}

+ 0 - 97
application/order/controller/IntegralOrder.php

@@ -1,97 +0,0 @@
-<?php
-namespace app\order\controller;
-use library\Controller;
-use think\Db;
-/**
- * 兑换订单管理
- * Class IntegralOrder
- * @package app\order\controller
- */
-class IntegralOrder extends Controller
-{
-    protected $table = 'ExchangeOrder';
-    /**
-     * 订单列表
-     * @auth true
-     * @menu true
-     */
-    public function index()
-    {
-        $this->title = '兑换订单管理';
-        $this->order_status = ['待支付','已支付/待发货','已发货/待收货','已收货'];
-        $query = $this->_query($this->table);
-        $where = [];
-        $where[] = ['o.is_deleted','=',0];
-        $where[] = ['o.cancel_state','=',0];
-        if($this->request->request('tel'))$where[]= ['u.phone','like','%'.$this->request->request('tel').'%'];
-        if($this->request->request('user_name'))$where[]= ['u.name','like','%'.$this->request->request('user_name').'%'];
-        if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
-        if($this->request->request('order_status') > -1) $where[]= ['o.status','=',$this->request->request('order_status')];
-
-        $query->alias('o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT');
-        if(!empty($where)) $query->where($where);
-        $query ->order('o.id desc')->page();
-    }
-
-
-    /**
-     * 订单详情
-     * @auth true
-     * @menu true
-     */
-    public function detail()
-    {
-        $this->title = '兑换订单详情';
-        $order_id = input('id');
-        $detail = Db::table('exchange_order o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT')
-            ->where('o.id',$order_id)
-            ->find();
-        $address_info = Db::table('delivery_address')->field('id,mer_name,detail,phone,name')->find($detail['address_id']);
-        $this->assign('detail',$detail);
-        $this->assign('address_info',$address_info);
-        $this->fetch('detail');
-    }
-
-    /**
-     * 订单发货
-     * @auth true
-     * @menu true
-     */
-
-    public function deliver()
-    {
-        $this->title = '发货';
-        $this->express_company = Db::table('store_express_company')->field('id,express_title')->select();
-        $this->_form($this->table,'deliver');
-    }
-
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if ($this->request->isPost() && $this->request->action() == 'deliver') {
-            $express_company =  Db::table('store_express_company')->field('id,express_title')->find($data['express_company_id']);
-            $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
-            $data['express_send_at'] = date("Y-m-d H:i:s");
-            $data['express_state'] = 1;
-            $data['status'] = 2;
-        }
-        if ($this->request->isGet() && $this->request->action() == 'deliver') {
-            if (isset($data['address_id'])){
-                $this->address_info = Db::table('delivery_address')->field('id,mer_name,detail,phone,name')->find($data['address_id']);
-            }
-        }
-    }
-
-
-}

+ 0 - 87
application/order/controller/Order.php

@@ -1,87 +0,0 @@
-<?php
-namespace app\order\controller;
-use library\Controller;
-use think\Db;
-/**
- * 订单管理
- * Class Order
- * @package app\order\controller
- */
-class Order extends Controller
-{
-    protected $table = 'StoreOrder';
-    /**
-     * 订单列表
-     * @auth true
-     * @menu true
-     */
-    public function index()
-    {
-        $this->title = '线上商城订单管理';
-        $this->order_status = ['待支付','已支付/待发货','已发货/待收货','已收货','已评论','','','','','已取消'];
-        $query = $this->_query($this->table);
-        $where = [];
-        if($this->request->request('tel'))$where[]= ['u.phone','like','%'.$this->request->request('tel').'%'];
-        if($this->request->request('user_name'))$where[]= ['u.name','like','%'.$this->request->request('user_name').'%'];
-        if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
-        if($this->request->request('order_status') > -1) $where[]= ['o.status','=',$this->request->request('order_status')];
-        $where[] =['source','=',0] ;
-        $query->alias('o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT');
-        if(!empty($where)) $query->where($where);
-        $query ->order('o.id desc')->page();
-    }
-
-
-    /**
-     * 订单详情
-     * @auth true
-     * @menu true
-     */
-    public function detail()
-    {
-        $this->title = '订单详情';
-        $order_id = input('id');
-        $detail = Db::table('store_order o')
-            ->field('o.* , u.name as user_name ,u.phone')
-            ->join('store_member u',' o.uid = u.id ','LEFT')
-            ->where('o.id',$order_id)
-            ->find();
-        $this->assign('detail',$detail);
-        $this->fetch('detail');
-    }
-
-    /**
-     * 订单发货
-     * @auth true
-     * @menu true
-     */
-
-    public function deliver()
-    {
-        $this->title = '发货';
-        $this->express_company = Db::table('store_express_company')->field('id,express_title')->select();
-        $this->_form($this->table,'deliver');
-    }
-
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if ($this->request->isPost() && $this->request->action() == 'deliver') {
-            $express_company =  Db::table('store_express_company')->field('id,express_title')->find($data['express_company_id']);
-            $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
-            $data['express_send_at'] = date("Y-m-d H:i:s");
-            $data['express_state'] = 1;
-        }
-    }
-
-
-}

+ 0 - 46
application/order/view/crystal_order/index.html

@@ -1,46 +0,0 @@
-{extend name='admin@main'}
-{block name="content"}
-<div class="think-box-shadow">
-    <div style="background-color: #e3e3c7 ;height: 50px;overflow: hidden">
-        <p style="line-height: 50px;font-size: 16px">&nbsp;&nbsp;
-            总订单数:<span style='color:red'>{$order_num}</span> ,
-            总金额:<span style='color:red'>{$total_money}</span>
-        </p>
-    </div>
-    {include file='crystal_order/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
-            <th class='text-left nowrap'>用户名</th>
-            <th class='text-left nowrap'>手机号</th>
-            <th class='text-left nowrap'>订单金额</th>
-            <th class='text-left nowrap'>充值元石</th>
-            <th class='text-left nowrap'>订单号</th>
-            <th class='text-left nowrap'>订单状态</th>
-            <th class="text-left nowrap">支付时间</th>
-            <th class="text-left nowrap">添加时间</th>
-
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
-            <td class='text-left nowrap'>{$vo.user_name|default=''}</td>
-            <td class='text-left nowrap'>{$vo.phone|default=''}</td>
-            <td class='text-left nowrap'>{$vo.price_total|default=''}</td>
-            <td class='text-left nowrap'>{$vo.crystal|default=''}</td>
-            <td class='text-left nowrap'>{$vo.order_no|default=''}</td>
-            <td class='text-left nowrap'>{$order_status[$vo.status]|default=''}</td>
-            <td class='text-left nowrap'>{$vo.pay_at|default='--'}</td>
-            <td class='text-left nowrap'>{$vo.create_at}</td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-{/block}

+ 0 - 28
application/order/view/crystal_order/index_search.html

@@ -1,28 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单号</label>
-            <div class="layui-input-inline">
-                <input name="order_no" value="{$Think.get.order_no|default=''}" placeholder="请输入订单号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="tel" value="{$Think.get.tel|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">用户名称</label>
-            <div class="layui-input-inline">
-                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入用户名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 50
application/order/view/goods_order/deliver.html

@@ -1,50 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body" style="height: 400px">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">订单号</label>
-            <label class="layui-col-xs10">
-                <input name="order_no"  style="background-color: #e6e6e6" readonly value='{$vo.order_no|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">快递公司</label>
-            <div class="layui-input-inline">
-                <select name="express_company_id" >
-                    {foreach $express_company as $ck=>$cv}
-                        {if $cv.id == $vo.express_company_id}
-                        <option selected value="{$cv.id}">{$cv.express_title}</option>
-                        {else}
-                        <option value="{$cv.id}">{$cv.express_title}</option>
-                        {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">物流单号</label>
-            <label class="layui-col-xs10">
-                <input name="express_send_no"  value='{$vo.express_send_no}' placeholder="请输入物流单号" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">发货时间</label>
-            <label class="layui-col-xs10">
-                <input readonly name="express_send_at"  value='{$vo.express_send_at|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <input type='hidden' value='{$vo.uid}' name='uid'>
-        <button class="layui-btn" type='submit'>发货</button>
-    </div>
-</form>
-<script>
-    window.form.render();
-    $("#layui-layer-content").height(600)
-</script>

+ 0 - 84
application/order/view/goods_order/detail.html

@@ -1,84 +0,0 @@
-<style>
-    .layui-card-body
-    {
-        height: 60%;
-    }
-</style>
-<div class="layui-card-body">
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">订单号</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.order_no|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    {if $detail.pay_state == 1}
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">支付号</label>
-            <div class="layui-input-block">
-                <input  readonly  value='{$detail.pay_no|default=""}' placeholder="" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">支付时间</label>
-            <div class="layui-input-block">
-                <input  readonly  value='{$detail.pay_time|default=""}' placeholder="" class="layui-input">
-            </div>
-        </div>
-    {/if}
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">用户名</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.user_name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">会员手机</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.phone|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">商品数</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.goods_num|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">商品名称</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.goods_name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">商品封面</label>
-        <div class="layui-input-block">
-            <img  src="{$detail.goods_cover|default=''}" width="50px">
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">订单总金额</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.price_total|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">创建时间</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.create_at|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-</div>
-
-<script>
-    window.form.render();
-
-</script>

+ 0 - 47
application/order/view/goods_order/index.html

@@ -1,47 +0,0 @@
-{extend name='admin@main'}
-{block name="content"}
-<div class="think-box-shadow">
-    <div style="background-color: #e3e3c7 ;height: 50px;overflow: hidden">
-        <p style="line-height: 50px;font-size: 16px">&nbsp;&nbsp;
-            总支付单数:<span style='color:red'>{$order_num}</span> ,
-            总销售额:<span style='color:red'>{$total_money}</span>
-        </p>
-    </div>
-    {include file='goods_order/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
-            <th class='text-left nowrap'>用户名</th>
-            <th class='text-left nowrap'>手机号</th>
-            <th class='text-left nowrap'>订单金额</th>
-            <th class='text-left nowrap'>商品数量</th>
-            <th class='text-left nowrap'>订单号</th>
-            <th class='text-left nowrap'>订单状态</th>
-            <th class="text-left nowrap">添加时间</th>
-            <th class="text-left nowrap">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
-            <td class='text-left nowrap'>{$vo.user_name|default=''}</td>
-            <td class='text-left nowrap'>{$vo.phone|default=''}</td>
-            <td class='text-left nowrap'>{$vo.price_total|default=''}</td>
-            <td class='text-left nowrap'>{$vo.goods_num|default=''}</td>
-            <td class='text-left nowrap'>{$vo.order_no|default=''}</td>
-            <td class='text-left nowrap'>{$order_status[$vo.status]|default='已取消'}</td>
-            <td class='text-left nowrap'>{$vo.create_at}</td>
-            <td class='text-left nowrap'>
-                <a data-title="查看详情" class="layui-btn layui-btn-sm" data-modal='{:url("detail")}?id={$vo.id}'>查看详情</a>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-{/block}

+ 0 - 50
application/order/view/goods_order/index_search.html

@@ -1,50 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单号</label>
-            <div class="layui-input-inline">
-                <input name="order_no" value="{$Think.get.order_no|default=''}" placeholder="请输入订单号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="tel" value="{$Think.get.tel|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">用户名称</label>
-            <div class="layui-input-inline">
-                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入用户名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单状态</label>
-            <div class="layui-input-inline">
-                <select class="layui-select" name="order_status">
-                    <option  value="-1">全部</option>
-                    {foreach $order_status as $k=>$v}
-                        {if $v}
-                            {if $Think.get.order_status eq $k}
-                            <option selected value="{$k}">{$v}</option>
-                            {else}
-                            <option  value="{$k}">{$v}</option>
-                            {/if}
-                        {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-
-
-
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 79
application/order/view/integral_order/deliver.html

@@ -1,79 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body" style="height: 400px">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">订单号</label>
-            <label class="layui-col-xs10">
-                <input name="order_no"  style="background-color: #e6e6e6" readonly value='{$vo.order_no|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">收货地区</label>
-            <label class="layui-col-xs10">
-                <input  style="background-color: #e6e6e6" readonly value='{$address_info.mer_name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">详细地址</label>
-            <label class="layui-col-xs10">
-                <input  style="background-color: #e6e6e6" readonly value='{$address_info.detail|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">收货人</label>
-            <label class="layui-col-xs10">
-                <input  style="background-color: #e6e6e6" readonly value='{$address_info.name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">电话</label>
-            <label class="layui-col-xs10">
-                <input  style="background-color: #e6e6e6" readonly value='{$address_info.phone|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">快递公司</label>
-            <div class="layui-input-inline">
-                <select name="express_company_id" >
-                    {foreach $express_company as $ck=>$cv}
-                    {if $cv.id == $vo.express_company_id}
-                    <option selected value="{$cv.id}">{$cv.express_title}</option>
-                    {else}
-                    <option value="{$cv.id}">{$cv.express_title}</option>
-                    {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">物流单号</label>
-            <label class="layui-col-xs10">
-                <input name="express_send_no"  value='{$vo.express_send_no}' placeholder="请输入物流单号" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">发货时间</label>
-            <label class="layui-col-xs10">
-                <input readonly name="express_send_at"  value='{$vo.express_send_at|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center" style="margin-top: 100px">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <input type='hidden' value='{$vo.uid}' name='uid'>
-        <button class="layui-btn" type='submit'>发货</button>
-    </div>
-</form>
-<script>
-    window.form.render();
-    $("#layui-layer-content").height(800)
-</script>

+ 0 - 125
application/order/view/integral_order/detail.html

@@ -1,125 +0,0 @@
-<style>
-    .layui-card-body
-    {
-        height: 60%;
-    }
-</style>
-<div class="layui-card-body">
-    <div class="layui-form-item">
-        <label class="layui-form-label ">订单号</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.order_no|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    {if $detail.express_send_no}
-    <div class="layui-form-item">
-        <label class="layui-form-label ">物流单号</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.express_send_no|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    {/if}
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">用户名</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.user_name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label ">会员手机</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.phone|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">商品名称</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.goods_name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">商品封面</label>
-        <div class="layui-input-block">
-            <img  src="{$detail.goods_cover}" style="height: 50px;width: 50px" />
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">商品数</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.goods_num|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label ">订单总额</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.price_total|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">收货地区</label>
-        <div class="layui-input-block">
-            <input  readonly value='{$address_info.mer_name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">详细地址</label>
-        <div class="layui-input-block">
-            <input  readonly value='{$address_info.detail|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">收货人</label>
-        <div class="layui-input-block">
-            <input   readonly value='{$address_info.name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label ">电话</label>
-        <div class="layui-input-block">
-            <input  readonly value='{$address_info.phone|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label ">物流公司</label>
-        <div class="layui-input-block">
-            <input name="express_company_title"  value='{$detail.express_company_title}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">物流单号</label>
-        <div class="layui-input-block">
-            <input name="express_send_no"  value='{$detail.express_send_no}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label ">发货时间</label>
-        <div class="layui-input-block">
-            <input readonly name="express_send_at"  value='{$detail.express_send_at|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label ">兑换时间</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.pay_time|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-</div>
-
-<script>
-    window.form.render();
-
-</script>

+ 0 - 36
application/order/view/integral_order/form.html

@@ -1,36 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">用户名</label>
-            <label class="layui-col-xs10">
-                {notempty name='vo.id'}  <input name="name" required value='{$vo.name|default=""}' style="background-color: #e6e6e6" readonly class="layui-input">{/notempty}
-                {empty name='vo.id'}  <input name="name" required value='{$vo.name|default=""}' placeholder="请输入用户名" class="layui-input">{/empty}
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">登录手机号</label>
-            <label class="layui-col-xs10">
-                {notempty name='vo.id'}    <input name="phone" required value='{$vo.phone|default=""}' style="background-color: #e6e6e6" readonly class="layui-input">{/notempty}
-                {empty name='vo.id'}       <input name="phone" required value='{$vo.phone|default=""}' placeholder="请输入登录手机号" class="layui-input">{/empty}
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">登录密码</label>
-            <label class="layui-col-xs10">
-                <input name="password" required value='{$vo.password|default=""}' placeholder="请输入登录密码" class="layui-input">
-            </label>
-        </div>
-
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <button class="layui-btn" type='submit'>保存数据</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
-    </div>
-</form>

+ 0 - 44
application/order/view/integral_order/index.html

@@ -1,44 +0,0 @@
-{extend name='admin@main'}
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='integral_order/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
-            <th class='text-left nowrap'>用户名</th>
-            <th class='text-left nowrap'>手机号</th>
-            <th class='text-left nowrap'>订单金额</th>
-            <th class='text-left nowrap'>商品数量</th>
-            <th class='text-left nowrap'>订单号</th>
-            <th class='text-left nowrap'>订单状态</th>
-            <th class="text-left nowrap">添加时间</th>
-            <th class="text-left nowrap">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
-            <td class='text-left nowrap'>{$vo.user_name|default=''}</td>
-            <td class='text-left nowrap'>{$vo.phone|default=''}</td>
-            <td class='text-left nowrap'>{$vo.price_total|default=''}</td>
-            <td class='text-left nowrap'>{$vo.goods_num|default=''}</td>
-            <td class='text-left nowrap'>{$vo.order_no|default=''}</td>
-            <td class='text-left nowrap'>{$order_status[$vo.status]|default=''}</td>
-            <td class='text-left nowrap'>{$vo.create_at}</td>
-            <td class='text-left nowrap'>
-                {if $vo.status > 0 && $vo.status != 9}
-                <a data-title="发货" class="layui-btn layui-btn-sm" data-modal='{:url("deliver")}?id={$vo.id}'>发货</a>
-                {/if}
-                <a data-title="查看详情" class="layui-btn layui-btn-sm" data-modal='{:url("detail")}?id={$vo.id}'>查看详情</a>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-{/block}

+ 0 - 50
application/order/view/integral_order/index_search.html

@@ -1,50 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单号</label>
-            <div class="layui-input-inline">
-                <input name="order_no" value="{$Think.get.order_no|default=''}" placeholder="请输入订单号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="tel" value="{$Think.get.tel|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">用户名称</label>
-            <div class="layui-input-inline">
-                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入用户名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单状态</label>
-            <div class="layui-input-inline">
-                <select class="layui-select" name="order_status">
-                    <option  value="-1">全部</option>
-                    {foreach $order_status as $k=>$v}
-                    {if $v}
-                    {if $Think.get.order_status eq $k}
-                    <option selected value="{$k}">{$v}</option>
-                    {else}
-                    <option  value="{$k}">{$v}</option>
-                    {/if}
-                    {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-
-
-
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 50
application/order/view/order/deliver.html

@@ -1,50 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body" style="height: 400px">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">订单号</label>
-            <label class="layui-col-xs10">
-                <input name="order_no"  style="background-color: #e6e6e6" readonly value='{$vo.order_no|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">快递公司</label>
-            <div class="layui-input-inline">
-                <select name="express_company_id" >
-                    {foreach $express_company as $ck=>$cv}
-                        {if $cv.id == $vo.express_company_id}
-                        <option selected value="{$cv.id}">{$cv.express_title}</option>
-                        {else}
-                        <option value="{$cv.id}">{$cv.express_title}</option>
-                        {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">物流单号</label>
-            <label class="layui-col-xs10">
-                <input name="express_send_no"  value='{$vo.express_send_no}' placeholder="请输入物流单号" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">发货时间</label>
-            <label class="layui-col-xs10">
-                <input readonly name="express_send_at"  value='{$vo.express_send_at|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <input type='hidden' value='{$vo.uid}' name='uid'>
-        <button class="layui-btn" type='submit'>发货</button>
-    </div>
-</form>
-<script>
-    window.form.render();
-    $("#layui-layer-content").height(600)
-</script>

+ 0 - 109
application/order/view/order/detail.html

@@ -1,109 +0,0 @@
-<style>
-    .layui-card-body
-    {
-        height: 60%;
-    }
-</style>
-<div class="layui-card-body">
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">订单号</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.order_no|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    {if $detail.express_send_no}
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">物流单号</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.express_send_no|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    {/if}
-    {if $detail.pay_state == 1}
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">支付号</label>
-            <div class="layui-input-block">
-                <input  readonly  value='{$detail.pay_no|default=""}' placeholder="" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">支付时间</label>
-            <div class="layui-input-block">
-                <input  readonly  value='{$detail.pay_at|default=""}' placeholder="" class="layui-input">
-            </div>
-        </div>
-    {/if}
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">用户名</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.user_name|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">会员手机</label>
-        <div class="layui-input-block">
-            <input  readonly  value='{$detail.phone|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">商品数</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.total_num|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">商品详情</label>
-        <div class="layui-input-block">
-            <table class="layui-table margin-top-10" lay-skin="line">
-                <thead>
-                <tr>
-                    <th class='text-left nowrap'>货号</th>
-                    <th class='text-left nowrap'>图片</th>
-                    <th class='text-left nowrap'>数量</th>
-                    <th class='text-left nowrap'>价格</th>
-                </tr>
-                </thead>
-                <tbody class="no_html">
-                {foreach :json_decode($detail.pro_info,true) as $sk=>$sv}
-                <tr class="no_detail">
-                    <td class='text-left nowrap'>
-                        <input class='layui-input' readonly style="background-color: #e6e6e6" name='goods_no[]' value="{$sv['goods_no']}"/>
-                    </td>
-                    <td class='text-left nowrap'><img  src="{$vo.spec_img|default=''}" width="30px"></td>
-                    <td class='text-left nowrap'>
-                        <input class='layui-input'  readonly style="background-color: #e6e6e6" name='store_num[]' value="{$sv['num']}"/>
-                    </td>
-                    <td class='text-left nowrap'>
-                        <input class='layui-input'  readonly style="background-color: #e6e6e6" name='sell_money[]' value="{$sv['sell_money']}"/>
-                    </td>
-                </tr>
-                {/foreach}
-                </tbody>
-            </table>
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">订单总金额</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.price_total|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-
-    <div class="layui-form-item">
-        <label class="layui-form-label label-required">创建时间</label>
-        <div class="layui-input-block">
-            <input readonly  value='{$detail.create_at|default=""}' placeholder="" class="layui-input">
-        </div>
-    </div>
-
-</div>
-
-<script>
-    window.form.render();
-
-</script>

+ 0 - 36
application/order/view/order/form.html

@@ -1,36 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">用户名</label>
-            <label class="layui-col-xs10">
-                {notempty name='vo.id'}  <input name="name" required value='{$vo.name|default=""}' style="background-color: #e6e6e6" readonly class="layui-input">{/notempty}
-                {empty name='vo.id'}  <input name="name" required value='{$vo.name|default=""}' placeholder="请输入用户名" class="layui-input">{/empty}
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">登录手机号</label>
-            <label class="layui-col-xs10">
-                {notempty name='vo.id'}    <input name="phone" required value='{$vo.phone|default=""}' style="background-color: #e6e6e6" readonly class="layui-input">{/notempty}
-                {empty name='vo.id'}       <input name="phone" required value='{$vo.phone|default=""}' placeholder="请输入登录手机号" class="layui-input">{/empty}
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">登录密码</label>
-            <label class="layui-col-xs10">
-                <input name="password" required value='{$vo.password|default=""}' placeholder="请输入登录密码" class="layui-input">
-            </label>
-        </div>
-
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <button class="layui-btn" type='submit'>保存数据</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
-    </div>
-</form>

+ 0 - 44
application/order/view/order/index.html

@@ -1,44 +0,0 @@
-{extend name='admin@main'}
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='order/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
-            <th class='text-left nowrap'>用户名</th>
-            <th class='text-left nowrap'>手机号</th>
-            <th class='text-left nowrap'>订单金额</th>
-            <th class='text-left nowrap'>商品数量</th>
-            <th class='text-left nowrap'>订单号</th>
-            <th class='text-left nowrap'>订单状态</th>
-            <th class="text-center nowrap">添加时间</th>
-            <th class="text-center nowrap">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
-            <td class='text-left nowrap'>{$vo.user_name|default=''}</td>
-            <td class='text-left nowrap'>{$vo.phone|default=''}</td>
-            <td class='text-left nowrap'>{$vo.price_total|default=''}</td>
-            <td class='text-left nowrap'>{$vo.goods_num|default=''}</td>
-            <td class='text-left nowrap'>{$vo.order_no|default=''}</td>
-            <td class='text-left nowrap'>{$order_status[$vo.status]|default=''}</td>
-            <td class='text-center nowrap'>{$vo.create_at}</td>
-            <td class='text-center nowrap'>
-                {if $vo.status > 0 && $vo.status != 9}
-                <a data-title="发货" class="layui-btn layui-btn-sm" data-modal='{:url("deliver")}?id={$vo.id}'>发货</a>
-                {/if}
-                <a data-title="查看详情" class="layui-btn layui-btn-sm" data-modal='{:url("detail")}?id={$vo.id}'>查看详情</a>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-{/block}

+ 0 - 50
application/order/view/order/index_search.html

@@ -1,50 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单号</label>
-            <div class="layui-input-inline">
-                <input name="order_no" value="{$Think.get.order_no|default=''}" placeholder="请输入订单号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="tel" value="{$Think.get.tel|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">用户名称</label>
-            <div class="layui-input-inline">
-                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入用户名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">订单状态</label>
-            <div class="layui-input-inline">
-                <select class="layui-select" name="order_status">
-                    <option  value="-1">全部</option>
-                    {foreach $order_status as $k=>$v}
-                        {if $v}
-                            {if $Think.get.order_status eq $k}
-                            <option selected value="{$k}">{$v}</option>
-                            {else}
-                            <option  value="{$k}">{$v}</option>
-                            {/if}
-                        {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-
-
-
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 196
application/store/command/AutoRun.php

@@ -1,196 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\command;
-
-use think\console\Command;
-use think\console\Input;
-use think\console\Output;
-use think\Db;
-use think\db\exception\DataNotFoundException;
-use think\db\exception\ModelNotFoundException;
-use think\Exception;
-use think\exception\DbException;
-use think\exception\PDOException;
-use We;
-
-/**
- * 商城数据处理指令
- * Class AutoRun
- * @package app\store\command
- */
-class AutoRun extends Command
-{
-
-    /**
-     * 配置指令信息
-     */
-    protected function configure()
-    {
-        $this->setName('xclean:store')->setDescription('[清理]检查并处理商城任务');
-    }
-
-    /**
-     * 业务指令执行
-     * @param Input $input
-     * @param Output $output
-     * @throws Exception
-     * @throws DataNotFoundException
-     * @throws ModelNotFoundException
-     * @throws DbException
-     * @throws PDOException
-     */
-    protected function execute(Input $input, Output $output)
-    {
-        // 自动取消30分钟未支付的订单
-        $this->autoCancelOrder();
-        // 清理一天前未支付的订单
-        $this->autoRemoveOrder();
-        // 订单自动退款处理
-        // $this->autoRefundOrder();
-        // 提现自动打款处理
-        // $this->autoTransfer();
-    }
-
-    /**
-     * 自动取消30分钟未支付的订单
-     * @throws Exception
-     * @throws PDOException
-     */
-    private function autoCancelOrder()
-    {
-        $datetime = $this->getDatetime('store_order_wait_time');
-        $where = [['status', 'in', ['1', '2']], ['pay_state', 'eq', '0'], ['create_at', '<', $datetime]];
-        $count = Db::name('StoreOrder')->where($where)->update([
-            'status'       => '0',
-            'cancel_state' => '1',
-            'cancel_at'    => date('Y-m-d H:i:s'),
-            'cancel_desc'  => '30分钟未完成支付自动取消订单',
-        ]);
-        if ($count > 0) {
-            $this->output->info("共计自动取消了30分钟未支付的{$count}笔订单!");
-        } else {
-            $this->output->comment('没有需要自动取消30分钟未支付的订单记录!');
-        }
-    }
-
-    /**
-     * 清理一天前未支付的订单
-     * @throws Exception
-     * @throws DataNotFoundException
-     * @throws ModelNotFoundException
-     * @throws DbException
-     * @throws PDOException
-     */
-    private function autoRemoveOrder()
-    {
-        $datetime = $this->getDatetime('store_order_clear_time');
-        $where = [['status', 'eq', '0'], ['pay_state', 'eq', '0'], ['create_at', '<', $datetime]];
-        $list = Db::name('StoreOrder')->where($where)->limit(20)->select();
-        if (count($orderNos = array_unique(array_column($list, 'order_no'))) > 0) {
-            $this->output->info("自动删除前一天已经取消的订单:" . PHP_EOL . join(',' . PHP_EOL, $orderNos));
-            Db::name('StoreOrder')->whereIn('order_no', $orderNos)->delete();
-            Db::name('StoreOrderList')->whereIn('order_no', $orderNos)->delete();
-        } else {
-            $this->output->comment('没有需要自动删除前一天已经取消的订单!');
-        }
-    }
-
-    /**
-     * 订单自动退款操作
-     * @throws Exception
-     * @throws DataNotFoundException
-     * @throws ModelNotFoundException
-     * @throws DbException
-     * @throws PDOException
-     */
-    private function autoRefundOrder()
-    {
-        // 未完成退款的订单,执行微信退款操作
-        foreach (Db::name('StoreOrder')->where(['refund_state' => '1'])->select() as $order) try {
-            $this->output->writeln("正在为 {$order['order_no']} 执行退款操作...");
-            $result = We::WePayRefund(config('wechat.wxpay'))->create([
-                'transaction_id' => $order['pay_no'],
-                'out_refund_no'  => $order['refund_no'],
-                'total_fee'      => $order['price_total'] * 100,
-                'refund_fee'     => $order['pay_price'] * 100,
-                'refund_account' => 'REFUND_SOURCE_UNSETTLED_FUNDS',
-            ]);
-            if ($result['return_code'] === 'SUCCESS' && $result['result_code'] === 'SUCCESS') {
-                Db::name('StoreOrder')->where(['order_no' => $order['order_no']])->update([
-                    'refund_state' => '2', 'refund_desc' => '自动退款成功!',
-                ]);
-            } else {
-                Db::name('StoreOrder')->where(['order_no' => $order['order_no']])->update([
-                    'refund_desc' => isset($result['err_code_des']) ? $result['err_code_des'] : '自动退款失败',
-                ]);
-            }
-        } catch (\Exception $e) {
-            $this->output->writeln("订单 {$order['order_no']} 执行退款失败,{$e->getMessage()}!");
-            Db::name('StoreOrder')->where(['order_no' => $order['order_no']])->update(['refund_desc' => $e->getMessage()]);
-        }
-        $this->output->writeln('自动检测退款订单执行完成!');
-    }
-
-    /**
-     * 自动企业打款操作
-     * @throws Exception
-     * @throws DataNotFoundException
-     * @throws ModelNotFoundException
-     * @throws DbException
-     * @throws PDOException
-     */
-    private function autoTransfer()
-    {
-        # 批量企业打款
-        foreach (Db::name('StoreProfitUsed')->where(['status' => '1'])->select() as $vo) try {
-            $wechat = We::WePayTransfers(config('wechat.wxpay'));
-            $result = $wechat->create([
-                'partner_trade_no' => $vo['trs_no'],
-                'openid'           => $vo['openid'],
-                'check_name'       => 'NO_CHECK',
-                'amount'           => $vo['pay_price'] * 100,
-                'desc'             => '营销活动拥金提现',
-                'spbill_create_ip' => '127.0.0.1',
-            ]);
-            if ($result['return_code'] === 'SUCCESS' && $result['result_code'] === 'SUCCESS') {
-                Db::name('StoreProfitUsed')->where(['trs_no' => $vo['trs_no']])->update([
-                    'status' => '2', 'pay_desc' => '拥金提现成功!', 'pay_no' => $result['payment_no'], 'pay_at' => date('Y-m-d H:i:s'),
-                ]);
-            } else {
-                Db::name('StoreProfitUsed')->where(['trs_no' => $vo['trs_no']])->update([
-                    'pay_desc' => isset($result['err_code_des']) ? $result['err_code_des'] : '自动打款失败', 'last_at' => date('Y-m-d H:i:s'),
-                ]);
-            }
-        } catch (\Exception $e) {
-            $this->output->writeln("订单 {$vo['trs_no']} 执行提现失败,{$e->getMessage()}!");
-            Db::name('StoreProfitUsed')->where(['trs_no' => $vo['trs_no']])->update(['pay_desc' => $e->getMessage()]);
-        }
-    }
-
-    /**
-     * 获取配置时间
-     * @param string $code
-     * @return string
-     * @throws Exception
-     * @throws PDOException
-     */
-    private function getDatetime($code)
-    {
-        $minutes = intval(sysconf($code) * 60);
-        return date('Y-m-d H:i:s', strtotime("-{$minutes} minutes"));
-    }
-
-}

+ 0 - 139
application/store/controller/Banner.php

@@ -1,139 +0,0 @@
-<?php
-namespace app\store\controller;
-use library\Controller;
-use think\Db;
-
-/**
- * 轮播图
- * Class Goods
- * @package app\store\controller
- */
-class Banner extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'StoreBanner';
-
-    /**
-     * 轮播图列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '轮播图列表';
-        $query = $this->_query($this->table)->where('is_deleted',0);
-        $query->like('name');
-        $query->order(' sort desc , id desc')->page();
-    }
-
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-
-    }
-
-
-
-
-
-
-
-    /**
-     * 添加轮播图
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function add()
-    {
-        $this->title = '添加轮播图';
-        $this->_form($this->table, 'form');
-    }
-
-
-    /**
-     * 编辑轮播图
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function edit()
-    {
-        $this->title = '编辑轮播图';
-        $this->_form($this->table, 'form');
-    }
-
-    /**
-     * 禁用
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function forbidden()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 启用
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function enable()
-    {
-        $this->_save($this->table, ['status' => 1]);
-    }
-
-    /**
-     * 删除
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function del()
-    {
-        $this->_save($this->table, ['is_deleted' => 1]);
-    }
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        $data['create_at'] = date('Y-m-d H:i:s');
-    }
-
-}

+ 0 - 63
application/store/controller/Config.php

@@ -1,63 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller;
-
-use app\store\service\ExtendService;
-use library\Controller;
-
-/**
- * 活动参数配置
- * Class Config
- * @package app\store\controller
- */
-class Config extends Controller
-{
-
-    /**
-     * 活动参数配置
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '参数配置';
-        $this->applyCsrfToken('save');
-        $this->query = ExtendService::queryChinaSmsBalance();
-        $this->query2 = ExtendService::queryGlobeSmsBalance();
-        $this->sell_switch = sysconf('sell_switch');
-        $this->crystal_switch = sysconf('crystal_switch');
-        $this->goods_detail_switch = sysconf('goods_detail_switch');
-        $this->fetch();
-    }
-
-    /**
-     * 保存商城参数
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function save()
-    {
-        if ($this->request->isPost()) {
-            $this->applyCsrfToken('save');
-            foreach ($this->request->post() as $k => $v) sysconf($k, $v);
-            $this->success('活动参数设置保存成功!');
-        }
-    }
-
-}

+ 0 - 139
application/store/controller/ExchangeCode.php

@@ -1,139 +0,0 @@
-<?php
-namespace app\store\controller;
-use library\Controller;
-use think\Db;
-
-/**
- * 兑换码
- * Class ExchangeCode
- * @package app\store\controller
- */
-class ExchangeCode extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GoodsCode';
-
-    /**
-     * 兑换码列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '兑换码管理';
-        $goods_id = input('id',0);
-        $code = input('code','');
-        $status = input('status',0);
-        $this->goods_id = $goods_id;
-        $query = $this->_query($this->table)->alias('c')
-            ->field('c.*,m.name as user_name')
-            ->join('store_member m','m.id=c.user_id','LEFT')
-            ->where('c.goods_id',$goods_id);
-        if($code) $query->where('c.code',$code);
-        if($status) $query->where('c.status',$status);
-        $query->order('status asc , id desc')->page();
-    }
-
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as $k=>&$v){
-
-        }
-    }
-
-
-
-    /**
-     * 添加兑换码
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function add()
-    {
-        $this->title = '添加兑换码';
-        $goods_id = input('goods_id',0);
-        $this->goods_id = $goods_id;
-        $this->_form($this->table, 'form');
-    }
-
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if($this->request->post() &&  $this->request->action() == 'add'){
-            $code_arr=[];
-            for($i=0;$i< $data['num'];$i++){
-                $code_str = $this->getRegisterCode($data['goods_id']);
-                $code_arr[] = [
-                    'code' => $code_str,
-                    'goods_id' => $data['goods_id'],
-                ];
-            }
-            Db::table('goods_code')->insertAll($code_arr);
-            $this->success('添加成功!');
-        }
-    }
-
-
-
-    /**
-     * @auth true
-     * @menu true
-     * 兑换码下架
-     */
-    public function del()
-    {
-        $this->_delete($this->table);
-    }
-
-
-
-    public function getRegisterCode($goods_id)
-    {
-        $length = 13;
-        $base_code = explode(',',"A,B,C,D,E,F,G,H,J,K,L,0,1,2,3,4,5,6,7,8,9,M,N,P,Q,R,S,T,U,V,W,X,Y,Z");
-        $id_length = strlen($goods_id);
-        $code_key = array_rand($base_code, $length - $id_length);
-        $code_str = '';
-        array_map(function ($val)use (&$code_str,$base_code){
-            $code_str .=$base_code[$val] ;
-        },$code_key);
-        return $code_str.$goods_id;
-    }
-
-
-
-
-
-
-
-}

+ 0 - 169
application/store/controller/Goods.php

@@ -1,169 +0,0 @@
-<?php
-namespace app\store\controller;
-use library\Controller;
-use think\Db;
-
-/**
- * 商品
- * Class Goods
- * @package app\store\controller
- */
-class Goods extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'StoreGoods';
-
-    /**
-     * 商品列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '商品管理';
-        $this->goods_type =[
-            1=>'售卖',
-            2=>'兑换',
-            3=>'邀请赠送',
-        ];
-        $query = $this->_query($this->table)->where('is_deleted',0)->like('name');
-        $query->dateBetween('create_at')->order('sort desc , id desc')->page();
-    }
-
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as $k=>&$v){
-
-        }
-    }
-
-
-
-    /**
-     * 添加商品
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function add()
-    {
-        $this->title = '添加商品';
-        to_reload();
-        $this->goods_type =[
-            1=>'售卖',
-            2=>'兑换',
-            3=>'邀请赠送',
-        ];
-
-        $this->_form($this->table, 'form');
-    }
-
-
-    /**
-     * 编辑商品
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    function edit()
-    {
-        $this->title = '编辑商品';
-        to_reload();
-        $this->goods_type =[
-            1=>'售卖',
-            2=>'兑换',
-            3=>'邀请赠送',
-        ];
-        $this->_form($this->table, 'form');
-    }
-
-
-
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-        if($this->request->post()){
-            if(!isset($data['id'])) $data['base_stock'] = $data['stock'];
-            $data['sell_day'] = date('Y-m-d',strtotime($data['sell_time']));
-            $data['sell_point'] = date('H:i',strtotime($data['sell_time']));
-            $data['goods_auth'] = $data['issuer'];
-        }
-    }
-
-
-    /**
-     * @auth true
-     * @menu true
-     * 商品上架
-     */
-    public function up()
-    {
-        $this->_save($this->table, ['status' => '1']);
-    }
-
-    /**
-     * @auth true
-     * @menu true
-     * 商品下架
-     */
-    public function down()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-
-    /**
-     * @auth true
-     * @menu true
-     * 商品下架
-     */
-    public function del()
-    {
-        $this->_save($this->table, ['is_deleted' => '1']);
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-}

+ 0 - 161
application/store/controller/IntegralGoods.php

@@ -1,161 +0,0 @@
-<?php
-namespace app\store\controller;
-use library\Controller;
-use think\Db;
-
-/**
- * 积分商品
- * Class Goods
- * @package app\store\controller
- */
-class IntegralGoods extends Controller
-{
-
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'ExchangeGoods';
-
-    /**
-     * 商品列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '商品管理';
-        $query = $this->_query($this->table)->where('is_deleted',0)->like('name');
-        $query->dateBetween('create_at')->order('sort desc , id desc')->page();
-    }
-
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as $k=>&$v){
-
-        }
-    }
-
-
-
-    /**
-     * 添加商品
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function add()
-    {
-        $this->title = '添加商品';
-        // 分类
-        $goods_cate = Db::table('store_goods_cate')
-            ->field('id,title')
-            ->where(['is_deleted'=>0,'status'=>1,'pid'=>0])
-            ->order('sort desc ,id desc')
-            ->select();
-        $this->goods_cate =  $goods_cate;
-        $this->_form($this->table, 'form');
-    }
-
-
-    /**
-     * 编辑商品
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    function edit()
-    {
-        $this->title = '编辑商品';
-        // 分类
-        $goods_cate = Db::table('store_goods_cate')
-            ->field('id,title')
-            ->where(['is_deleted'=>0,'status'=>1,'pid'=>0])
-            ->order('sort desc ,id desc')
-            ->select();
-        $this->goods_cate =  $goods_cate;
-        $this->all_temp = Db::table('freight_template')
-            ->field('id,name')->where(['status'=>1,'is_deleted'=>0])
-            ->order('sort desc ,id desc')->select();
-        $this->_form($this->table, 'form');
-    }
-
-
-
-
-
-    /**
-     * 表单数据处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     */
-    protected function _form_filter(&$data)
-    {
-
-    }
-
-
-    /**
-     * @auth true
-     * @menu true
-     * 商品上架
-     */
-    public function up()
-    {
-        $this->_save($this->table, ['status' => '1']);
-    }
-
-     /**
-     * @auth true
-     * @menu true
-     * 商品下架
-     */
-    public function down()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-
-    /**
-     * @auth true
-     * @menu true
-     * 商品下架
-     */
-    public function del()
-    {
-        $this->_save($this->table, ['is_deleted' => '1']);
-    }
-
-
-
-
-
-
-
-
-
-
-}

+ 0 - 38
application/store/controller/api/Data.php

@@ -1,38 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api;
-
-use library\Controller;
-
-/**
- * 数据商城基础数据
- * Class Data
- * @package app\store\controller\api
- */
-class Data extends Controller
-{
-    /**
-     * 获取轮播图片数据
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function getSlider()
-    {
-        $this->keys = input('keys', 'slider_home');
-        $this->success('获取轮播图片数据!', sysdata($this->keys));
-    }
-
-}

+ 0 - 38
application/store/controller/api/Express.php

@@ -1,38 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api;
-
-use library\Controller;
-
-/**
- * 快递查询接口
- * Class Express
- * @package app\store\controller\api
- */
-class Express extends Controller
-{
-    /**
-     * 物流查询结果
-     */
-    public function query()
-    {
-        $this->expressNo = input('express_no', '');
-        $this->expressCode = input('express_code', '');
-        $result = \library\tools\Express::query($this->expressCode, $this->expressNo);
-        $this->success('获取物流查询结果!', $result);
-    }
-
-}

+ 0 - 122
application/store/controller/api/Goods.php

@@ -1,122 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api;
-
-use library\Controller;
-use think\Db;
-
-/**
- * 商品管理接口
- * Class Goods
- * @package app\store\controller\api
- */
-class Goods extends Controller
-{
-
-    /**
-     * 获取商品列表
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function gets()
-    {
-        $where = [['status', 'eq', '1'], ['is_deleted', 'eq', '0']];
-        $this->success('获取商品列表成功!', ['list' => $this->_getGoodsList($where)]);
-    }
-
-    /**
-     * 获取礼包商品列表
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function vips()
-    {
-        $where = [['status', 'eq', '1'], ['is_deleted', 'eq', '0']];
-        $this->success('获取礼包列表成功!', ['list' => $this->_getGoodsList($where)]);
-    }
-
-    /**
-     * 获取商品列表
-     * @param array $where
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    private function _getGoodsList($where = [])
-    {
-        if ($this->request->has('title', 'post', true)) {
-            $where[] = ['title', 'like', "%{$this->request->post('title')}%"];
-        }
-        if ($this->request->has('cate_id', 'post', true)) {
-            $where[] = ['cate_id', 'eq', $this->request->post('cate_id')];
-        }
-        $field = 'id,title,logo,cate_id,image,number_sales,number_stock,content,specs,lists';
-        $list = Db::name('StoreGoods')->field($field)->where($where)->order('sort desc,id desc')->select();
-        $goodsList = Db::name('StoreGoodsList')->whereIn('goods_id', array_unique(array_column($list, 'id')))->select();
-        foreach ($list as &$vo) {
-            $vo['list'] = [];
-            $vo['image'] = explode('|', $vo['image']);
-            $vo['specs'] = json_decode($vo['specs'], true);
-            $vo['lists'] = json_decode($vo['lists'], true);
-            foreach ($goodsList as $goods) if ($goods['goods_id'] === $vo['id']) {
-                array_push($vo['list'], $goods);
-            }
-        }
-        return $list;
-    }
-
-    /**
-     * 获取单个商品信息
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function get()
-    {
-        $goods_id = input('goods_id');
-        $where = ['is_deleted' => '0', 'status' => '1', 'id' => $goods_id];
-        $field = 'id,title,logo,cate_id,image,number_sales,number_stock,content,specs,lists';
-        $goods = Db::name('StoreGoods')->field($field)->where($where)->find();
-        if (empty($goods)) $this->error('指定商品不存在,请更换商品ID重试!');
-        $goods['image'] = explode('|', $goods['image']);
-        $goods['specs'] = json_decode($goods['specs'], true);
-        $goods['lists'] = json_decode($goods['lists'], true);
-        $goods['list'] = Db::name('StoreGoodsList')->where(['goods_id' => $goods_id])->select();
-        if (empty($goods['list'])) {
-            $this->error('指定商品规格不存在,请更换商品ID重试!');
-        } else {
-            $this->success('获取商品信息成功!', $goods);
-        }
-    }
-
-    /**
-     * 获取商品分类信息
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function cate()
-    {
-        $where = ['is_deleted' => '0', 'status' => '1'];
-        $field = 'id cate_id,logo cate_logo,title cate_title';
-        $list = Db::name('StoreGoodsCate')->field($field)->where($where)->order('sort desc,id desc')->select();
-        $this->success('获取商品分类成功!', ['list' => $list]);
-    }
-
-}

+ 0 - 80
application/store/controller/api/Member.php

@@ -1,80 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api;
-
-use library\Controller;
-use think\Db;
-
-/**
- * 会员管理基类
- * Class Member
- * @package app\store\controller\api
- */
-class Member extends Controller
-{
-    /**
-     * 当前会员ID
-     * @var integer
-     */
-    protected $mid;
-
-    /**
-     * 当前会员数据
-     * @var array
-     */
-    protected $member;
-
-    /**
-     * 当前公众号OPENID
-     * @var string
-     */
-    protected $openid;
-
-    /**
-     * Member constructor.
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function __construct()
-    {
-        parent::__construct();
-        // 会员信息检查
-        $this->mid = $this->request->post('mid');
-        $this->openid = $this->request->post('openid');
-        if (empty($this->mid)) $this->error('无效的会员ID参数!');
-        if (empty($this->openid)) $this->error('无效的会员绑定OPENID!');
-        $this->getMember();
-    }
-
-    /**
-     * 获取会员信息
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function getMember()
-    {
-        $where = ['id' => $this->mid, 'openid' => $this->openid];
-        $this->member = Db::name('StoreMember')->where($where)->find();
-        if (empty($this->member)) $this->error('无效的会员信息,请重新登录授权!');
-        // 会员当前已经领取次数
-        $where = [['mid', 'eq', $this->mid], ['status', 'in', ['2', '3', '4', '5']]];
-        $this->member['times_used'] = Db::name('StoreOrder')->where($where)->count();
-        return $this->member;
-    }
-
-}

+ 0 - 74
application/store/controller/api/Notify.php

@@ -1,74 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api;
-
-use app\store\service\OrderService;
-use think\Db;
-
-/**
- * 支付通知处理
- * Class Notify
- * @package app\store\controller\api
- */
-class Notify
-{
-    /**
-     * 微信支付通知处理
-     * @return string
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function wxpay()
-    {
-        $wechat = \We::WePayOrder(config('wechat.miniapp'));
-        $notify = $wechat->getNotify();
-        if ($notify['result_code'] == 'SUCCESS' && $notify['return_code'] == 'SUCCESS') {
-            if ($this->update($notify['out_trade_no'], $notify['transaction_id'], $notify['cash_fee'] / 100, 'wechat')) {
-                return $wechat->getNotifySuccessReply();
-            }
-        } else {
-            return $wechat->getNotifySuccessReply();
-        }
-    }
-
-    /**
-     * 订单状态更新
-     * @param string $order_no 订单号
-     * @param string $pay_no 交易号
-     * @param string $pay_price 交易金额
-     * @param string $type 支付类型
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    private function update($order_no, $pay_no, $pay_price, $type = 'wechat')
-    {
-        // 检查订单支付状态
-        $where = ['order_no' => $order_no, 'pay_state' => '0', 'status' => '2'];
-        $order = Db::name('StoreOrder')->where($where)->find();
-        if (empty($order)) return false;
-        // 更新订单支付状态
-        $result = Db::name('StoreOrder')->where($where)->update([
-            'pay_type'  => $type, 'pay_no' => $pay_no, 'status' => '3',
-            'pay_price' => $pay_price, 'pay_state' => '1', 'pay_at' => date('Y-m-d H:i:s'),
-        ]);
-        // 调用会员升级机制
-        OrderService::update($order['order_no']);
-        return $result !== false;
-    }
-
-}

+ 0 - 92
application/store/controller/api/Wechat.php

@@ -1,92 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api;
-
-use library\Controller;
-use think\Db;
-use think\exception\HttpResponseException;
-
-/**
- * Class Wechat
- * @package app\store\controller\api
- */
-class Wechat extends Controller
-{
-    /**
-     * 获取小程序配置
-     * @return array
-     */
-    private function config()
-    {
-        return config('wechat.miniapp');
-    }
-
-    /**
-     * Code信息换取
-     */
-    public function session()
-    {
-        try {
-            $code = $this->request->post('code');
-            $result = \We::WeMiniCrypt($this->config())->session($code);
-            if (isset($result['openid'])) {
-                data_save('StoreMember', ['openid' => $result['openid']], 'openid');
-                $result['member'] = Db::name('StoreMember')->where(['openid' => $result['openid']])->find();
-                $this->success('授权CODE信息换取成功!', $result);
-            } else {
-                $this->error("[{$result['errcode']}] {$result['errmsg']}");
-            }
-        } catch (HttpResponseException $exception) {
-            throw $exception;
-        } catch (\Exception $exception) {
-            $this->error("授权CODE信息换取失败,{$exception->getMessage()}");
-        }
-    }
-
-    /**
-     * 小程序数据解密
-     */
-    public function decode()
-    {
-        try {
-            $iv = $this->request->post('iv');
-            $session = $this->request->post('session');
-            $content = $this->request->post('encrypted');
-            if (empty($session)) {
-                $code = $this->request->post('code');
-                $result = \We::WeMiniCrypt($this->config())->session($code);
-                $session = isset($result['session_key']) ? $result['session_key'] : '';
-            }
-            $result = \We::WeMiniCrypt($this->config())->decode($iv, $session, $content);
-            if ($result !== false && isset($result['openId'])) {
-                data_save('StoreMember', [
-                    'openid'   => $result['openId'],
-                    'headimg'  => $result['avatarUrl'],
-                    'nickname' => $result['nickName'],
-                ], 'openid');
-                $result['member'] = Db::name('StoreMember')->where(['openid' => $result['openId']])->find();
-                $this->success('小程序加密数据解密成功!', $result);
-            } else {
-                $this->error('小程序加密数据解密失败,请稍候再试!');
-            }
-        } catch (HttpResponseException $exception) {
-            throw $exception;
-        } catch (\Exception $e) {
-            $this->error("小程序加密数据解密失败,{$e->getMessage()}");
-        }
-    }
-
-}

+ 0 - 128
application/store/controller/api/member/Address.php

@@ -1,128 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api\member;
-
-use app\store\controller\api\Member;
-use think\Db;
-
-/**
- * 会员收货地址管理
- * Class Address
- * @package app\store\controller\api\member
- */
-class Address extends Member
-{
-
-    /**
-     * 获取会员收货地址信息
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function gets()
-    {
-        $this->success('获取会员收货地址成功!', [
-            'list' => Db::name('StoreMemberAddress')
-                ->where(['mid' => $this->member['id']])
-                ->order('is_default desc,id desc')
-                ->select(),
-        ]);
-    }
-
-    /**
-     * 更新收货地址
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function set()
-    {
-        $data = $this->_input([
-            'mid'        => $this->request->post('mid'),
-            'openid'     => $this->request->post('openid'),
-            'name'       => $this->request->post('name'),
-            'phone'      => $this->request->post('phone'),
-            'province'   => $this->request->post('province'),
-            'city'       => $this->request->post('city'),
-            'area'       => $this->request->post('area'),
-            'address'    => $this->request->post('address'),
-            'is_default' => $this->request->post('is_default'),
-        ], [
-            'name'     => 'require',
-            'phone'    => 'require|mobile',
-            'province' => 'require',
-            'city'     => 'require',
-            'area'     => 'require',
-            'address'  => 'require',
-        ], [
-            'name.require'     => '收货人姓名不能为空!',
-            'phone.require'    => '收货人联系手机不能为空!',
-            'phone.mobile'     => '收货人联系手机格式不对!',
-            'province.require' => '收货地址省份不能为空!',
-            'city.require'     => '收货地址城市不能为空!',
-            'area.require'     => '收货地址区域不能为空!',
-            'address.require'  => '收货详情地址不能为空!',
-        ]);
-        if (!empty($data['is_default'])) {
-            Db::name('StoreMemberAddress')->where(['mid' => $this->member['id']])->setField('is_default', '0');
-        }
-        if ($this->request->has('id', 'post', true)) {
-            $data['id'] = $this->request->post('id');
-        }
-        if (data_save('StoreMemberAddress', $data, 'id')) {
-            $this->success('收货地址更新成功!');
-        }
-        $this->error('收货地址更新失败,请稍候再试!');
-    }
-
-    /**
-     * 删除收货地址
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function del()
-    {
-        $id = $this->request->post('address_id');
-        if (empty($id)) $this->error('待处理的收货地址ID不能为空!');
-        $where = ['id' => $id, 'mid' => $this->member['id']];
-        if (Db::name('StoreMemberAddress')->where($where)->delete() !== false) {
-            $this->success('删除收货地址成功!');
-        }
-        $this->error('删除收货地址失败,请稍候再试!');
-    }
-
-    /**
-     * 设置默认收货地址
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function setDefault()
-    {
-        $id = $this->request->post('address_id');
-        if (empty($id)) $this->error('待处理的收货地址ID不存在!');
-        $where = ['id' => $id, 'mid' => $this->member['id']];
-        $address = Db::name('StoreMemberAddress')->where($where)->find();
-        if (empty($address)) $this->error('待处理的收货地址获取失败,请稍候再试!');
-        Db::name('StoreMemberAddress')->where(['mid' => $this->member['id']])->update(['is_default' => '0']);
-        if (Db::name('StoreMemberAddress')->where($where)->update(['is_default' => '1']) !== false) {
-            $this->success('设置默认收货地址成功!');
-        }
-        $this->error('设置默认收货地址失败!');
-    }
-
-}

+ 0 - 122
application/store/controller/api/member/Center.php

@@ -1,122 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api\member;
-
-use app\store\controller\api\Member;
-use app\store\service\ExtendService;
-use think\Db;
-
-/**
- * 商品会员中心
- * Class Center
- * @package app\store\controller\api\member
- */
-class Center extends Member
-{
-    /**
-     * 修改会员资料
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function info()
-    {
-        $data = [];
-        if ($this->request->has('headimg', 'post', true)) {
-            $data['headimg'] = $this->request->post('headimg');
-        }
-        if ($this->request->has('nickname', 'post', true)) {
-            $data['nickname'] = $this->request->post('nickname');
-        }
-        if ($this->request->has('username', 'post', true)) {
-            $data['username'] = $this->request->post('username');
-        }
-        if (empty($data)) $this->error('没有需要修改的数据哦!');
-        if (data_save('StoreMember', array_merge($data, ['id' => $this->mid]), 'id') !== false) {
-            $this->success('会员资料更新成功!', $this->getMember());
-        } else {
-            $this->error('会员资料更新失败,请稍候再试!');
-        }
-    }
-
-    /**
-     * 发送短信验证码
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function sendsms()
-    {
-        $phone = $this->request->post('phone');
-        if ($this->request->post('secure') !== sysconf('sms_secure')) {
-            $this->error('短信发送安全码不正确,请使用正确的安全码!');
-        }
-        $member = Db::name('StoreMember')->where(['phone' => $phone])->find();
-        if (!empty($member)) $this->error('该手机号已经注册了,请使用其它手机号!');
-        $cache = cache($cachekey = "send_register_sms_{$phone}");
-        if (is_array($cache) && isset($cache['time']) && $cache['time'] > time() - 120) {
-            $dtime = ($cache['time'] + 120 < time()) ? 0 : (120 - time() + $cache['time']);
-            $this->success('短信验证码已经发送!', ['time' => $dtime]);
-        }
-        list($code, $content) = [rand(1000, 9999), sysconf('sms_reg_template')];
-        if (empty($content) || stripos($content, '{code}') === false) {
-            $content = '您的验证码为{code},请在十分钟内完成操作!';
-        }
-        cache($cachekey, ['phone' => $phone, 'captcha' => $code, 'time' => time()], 600);
-        if (empty($content) || strpos($content, '{code}') === false) {
-            $this->error('获取短信模板失败,联系管理员配置!');
-        }
-        $cache = cache($cachekey);
-        if (ExtendService::sendChinaSms($this->mid, $phone, str_replace('{code}', $code, $content))) {
-            $dtime = ($cache['time'] + 120 < time()) ? 0 : (120 - time() + $cache['time']);
-            $this->success('短信验证码发送成功!', ['time' => $dtime]);
-        } else {
-            $this->error('短信发送失败,请稍候再试!');
-        }
-    }
-
-    /**
-     * 会员登录绑定
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function bind()
-    {
-        $code = $this->request->post('code');
-        $phone = $this->request->post('phone');
-        $cache = cache($cachekey = "send_register_sms_{$phone}");
-        if (is_array($cache) && isset($cache['captcha']) && $cache['captcha'] == $code) {
-            $where = ['id' => $this->member['id']];
-            if (Db::name('StoreMember')->where($where)->update(['phone' => $phone]) !== false) {
-                $this->success('手机绑定登录成功!');
-            } else {
-                $this->error('手机绑定登录失败,请稍候再试!');
-            }
-        } else {
-            $this->error('短信验证码验证失败!');
-        }
-    }
-
-    /**
-     * 获取会员资源成功
-     */
-    public function member()
-    {
-        $this->success('获取会员资料成功!', $this->member);
-    }
-
-}

+ 0 - 313
application/store/controller/api/member/Order.php

@@ -1,313 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\controller\api\member;
-
-use app\store\controller\api\Member;
-use app\store\service\GoodsService;
-use app\store\service\OrderService;
-use library\tools\Data;
-use think\Db;
-use think\exception\HttpResponseException;
-
-/**
- * 订单接口管理
- * Class Order
- * @package app\store\controller\api\member
- */
-class Order extends Member
-{
-
-    /**
-     * 创建商城订单
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * 商品ID1@商品规格1@商品数量1||商品ID2@商品规格2@商品数量2
-     */
-    public function set()
-    {
-        // 商品规则
-        $rule = $this->request->post('rule', '');
-        if (empty($rule)) $this->error('下单商品规则不能为空!');
-        // 订单处理
-        list($orderList, $order) = [[], [
-            'status'   => '1', 'mid' => $this->mid,
-            'order_no' => Data::uniqidNumberCode(12),
-            'from_mid' => $this->request->post('from_mid', '0'),
-        ]];
-        // 推荐人处理
-        if (intval($order['from_mid']) === intval($this->mid)) {
-            $order['from_mid'] = '0';
-        } elseif ($order['from_mid'] > 0) {
-            if (Db::name('StoreMember')->where(['id' => $order['from_mid']])->count() < 1) {
-                $this->error('无效的推荐会员ID,稍候再试!');
-            }
-        }
-        foreach (explode('||', $rule) as $item) {
-            list($goods_id, $goods_spec, $number) = explode('@', $item);
-            // 商品信息检查
-            $goods = Db::name('StoreGoods')->where(['id' => $goods_id, 'status' => '1', 'is_deleted' => '0'])->find();
-            if (empty($goods)) $this->error('查询商品主体信息失败,请稍候再试!');
-            $spec = Db::name('StoreGoodsList')->where(['goods_id' => $goods_id, 'goods_spec' => $goods_spec])->find();
-            if (empty($spec)) $this->error('查询商品规则信息失败,请稍候再试!');
-            // 商品库存检查
-            if ($spec['number_sales'] + $number > $spec['number_stock']) {
-                $this->error('商品库存不足,请购买其它商品!');
-            }
-            // 订单详情处理
-            array_push($orderList, [
-                'mid'               => $order['mid'],
-                'from_mid'          => $order['from_mid'],
-                'order_no'          => $order['order_no'],
-                // 商品信息字段管理
-                'goods_id'          => $goods_id,
-                'goods_spec'        => $goods_spec,
-                'goods_logo'        => $goods['logo'],
-                'goods_title'       => $goods['title'],
-                'number_goods'      => $number,
-                'number_express'    => $spec['number_express'],
-                // 费用字段处理
-                'price_market'      => $spec['price_market'],
-                'price_selling'     => $spec['price_selling'],
-                'price_real'        => $spec['price_selling'] * $number,
-                'price_express'     => $goods['price_express'],
-                // 返利字段处理
-                'price_rate'        => $goods['price_rate'],
-                'price_rate_amount' => $spec['price_selling'] * $number * $goods['price_rate'] / 100,
-            ]);
-        }
-        $order['price_goods'] = array_sum(array_column($orderList, 'price_real')) + 0;
-        $order['price_express'] = max(array_column($orderList, 'price_express')) + 0;
-        $order['price_total'] = $order['price_goods'] + $order['price_express'];
-        $order['price_rate_amount'] = array_sum(array_column($orderList, 'price_rate_amount')) + 0;
-        try {
-            // 订单数据写入
-            Db::name('StoreOrder')->insert($order);
-            Db::name('StoreOrderList')->insertAll($orderList);
-            // 同步商品库存及销量
-            foreach (array_unique(array_column($orderList, 'goods_id')) as $goodsId) GoodsService::syncStock($goodsId);
-            $this->success('订单创建成功,请补全收货信息后支付!', ['order' => $order]);
-        } catch (HttpResponseException $exception) {
-            throw $exception;
-        } catch (\Exception $e) {
-            $this->error("创建订单失败,请稍候再试!{$e->getMessage()}");
-        }
-    }
-
-    /**
-     * 订单信息完成
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function perfect()
-    {
-        $data = $this->_input([
-            'order_no'   => $this->request->post('order_no'),
-            'address_id' => $this->request->post('address_id'),
-        ], [
-            'order_no'   => 'require',
-            'address_id' => 'require',
-        ], [
-            'order_no.require'   => '订单号不能为空!',
-            'address_id.require' => '收货地址ID不能为空(0自提可以为空)',
-        ]);
-        $map = ['order_no' => $data['order_no'], 'mid' => $this->member['id']];
-        $order = Db::name('StoreOrder')->whereIn('status', ['1', '2'])->where($map)->find();
-        if (empty($order)) $this->error('订单异常,请返回商品重新下单!');
-        $update = ['status' => '2'];
-        $where = ['id' => $data['address_id'], 'mid' => $this->member['id']];
-        $address = Db::name('StoreMemberAddress')->where($where)->find();
-        if (empty($address)) $this->error('会员收货地址异常,请刷新页面重试!');
-        $update['express_address_id'] = $data['address_id'];
-        $update['express_name'] = $address['name'];
-        $update['express_phone'] = $address['phone'];
-        $update['express_province'] = $address['province'];
-        $update['express_city'] = $address['city'];
-        $update['express_area'] = $address['area'];
-        $update['express_address'] = $address['address'];
-        if (Db::name('StoreOrder')->where($map)->update($update) !== false) {
-            $params = $this->getPayParams($order['order_no'], $order['price_total']);
-            $this->success('更新订单会员信息成功!', $params);
-        } else {
-            $this->error('更新订单会员信息失败,请稍候再试!');
-        }
-    }
-
-    /**
-     * 获取订单支付状态
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function pay()
-    {
-        $order_no = $this->request->post('order_no');
-        $order = Db::name('StoreOrder')->where(['order_no' => $order_no])->find();
-        if (empty($order_no)) $this->error('获取订单信息异常,请稍候再试!');
-        if ($order['pay_state']) $this->error('订单已经完成支付,不需要再次支付!');
-        if ($order['status'] <> 2) $this->error('该订单不能发起支付哦!');
-        try {
-            $param = $this->getPayParams($order['order_no'], $order['price_total']);
-            $this->success('获取订单支付参数成功!', $param);
-        } catch (HttpResponseException $exception) {
-            throw  $exception;
-        } catch (\Exception $e) {
-            $this->error("获取订单支付参数失败,{$e->getMessage()}");
-        }
-    }
-
-    /**
-     * 获取订单支付参数
-     * @param string $order_no
-     * @param string $pay_price
-     * @return array
-     */
-    private function getPayParams($order_no, $pay_price)
-    {
-        $options = [
-            'body'             => '商城订单支付',
-            'openid'           => $this->openid,
-            'out_trade_no'     => $order_no,
-            // 'total_fee'        => '1',
-            'total_fee'        => $pay_price * 100,
-            'trade_type'       => 'JSAPI',
-            'notify_url'       => url('@store/api.notify/wxpay', '', false, true),
-            'spbill_create_ip' => $this->request->ip(),
-        ];
-        try {
-            $pay = \We::WePayOrder(config('wechat.miniapp'));
-            $info = $pay->create($options);
-            if ($info['return_code'] === 'SUCCESS' && $info['result_code'] === 'SUCCESS') {
-                return $pay->jsapiParams($info['prepay_id']);
-            }
-            if (isset($info['err_code_des'])) {
-                throw new \think\Exception($info['err_code_des']);
-            }
-        } catch (\Exception $e) {
-            $this->error("创建订单失败参数失败,{$e->getMessage()}");
-        }
-    }
-
-    /**
-     * 获取订单列表
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function gets()
-    {
-        $where = [['mid', 'eq', $this->mid]];
-        if ($this->request->has('order_no', 'post', true)) {
-            $where[] = ['order_no', 'eq', $this->request->post('order_no')];
-        } else {
-            $where[] = ['status', 'in', ['0', '2', '3', '4', '5']];
-        }
-        if ($this->request->has('status', 'post', true)) {
-            $where[] = ['status', 'eq', $this->request->post('status')];
-        }
-        $result = $this->_query('StoreOrder')->where($where)->order('id desc')->page(true, false, false, 20);
-        $glist = Db::name('StoreOrderList')->whereIn('order_no', array_unique(array_column($result['list'], 'order_no')))->select();
-        foreach ($result['list'] as &$vo) {
-            list($vo['goods_count'], $vo['list']) = [0, []];
-            foreach ($glist as $goods) if ($vo['order_no'] === $goods['order_no']) {
-                $vo['list'][] = $goods;
-                $vo['goods_count'] += $goods['number_goods'];
-            }
-        }
-        $this->success('获取订单列表成功!', $result);
-    }
-
-    /**
-     * 订单取消
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function cancel()
-    {
-        $where = [
-            'mid'      => $this->member['id'],
-            'order_no' => $this->request->post('order_no'),
-        ];
-        $order = Db::name('StoreOrder')->where($where)->find();
-        if (empty($order)) $this->error('待取消的订单不存在,请稍候再试!');
-        if (in_array($order['status'], ['1', '2'])) {
-            $result = Db::name('StoreOrder')->where($where)->update([
-                'status'       => '0',
-                'cancel_state' => '1',
-                'cancel_at'    => date('Y-m-d H:i:s'),
-                'cancel_desc'  => '用户主动取消订单!',
-            ]);
-            if ($result !== false && OrderService::syncStock($order['order_no'])) {
-                $this->success('订单取消成功!');
-            } else {
-                $this->error('订单取消失败,请稍候再试!');
-            }
-        } else {
-            $this->error('该订单状态不允许取消哦~');
-        }
-    }
-
-    /**
-     * 订单确认收货
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function confirm()
-    {
-        $where = [
-            'mid'      => $this->member['id'],
-            'order_no' => $this->request->post('order_no'),
-        ];
-        $order = Db::name('StoreOrder')->where($where)->find();
-        if (empty($order)) $this->error('待确认的订单不存在,请稍候再试!');
-        if (in_array($order['status'], ['4'])) {
-            if (Db::name('StoreOrder')->where($where)->update(['status' => '5']) !== false) {
-                $this->success('订单确认成功!');
-            } else {
-                $this->error('订单取确认失败,请稍候再试!');
-            }
-        } else {
-            $this->error('该订单状态不允许确认哦~');
-        }
-    }
-
-    /**
-     * 订单状态统计
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function total()
-    {
-        $result = Db::name('StoreOrder')
-            ->fieldRaw('mid,status,count(1) count')
-            ->where(['mid' => $this->mid])
-            ->group('status')
-            ->select();
-        $this->success('获取订单统计记录!', $result);
-    }
-}

+ 0 - 84
application/store/service/ExpressService.php

@@ -1,84 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\service;
-
-use think\Db;
-
-/**
- * 商城邮费服务
- * Class ExpressService
- * @package app\store\service
- */
-class ExpressService
-{
-
-    /**
-     * 订单邮费计算
-     * @param string $province 配送省份
-     * @param string $number 计费数量
-     * @param string $amount 订单金额
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public static function price($province, $number, $amount)
-    {
-        // 读取对应的模板规则
-        $map = [['is_default', 'eq', '0'], ['rule', 'like', "%{$province}%"]];
-        $rule = Db::name('StoreExpressTemplate')->where($map)->find();
-        if (!empty($rule)) return self::buildData($rule, '普通模板', $number, $amount);
-        $rule = Db::name('StoreExpressTemplate')->where(['is_default' => '1'])->find();
-        return self::buildData($rule, '默认模板', $number, $amount);
-    }
-
-    /**
-     * 生成邮费数据
-     * @param array $rule 模板规则
-     * @param string $type 模板类型
-     * @param integer $number 计费件数
-     * @param double $amount 订单金额
-     * @return array
-     */
-    protected static function buildData($rule, $type, $number, $amount)
-    {
-        // 异常规则
-        if (empty($rule)) return [
-            'express_price' => 0.00, 'express_type' => '未知模板', 'express_desc' => '未匹配到邮费模板',
-        ];
-        // 满减免邮
-        if ($rule['order_reduction_state'] && $amount >= $rule['order_reduction_price']) {
-            return [
-                'express_price' => 0.00, 'express_type' => $type,
-                'express_desc'  => "订单总金额满{$rule['order_reduction_price']}元减免全部邮费",
-            ];
-        }
-        // 首重计费
-        if ($number <= $rule['first_number']) return [
-            'express_price' => $rule['first_price'], 'express_type' => $type,
-            'express_desc'  => "首件计费,{$rule['first_number']}件及{$rule['first_number']}以内计费{$rule['first_price']}元",
-        ];
-        // 续重计费
-        list($price1, $price2) = [$rule['first_price'], 0];
-        if ($rule['next_number'] > 0 && $rule['next_price'] > 0) {
-            $price2 = $rule['next_price'] * ceil(($number - $rule['first_number']) / $rule['next_number']);
-        }
-        return [
-            'express_price' => $price1 + $price2, 'express_type' => $type,
-            'express_desc'  => "续件计费,超出{$rule['first_number']}件,首件费用{$rule['first_price']}元 + 续件费用{$price2}元",
-        ];
-    }
-}

+ 0 - 423
application/store/service/ExtendService.php

@@ -1,423 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\service;
-
-use library\tools\Http;
-use think\Db;
-
-/**
- * 短信业务扩展服务
- * Class ExtendService
- * @package app\store\service
- * =================================
- * =================================
- * 发送国内短信需要给产品码 [productid]
- * --- 验证短信的产品码为:676767
- * --- 营销短信的产品码为:333333
- * ---------------------------------
- * ---------------------------------
- * 发送国际短信需要给国家代码 [code]
- * --- 国家代码见 getGlobeRegionMap
- * ---------------------------------
- * ---------------------------------
- * 需要开通短信账号请联系客服
- * --- 客服电话:18122377655
- * =================================
- */
-class ExtendService
-{
-
-    /**
-     * 发送国内短信验证码
-     * @param string $mid 会员ID
-     * @param string $phone 手机号
-     * @param string $content 短信内容
-     * @param string $productid 短信通道ID
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public static function sendChinaSms($mid, $phone, $content, $productid = '676767')
-    {
-        $tkey = date("YmdHis");
-        $result = Http::post('http://www.ztsms.cn/sendNSms.do', [
-            'tkey'     => $tkey, 'mobile' => $phone, 'content' => $content,
-            'username' => sysconf('sms_zt_username'), 'productid' => $productid,
-            'password' => md5(md5(sysconf('sms_zt_password')) . $tkey),
-        ]);
-        list($code, $msg) = explode(',', $result . ',');
-        Db::name('StoreMemberSmsHistory')->insert([
-            'mid' => $mid, 'phone' => $phone, 'content' => $content, 'result' => $result
-        ]);
-        return intval($code) === 1;
-    }
-
-    /**
-     * 发送国内短信验证码
-     * @param string $mid 会员ID
-     * @param string $phone 目标手机
-     * @param integer $wait 等待时间
-     * @param string $type 短信模板
-     * @return array
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public static function sendChinaSmsByCode($mid, $phone, $wait = 120, $type = 'sms_reg_template')
-    {
-        $cache = cache($ckey = "{$type}_{$phone}");
-        if (is_array($cache) && isset($cache['time']) && $cache['time'] > time() - $wait) {
-            $dtime = ($cache['time'] + $wait < time()) ? 0 : ($wait - time() + $cache['time']);
-            return [1, '短信验证码已经发送!', ['time' => $dtime]];
-        }
-        list($code, $content) = [rand(1000, 9999), sysconf($type)];
-        if (empty($content) || stripos($content, '{code}') === false) {
-            $content = '您的验证码为{code},请在十分钟内完成操作!';
-        }
-        cache($ckey, $cache = ['phone' => $phone, 'code' => $code, 'time' => time()], 600);
-        if (self::sendChinaSms($mid, $phone, str_replace('{code}', $code, $content))) {
-            $dtime = ($cache['time'] + $wait < time()) ? 0 : ($wait - time() + $cache['time']);
-            return [1, '短信验证码发送成功!', ['time' => $dtime]];
-        } else {
-            return [0, '短信发送失败,请稍候再试!', []];
-        }
-    }
-
-    /**
-     * 验证手机短信验证码
-     * @param string $phone 目标手机
-     * @param string $code 短信验证码
-     * @param string $type 短信模板
-     * @return boolean
-     */
-    public static function checkChinaSmsByCode($phone, $code, $type = 'sms_reg_template')
-    {
-        $cache = cache($cachekey = "{$type}_{$phone}");
-        return is_array($cache) && isset($cache['code']) && $cache['code'] == $code;
-    }
-
-    /**
-     * 查询国内短信余额
-     * @return array
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public static function queryChinaSmsBalance()
-    {
-        $tkey = date("YmdHis");
-        $result = Http::post('http://www.ztsms.cn/balanceN.do', [
-            'username' => sysconf('sms_zt_username'), 'tkey' => $tkey,
-            'password' => md5(md5(sysconf('sms_zt_password')) . $tkey),
-        ]);
-        if ($result > -1) {
-            return ['code' => 1, 'num' => $result, 'msg' => '获取短信剩余条数成功!'];
-        } elseif ($result > -2) {
-            return ['code' => 0, 'num' => '0', 'msg' => '用户名或者密码不正确!'];
-        } elseif ($result > -3) {
-            return ['code' => 0, 'num' => '0', 'msg' => 'tkey不正确!'];
-        } elseif ($result > -4) {
-            return ['code' => 0, 'num' => '0', 'msg' => '用户不存在或用户停用!'];
-        }
-    }
-
-    /**
-     * 错误消息处理
-     * @var array
-     */
-    private static $globeMessageMap = [
-        2  => '用户账号为空',
-        3  => '用户账号错误',
-        4  => '授权密码为空',
-        5  => '授权密码错误',
-        6  => '当前时间为空',
-        7  => '当前时间错误',
-        8  => '用户类型错误',
-        9  => '用户鉴权错误',
-        10 => '请求IP已被列入黑名单',
-    ];
-
-    /**
-     * 发送国际短信内容
-     * @param string $mid 会员编号
-     * @param string $code 国家代码
-     * @param string $mobile 手机号码
-     * @param string $content 发送内容
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public static function sendGlobeSms($mid, $code, $mobile, $content)
-    {
-        $tkey = date("YmdHis");
-        $result = Http::post('http://intl.zthysms.com/intSendSms.do', [
-            'tkey'     => $tkey, 'code' => $code, 'mobile' => $mobile,
-            'content'  => $content, 'username' => sysconf('sms_zt_username2'),
-            'password' => md5(md5(sysconf('sms_zt_password2')) . $tkey),
-        ]);
-        Db::name('StoreMemberSmsHistory')->insert([
-            'mid' => $mid, 'region' => $code, 'phone' => $mobile, 'content' => $content, 'result' => $result,
-        ]);
-        return intval($result) === 1;
-    }
-
-    /**
-     * 查询国际短信余额
-     * @return array
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public static function queryGlobeSmsBalance()
-    {
-        $tkey = date("YmdHis");
-        $result = Http::post('http://intl.zthysms.com/intBalance.do', [
-            'username' => sysconf('sms_zt_username2'), 'tkey' => $tkey,
-            'password' => md5(md5(sysconf('sms_zt_password2')) . $tkey),
-        ]);
-        if (!is_numeric($result) && ($state = intval($result)) && isset(self::$globeMessageMap[$state])) {
-            return ['code' => 0, 'num' => 0, 'msg' => self::$globeMessageMap[$state]];
-        } else {
-            return ['code' => 1, 'num' => $result, 'msg' => '查询成功'];
-        }
-    }
-
-    /**
-     * 获取国际地域编号
-     * @return array
-     */
-    public static function getGlobeRegionMap()
-    {
-        return [
-            ['title' => '中国 台湾', 'english' => 'Taiwan', 'code' => 886],
-            ['title' => '东帝汶民主共和国', 'english' => 'DEMOCRATIC REPUBLIC OF TIMORLESTE', 'code' => 670],
-            ['title' => '中非共和国', 'english' => 'Central African Republic', 'code' => 236],
-            ['title' => '丹麦', 'english' => 'Denmark', 'code' => 45],
-            ['title' => '乌克兰', 'english' => 'Ukraine', 'code' => 380],
-            ['title' => '乌兹别克斯坦', 'english' => 'Uzbekistan', 'code' => 998],
-            ['title' => '乌干达', 'english' => 'Uganda', 'code' => 256],
-            ['title' => '乌拉圭', 'english' => 'Uruguay', 'code' => 598],
-            ['title' => '乍得', 'english' => 'Chad', 'code' => 235],
-            ['title' => '也门', 'english' => 'Yemen', 'code' => 967],
-            ['title' => '亚美尼亚', 'english' => 'Armenia', 'code' => 374],
-            ['title' => '以色列', 'english' => 'Israel', 'code' => 972],
-            ['title' => '伊拉克', 'english' => 'Iraq', 'code' => 964],
-            ['title' => '伊朗', 'english' => 'Iran', 'code' => 98],
-            ['title' => '伯利兹', 'english' => 'Belize', 'code' => 501],
-            ['title' => '佛得角', 'english' => 'Cape Verde', 'code' => 238],
-            ['title' => '俄罗斯', 'english' => 'Russia', 'code' => 7],
-            ['title' => '保加利亚', 'english' => 'Bulgaria', 'code' => 359],
-            ['title' => '克罗地亚', 'english' => 'Croatia', 'code' => 385],
-            ['title' => '关岛', 'english' => 'Guam', 'code' => 1671],
-            ['title' => '冈比亚', 'english' => 'The Gambia', 'code' => 220],
-            ['title' => '冰岛', 'english' => 'Iceland', 'code' => 354],
-            ['title' => '几内亚', 'english' => 'Guinea', 'code' => 224],
-            ['title' => '几内亚比绍', 'english' => 'Guinea - Bissau', 'code' => 245],
-            ['title' => '列支敦士登', 'english' => 'Liechtenstein', 'code' => 423],
-            ['title' => '刚果共和国', 'english' => 'The Republic of Congo', 'code' => 242],
-            ['title' => '刚果民主共和国', 'english' => 'Democratic Republic of the Congo', 'code' => 243],
-            ['title' => '利比亚', 'english' => 'Libya', 'code' => 218],
-            ['title' => '利比里亚', 'english' => 'Liberia', 'code' => 231],
-            ['title' => '加拿大', 'english' => 'Canada', 'code' => 1],
-            ['title' => '加纳', 'english' => 'Ghana', 'code' => 233],
-            ['title' => '加蓬', 'english' => 'Gabon', 'code' => 241],
-            ['title' => '匈牙利', 'english' => 'Hungary', 'code' => 36],
-            ['title' => '南非', 'english' => 'South Africa', 'code' => 27],
-            ['title' => '博茨瓦纳', 'english' => 'Botswana', 'code' => 267],
-            ['title' => '卡塔尔', 'english' => 'Qatar', 'code' => 974],
-            ['title' => '卢旺达', 'english' => 'Rwanda', 'code' => 250],
-            ['title' => '卢森堡', 'english' => 'Luxembourg', 'code' => 352],
-            ['title' => '印尼', 'english' => 'Indonesia', 'code' => 62],
-            ['title' => '印度', 'english' => 'India', 'code' => 91918919],
-            ['title' => '危地马拉', 'english' => 'Guatemala', 'code' => 502],
-            ['title' => '厄瓜多尔', 'english' => 'Ecuador', 'code' => 593],
-            ['title' => '厄立特里亚', 'english' => 'Eritrea', 'code' => 291],
-            ['title' => '叙利亚', 'english' => 'Syria', 'code' => 963],
-            ['title' => '古巴', 'english' => 'Cuba', 'code' => 53],
-            ['title' => '吉尔吉斯斯坦', 'english' => 'Kyrgyzstan', 'code' => 996],
-            ['title' => '吉布提', 'english' => 'Djibouti', 'code' => 253],
-            ['title' => '哥伦比亚', 'english' => 'Colombia', 'code' => 57],
-            ['title' => '哥斯达黎加', 'english' => 'Costa Rica', 'code' => 506],
-            ['title' => '喀麦隆', 'english' => 'Cameroon', 'code' => 237],
-            ['title' => '图瓦卢', 'english' => 'Tuvalu', 'code' => 688],
-            ['title' => '土库曼斯坦', 'english' => 'Turkmenistan', 'code' => 993],
-            ['title' => '土耳其', 'english' => 'Turkey', 'code' => 90],
-            ['title' => '圣卢西亚', 'english' => 'Saint Lucia', 'code' => 1758],
-            ['title' => '圣基茨和尼维斯', 'english' => 'Saint Kitts and Nevis', 'code' => 1869],
-            ['title' => '圣多美和普林西比', 'english' => 'Sao Tome and Principe', 'code' => 239],
-            ['title' => '圣文森特和格林纳丁斯', 'english' => 'Saint Vincent and the Grenadines', 'code' => 1784],
-            ['title' => '圣皮埃尔和密克隆群岛', 'english' => 'Saint Pierre and Miquelon', 'code' => 508],
-            ['title' => '圣赫勒拿岛', 'english' => 'Saint Helena', 'code' => 290],
-            ['title' => '圣马力诺', 'english' => 'San Marino', 'code' => 378],
-            ['title' => '圭亚那', 'english' => 'Guyana', 'code' => 592],
-            ['title' => '坦桑尼亚', 'english' => 'Tanzania', 'code' => 255],
-            ['title' => '埃及', 'english' => 'Egypt', 'code' => 20],
-            ['title' => '埃塞俄比亚', 'english' => 'Ethiopia', 'code' => 251],
-            ['title' => '基里巴斯', 'english' => 'Kiribati', 'code' => 686],
-            ['title' => '塔吉克斯坦', 'english' => 'Tajikistan', 'code' => 992],
-            ['title' => '塞内加尔', 'english' => 'Senegal', 'code' => 221],
-            ['title' => '塞尔维亚', 'english' => 'Serbia and Montenegro', 'code' => 381],
-            ['title' => '塞拉利昂', 'english' => 'Sierra Leone', 'code' => 232],
-            ['title' => '塞浦路斯', 'english' => 'Cyprus', 'code' => 357],
-            ['title' => '塞舌尔', 'english' => 'Seychelles', 'code' => 248],
-            ['title' => '墨西哥', 'english' => 'Mexico', 'code' => 52],
-            ['title' => '多哥', 'english' => 'Togo', 'code' => 228],
-            ['title' => '多米尼克', 'english' => 'Dominica', 'code' => 1767],
-            ['title' => '奥地利', 'english' => 'Austria', 'code' => 43],
-            ['title' => '委内瑞拉', 'english' => 'Venezuela', 'code' => 58],
-            ['title' => '孟加拉', 'english' => 'Bangladesh', 'code' => 880],
-            ['title' => '安哥拉', 'english' => 'Angola', 'code' => 244],
-            ['title' => '安圭拉岛', 'english' => 'Anguilla', 'code' => 1264],
-            ['title' => '安道尔', 'english' => 'Andorra', 'code' => 376],
-            ['title' => '密克罗尼西亚', 'english' => 'Federated States of Micronesia', 'code' => 691],
-            ['title' => '尼加拉瓜', 'english' => 'Nicaragua', 'code' => 505],
-            ['title' => '尼日利亚', 'english' => 'Nigeria', 'code' => 234],
-            ['title' => '尼日尔', 'english' => 'Niger', 'code' => 227],
-            ['title' => '尼泊尔', 'english' => 'Nepal', 'code' => 977],
-            ['title' => '巴勒斯坦', 'english' => 'Palestine', 'code' => 970],
-            ['title' => '巴哈马', 'english' => 'The Bahamas', 'code' => 1242],
-            ['title' => '巴基斯坦', 'english' => 'Pakistan', 'code' => 92],
-            ['title' => '巴巴多斯', 'english' => 'Barbados', 'code' => 1246],
-            ['title' => '巴布亚新几内亚', 'english' => 'Papua New Guinea', 'code' => 675],
-            ['title' => '巴拉圭', 'english' => 'Paraguay', 'code' => 595],
-            ['title' => '巴拿马', 'english' => 'Panama', 'code' => 507],
-            ['title' => '巴林', 'english' => 'Bahrain', 'code' => 973],
-            ['title' => '巴西', 'english' => 'Brazil', 'code' => 55],
-            ['title' => '布基纳法索', 'english' => ' Burkina Faso', 'code' => 226],
-            ['title' => '布隆迪', 'english' => 'Burundi', 'code' => 257],
-            ['title' => '希腊', 'english' => ' Greece', 'code' => 30],
-            ['title' => '帕劳', 'english' => 'Palau', 'code' => 680],
-            ['title' => '库克群岛', 'english' => ' Cook Islands', 'code' => 682],
-            ['title' => '开曼群岛', 'english' => 'Cayman Islands', 'code' => 1345],
-            ['title' => '德国', 'english' => ' Germany', 'code' => 49],
-            ['title' => '意大利', 'english' => 'Italy', 'code' => 39],
-            ['title' => '所罗门群岛', 'english' => ' Solomon Islands', 'code' => 677],
-            ['title' => '托克劳', 'english' => 'Tokelau', 'code' => 690],
-            ['title' => '拉脱维亚', 'english' => 'Latvia', 'code' => 371],
-            ['title' => '挪威', 'english' => 'Norway', 'code' => 47],
-            ['title' => '捷克共和国', 'english' => 'Czech Republic', 'code' => 420],
-            ['title' => '摩尔多瓦', 'english' => 'Moldova', 'code' => 373],
-            ['title' => '摩洛哥', 'english' => 'Morocco', 'code' => 212],
-            ['title' => '摩纳哥', 'english' => 'Monaco', 'code' => 377],
-            ['title' => '文莱', 'english' => 'Brunei Darussalam', 'code' => 673],
-            ['title' => '斐济', 'english' => 'Fiji', 'code' => 679],
-            ['title' => '斯威士兰王国', 'english' => 'The Kingdom of Swaziland', 'code' => 268],
-            ['title' => '斯洛伐克', 'english' => 'Slovakia', 'code' => 421],
-            ['title' => '斯洛文尼亚', 'english' => 'Slovenia', 'code' => 386],
-            ['title' => '斯里兰卡', 'english' => 'Sri Lanka', 'code' => 94],
-            ['title' => '新加坡', 'english' => 'Singapore ', 'code' => 65],
-            ['title' => '新喀里多尼亚', 'english' => 'New Caledonia', 'code' => 687],
-            ['title' => '新西兰', 'english' => 'New Zealand', 'code' => 64],
-            ['title' => '日本', 'english' => 'Japan', 'code' => 81],
-            ['title' => '智利', 'english' => 'Chile', 'code' => 56],
-            ['title' => '朝鲜', 'english' => 'Korea, North', 'code' => 850],
-            ['title' => '柬埔寨 ', 'english' => 'Cambodia', 'code' => 855],
-            ['title' => '格林纳达', 'english' => 'Grenada', 'code' => 1473],
-            ['title' => '格陵兰', 'english' => 'Greenland', 'code' => 299],
-            ['title' => '格鲁吉亚', 'english' => 'Georgia', 'code' => 995],
-            ['title' => '比利时', 'english' => 'Belgium', 'code' => 32],
-            ['title' => '毛里塔尼亚', 'english' => 'Mauritania', 'code' => 222],
-            ['title' => '毛里求斯', 'english' => 'Mauritius', 'code' => 230],
-            ['title' => '汤加', 'english' => 'Tonga', 'code' => 676],
-            ['title' => '沙特阿拉伯', 'english' => 'Saudi Arabia', 'code' => 966],
-            ['title' => '法国', 'english' => 'France', 'code' => 33],
-            ['title' => '法属圭亚那', 'english' => 'French Guiana', 'code' => 594],
-            ['title' => '法属波利尼西亚', 'english' => 'French Polynesia', 'code' => 689],
-            ['title' => '法属西印度群岛', 'english' => 'french west indies', 'code' => 596],
-            ['title' => '法罗群岛', 'english' => 'Faroe Islands', 'code' => 298],
-            ['title' => '波兰', 'english' => 'Poland', 'code' => 48],
-            ['title' => '波多黎各', 'english' => 'The Commonwealth of Puerto Rico', 'code' => 17871939],
-            ['title' => '波黑', 'english' => 'Bosnia and Herzegovina ', 'code' => 387],
-            ['title' => '泰国', 'english' => 'Thailand', 'code' => 66],
-            ['title' => '津巴布韦', 'english' => 'Zimbabwe', 'code' => 263],
-            ['title' => '洪都拉斯', 'english' => 'Honduras', 'code' => 504],
-            ['title' => '海地', 'english' => 'Haiti', 'code' => 509],
-            ['title' => '澳大利亚', 'english' => 'Australia', 'code' => 61],
-            ['title' => '澳门', 'english' => 'Macao', 'code' => 853],
-            ['title' => '爱尔兰', 'english' => 'Ireland', 'code' => 353],
-            ['title' => '爱沙尼亚', 'english' => 'Estonia', 'code' => 372],
-            ['title' => '牙买加 ', 'english' => 'Jamaica', 'code' => 1876],
-            ['title' => '特克斯和凯科斯群岛', 'english' => 'Turks and Caicos Islands', 'code' => 1649],
-            ['title' => '特立尼达和多巴哥', 'english' => 'Trinidad and Tobago', 'code' => 1868],
-            ['title' => '玻利维亚', 'english' => 'Bolivia', 'code' => 591],
-            ['title' => '瑙鲁', 'english' => 'Nauru', 'code' => 674],
-            ['title' => '瑞典', 'english' => 'Sweden', 'code' => 46],
-            ['title' => '瑞士', 'english' => 'Switzerland', 'code' => 41],
-            ['title' => '瓜德罗普', 'english' => 'Guadeloupe', 'code' => 590],
-            ['title' => '瓦利斯和富图纳群岛', 'english' => 'Wallis et Futuna', 'code' => 681],
-            ['title' => '瓦努阿图', 'english' => 'Vanuatu', 'code' => 678],
-            ['title' => '留尼汪 ', 'english' => 'Reunion', 'code' => 262],
-            ['title' => '白俄罗斯', 'english' => 'Belarus', 'code' => 375],
-            ['title' => '百慕大', 'english' => 'Bermuda', 'code' => 1441],
-            ['title' => '直布罗陀', 'english' => 'Gibraltar', 'code' => 350],
-            ['title' => '福克兰群岛', 'english' => 'Falkland', 'code' => 500],
-            ['title' => '科威特', 'english' => 'Kuwait', 'code' => 965],
-            ['title' => '科摩罗和马约特', 'english' => 'Comoros', 'code' => 269],
-            ['title' => '科特迪瓦', 'english' => 'Cote d’Ivoire', 'code' => 225],
-            ['title' => '秘鲁', 'english' => 'Peru', 'code' => 51],
-            ['title' => '突尼斯', 'english' => 'Tunisia', 'code' => 216],
-            ['title' => '立陶宛', 'english' => 'Lithuania', 'code' => 370],
-            ['title' => '索马里', 'english' => 'Somalia', 'code' => 252],
-            ['title' => '约旦', 'english' => 'Jordan', 'code' => 962],
-            ['title' => '纳米比亚', 'english' => 'Namibia', 'code' => 264],
-            ['title' => '纽埃岛', 'english' => 'Island of Niue', 'code' => 683],
-            ['title' => '缅甸  ', 'english' => 'Burma', 'code' => 95],
-            ['title' => '罗马尼亚', 'english' => 'Romania', 'code' => 40],
-            ['title' => '美国', 'english' => 'United States of America', 'code' => 1],
-            ['title' => '美属维京群岛', 'english' => 'Virgin Islands', 'code' => 1340],
-            ['title' => '美属萨摩亚', 'english' => 'American Samoa', 'code' => 1684],
-            ['title' => '老挝', 'english' => 'Laos', 'code' => 856],
-            ['title' => '肯尼亚', 'english' => 'Kenya', 'code' => 254],
-            ['title' => '芬兰', 'english' => 'Finland', 'code' => 358],
-            ['title' => '苏丹', 'english' => 'Sudan', 'code' => 249],
-            ['title' => '苏里南', 'english' => 'Suriname', 'code' => 597],
-            ['title' => '英国', 'english' => 'United Kingdom', 'code' => 44],
-            ['title' => '英属维京群岛', 'english' => 'British Virgin Islands', 'code' => 1284],
-            ['title' => '荷兰', 'english' => 'Netherlands', 'code' => 31],
-            ['title' => '荷属安的列斯', 'english' => 'Netherlands Antilles', 'code' => 599],
-            ['title' => '莫桑比克', 'english' => 'Mozambique', 'code' => 258],
-            ['title' => '莱索托', 'english' => 'Lesotho', 'code' => 266],
-            ['title' => '菲律宾', 'english' => 'Philippines', 'code' => 63],
-            ['title' => '萨尔瓦多', 'english' => 'El Salvador', 'code' => 503],
-            ['title' => '萨摩亚', 'english' => 'Samoa', 'code' => 685],
-            ['title' => '葡萄牙', 'english' => 'Portugal', 'code' => 351],
-            ['title' => '蒙古', 'english' => 'Mongolia', 'code' => 976],
-            ['title' => '西班牙', 'english' => 'Spain', 'code' => 34],
-            ['title' => '贝宁', 'english' => 'Benin', 'code' => 229],
-            ['title' => '赞比亚', 'english' => 'Zambia', 'code' => 260],
-            ['title' => '赤道几内亚', 'english' => 'Equatorial Guinea', 'code' => 240],
-            ['title' => '越南', 'english' => 'Vietnam', 'code' => 84],
-            ['title' => '阿塞拜疆', 'english' => 'Azerbaijan', 'code' => 994],
-            ['title' => '阿富汗', 'english' => 'Afghanistan', 'code' => 93],
-            ['title' => '阿尔及利亚', 'english' => 'Algeria', 'code' => 213],
-            ['title' => '阿尔巴尼亚', 'english' => 'Albania', 'code' => 355],
-            ['title' => '阿拉伯联合酋长国', 'english' => 'United Arab Emirates', 'code' => 971],
-            ['title' => '阿曼', 'english' => 'Oman', 'code' => 968],
-            ['title' => '阿根廷', 'english' => 'Argentina', 'code' => 54],
-            ['title' => '阿鲁巴', 'english' => 'Aruba', 'code' => 297],
-            ['title' => '韩国', 'english' => 'Korea, South)', 'code' => 82],
-            ['title' => '香港', 'english' => 'Hong Kong(SAR)', 'code' => 852],
-            ['title' => '马其顿', 'english' => 'Macedonia', 'code' => 389],
-            ['title' => '马尔代夫', 'english' => 'Maldives  ', 'code' => 960],
-            ['title' => '马拉维', 'english' => ' Malawi', 'code' => 265],
-            ['title' => '马来西亚', 'english' => 'Malaysia', 'code' => 60],
-            ['title' => '马绍尔群岛', 'english' => 'Marshall Islands', 'code' => 692],
-            ['title' => '马耳他', 'english' => 'Malta', 'code' => 356],
-            ['title' => '马达加斯加', 'english' => 'Madagascar', 'code' => 261],
-            ['title' => '马里', 'english' => 'Mali', 'code' => 223],
-            ['title' => '黎巴嫩', 'english' => 'Lebanon', 'code' => 961],
-            ['title' => '黑山共和国', 'english' => 'The Republic of Montenegro', 'code' => 382],
-        ];
-    }
-
-}

+ 0 - 71
application/store/service/GoodsService.php

@@ -1,71 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\service;
-
-use think\Db;
-
-/**
- * 商品数据管理
- * Class GoodsService
- * @package app\store\logic
- */
-class GoodsService
-{
-    /**
-     * 同步商品库存信息
-     * @param integer $goodsId
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public static function syncStock($goodsId)
-    {
-        // 商品入库统计
-        $fields = "goods_id,goods_spec,ifnull(sum(number_stock),0) number_stock";
-        $stockList = Db::name('StoreGoodsStock')->field($fields)->where(['goods_id' => $goodsId])->group('goods_id,goods_spec')->select();
-        // 商品销量统计
-        $where = [['b.goods_id', 'eq', $goodsId], ['a.status', 'in', ['1', '2', '3', '4', '5']]];
-        $fields = 'b.goods_id,b.goods_spec,ifnull(sum(b.number_goods),0) number_sales';
-        $salesList = Db::table('store_order a')->field($fields)->leftJoin('store_order_list b', 'a.order_no=b.order_no')->where($where)->group('b.goods_id,b.goods_spec')->select();
-        // 组装更新数据
-        $dataList = [];
-        foreach (array_merge($stockList, $salesList) as $vo) {
-            $key = "{$vo['goods_id']}@@{$vo['goods_spec']}";
-            $dataList[$key] = isset($dataList[$key]) ? array_merge($dataList[$key], $vo) : $vo;
-            if (empty($dataList[$key]['number_sales'])) $dataList[$key]['number_sales'] = '0';
-            if (empty($dataList[$key]['number_stock'])) $dataList[$key]['number_stock'] = '0';
-        }
-        unset($salesList, $stockList);
-        // 更新商品规格销量及库存
-        foreach ($dataList as $vo) Db::name('StoreGoodsList')->where([
-            'goods_id'   => $goodsId,
-            'goods_spec' => $vo['goods_spec'],
-        ])->update([
-            'number_stock' => $vo['number_stock'],
-            'number_sales' => $vo['number_sales'],
-        ]);
-        // 更新商品主体销量及库存
-        Db::name('StoreGoods')->where(['id' => $goodsId])->update([
-            'number_stock' => intval(array_sum(array_column($dataList, 'number_stock'))),
-            'number_sales' => intval(array_sum(array_column($dataList, 'number_sales'))),
-        ]);
-        return true;
-    }
-
-}

+ 0 - 67
application/store/service/OrderService.php

@@ -1,67 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\store\service;
-
-use think\Db;
-
-/**
- * 订单服务管理器
- * Class OrderService
- * @package app\store\service
- */
-class OrderService
-{
-    /**
-     * 根据订单号升级会员等级
-     * @param string $order_no 订单单号
-     * @return boolean
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public static function update($order_no)
-    {
-        // @todo 更新订单状态
-    }
-
-    /**
-     * 根据订单同步库存销量
-     * @param string $order_no
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public static function syncStock($order_no)
-    {
-        $map = ['order_no' => $order_no];
-        $goodsIds = Db::name('StoreOrderList')->where($map)->column('goods_id');
-        foreach (array_unique($goodsIds) as $goodsId) if (!GoodsService::syncStock($goodsId)) return false;
-        return true;
-    }
-
-    /**
-     * 订单利润计算
-     * @param string $order_no
-     * @return boolean
-     */
-    public static function profit($order_no = '')
-    {
-        // @todo 计算订单返佣
-    }
-}

+ 0 - 19
application/store/sys.php

@@ -1,19 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-// 注册系统指令
-\think\Console::addDefaultCommands([
-    'app\store\command\AutoRun',
-]);

+ 0 - 51
application/store/view/banner/form.html

@@ -1,51 +0,0 @@
-<style>
-    .uploadimage{
-        width: 10pc !important;
-    }
-</style>
-<div class="think-box-shadow">
-<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
-    <div class="layui-card-body">
-
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">名称</label>
-            <div class="layui-input-block">
-                <input name="name" maxlength="20"  value='{$vo.name|default=""}' placeholder="请输入名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">图片</label>
-            <div class="layui-input-block">
-                <input name="cover" type="hidden" value="{$vo.cover|default=''}">
-                &nbsp; &nbsp;<span style="margin-right: 20px">建议尺寸宽700px 高330px </span>
-            </div>
-
-        </div>
-
-        <div class="layui-form-item">
-            <label class="layui-form-label">链接</label>
-            <div class="layui-input-block">
-                <input type="" name="link"  value='{$vo.link|default=""}' placeholder="" class="layui-input">
-            </div>
-        </div>
-
-
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">排序</label>
-            <div class="layui-input-block">
-                <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
-            </div>
-        </div>
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <div class="layui-form-item text-center">
-            <button class="layui-btn" type='submit'>保 存</button>
-            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定取消编辑吗?" data-close>取消编辑</button>
-        </div>
-    </div>
-</form>
-    <script>
-        window.form.render();
-        $('[name="cover"]').uploadOneImage();
-    </script>
-</div>

+ 0 - 64
application/store/view/banner/index.html

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

+ 0 - 15
application/store/view/banner/index_search.html

@@ -1,15 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">商品名称</label>
-            <div class="layui-input-inline">
-                <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入分类名称" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 18
application/store/view/config/index-about-us.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">关于我们</span><span class="nowrap color-desc">AboutUs</span>
-            <textarea name="about_us">{:sysconf('about_us')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="about_us"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 18
application/store/view/config/index-agreement.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">用户协议</span><span class="nowrap color-desc">Agreement</span>
-            <textarea name="agreement">{:sysconf('agreement')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="agreement"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 40
application/store/view/config/index.html

@@ -1,40 +0,0 @@
-{extend name="admin@main"}
-
-{block name="content"}
-
-<div class="layui-tab layui-tab-card think-bg-white">
-    <ul class="layui-tab-title notselect">
-        <li data-type="store-config-type-sms1">参数设置</li>
-        <li data-type="store-config-type-sms2">用户协议</li>
-        <li data-type="store-config-type-sms2">隐私政策</li>
-        <li data-type="store-config-type-sms2">平台协议</li>
-        <li data-type="store-config-type-sms2">购买与转赠须知</li>
-        <li data-type="store-config-type-sms2">关于我们</li>
-        <li data-type="store-config-type-sms2">客服配置</li>
-        <li data-type="store-config-type-sms2">自定义文字</li>
-    </ul>
-    <div class="layui-tab-content">
-        <div class="layui-tab-item">{include file='config/platform-set'}</div>
-        <div class="layui-tab-item">{include file='config/index-agreement'}</div>
-        <div class="layui-tab-item">{include file='config/privacy'}</div>
-        <div class="layui-tab-item">{include file='config/platform-agreement'}</div>
-        <div class="layui-tab-item">{include file='config/purchase-notice'}</div>
-        <div class="layui-tab-item">{include file='config/index-about-us'}</div>
-        <div class="layui-tab-item">{include file='config/service'}</div>
-        <div class="layui-tab-item">{include file='config/self'}</div>
-    </div>
-</div>
-
-<script>
-    (function (storage) {
-        (function (type, $default, $checked) {
-            $default = $('.layui-tab ul.layui-tab-title li:first');
-            $checked = $('.layui-tab ul.layui-tab-title li[data-type="' + type + '"]');
-            ($checked.length > 0 ? $checked : $default).trigger('click');
-        })(layui.data(storage)['type'] || '');
-        $('.layui-tab ul.layui-tab-title li[data-type]').on('click', function () {
-            layui.data(storage, {key: 'type', value: this.getAttribute('data-type')});
-        });
-    })('store-config-type');
-</script>
-{/block}

+ 0 - 18
application/store/view/config/platform-agreement.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">平台协议</span><span class="nowrap color-desc">PlatformAgreement</span>
-            <textarea name="platform_agreement">{:sysconf('platform_agreement')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="platform_agreement"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 18
application/store/view/config/platform-notice.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">平台消息</span><span class="nowrap color-desc">PlatformNotice</span>
-            <textarea name="platform_notice">{:sysconf('platform_notice')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="platform_notice"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 104
application/store/view/config/platform-set.html

@@ -1,104 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-
-        <label class="layui-form-item block relative">
-            <span class="color-green margin-right-10">自动取消订单时间(分)</span><span class="nowrap color-desc">CancelTime</span>
-            <input name="cancel_time" type="number" required placeholder="自动取消订单时间" value="{:sysconf('cancel_time')}" class="layui-input">
-            <p class="help-block">用户下单后??分之后未支付自动取消(正整数)</p>
-        </label>
-
-
-        <label class="layui-form-item block relative">
-            <span class="color-green margin-right-10">自定义名称</span><span class="nowrap color-desc">PlatName</span>
-            <input name="plat_name" required placeholder="" value="{:sysconf('plat_name')}" class="layui-input">
-        </label>
-
-        <label class="layui-form-item block relative">
-            <span class="color-green margin-right-10">关于发货</span><span class="nowrap color-desc">AboutDeliver</span>
-            <input name="about_deliver"  placeholder="" value="{:sysconf('about_deliver')}" class="layui-input">
-        </label>
-
-        <label class="layui-form-item block relative">
-            <span class="color-green margin-right-10">商品详情开关</span><span class="nowrap color-desc">GoodsDetailSwitch</span>
-            <div>
-                {foreach [1=>'开启',0=>'关闭'] as $sk=>$sv}
-                <!--{if $goods_detail_switch eq $sk}-->
-                <label >
-                    <input checked type="radio" name="goods_detail_switch" value="{$sk}"  lay-filter="goods_detail_switch">
-                </label>
-                <!--{else}-->
-                <label>
-                    <input type="radio" name="goods_detail_switch" value="{$sk}"  lay-filter="goods_detail_switch" >
-                </label>
-                <!--{/if}-->
-                <span class="margin-right-5">{$sv}</span>
-                {/foreach}
-            </div>
-            <p class="help-block"></p>
-        </label>
-
-
-
-        <label class="layui-form-item block relative">
-            <span class="color-green margin-right-10">销售历史开关</span><span class="nowrap color-desc">SellSwitch</span>
-            <div>
-                {foreach [1=>'开启',0=>'关闭'] as $sk=>$sv}
-                <!--{if $sell_switch eq $sk}-->
-                <label >
-                    <input checked type="radio" name="sell_switch" value="{$sk}"  lay-filter="sell_switch">
-                </label>
-                <!--{else}-->
-                <label>
-                    <input type="radio" name="sell_switch" value="{$sk}"  lay-filter="sell_switch" >
-                </label>
-                <!--{/if}-->
-                <span class="margin-right-5">{$sv}</span>
-                {/foreach}
-            </div>
-            <p class="help-block"></p>
-        </label>
-
-
-        <label class="layui-form-item block relative">
-            <span class="color-green margin-right-10">元石开关</span><span class="nowrap color-desc">CrystalSwitch</span>
-            <div>
-                {foreach [1=>'开启',0=>'关闭'] as $sk=>$sv}
-                <!--{if $crystal_switch eq $sk}-->
-                <label >
-                    <input checked type="radio" name="crystal_switch" value="{$sk}"  lay-filter="crystal_switch">
-                </label>
-                <!--{else}-->
-                <label>
-                    <input type="radio" name="crystal_switch" value="{$sk}"  lay-filter="crystal_switch" >
-                </label>
-                <!--{/if}-->
-                <span class="margin-right-5">{$sv}</span>
-                {/foreach}
-            </div>
-            <p class="help-block"></p>
-        </label>
-
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-</form>
-<script>
-    layui.use('laydate', function(){
-        var laydate = layui.laydate;
-        //时间选择器
-        laydate.render({
-            elem: '#start_time_cost'
-            ,type: 'time'
-        });
-        laydate.render({
-            elem: '#end_time_cost'
-            ,type: 'time'
-        });
-    })
-
-
-
-
-</script>

+ 0 - 18
application/store/view/config/privacy.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">隐私政策</span><span class="nowrap color-desc">Privacy</span>
-            <textarea name="privacy">{:sysconf('privacy')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="privacy"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 18
application/store/view/config/purchase-notice.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">购买与转赠须知</span><span class="nowrap color-desc">PurchaseNotice</span>
-            <textarea name="purchase_notice">{:sysconf('purchase_notice')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="purchase_notice"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 18
application/store/view/config/self.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">自定义文字</span><span class="nowrap color-desc">Self</span>
-            <textarea name="self">{:sysconf('self')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="self"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 18
application/store/view/config/service.html

@@ -1,18 +0,0 @@
-<form onsubmit="return false;" data-auto="true" action="{:url('save')}" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body padding-40">
-        <label class="layui-form-item margin-top-20 block relative">
-            <span class="color-green margin-right-10">客服配置</span><span class="nowrap color-desc">Service</span>
-            <textarea name="service">{:sysconf('service')}</textarea>
-        </label>
-        <div class="layui-form-item text-center margin-top-20">
-            <button class="layui-btn" type="submit">保存配置</button>
-        </div>
-    </div>
-    <script>
-        window.form.render();
-        require(['ckeditor', 'angular'], function () {
-            window.createEditor('[name="service"]', {height: 500});
-        })
-    </script>
-</form>

+ 0 - 28
application/store/view/exchange_code/form.html

@@ -1,28 +0,0 @@
-
-<div class="think-box-shadow">
-<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
-    <div class="layui-card-body">
-        <input type="hidden" name="goods_id" value="{$goods_id|default='0'}"/>
-        <div class="layui-form-item">
-            <label class="layui-form-label label-required">数量</label>
-            <div class="layui-input-block">
-                <select name="num" >
-                    <option value="1">1</option>
-                    <option value="10">10</option>
-                    <option value="50">50</option>
-                    <option value="100">100</option>
-                    <option value="500">500</option>
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-form-item text-center" style="margin-top: 100px">
-            <button class="layui-btn" type='submit'>保 存</button>
-            <button class="layui-btn layui-btn-danger" type='button' data-close>取消</button>
-        </div>
-    </div>
-</form>
-    <script>
-        window.form.render();
-    </script>
-</div>

+ 0 - 61
application/store/view/exchange_code/index.html

@@ -1,61 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-    <button data-modal='{:url("add")}?goods_id={$goods_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='exchange_code/index_search'}
-    <table class="layui-table margin-top-20" lay-skin="line">
-        <thead>
-        <tr>
-            <th class='text-left nowrap'>兑换码</th>
-            <th class='text-left nowrap'>使用状态</th>
-            <th class='text-left nowrap'>会员</th>
-            <th class="text-left" style="width: 20%">操作</th>
-        </tr>
-        </thead>
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-
-            <td class='text-left nowrap'>{$vo.code|default=''}</td>
-            <td class='text-left nowrap'>{$vo.status == 1 ? '未使用':'已使用'}</td>
-            <td class='text-left nowrap'>{$vo.user_name|default='--'}</td>
-            <td class='text-left' style="width: 20%">
-                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/store/exchange_code/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg(data.info);
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-
-</script>
-{/block}
-
-
-

+ 0 - 25
application/store/view/exchange_code/index_search.html

@@ -1,25 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">使用状态</label>
-            <div class="layui-input-inline">
-                <select class="layui-select" name="status">
-                    {foreach ['全部','未使用','已使用'] as $k=>$v}
-                        {if $Think.get.status eq $k}
-                            <option selected value="{$k}">{$v}</option>
-                        {else}
-                            <option  value="{$k}">{$v}</option>
-                        {/if}
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 479
application/store/view/goods/form.html

@@ -1,479 +0,0 @@
-
-<link rel="stylesheet" href="/static/plugs/layui/css/layui.css"  media="all">
-
-<style>
-    .layui-form-item {
-        width: 80%;
-        height: 90%;
-    }
-    .layui-form-radio{
-       width: 10px !important;
-    }
-
-</style>
-
-<div class="think-box-shadow" style="height: 100%">
-    <form class="layui-form layui-card" id="subForm" action="{:request()->url()}"  data-auto="true" method="post" autocomplete="off">
-        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
-            <legend>商品编辑</legend>
-        </fieldset>
-        <div class="layui-tab">
-            <ul class="layui-tab-title">
-                <li class="layui-this">基础设置</li>
-                <li >其他</li>
-            </ul>
-            <div class="layui-tab-content ">
-                <!--基础设置-->
-                <div class="layui-tab-item layui-show">
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品名称</label>
-                        <div class="layui-input-block">
-                            <input name="name" lay-verify="required" maxlength="50"  value='{$vo.name|default=""}' placeholder="请输入商品名称" class="layui-input">
-                        </div>
-                    </div>
-
-
-                    <div class="layui-form-item" style="display: none">
-                        <label class="layui-form-label">商品简介</label>
-                        <div class="layui-input-block">
-                            <input name="desc" maxlength="50"  value='{$vo.desc|default=""}' placeholder="请输入商品简介" class="layui-input">
-                        </div>
-                    </div>
-
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品封面</label>
-                        <div class="layui-input-block">
-                            <input name="cover" type="hidden" value="{$vo.cover|default=''}">
-                        </div>
-                    </div>
-
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品类型</label>
-                        <div class="layui-input-inline">
-                            <input type="hidden" id="goods_type" value="{$vo.type|default='1'}"/>
-                            <select name="type" {if isset($vo.id)}disabled{/if} lay-filter ="type">
-                                {foreach  $goods_type as $gk=>$gv}
-                                    <option value="{$gk}"  {if isset($vo.id) && $vo.type ==  $gk}selected{/if}>{$gv}</option>
-                                {/foreach}
-                            </select>
-                        </div>
-                    </div>
-
-                    <div class="goods_type">
-                        <div class="layui-form-item type1">
-                            <label class="layui-form-label label-required">商品售价</label>
-                            <div class="layui-input-block">
-                                <input name="goods_price" type="number" step="1" class="layui-input"  value="{$vo.goods_price|default=''}">
-                            </div>
-                        </div>
-                        <div class="layui-form-item type3">
-                            <label class="layui-form-label">邀请人数</label>
-                            <div class="layui-input-block">
-                                <input name="invite_num" type="number" step="1" class="layui-input"  value="{$vo.invite_num|default='0'}">
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">是否转赠</label>
-
-                        <div class="layui-input-block">
-                            <input type="hidden" id="is_gift" value="{$vo.is_gift|default='0'}"/>
-                            <div>
-                                {foreach [0=>'否',1=>'是'] as $sk=>$sv}
-                                <!--{if (isset($vo.id) && $vo.is_gift eq $sk) || ($sk== 0 && !isset($vo.id)) }-->
-                                <label>
-                                    <input checked type="radio"  name="is_gift" value="{$sk}"  lay-filter="is_gift">
-                                </label>
-                                <!--{else}-->
-                                <label >
-                                    <input type="radio" name="is_gift" value="{$sk}"  lay-filter="is_gift" >
-                                </label>
-                                <!--{/if}-->
-                                <span class="" style="line-height: 22px">{$sv}</span>
-                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                {/foreach}
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item type4 ">
-                        <label class="layui-form-label">转赠元石</label>
-                        <div class="layui-input-block">
-                            <input name="crystal" type="number" step="1" class="layui-input"  value="{$vo.crystal|default='0'}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item type4">
-                        <label class="layui-form-label">转赠时间限制(天)</label>
-                        <div class="layui-input-block">
-                            <input name="gift_day" type="number" step="1" class="layui-input"  value="{$vo.gift_day|default='0'}">
-                        </div>
-                    </div>
-
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品库存</label>
-                        <div class="layui-input-block">
-                            <input name="stock"type="number" step="1" class="layui-input"  value="{$vo.stock|default=''}">
-                        </div>
-                    </div>
-
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">收藏量</label>
-                        <div class="layui-input-block">
-                            <input name="vir_num"type="number" step="1" class="layui-input"  value="{$vo.vir_num|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">藏品介绍</label>
-                        <div class="layui-input-block">
-                            <input name="coll_intro"type=""  class="layui-input"  value="{$vo.coll_intro|default=''}">
-                        </div>
-                    </div>
-
-
-                    <div class="layui-form-item" >
-                        <label class="layui-form-label ">上架时间</label>
-                        <div class="layui-input-block">
-                            <input name="sell_time" id="sell_time" value='{$vo.sell_time|default=""}' placeholder="" class="layui-input">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">展示类型</label>
-                        <div class="layui-input-inline">
-                            <input id="adv_type" type="hidden" value="{$vo.adv_type|default='1'}" />
-                            <select name="adv_type" lay-filter ="adv_type">
-                                <option value="1" {if isset($vo.adv_type) && $vo.adv_type == 1}selected{/if}>图片</option>
-                                <option value="3" {if isset($vo.adv_type) && $vo.adv_type == 3}selected{/if}>视频</option>
-                            </select>
-                        </div>
-                    </div>
-
-                    <div class="adv_box">
-                        <div class="layui-form-item adv_box1">
-                            <label class="layui-form-label">展示封面</label>
-                            <div class="layui-input-block">
-                                <input name="adv_cover" type="hidden" value="{$vo.adv_cover|default=''}">
-                            </div>
-                        </div>
-
-                        <div class="layui-form-item adv_box2">
-                            <label class="layui-form-label">展示音频</label>
-                            <div class="layui-input-block">
-                                <div class="audio_box" style="float:left;">
-                                    <audio   style='' controls>
-                                        <source  src="" >
-                                        <source id="mp3" src="{$vo.mp3_url|default=''}" >
-                                    </audio>
-                                </div>
-                                <div  class ='up_img' style='color: blue;line-height:50px;margin-left:30px;float: left; width: 60px ;'>选 择</div >
-                                <input  style="display: none"  type="file" name="file" accept="mp3" value="" onchange="upload_img(this)" class="layui-input"/>
-                                <input  style="display: none"  value="{$vo.mp3_url|default=''}" name="mp3_url" class="layui-input"/>
-                                <div></div>
-                            </div>
-                        </div>
-
-
-
-
-
-                        <div class="layui-form-item adv_box3">
-                            <label class="layui-form-label ">展示视频</label>
-                            <div class="layui-input-block">
-                                <input name="audio_url" type="hidden" value="{$vo.audio_url|default=''}">
-                            </div>
-                        </div>
-
-                        <div class="layui-form-item adv_box3">
-                            <label class="layui-form-label ">进度显示</label>
-                            <div class="layui-input-block">
-                                <input type="hidden" id="audio_line" value="{$vo.audio_line|default='0'}"/>
-                                <div>
-                                    {foreach [0=>'否',1=>'是'] as $sk=>$sv}
-                                    <!--{if (isset($vo.id) && $vo.audio_line eq $sk) || ($sk== 0 && !isset($vo.id)) }-->
-                                    <label>
-                                        <input checked type="radio"  name="audio_line" value="{$sk}"  lay-filter="audio_line">
-                                    </label>
-                                    <!--{else}-->
-                                    <label >
-                                        <input type="radio" name="audio_line" value="{$sk}"  lay-filter="audio_line" >
-                                    </label>
-                                    <!--{/if}-->
-                                    <span class="" style="line-height: 22px">{$sv}</span>
-                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                    {/foreach}
-                                </div>
-                            </div>
-                        </div>
-
-                    </div>
-                    <div class="layui-form-item" >
-                        <label class="layui-form-label">购买须知</label>
-                        <div class="layui-input-block">
-                            <textarea name="buy_notice" style="height: 150px;width: 100%;border-color: #e6e6e6" >{$vo.buy_notice|default=""}</textarea>
-                        </div>
-                    </div>
-
-                </div>
-                <!--其他设置-->
-                <div class="layui-tab-item">
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">分享图片</label>
-                        <div class="layui-input-block">
-                            <input name="share_img" type="hidden" value="{$vo.share_img|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">支付图片</label>
-                        <div class="layui-input-block">
-                            <input name="pay_pic" type="hidden" value="{$vo.pay_pic|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">支付内容</label>
-                        <div class="layui-input-block">
-                            <input name="pay_content" maxlength="30" type=""  class="layui-input"  value="{$vo.pay_content|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">发行方头像</label>
-                        <div class="layui-input-block">
-                            <input name="auth_img" type="hidden" value="{$vo.auth_img|default=''}">
-                        </div>
-                    </div>
-
-
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label">发行方</label>
-                        <div class="layui-input-block">
-                            <input name="issuer" class="layui-input"  value="{$vo.issuer|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item" >
-                        <label class="layui-form-label">商品详情</label>
-                        <div class="layui-input-block">
-                            <textarea name="detail">{$vo.detail|default=""}</textarea>
-                        </div>
-                    </div>
-                    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-                    <div class="layui-form-item text-center">
-                        <span class="layui-btn" type='submit' id ="submit">保 存</span>
-                        <button class="layui-btn layui-btn-danger" type='button' onclick="history.go(-1);">取消编辑</button>
-                    </div>
-                </div>
-            </div>
-
-        </div>
-    </form>
-</div>
-<script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script>
-<script>
-    window.form.render();
-    require(['ckeditor', 'angular'], function () {
-        window.createEditor('[name="detail"]', {height: 500,width:1000});
-    })
-    layui.use('laydate', function(){
-        var laydate = layui.laydate;
-        laydate.render({
-            elem: '#sell_time'
-            ,type: 'datetime'
-        });
-        laydate.render({
-            elem: '#end_time'
-            ,type: 'datetime'
-        });
-    })
-    $('[name="cover"]').uploadOneImage();
-    $('[name="share_img"]').uploadOneImage();
-    $('[name="adv_cover"]').uploadOneImage();
-    $('[name="auth_img"]').uploadOneImage();
-    $('[name="pay_pic"]').uploadOneImage();
-    $('[name="audio_url"]').uploadOneVideo()
-    /**
-     * 表单验证
-     */
-    $(document).on('click','#submit',function () {
-        if($('#submit').hasClass('is_sub')) {
-            return false;
-        }
-
-        var goods_name = $('input[name="name"]').val();
-        if(!goods_name){
-            layer.msg('请填写商品名称!')
-            return false;
-        }
-
-        var goods_cover = $('input[name="cover"]').val();
-        if(!goods_cover){
-            layer.msg('请上传商品封面!')
-            return false;
-        }
-
-        var goods_type = $('select[name="type"]').val();
-        var goods_price = $('input[name="goods_price"]').val();
-        if(!goods_type == 1 && !goods_price){
-            layer.msg('请输入商品价格!')
-            return false;
-        }
-
-        var  vir_num =  $('input[name="vir_num"]').val();
-        if(!vir_num){
-            layer.msg('请输入商品收藏量!')
-            return false;
-        }
-
-
-
-        $('#submit').addClass('is_sub');
-        $("#subForm").submit();
-    })
-    layui.use('element', function(){
-        var $ = layui.jquery
-            ,element = layui.element;
-        var active = {
-            tabAdd: function(){
-                element.tabAdd('demo', {
-                    title: '新选项'+ (Math.random()*1000|0)
-                    ,content: '内容'+ (Math.random()*1000|0)
-                    ,id: new Date().getTime()
-                })
-            }
-            ,tabDelete: function(othis){
-                element.tabDelete('demo', '44');
-                othis.addClass('layui-btn-disabled');
-            }
-            ,tabChange: function(){
-                element.tabChange('demo', '22');
-            }
-        };
-
-        $('.site-demo-active').on('click', function(){
-            var othis = $(this), type = othis.data('type');
-            active[type] ? active[type].call(this, othis) : '';
-        });
-
-        //Hash地址的定位
-        var layid = location.hash.replace(/^#test=/, '');
-        element.tabChange('test', layid);
-
-        element.on('tab(test)', function(elem){
-            location.hash = 'test='+ $(this).attr('lay-id');
-        });
-
-    });
-
-
-    // 商品类型
-    var goods_type = $("#goods_type").val();
-    type_listen(goods_type)
-    // 商品类型选择监听
-    form.on('select(type)', function(data){
-        type_listen(data.value)
-    })
-    function type_listen(val) {
-        $(".goods_type .layui-form-item").hide();
-        $(".type"+val).show();
-        window.form.render();
-    }
-    // 单选按钮
-    var  is_gift = $("#is_gift").val();
-    gift_listen(is_gift);
-    function gift_listen(is_gift){
-        if(is_gift == 1){
-            $(".type4").show();
-        }else{
-            $(".type4").hide();
-        }
-    }
-    form.on('radio(is_gift)', function(data){
-        if($("input[name='is_gift']:checked").val() == 1){
-            $(".type4").show();
-        }else{
-            $(".type4").hide();
-        }
-    })
-
-    // 广告
-    var adv_type = $("#adv_type").val();
-    sel_listen(adv_type)
-    // 分类选择监听
-    form.on('select(adv_type)', function(data){
-        sel_listen(data.value)
-    })
-    function sel_listen(val) {
-        $(".adv_box .layui-form-item").hide();
-        $(".adv_box"+val).show();
-        window.form.render();
-    }
-
-    //mp3上传
-    $(document).on("click",'.up_img',function () {
-        $(this).siblings('[name="file"]').click();
-    })
-
-    function upload_img(e,k) {
-        var file = e.files[0]; //获取图片资源
-        var fileTypes = ['mp3'];
-        var bTypeMatch = false
-        for (var i = 0; i < fileTypes.length; i++) {
-            var start = file.name.lastIndexOf(".");
-            var fileType = file.name.substring(start + 1);
-            if (fileType.toLowerCase() == fileTypes[i]) {
-                bTypeMatch = true;
-                break;
-            }
-        }
-        if (bTypeMatch) {
-            if (file.size <= 1024 * 1024 * 50) {
-                var farmData = new FormData();
-                farmData.append("file", file)
-                $.ajax("/api/Upload/upload", {
-                    data: farmData,
-                    processData: false,
-                    contentType: false,
-                    dataType: 'json',
-                    type: 'post', //HTTP请求类型
-                    headers: {
-                        'zbtoken': localStorage.getItem("token"),
-                        'enctype': 'multipart/form-data',
-                    },
-                    success: function (data) {
-                        console.log(data)
-                        if(data.code == 1) {
-                            $("#mp3").attr('src',data.data);
-                            $(".audio_box").html($(".audio_box").html());
-                            $("input[name='mp3_url']").attr('value',data.data)
-                            window.form.render();
-                        }
-                        layer.msg(data.msg);
-                    },
-                    error: function (xhr, type, errorThrown) {
-                        console.log(type);
-                    }
-                });
-            } else {
-                alert('仅支持不超过50M的MP3');
-                return false;
-            }
-        } else {
-            alert("格式有误!请上传mp3格式");
-            return false;
-        }
-    }
-
-
-
-</script>
-

+ 0 - 111
application/store/view/goods/index.html

@@ -1,111 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-<a data-open='{:url("add")}'   data-title="添加商品" class='layui-btn layui-btn-sm layui-btn-primary'>添加商品</a>
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='goods/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'>
-                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
-            </th>
-            <th class='list-table-sort-td'>
-                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
-            </th>
-            <th class='text-left nowrap'>商品名称</th>
-            <th class='text-left nowrap'>封面</th>
-            <th class='text-left nowrap'>售价</th>
-            <th class='text-left nowrap'>库存</th>
-            <th class='text-left nowrap'>收藏量</th>
-            <th class='text-left nowrap'>商品类型</th>
-            <th class='text-left nowrap'>展示类型</th>
-            <th class="text-left nowrap">添加时间</th>
-            <th class="text-left nowrap">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'>
-                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
-            </td>
-            <td class='list-table-sort-td'>
-                <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
-            </td>
-            <td class='text-left nowrap'>{$vo.name|default=''}</td>
-            <td class='text-left nowrap'>
-                <img data-tips-image="{$vo.cover|default=''}"  src="{$vo.cover|default=''}" width="50px">
-            </td>
-            <td class='text-left nowrap'>{$vo.goods_price|default=''}</td>
-            <td class='text-left nowrap'>{$vo.stock|default=''}</td>
-            <td class='text-left nowrap'>{$vo.vir_num|default=''}</td>
-            <td class='text-left nowrap'>{$goods_type[$vo.type]}</td>
-            <td class='text-left nowrap'>{$vo.adv_type == 1 ? '图片' : ($vo.adv_type == 2 ? '音频':'视频')}</td>
-            <td class='text-left nowrap'>{$vo.create_at}</td>
-            <td class='text-left nowrap'>
-                <a data-title="编辑商品" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {if $vo.type eq 2}
-                <a data-title="兑换码" class="layui-btn layui-btn-sm" data-open='{:url("store/exchange_code/index")}?id={$vo.id}'>兑换码</a>
-                {elseif $vo.type eq 3}
-                <a data-title="邀请列表" class="layui-btn layui-btn-sm" data-open='{:url("user/invite/index")}?goods_id={$vo.id}'>邀请列表</a>
-                {/if}
-                {if $vo.status eq 1}
-                <span class="layui-btn layui-btn-sm layui-btn-warm"   onclick="btn_confirm('下架','down','{$vo.id}');">下 架</span>
-                {else}
-                <span class="layui-btn layui-btn-sm layui-btn-warm" onclick="btn_confirm('上架','up','{$vo.id}');">上 架</span>
-                {/if}
-                <span data-title="删除商品" class="layui-btn layui-btn-sm layui-btn-danger"   onclick="btn_confirm('删除','del','{$vo.id}');" >删 除</span>
-
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    $('.video_player').click(function () {
-        vUrl = $(this).data('src');  //获取到播放的url
-        var loadstr = '<video width="100%" height="100%"  controls="controls" autobuffer="autobuffer"  autoplay="autoplay" loop="loop">' +
-            '<source src='+vUrl+' type="video/mp4"></source></video>';
-        layer.open({
-            type: 1,
-            title: false,
-            area: ['730px', '500px'],
-            shade: [0.8, 'rgb(14, 16, 22)'],
-            skin: 'demo-class',
-            content: loadstr
-        });
-    });
-
-
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/store/goods/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg(data.info);
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-</script>
-{/block}
-
-
-

+ 0 - 16
application/store/view/goods/index_search.html

@@ -1,16 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">商品名称</label>
-            <div class="layui-input-inline">
-                <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入商品名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 115
application/store/view/integral_goods/form.html

@@ -1,115 +0,0 @@
-
-<link rel="stylesheet" href="/static/plugs/layui/css/layui.css"  media="all">
-
-<style>
-    .layui-form-item {
-        width: 80%;
-        height: 90%;
-    }
-
-</style>
-
-<div class="think-box-shadow" style="height: 100%">
-    <form class="layui-form layui-card" id="subForm" action="{:request()->url()}"  data-auto="true" method="post" autocomplete="off">
-        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
-            <legend>商品编辑</legend>
-        </fieldset>
-        <div class="layui-tab">
-            <ul class="layui-tab-title">
-                <li class="layui-this">基础设置</li>
-            </ul>
-            <div class="layui-tab-content">
-
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品名称</label>
-                        <div class="layui-input-block">
-                            <input name="name" lay-verify="required" maxlength="50"  value='{$vo.name|default=""}' placeholder="请输入商品名称" class="layui-input">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品简介</label>
-                        <div class="layui-input-block">
-                            <input name="desc" maxlength="50"  value='{$vo.desc|default=""}' placeholder="请输入商品简介" class="layui-input">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品分类</label>
-                        <div class="layui-input-inline">
-                            <select name="first_classify" lay-filter ="first_classify">
-                                <option value="0">请选择</option>
-                                {if !empty($goods_cate)}
-                                    {foreach $goods_cate as $ck=>$cv}
-                                        {if !empty($vo.first_classify) &&  $vo.first_classify == $cv['id'] }
-                                            <option selected data-cl_key="{$ck}" value="{$cv['id']}">{$cv['title']}</option>
-                                        {else}
-                                            <option data-cl_key="{$ck}" value="{$cv['id']}">{$cv['title']}</option>
-                                        {/if}
-                                    {/foreach}
-                                {/if}
-                            </select>
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">商品封面</label>
-                        <div class="layui-input-block">
-                            <input name="cover" type="hidden" value="{$vo.cover|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">元石</label>
-                        <div class="layui-input-block">
-                            <input name="crystal" type="number" step="1" class="layui-input"  value="{$vo.crystal|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item">
-                        <label class="layui-form-label label-required">库存</label>
-                        <div class="layui-input-block">
-                            <input name="stock"type="number" step="1" class="layui-input"  value="{$vo.stock|default=''}">
-                        </div>
-                    </div>
-
-                    <div class="layui-form-item" >
-                        <label class="layui-form-label">详情</label>
-                        <div class="layui-input-block">
-                            <textarea name="detail">{$vo.detail|default=""}</textarea>
-                        </div>
-                    </div>
-
-                    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-                    <div class="layui-form-item text-center">
-                        <span class="layui-btn" type='submit' id ="submit">保 存</span>
-                        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定取消编辑吗?" data-close>取消编辑</button>
-                    </div>
-            </div>
-        </div>
-    </form>
-</div>
-<script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script>
-<script>
-    window.form.render();
-
-    require(['ckeditor', 'angular'], function () {
-        window.createEditor('[name="detail"]', {height: 500,width:1000});
-    })
-
-    $('[name="cover"]').uploadOneImage();
-
-    /**
-     * 表单验证
-     */
-    $(document).on('click','#submit',function () {
-        if($('#submit').hasClass('is_sub')) {
-            return false;
-        }
-        $('#submit').addClass('is_sub');
-        $("#subForm").submit();
-    })
-
-
-</script>

+ 0 - 108
application/store/view/integral_goods/index.html

@@ -1,108 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-    <a data-open='{:url("add")}'   data-title="添加商品" class='layui-btn layui-btn-sm layui-btn-primary'>添加商品</a>
-{/block}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='integral_goods/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='list-table-check-td think-checkbox'>
-                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
-            </th>
-            <th class='list-table-sort-td'>
-                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
-            </th>
-            <th class='text-left nowrap'>商品名称</th>
-            <th class='text-left nowrap'>封面</th>
-            <th class='text-left nowrap'>元石</th>
-            <th class='text-left nowrap'>库存</th>
-            <th class="text-center">添加时间</th>
-            <th class="text-center">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'>
-                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
-            </td>
-            <td class='list-table-sort-td'>
-                <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
-            </td>
-            <td class='text-left nowrap'>
-                {$vo.name|default=''}
-            </td>
-
-            <td class='text-left nowrap'>
-                <img data-tips-image="{$vo.cover|default=''}"  src="{$vo.cover|default=''}" width="50px">
-            </td>
-
-            <td class='text-left nowrap'>
-                {$vo.crystal|default=''}
-            </td>
-            <td class='text-left nowrap'>
-                {$vo.stock|default=''}
-            </td>
-
-            <td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
-            <td class='text-center nowrap'>
-                <a data-title="编辑商品" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                {if $vo.status eq 1}
-                <span class="layui-btn layui-btn-sm layui-btn-warm"   onclick="btn_confirm('下架','down','{$vo.id}');">下 架</span>
-                {else}
-                <span class="layui-btn layui-btn-sm layui-btn-warm" onclick="btn_confirm('上架','up','{$vo.id}');">上 架</span>
-                {/if}
-                <span data-title="删除商品" class="layui-btn layui-btn-sm layui-btn-danger"   onclick="btn_confirm('删除','del','{$vo.id}');" >删 除</span>
-
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    $('.video_player').click(function () {
-        vUrl = $(this).data('src');  //获取到播放的url
-        var loadstr = '<video width="100%" height="100%"  controls="controls" autobuffer="autobuffer"  autoplay="autoplay" loop="loop">' +
-            '<source src='+vUrl+' type="video/mp4"></source></video>';
-        layer.open({
-            type: 1,
-            title: false,
-            area: ['730px', '500px'],
-            shade: [0.8, 'rgb(14, 16, 22)'],
-            skin: 'demo-class',
-            content: loadstr
-        });
-    });
-
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/store/integral_goods/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg(data.info);
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-</script>
-{/block}
-
-
-

+ 0 - 16
application/store/view/integral_goods/index_search.html

@@ -1,16 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">商品名称</label>
-            <div class="layui-input-inline">
-                <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入商品名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 53
application/user/controller/Crystal.php

@@ -1,53 +0,0 @@
-<?php
-
-
-namespace app\user\controller;
-
-use library\Controller;
-use think\Db;
-
-/**
- * 会员元石
- * Class Crystal
- * @package app\user\controller
- */
-class Crystal extends Controller
-{
-    protected  $table ="CrystalInfo";
-
-
-    /**
-     * 元石变更列表
-     * @auth true
-     * @menu true
-     */
-    public function index()
-    {
-        $this->title = '元石列表';
-        $query = $this->_query($this->table);
-        $where= [];
-        $int_type = Db::table('crystal_type')->where('status',1)->select();
-        $this->int_type = array_column($int_type,null,'id');
-        if($this->request->request('phone'))      $where[]= ['m.phone','=',$this->request->request('phone')];
-        $where[]= ['i.is_deleted','=',0];
-        $query->alias('i')
-            ->field('i.* ,m.headimg,m.name,m.phone')
-            ->join('store_member m',' m.id = i.user_id ','LEFT');
-        if(!empty($where)) $query->where($where);
-        $query ->order('i.id desc')->page();
-    }
-
-    /**
-     * 删除元石日志
-     * @auth true
-     * @menu true
-     */
-    public function del()
-    {
-        $this->_save($this->table, ['is_deleted' => 1]);
-    }
-
-
-
-
-}

+ 0 - 148
application/user/controller/Gift.php

@@ -1,148 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\user\controller;
-
-use library\Controller;
-use think\Db;
-use function GuzzleHttp\Psr7\build_query;
-
-/**
- * 转赠记录管理
- * Class Gift
- * @package app\user\controller
- */
-class Gift extends Controller
-{
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GoodsPresentInfo';
-
-    /**
-     * 作品列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '转赠列表';
-        $where = [];
-       // $where[]= ['c.status','=',1];
-        if(input('goods_name')) $where[]= ['c.goods_name','like','%'.input('goods_name').'%'];
-        if(input('user_name')) $where[]= ['m.name','like','%'.input('user_name').'%'];
-        if(input('phone')) $where[]= ['m.phone','like','%'.input('phone').'%'];
-        $query = $this->_query($this->table)
-            ->alias('i')
-            ->field('i.id,i.create_at,i.to_user,m.name as user_name,m.headimg,m.phone,c.goods_name,c.goods_cover,c.serial,c.hash_str')
-            ->join('store_member m','m.id = i.from_user')
-            ->join('goods_collect c','c.id = i.from_cid');
-         if(!empty($where)) $query->where($where);
-        $query->order('i.id desc')->page();
-    }
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as $k=>&$v){
-            $to_user = Db::table('store_member')->field('name,headimg,phone')->find($v['to_user']);
-            $v['to_user_name'] = $to_user['name'];
-            $v['to_user_headimg'] = $to_user['headimg'];
-            $v['to_user_phone'] = $to_user['phone'];
-        }
-    }
-
-
-
-    //删除货主
-    public function remove()
-    {
-        $this->_save($this->table, ['status' => '3']);
-    }
-
-    public function edit(){
-        $this->title = '编辑';
-        $this->_form($this->table, 'form');
-    }
-
-
-    protected function _form_filter(&$data){
-        if($this->request->isPost() && $this->request->action() == 'integral')
-        {
-            if($data['id']) {
-                if($data['int_type'] == 6) {
-                    update_user_integral($data['id'],$data['int_num'],$data['int_type'],'后台增加');
-                }else{
-                    update_user_integral($data['id'],$data['int_num'] * -1,$data['int_type'],'后台扣减');
-                }
-            }
-        }
-        if($this->request->isPost() && $this->request->action() == 'send')
-        {
-            if($data['id']) {
-               $send_num = intval($data['send_num']);
-               $coupon_id = $data['coupon_id'];
-               if($send_num > 0){
-                   $coupon_info  = Db::table('store_coupon_config')->find($coupon_id);
-                   $low_day =  $coupon_info['low_day'];
-                   $coupon_data = [];
-                   for ($c = 1 ;$c <= $send_num ;$c++) {
-                       $coupon_data[]= [
-                            'user_id'   => $data['id'],
-                            'low_day'   =>$coupon_info['low_day'],
-                            'lid'       =>$coupon_id,
-                            'money'     =>$coupon_info['amount'],
-                            'type'      =>1,
-                            'create_at'=> date('Y-m-d H:i:s'),
-                            'past_at'  => date('Y-m-d H:i:s',strtotime("+$low_day days"))
-                       ];
-
-                   }
-                   Db::table('user_coupon_list')->insertAll($coupon_data);
-               }
-            }
-        }
-
-        if($this->request->isPost() && $this->request->action() == 'crystal'){
-            if($data['id']) {
-                $change_crystal = intval($data['change_crystal']);
-                $change_type = $data['int_type'];
-                $mul = $change_type == 12 ? 1:-1;
-                $msg = $change_type == 12 ? '后台充值':'后台扣减';
-                $user_info = Db::table('store_member')->find($data['id']);
-                $data['crystal'] = $user_info['crystal'] + $change_crystal*$mul;
-                if( $data['crystal'] <0  || $data['crystal_cash']<0 ) $this->error('扣减数据数量有误!');
-                if($change_crystal) crystal_log($data['id'],$change_crystal*$mul,$msg.'(元石)',$change_type);
-            }
-        }
-    }
-
-
-
-
-}

+ 0 - 103
application/user/controller/GiftLog.php

@@ -1,103 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\user\controller;
-
-use library\Controller;
-use think\Db;
-use function GuzzleHttp\Psr7\build_query;
-
-/**
- * 转赠记录管理
- * Class Gift
- * @package app\user\controller
- */
-class GiftLog extends Controller
-{
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GoodsCollect';
-
-    /**
-     * 作品列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '溯源';
-        $id = input('id');
-        $original_id = input('original_id');
-        if($original_id > 0){
-            $list = Db::table('goods_collect')
-                ->alias('i')
-                ->field('i.*,m.name as user_name,m.headimg,m.phone')
-                ->join('store_member m','m.id = i.user_id','LEFT')
-                ->where('original_id|i.id',$original_id)
-                ->order('i.id asc')->select();
-        }else{
-            $list = Db::table('goods_collect')
-                ->alias('i')
-                ->field('i.*,m.name as user_name,m.headimg,m.phone')
-                ->join('store_member m','m.id = i.user_id','LEFT')
-                ->where('i.id',$id)
-                ->order('i.id asc')->select();
-        }
-        $this->assign('list',$list);
-        $this->fetch('index');
-   }
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-
-    }
-
-
-
-    //删除货主
-    public function remove()
-    {
-        $this->_save($this->table, ['status' => '3']);
-    }
-
-    public function edit(){
-        $this->title = '编辑';
-        $this->_form($this->table, 'form');
-    }
-
-
-    protected function _form_filter(&$data)
-    {
-
-    }
-
-
-
-}

+ 0 - 167
application/user/controller/GoodsCollect.php

@@ -1,167 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\user\controller;
-
-use library\Controller;
-use think\Db;
-use function GuzzleHttp\Psr7\build_query;
-
-/**
- * 收藏记录管理
- * Class GoodsCollect
- * @package app\user\controller
- */
-class GoodsCollect extends Controller
-{
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'GoodsCollect';
-
-    /**
-     * 作品列表
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '作品列表';
-        $this->source_arr = ['','购买','兑换','邀请','赠送'];
-        if(input('hash_str')){
-            $detail = Db::table('goods_collect')->where('hash_str',input('hash_str'))->find();
-            $id = $detail['id'];
-            $original_id =$detail['original_id'];
-            if($original_id > 0){
-                $query = $this->_query($this->table)
-                    ->alias('c')
-                    ->field('c.*,m.name as user_name,m.headimg,m.phone')
-                    ->join('store_member m','m.id = c.user_id','LEFT')
-                    ->where('original_id|c.id',$original_id)
-                    ->order('c.id asc')->page();
-            }else{
-                $query = $this->_query($this->table)
-                    ->alias('c')
-                    ->field('c.*,m.name as user_name,m.headimg,m.phone')
-                    ->join('store_member m','m.id = c.user_id','LEFT')
-                    ->where('c.id',$id)
-                    ->order('c.id asc')->page();
-            }
-        }else{
-            $where = [];
-            $where[]= ['c.status','=',1];
-            if(input('goods_name')) $where[]= ['c.goods_name','like','%'.input('goods_name').'%'];
-            if(input('user_name')) $where[]= ['m.name','like','%'.input('user_name').'%'];
-            if(input('phone')) $where[]= ['m.phone','like','%'.input('phone').'%'];
-            $query = $this->_query($this->table)
-                ->alias('c')
-                ->field('c.*,m.name as user_name,m.headimg,m.phone')
-                ->join('store_member m','m.id = c.user_id','LEFT')
-                ->where($where);
-            $query->order('c.id desc')->page();
-        }
-
-    }
-    /**
-     * 数据列表处理
-     * @auth true
-     * @menu true
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as $k=>&$v){
-
-        }
-    }
-
-
-
-    //删除货主
-    public function remove()
-    {
-        $this->_save($this->table, ['status' => '3']);
-    }
-
-    public function edit(){
-        $this->title = '编辑';
-        $this->_form($this->table, 'form');
-    }
-
-
-    protected function _form_filter(&$data){
-        if($this->request->isPost() && $this->request->action() == 'integral')
-        {
-            if($data['id']) {
-                if($data['int_type'] == 6) {
-                    update_user_integral($data['id'],$data['int_num'],$data['int_type'],'后台增加');
-                }else{
-                    update_user_integral($data['id'],$data['int_num'] * -1,$data['int_type'],'后台扣减');
-                }
-            }
-        }
-        if($this->request->isPost() && $this->request->action() == 'send')
-        {
-            if($data['id']) {
-               $send_num = intval($data['send_num']);
-               $coupon_id = $data['coupon_id'];
-               if($send_num > 0){
-                   $coupon_info  = Db::table('store_coupon_config')->find($coupon_id);
-                   $low_day =  $coupon_info['low_day'];
-                   $coupon_data = [];
-                   for ($c = 1 ;$c <= $send_num ;$c++) {
-                       $coupon_data[]= [
-                            'user_id'   => $data['id'],
-                            'low_day'   =>$coupon_info['low_day'],
-                            'lid'       =>$coupon_id,
-                            'money'     =>$coupon_info['amount'],
-                            'type'      =>1,
-                            'create_at'=> date('Y-m-d H:i:s'),
-                            'past_at'  => date('Y-m-d H:i:s',strtotime("+$low_day days"))
-                       ];
-
-                   }
-                   Db::table('user_coupon_list')->insertAll($coupon_data);
-               }
-            }
-        }
-
-        if($this->request->isPost() && $this->request->action() == 'crystal'){
-            if($data['id']) {
-                $change_crystal = intval($data['change_crystal']);
-                $change_type = $data['int_type'];
-                $mul = $change_type == 12 ? 1:-1;
-                $msg = $change_type == 12 ? '后台充值':'后台扣减';
-                $user_info = Db::table('store_member')->find($data['id']);
-                $data['crystal'] = $user_info['crystal'] + $change_crystal*$mul;
-                if( $data['crystal'] <0  || $data['crystal_cash']<0 ) $this->error('扣减数据数量有误!');
-                if($change_crystal) crystal_log($data['id'],$change_crystal*$mul,$msg.'(元石)',$change_type);
-            }
-        }
-    }
-
-
-
-
-}

+ 0 - 60
application/user/controller/Invite.php

@@ -1,60 +0,0 @@
-<?php
-
-
-namespace app\user\controller;
-
-use library\Controller;
-use think\Db;
-
-/**
- * 推荐管理
- * Class Invite
- * @package app\user\controller
- */
-class Invite extends Controller
-{
-    protected  $table ="InviteInfo";
-
-
-    /**
-     * 会员信息管理
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '邀请列表';
-        $name = input('name');
-        $phone = input('phone');
-        $goods_id = input('goods_id');
-        $pid = input('pid');
-        $where = [];
-        if($name) $where[] = ['m.name','like','%'.$name.'%'] ;
-        if($phone) $where[] = ['m.phone','=',$phone] ;
-        if($goods_id) $where[] = ['i.goods_id','=',$goods_id] ;
-        if($pid) $where[] = ['i.pid','=',$pid] ;
-        $query = $this->_query($this->table)->alias('i')
-            ->field('i.*,m.name,m.headimg,m.phone');
-        if(!empty($where)) $query->where($where);
-        $query->join('store_member m','m.id = i.user_id','LEFT')
-            ->order('i.id desc')->page();
-    }
-
-
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as $k=>&$v){
-            $parent_info = Db::table('store_member')->field('headimg,name')->find($v['pid']);
-            $v['p_name'] = $parent_info['name'];
-            $v['p_headimg'] = $parent_info['headimg'];
-        }
-    }
-
-
-
-}

+ 1 - 27
application/user/controller/Member.php

@@ -63,29 +63,6 @@ class Member extends Controller
 
         }
     }
-    //删除货主
-    public function remove()
-    {
-        $this->_save($this->table, ['is_deleted' => '1']);
-    }
-    //禁用货主
-    public function forbid()
-    {
-        $this->_save($this->table, ['status' => '0']);
-    }
-    //启用货主
-    public function resume()
-    {
-        $this->_save($this->table, ['status' => '1']);
-    }
-
-
-
-    public function integral(){
-        $this->title = '积分变更';
-        $this->_form($this->table, 'form');
-    }
-
 
     protected function _form_filter(&$data){
         if($this->request->isPost() && $this->request->action() == 'integral')
@@ -168,9 +145,6 @@ class Member extends Controller
     }
 
 
-    public function crystal(){
-        $this->title = '元石充值';
-        $this->_form($this->table, 'crystal');
-    }
+
 
 }

+ 0 - 68
application/user/view/crystal/form.html

@@ -1,68 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">用户名:</label>
-            <label class="layui-col-xs10">
-                <input  style="background-color: #e6e6e6" readonly value='{$user.name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">手机号:</label>
-            <label class="layui-col-xs10">
-                <input style="background-color: #e6e6e6" readonly value='{$user.phone|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">订单号</label>
-            <label class="layui-col-xs10">
-                <input name="order_no"  style="background-color: #e6e6e6" readonly value='{$vo.order_no|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">审核</label>
-            <div class="layui-input-inline">
-                <select name="sh_status" >
-                    <option value="0" {if $vo.sh_status eq 0}selected {/if} >暂不审核</option>
-                    <option value="1"  {if $vo.sh_status eq 1}selected {/if} >审核通过</option>
-                    <option value="2"  {if $vo.sh_status eq 2}selected {/if} >审核拒绝</option>
-                </select>
-            </div>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">审核备注</label>
-            <label class="layui-col-xs10">
-                <input name="remark"  value='{$vo.remark|default=""}' placeholder="请输入审核备注" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">积分转换</label>
-            <label class="layui-col-xs10">
-                <input name="integral"  value='{$vo.integral|default=""}' placeholder="请输入转换积分数" class="layui-input">
-            </label>
-        </div>
-
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <input type='hidden' value='{$vo.uid}' name='uid'>
-        {if $vo.sh_status == 0}
-            <button class="layui-btn" type='submit'>确定审核</button>
-            <button class="layui-btn layui-btn-danger" type='button' data-close>取消审核</button>
-        {else}
-            <button class="layui-btn layui-btn-danger" type='button' data-close>关闭</button>
-        {/if}
-
-    </div>
-</form>
-<script>
-    window.form.render();
-</script>

+ 0 - 58
application/user/view/crystal/index.html

@@ -1,58 +0,0 @@
-{extend name='admin@main'}
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='crystal/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='text-left nowrap'>头像</th>
-            <th class='text-left nowrap'>名称</th>
-            <th class='text-left nowrap'>手机号</th>
-            <th class='text-left nowrap'>元石</th>
-            <th class='text-left nowrap'>变更类型</th>
-            <th class="text-center nowrap">时间</th>
-            <th class="text-center nowrap">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='list-table-check-td think-checkbox'>{notempty name='vo.headimg'}<img data-tips-image style="width:20px;height:20px;vertical-align:top" src="{$vo.headimg|default=''}" class="margin-right-5">{/notempty}</td>
-            <td class='text-left nowrap'>{$vo.name|default='--'}</td>
-            <td class='text-left nowrap'>{$vo.phone|default='--'}</td>
-            <td class='text-left nowrap'>{$vo.crystal|default='--'}</td>
-            <td class='text-left nowrap'>{$int_type[$vo.type]['desc']|default='--'}</td>
-            <td class='text-center nowrap'>{$vo.create_at}</td>
-            <td class='text-center nowrap'>
-                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/user/crystal/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg(data.info);
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-</script>
-{/block}

+ 0 - 17
application/user/view/crystal/index_search.html

@@ -1,17 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-    </form>
-    <script>form.render()</script>
-</fieldset>

+ 0 - 55
application/user/view/gift/form.html

@@ -1,55 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body">
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">藏品:</label>
-            <label class="layui-col-xs10">
-                <input   value='{$vo.goods_name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">版本号:</label>
-            <label class="layui-col-xs10">
-                <input  readonly  value='{$vo.serial|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">哈希值:</label>
-            <label class="layui-col-xs10">
-                <input   value='{$vo.hash_str|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">收藏者:</label>
-            <label class="layui-col-xs10">
-                <input  value='{$vo.sc_name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">发行方:</label>
-             <label class="layui-col-xs10">
-                <input name="issuer" value='{$vo.issuer|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">创作者:</label>
-             <label class="layui-col-xs10">
-                <input name="framer" value='{$vo.framer|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <button class="layui-btn" type='submit'>提交</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-close>取消</button>
-    </div>
-</form>
-<script>
-    window.form.render();
-</script>

+ 0 - 51
application/user/view/gift/index.html

@@ -1,51 +0,0 @@
-{extend name='admin@main'}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='gift/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='text-left nowrap' style="width: 15%">转赠会员</th>
-            <th class='text-left nowrap' style="width: 15%">被转赠会员</th>
-            <th class='text-left nowrap' style="width: 15%">藏品</th>
-            <th class='text-left nowrap' style="width: 15%">哈希值</th>
-            <th class='text-left nowrap' style="width: 20%">时间</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    会员名称:{$vo.user_name|default='--'}<br>
-                    电话:{$vo.phone|default='--'}<br>
-                </div>
-            </td>
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.to_user_headimg|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    会员名称:{$vo.to_user_name|default='--'}<br>
-                    电话:{$vo.to_user_phone|default='--'}<br>
-                </div>
-            </td>
-
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.goods_cover|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    名称:{$vo.goods_name|default='--'}<br>
-                    版本号:{$vo.serial|default='--'}<br>
-                </div>
-            </td>
-            <td class='text-left'>{$vo.hash_str}</td>
-            <td class='text-left'>{$vo.create_at}</td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-{/block}

+ 0 - 33
application/user/view/gift/index_search.html

@@ -1,33 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">藏品名称</label>
-            <div class="layui-input-inline">
-                <input name="goods_name" value="{$Think.get.goods_name|default=''}" placeholder="请输入藏品名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">会员名称</label>
-            <div class="layui-input-inline">
-                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入会员名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-
-    </form>
-    <script>
-        form.render();
-    </script>
-</fieldset>

+ 0 - 64
application/user/view/gift_log/index.html

@@ -1,64 +0,0 @@
-{extend name='admin@main'}
-
-{block name="content"}
-<div class="think-box-shadow">
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='text-left nowrap' style="width: 10%">会员</th>
-            <th class='text-left nowrap' style="width: 15%">藏品</th>
-            <th class='text-left nowrap' style="width: 15%">哈希值</th>
-            <th class='text-left nowrap' style="width: 20%">时间</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    会员名称:{$vo.user_name|default='--'}<br>
-                    电话:{$vo.phone|default='--'}<br>
-                </div>
-            </td>
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.goods_cover|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    名称:{$vo.goods_name|default='--'}<br>
-                    版本号:{$vo.serial|default='--'}<br>
-                </div>
-            </td>
-            <td class='text-left'>{$vo.hash_str}</td>
-            <td class='text-left'>{$vo.create_at}</td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/user/goods_collect/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg(data.info);
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-</script>
-{/block}
-
-

+ 0 - 55
application/user/view/goods_collect/form.html

@@ -1,55 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body">
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">藏品:</label>
-            <label class="layui-col-xs10">
-                <input   value='{$vo.goods_name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">版本号:</label>
-            <label class="layui-col-xs10">
-                <input  readonly  value='{$vo.serial|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">哈希值:</label>
-            <label class="layui-col-xs10">
-                <input   value='{$vo.hash_str|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">收藏者:</label>
-            <label class="layui-col-xs10">
-                <input  value='{$vo.sc_name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">发行方:</label>
-             <label class="layui-col-xs10">
-                <input name="issuer" value='{$vo.issuer|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">创作者:</label>
-             <label class="layui-col-xs10">
-                <input name="framer" value='{$vo.framer|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <button class="layui-btn" type='submit'>提交</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-close>取消</button>
-    </div>
-</form>
-<script>
-    window.form.render();
-</script>

+ 0 - 79
application/user/view/goods_collect/index.html

@@ -1,79 +0,0 @@
-{extend name='admin@main'}
-
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='goods_collect/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='text-left nowrap' style="width: 10%">会员</th>
-            <th class='text-left nowrap' style="width: 12%">藏品</th>
-            <th class='text-left nowrap' style="width: 8%">来源</th>
-            <th class='text-left nowrap' style="width: 15%">哈希值</th>
-            <th class='text-left nowrap' style="width: 15%">收藏者</th>
-            <th class='text-left nowrap' style="width: 15%">发行方</th>
-            <th class='text-left nowrap' style="width: 15%">创作者</th>
-            <th class='text-left nowrap' style="width: 20%">时间</th>
-            <th class="text-left" style="width: 10%">操作</th>
-        </tr>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    会员名称:{$vo.user_name|default='--'}<br>
-                    电话:{$vo.phone|default='--'}<br>
-                </div>
-            </td>
-
-            <td class="text-left nowrap relative">
-                <img data-tips-image style="width:50px;height:50px" src="{$vo.goods_cover|default=''}" class="margin-right-5 text-top">
-                <div class="inline-block">
-                    名称:{$vo.goods_name|default='--'}<br>
-                    版本号:{$vo.serial|default='--'}<br>
-                </div>
-            </td>
-            <td class='text-left'>{$source_arr[$vo.source]}</td>
-            <td class='text-left'>{$vo.hash_str}</td>
-            <td class='text-left'>{$vo.sc_name}</td>
-            <td class='text-left'>{$vo.issuer}</td>
-            <td class='text-left'>{$vo.framer}</td>
-            <td class='text-left'>{$vo.create_at}</td>
-            <td class='text-left nowrap'>
-                <span class="layui-btn layui-btn-sm"  data-modal='{:url("edit")}?id={$vo.id}'>编 辑</span>
-                <span data-title="删除" class="layui-btn layui-btn-sm layui-btn-danger"   onclick="btn_confirm('删除','remove','{$vo.id}');" >删 除</span>
-            </td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-<script>
-    function btn_confirm(msg,fun,id) {
-        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/user/goods_collect/"+fun;
-            layer.closeAll();
-            $.ajax({
-                type: "post",
-                url: url,
-                data: {id:id},
-                dataType: "json",
-                async: false,
-                success: function (data) {
-                    layer.msg(data.info);
-                    setTimeout(function () {
-                        window.location.reload();
-                    },1000)
-                }
-            });
-        });
-    }
-</script>
-{/block}
-
-

+ 0 - 40
application/user/view/goods_collect/index_search.html

@@ -1,40 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">藏品名称</label>
-            <div class="layui-input-inline">
-                <input name="goods_name" value="{$Think.get.goods_name|default=''}" placeholder="请输入藏品名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">会员名称</label>
-            <div class="layui-input-inline">
-                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入会员名称" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">哈希溯源</label>
-            <div class="layui-input-inline">
-                <input name="hash_str" value="{$Think.get.hash_str|default=''}" placeholder="请输入哈希值" class="layui-input">
-            </div>
-        </div>
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-
-    </form>
-    <script>
-        form.render();
-    </script>
-</fieldset>

+ 0 - 40
application/user/view/invite/index.html

@@ -1,40 +0,0 @@
-{extend name='admin@main'}
-
-{block name="button"}
-<button onclick="history.go(-1);"  class='layui-btn layui-btn-sm layui-btn-primary'>返 回</button>
-{/block}
-{block name="content"}
-<div class="think-box-shadow">
-    {include file='invite/index_search'}
-    <table class="layui-table margin-top-10" lay-skin="line">
-        {notempty name='list'}
-        <thead>
-        <tr>
-            <th class='text-left nowrap' style="width: 10%">会员头像</th>
-            <th class='text-left nowrap' style="width: 15%">会员昵称</th>
-            <th class='text-left nowrap' style="width: 15%">手机号</th>
-            <th class='text-left nowrap' style="width: 15%">邀请人头像</th>
-            <th class='text-left nowrap' style="width: 15%">邀请人昵称</th>
-            <th class='text-left nowrap' style="width: 20%">注册时间</th>
-        </thead>
-        {/notempty}
-        <tbody>
-        {foreach $list as $key=>$vo}
-        <tr>
-            <td class='text-left nowrap'>
-                {notempty name='vo.headimg'}
-                <img data-tips-image style="width:20px;height:20px;vertical-align:top" src="{$vo.headimg|default=''}" class="margin-right-5">
-                {/notempty}
-            </td>
-            <td class='text-left nowrap'>{$vo.name|default='--'}</td>
-            <td class='text-left'>{$vo.phone|default='--'}</td>
-            <td class='text-left'> <img data-tips-image style="width:20px;height:20px;vertical-align:top" src="{$vo.p_headimg|default=''}" class="margin-right-5"></td>
-            <td class='text-left'>{$vo.p_name|default='--'} </td>
-            <td class='text-left'>{$vo.create_at|format_datetime}</td>
-        </tr>
-        {/foreach}
-        </tbody>
-    </table>
-    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
-</div>
-{/block}

+ 0 - 34
application/user/view/invite/index_search.html

@@ -1,34 +0,0 @@
-<fieldset>
-    <legend>条件搜索</legend>
-    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">昵称</label>
-            <div class="layui-input-inline">
-                <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入微信昵称" class="layui-input">
-            </div>
-        </div>
-        <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
-            <div class="layui-input-inline">
-                <input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input">
-                <input name="goods_id" type="hidden" value="{$Think.get.goods_id|default=''}"  class="layui-input">
-            </div>
-        </div>
-
-     <!--   <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">注册时间</label>
-            <div class="layui-input-inline">
-                <input name="create_at" value="{$Think.get.create_at|default=''}" placeholder="请选择注册时间" class="layui-input">
-            </div>
-        </div>-->
-
-        <div class="layui-form-item layui-inline">
-            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
-        </div>
-
-    </form>
-    <script>
-        form.render();
-        laydate.render({range: true, elem: '[name="create_at"]'})
-    </script>
-</fieldset>

+ 0 - 53
application/user/view/member/crystal.html

@@ -1,53 +0,0 @@
-<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
-
-    <div class="layui-card-body">
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">用户名:</label>
-            <label class="layui-col-xs10">
-                <input  style="background-color: #e6e6e6" readonly value='{$vo.name|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">手机号:</label>
-            <label class="layui-col-xs10">
-                <input style="background-color: #e6e6e6" readonly value='{$vo.phone|default=""}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">剩余元石:</label>
-            <label class="layui-col-xs10">
-                <input style="background-color: #e6e6e6" readonly value='{$vo.crystal|default="0"}' placeholder="" class="layui-input">
-            </label>
-        </div>
-
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">变更类型:</label>
-            <div class="layui-input-inline">
-                <select name="int_type" >
-                    <option value="4" >增加</option>
-                    <option value="3" >扣减</option>
-                </select>
-            </div>
-        </div>
-        <div class="layui-row margin-bottom-15">
-            <label class="layui-col-xs2 think-form-label">元石:</label>
-            <label class="layui-col-xs10">
-                <input name="change_crystal"  value='' min="0" placeholder="请输入元石变更数" class="layui-input">
-            </label>
-        </div>
-
-    </div>
-
-    <div class="hr-line-dashed"></div>
-    <div class="layui-form-item text-center">
-        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
-        <button class="layui-btn" type='submit'>提交</button>
-        <button class="layui-btn layui-btn-danger" type='button' data-close>取消</button>
-    </div>
-</form>
-<script>
-    window.form.render();
-</script>

+ 0 - 14
application/user/view/member/index.html

@@ -14,7 +14,6 @@
             <th class='text-left nowrap' style="width: 15%">手机号</th>
             <th class='text-left nowrap' style="width: 15%">是否认证</th>
             <th class='text-left nowrap' style="width: 20%">注册时间</th>
-            <th class="text-left" style="width: 20%">操作</th>
         </tr>
         </thead>
         {/notempty}
@@ -34,19 +33,6 @@
             <td class='text-left'>{$vo.phone|default='--'}</td>
             <td class='text-left'>{$vo.is_auth == '1' ?  '已认证':'未认证'}</td>
             <td class='text-left'>{$vo.create_at}</td>
-            <td class='text-left nowrap'>
-                <span class="layui-btn layui-btn-sm"  data-modal='{:url("crystal")}?id={$vo.id}'>元 石</span>
-                <a class="layui-btn layui-btn-sm " data-open="{:url('Invite/index')}?pid={$vo.id}" data-value="">推 荐</a>
-                {if $vo.status eq 1 and auth("forbid")}
-                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
-                {elseif auth("resume")}
-                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
-                {/if}
-
-                {if auth("store/member/remove")}
-                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该用户吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
-                {/if}
-            </td>
         </tr>
         {/foreach}
         </tbody>

+ 0 - 134
application/wechat/command/Fans.php

@@ -1,134 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\command;
-
-use app\wechat\service\WechatService;
-use think\console\Command;
-use think\console\Input;
-use think\console\Output;
-use think\Db;
-
-/**
- * 微信粉丝管理
- * Class Fans
- * @package app\wechat\command
- */
-class Fans extends Command
-{
-
-    /**
-     * 需要处理的模块
-     * @var array
-     */
-    protected $module = ['list', 'tags', 'black'];
-
-    /**
-     * 执行指令
-     * @param Input $input
-     * @param Output $output
-     * @return int|void|null
-     */
-    protected function execute(Input $input, Output $output)
-    {
-        foreach ($this->module as $m) {
-            if (method_exists($this, $fun = "_{$m}")) $this->$fun();
-        }
-    }
-
-
-    /**
-     * 同步微信粉丝列表
-     * @param string $next
-     * @param integer $done
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    protected function _list($next = '', $done = 0)
-    {
-        $appid = WechatService::getAppid();
-        $wechat = WechatService::WeChatUser();
-        $this->output->comment('开始同步微信粉丝数据 ...');
-        while (!is_null($next) && is_array($result = $wechat->getUserList($next)) && !empty($result['data']['openid'])) {
-            foreach (array_chunk($result['data']['openid'], 100) as $chunk) {
-                if (is_array($list = $wechat->getBatchUserInfo($chunk)) && !empty($list['user_info_list'])) {
-                    foreach ($list['user_info_list'] as $user) {
-                        $indexString = str_pad(++$done, strlen($result['total']), '0', STR_PAD_LEFT);
-                        $this->output->writeln("({$indexString}/{$result['total']}) 正在更新粉丝 {$user['openid']} {$user['nickname']}");
-                        \app\wechat\service\FansService::set($user, $appid);
-                    }
-                }
-            }
-            $next = $result['total'] > $done ? $result['next_openid'] : null;
-        }
-        $this->output->comment('微信粉丝数据同步完成');
-        $this->output->newLine();
-    }
-
-    /**
-     * 同步粉丝黑名单列表
-     * @param string $next
-     * @param integer $done
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function _black($next = '', $done = 0)
-    {
-        $wechat = WechatService::WeChatUser();
-        $this->output->comment('开始同步微信黑名单数据 ...');
-        while (!is_null($next) && is_array($result = $wechat->getBlackList($next)) && !empty($result['data']['openid'])) {
-            $done += $result['count'];
-            foreach (array_chunk($result['data']['openid'], 100) as $chunk) {
-                Db::name('WechatFans')->where(['is_black' => '0'])->whereIn('openid', $chunk)->update(['is_black' => '1']);
-            }
-            $this->output->writeln("--> 共计同步微信黑名单{$result['total']}人");
-            $next = $result['total'] > $done ? $result['next_openid'] : null;
-        }
-        $this->output->comment('微信黑名单数据同步完成');
-        $this->output->newLine();
-    }
-
-    /**
-     * 同步粉丝标签列表
-     * @param integer $index
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function _tags($index = 0)
-    {
-        $appid = WechatService::getAppid();
-        $wechat = WechatService::WeChatTags();
-        $this->output->comment('同步微信粉丝标签数据...');
-        if (is_array($list = $wechat->getTags()) && !empty($list['tags'])) {
-            $count = count($list['tags']);
-            foreach ($list['tags'] as &$tag) {
-                $tag['appid'] = $appid;
-                $indexString = str_pad(++$index, strlen($count), '0', STR_PAD_LEFT);
-                $this->output->writeln("({$indexString}/{$count}) 更新粉丝标签 {$tag['name']}");
-            }
-            Db::name('WechatFansTags')->where(['appid' => $appid])->delete();
-            Db::name('WechatFansTags')->insertAll($list['tags']);
-        }
-        $this->output->comment('微信粉丝标签数据同步完成');
-        $this->output->newLine();
-    }
-
-}

+ 0 - 35
application/wechat/command/fans/FansAll.php

@@ -1,35 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\command\fans;
-
-use app\wechat\command\Fans;
-
-/**
- * 同步全部粉丝指令
- * Class FansBlack
- * @package app\wechat\command\fans
- */
-class FansAll extends Fans
-{
-    /**
-     * 配置入口
-     */
-    protected function configure()
-    {
-        $this->module = ['list', 'black', 'tags'];
-        $this->setName('xfans:all')->setDescription('[同步]所有微信粉丝的数据');
-    }
-}

+ 0 - 35
application/wechat/command/fans/FansBlack.php

@@ -1,35 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\command\fans;
-
-use app\wechat\command\Fans;
-
-/**
- * 粉丝黑名单指令
- * Class FansBlack
- * @package app\wechat\command\fans
- */
-class FansBlack extends Fans
-{
-    /**
-     * 配置入口
-     */
-    protected function configure()
-    {
-        $this->module = ['black'];
-        $this->setName('xfans:black')->setDescription('[同步]微信黑名单粉丝数据');
-    }
-}

+ 0 - 36
application/wechat/command/fans/FansList.php

@@ -1,36 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\command\fans;
-
-use app\wechat\command\Fans;
-
-/**
- * 粉丝列表指令管理
- * Class FansList
- * @package app\wechat\command\fans
- */
-class FansList extends Fans
-{
-    /**
-     * 配置入口
-     */
-    protected function configure()
-    {
-        $this->module = ['list'];
-        $this->setName('xfans:list')->setDescription('[同步]微信粉丝的资料数据');
-    }
-
-}

+ 0 - 35
application/wechat/command/fans/FansTags.php

@@ -1,35 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\command\fans;
-
-use app\wechat\command\Fans;
-
-/**
- * 粉丝标签指令
- * Class FansTags
- * @package app\wechat\command\fans
- */
-class FansTags extends Fans
-{
-    /**
-     * 配置入口
-     */
-    protected function configure()
-    {
-        $this->module = ['tags'];
-        $this->setName('xfans:tags')->setDescription('[同步]粉丝的标签记录数据');
-    }
-}

+ 0 - 107
application/wechat/controller/Config.php

@@ -1,107 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller;
-
-use app\wechat\service\WechatService;
-use library\Controller;
-use library\File;
-
-/**
- * 微信授权绑定
- * Class Config
- * @package app\wechat\controller
- */
-class Config extends Controller
-{
-    /**
-     * 微信授权绑定
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function options()
-    {
-        $this->applyCsrfToken();
-        $this->thrNotify = url('@wechat/api.push', '', false, true);
-        if ($this->request->isGet()) {
-            $this->title = '微信授权绑定';
-            if (!($this->geoip = cache('mygeoip'))) {
-                cache('mygeoip', $this->geoip = gethostbyname($this->request->host()), 360);
-            }
-            $code = encode(url('@admin', '', true, true) . '#' . $this->request->url());
-            $this->authurl = config('wechat.service_url') . "/service/api.push/auth/{$code}";
-            if (input('?appid') && input('?appkey')) {
-                sysconf('wechat_type', 'thr');
-                sysconf('wechat_thr_appid', input('appid'));
-                sysconf('wechat_thr_appkey', input('appkey'));
-                WechatService::wechat()->setApiNotifyUri($this->thrNotify);
-            }
-            try {
-                $this->wechat = WechatService::wechat()->getConfig();
-            } catch (\Exception $e) {
-                $this->wechat = [];
-            }
-            $this->fetch();
-        } else {
-            foreach ($this->request->post() as $k => $v) sysconf($k, $v);
-            if ($this->request->post('wechat_type') === 'thr') {
-                WechatService::wechat()->setApiNotifyUri($this->thrNotify);
-            }
-            sysoplog('微信管理', '修改微信授权配置成功');
-            $uri = url('wechat/config/options');
-            $this->success('微信参数修改成功!', url('@admin') . "#{$uri}");
-        }
-    }
-
-    /**
-     * 微信支付配置
-     * @auth true
-     * @menu true
-     * @throws \OSS\Core\OssException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function payment()
-    {
-        $this->applyCsrfToken();
-        if ($this->request->isGet()) {
-            $this->title = '微信支付配置';
-            $file = File::instance('local');
-            $this->wechat_mch_ssl_cer = sysconf('wechat_mch_ssl_cer');
-            $this->wechat_mch_ssl_key = sysconf('wechat_mch_ssl_key');
-            $this->wechat_mch_ssl_p12 = sysconf('wechat_mch_ssl_p12');
-            if (!$file->has($this->wechat_mch_ssl_cer, true)) $this->wechat_mch_ssl_cer = '';
-            if (!$file->has($this->wechat_mch_ssl_key, true)) $this->wechat_mch_ssl_key = '';
-            if (!$file->has($this->wechat_mch_ssl_p12, true)) $this->wechat_mch_ssl_p12 = '';
-            $this->fetch();
-        } else {
-            if ($this->request->post('wechat_mch_ssl_type') === 'p12') {
-                if (!($sslp12 = $this->request->post('wechat_mch_ssl_p12'))) {
-                    $mchid = $this->request->post('wechat_mch_id');
-                    $content = File::instance('local')->get($sslp12, true);
-                    if (!openssl_pkcs12_read($content, $certs, $mchid)) {
-                        $this->error('商户MCH_ID与支付P12证书不匹配!');
-                    }
-                }
-            }
-            foreach ($this->request->post() as $k => $v) sysconf($k, $v);
-            sysoplog('微信管理', '修改微信支付配置成功');
-            $this->success('微信支付配置成功!');
-        }
-    }
-
-}

+ 0 - 140
application/wechat/controller/Fans.php

@@ -1,140 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller;
-
-use app\wechat\queue\WechatQueue;
-use app\wechat\service\WechatService;
-use library\Controller;
-use think\Db;
-use think\exception\HttpResponseException;
-
-/**
- * 微信粉丝管理
- * Class Fans
- * @package app\wechat\controller
- */
-class Fans extends Controller
-{
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'WechatFans';
-
-    /**
-     * 微信粉丝管理
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '微信粉丝管理';
-        $this->where = ['appid' => WechatService::getAppid()];
-        $query = $this->_query($this->table)->like('nickname')->equal('subscribe,is_black');
-        $query->dateBetween('subscribe_at')->where($this->where)->order('subscribe_time desc')->page();
-    }
-
-    /**
-     * 列表数据处理
-     * @param array $data
-     */
-    protected function _index_page_filter(array &$data)
-    {
-        $tags = Db::name('WechatFansTags')->column('id,name');
-        foreach ($data as &$user) {
-            $user['tags'] = [];
-            foreach (explode(',', $user['tagid_list']) as $tagid) {
-                if (isset($tags[$tagid])) $user['tags'][] = $tags[$tagid];
-            }
-        }
-    }
-
-    /**
-     * 批量拉黑粉丝
-     * @auth true
-     */
-    public function setBlack()
-    {
-        try {
-            $this->applyCsrfToken();
-            foreach (array_chunk(explode(',', $this->request->post('openid')), 20) as $openids) {
-                WechatService::WeChatUser()->batchBlackList($openids);
-                Db::name('WechatFans')->whereIn('openid', $openids)->update(['is_black' => '1']);
-            }
-            $this->success('拉黑粉丝信息成功!');
-        } catch (HttpResponseException $exception) {
-            throw  $exception;
-        } catch (\Exception $e) {
-            $this->error("拉黑粉丝信息失败,请稍候再试!{$e->getMessage()}");
-        }
-    }
-
-    /**
-     * 取消拉黑粉丝
-     * @auth true
-     */
-    public function delBlack()
-    {
-        try {
-            $this->applyCsrfToken();
-            foreach (array_chunk(explode(',', $this->request->post('openid')), 20) as $openids) {
-                WechatService::WeChatUser()->batchUnblackList($openids);
-                Db::name('WechatFans')->whereIn('openid', $openids)->update(['is_black' => '0']);
-            }
-            $this->success('取消拉黑粉丝信息成功!');
-        } catch (HttpResponseException $exception) {
-            throw  $exception;
-        } catch (\Exception $e) {
-            $this->error("取消拉黑粉丝信息失败,请稍候再试!{$e->getMessage()}");
-        }
-    }
-
-    /**
-     * 同步粉丝列表
-     * @auth true
-     */
-    public function sync()
-    {
-        try {
-            $this->appid = WechatService::getAppid();
-            sysoplog('微信管理', "创建微信[{$this->appid}]粉丝同步任务");
-            sysqueue("同步[{$this->appid}]粉丝列表", WechatQueue::URI, 0, ['appid' => $this->appid], 0);
-            $this->success('创建同步粉丝任务成功,需要时间来完成。<br>请到 系统管理 > 任务管理 查看执行进度!');
-        } catch (HttpResponseException $exception) {
-            throw $exception;
-        } catch (\Exception $e) {
-            $this->error("创建同步粉丝任务失败,请稍候再试!<br> {$e->getMessage()}");
-        }
-    }
-
-    /**
-     * 删除粉丝信息
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function remove()
-    {
-        $this->applyCsrfToken();
-        $this->_delete($this->table);
-    }
-
-}

+ 0 - 60
application/wechat/controller/Index.php

@@ -1,60 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller;
-
-use app\wechat\service\WechatService;
-use library\Controller;
-use think\Db;
-
-/**
- * 微信数据统计
- * Class Index
- * @package app\wechat\controller
- */
-class Index extends Controller
-{
-    /**
-     * 微信数据统计
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $map = ['appid' => WechatService::getAppid()];
-        $this->totalJson = ['xs' => [], 'ys' => []];
-        for ($i = 5; $i >= 0; $i--) {
-            $time = strtotime("-{$i} months");
-            $where = [['subscribe_at', '<=', date('Y-m-t 23:59:59', $time)]];
-            $this->totalJson['xs'][] = date('Y年m月', $time);
-            $item = ['_0' => 0, '_1' => 0];
-            $list = Db::name('WechatFans')->field('count(1) count,is_black black')->where($map)->where($where)->group('is_black')->select();
-            foreach ($list as $vo) $item["_{$vo['black']}"] = $vo['count'];
-            $this->totalJson['ys']['_0'][] = $item['_0'];
-            $this->totalJson['ys']['_1'][] = $item['_1'];
-        }
-        $this->totalFans = Db::name('WechatFans')->where(['is_black' => '0'])->where($map)->count();
-        $this->totalBlack = Db::name('WechatFans')->where(['is_black' => '1'])->where($map)->count();
-        $this->totalNews = Db::name('WechatNews')->where(['is_deleted' => '0'])->count();
-        $this->totalRule = Db::name('WechatKeys')->count();
-        $this->fetch();
-    }
-
-}

+ 0 - 224
application/wechat/controller/Keys.php

@@ -1,224 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller;
-
-use app\wechat\service\WechatService;
-use library\Controller;
-use think\Db;
-use think\exception\HttpResponseException;
-
-/**
- * 回复规则管理
- * Class Keys
- * @package app\wechat\controller
- */
-class Keys extends Controller
-{
-    /**
-     * 绑定数据表
-     * @var string
-     */
-    protected $table = 'WechatKeys';
-
-    /**
-     * 消息类型
-     * @var array
-     */
-    public $types = [
-        'text'  => '文字', 'news' => '图文', 'image' => '图片', 'music' => '音乐',
-        'video' => '视频', 'voice' => '语音', 'customservice' => '转客服',
-    ];
-
-    /**
-     * 回复规则管理
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        // 关键字二维码生成
-        if ($this->request->get('action') === 'qrc') {
-            try {
-                $wechat = WechatService::WeChatQrcode();
-                $result = $wechat->create($this->request->get('keys', ''));
-                $this->success('生成二维码成功!', "javascript:$.previewImage('{$wechat->url($result['ticket'])}')");
-            } catch (HttpResponseException $exception) {
-                throw  $exception;
-            } catch (\Exception $e) {
-                $this->error("生成二维码失败,请稍候再试!<br> {$e->getMessage()}");
-            }
-        }
-        // 关键字列表显示
-        $this->title = '回复规则管理';
-        $query = $this->_query($this->table)->like('keys,type')->equal('status')->dateBetween('create_at');
-        $query->whereNotIn('keys', ['subscribe', 'default'])->order('sort desc,id desc')->page();
-    }
-
-    /**
-     * 列表数据处理
-     * @param array $data
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as &$vo) {
-            $vo['qrc'] = url('@wechat/keys/index') . "?action=qrc&keys={$vo['keys']}";
-            $vo['type'] = isset($this->types[$vo['type']]) ? $this->types[$vo['type']] : $vo['type'];
-        }
-    }
-
-    /**
-     * 添加关键字
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function add()
-    {
-        $this->applyCsrfToken();
-        $this->title = '添加关键字规则';
-        $this->_form($this->table, 'form');
-    }
-
-    /**
-     * 编辑关键字
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function edit()
-    {
-        $this->applyCsrfToken();
-        $this->title = '编辑关键字规则';
-        $this->_form($this->table, 'form');
-    }
-
-    /**
-     * 删除关键字
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function remove()
-    {
-        $this->applyCsrfToken();
-        $this->_delete($this->table);
-    }
-
-    /**
-     * 禁用关键字
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function forbid()
-    {
-        $this->applyCsrfToken();
-        $this->_save($this->table, ['status' => '0']);
-    }
-
-    /**
-     * 启用关键字
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function resume()
-    {
-        $this->applyCsrfToken();
-        $this->_save($this->table, ['status' => '1']);
-    }
-
-    /**
-     * 配置关注回复
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function subscribe()
-    {
-        $this->applyCsrfToken();
-        $this->title = '编辑关注回复规则';
-        $this->_form($this->table, 'form', 'keys', [], ['keys' => 'subscribe']);
-    }
-
-    /**
-     * 配置默认回复
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function defaults()
-    {
-        $this->applyCsrfToken();
-        $this->title = '编辑默认回复规则';
-        $this->_form($this->table, 'form', 'keys', [], ['keys' => 'default']);
-    }
-
-    /**
-     * 添加数据处理
-     * @param array $data
-     */
-    protected function _form_filter(array &$data)
-    {
-        if ($this->request->isPost() && isset($data['keys'])) {
-            $db = Db::name($this->table)->where('keys', $data['keys']);
-            empty($data['id']) || $db->where('id', 'neq', $data['id']);
-            if ($db->count() > 0) {
-                $this->error('关键字已经存在,请使用其它关键字!');
-            }
-        }
-        if ($this->request->isGet()) {
-            $this->msgTypes = $this->types;
-            $root = rtrim(dirname(request()->basefile(true)), '\\/');
-            $this->defaultImage = "{$root}/static/theme/img/image.png";
-        }
-    }
-
-    /**
-     * 表单结果处理
-     * @param boolean $result
-     */
-    protected function _form_result($result)
-    {
-        if ($result !== false) {
-            list($url, $keys) = ['', $this->request->post('keys')];
-            if (!in_array($keys, ['subscribe', 'default'])) {
-                $url = url('@admin') . '#' . url('wechat/keys/index') . '?spm=' . $this->request->get('spm');
-            }
-            $this->success('恭喜, 关键字保存成功!', $url);
-        } else {
-            $this->error('关键字保存失败, 请稍候再试!');
-        }
-    }
-
-}

+ 0 - 170
application/wechat/controller/Menu.php

@@ -1,170 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller;
-
-use app\wechat\service\WechatService;
-use library\Controller;
-use think\Db;
-use think\exception\HttpResponseException;
-
-/**
- * 微信菜单管理
- * Class Menu
- * @package app\wechat\controller
- */
-class Menu extends Controller
-{
-    /**
-     * 微信菜单的类型
-     * @var array
-     */
-    protected $menuType = [
-        'click'              => '匹配规则',
-        'view'               => '跳转网页',
-        'miniprogram'        => '打开小程序',
-        // 'customservice'      => '转多客服',
-        'scancode_push'      => '扫码推事件',
-        'scancode_waitmsg'   => '扫码推事件且弹出“消息接收中”提示框',
-        'pic_sysphoto'       => '弹出系统拍照发图',
-        'pic_photo_or_album' => '弹出拍照或者相册发图',
-        'pic_weixin'         => '弹出微信相册发图器',
-        'location_select'    => '弹出地理位置选择器',
-    ];
-
-    /**
-     * 微信菜单管理
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        if ($this->request->get('output') === 'json') {
-            $where = [['keys', 'notin', ['subscribe', 'default']], ['status', 'eq', '1']];
-            $keys = Db::name('WechatKeys')->where($where)->order('sort desc,id desc')->select();
-            $this->success('获取数据成功!', ['menudata' => sysdata('menudata'), 'keysdata' => $keys]);
-        } else {
-            $this->title = '微信菜单定制';
-            $this->menuTypes = $this->menuType;
-            $this->fetch();
-        }
-    }
-
-    /**
-     * 编辑微信菜单
-     * @auth true
-     */
-    public function edit()
-    {
-        if ($this->request->isPost()) {
-            $data = $this->request->post('data');
-            if (empty($data)) { // 删除菜单
-                try {
-                    WechatService::WeChatMenu()->delete();
-                    sysoplog('微信管理', '删除微信菜单成功');
-                    $this->success('删除微信菜单成功!', '');
-                } catch (HttpResponseException $exception) {
-                    throw $exception;
-                } catch (\Exception $e) {
-                    sysoplog('微信管理', "删除微信菜单失败:{$e->getMessage()}");
-                    $this->error('删除微信菜单失败,请稍候再试!' . $e->getMessage());
-                }
-            } else {
-                try {
-                    sysdata('menudata', $this->_buildMenuData($menudata = json_decode($data, true)));
-                    WechatService::WeChatMenu()->create(['button' => sysdata('menudata')]);
-                    sysoplog('微信管理', '发布微信菜单成功');
-                    $this->success('保存发布菜单成功!', '');
-                } catch (HttpResponseException $exception) {
-                    throw $exception;
-                } catch (\Exception $e) {
-                    sysoplog('微信管理', "发布微信菜单失败:{$e->getMessage()}");
-                    $this->error("微信菜单发布失败,请稍候再试!<br> {$e->getMessage()}");
-                }
-            }
-        }
-    }
-
-    /**
-     * 菜单数据处理
-     * @param array $list
-     * @return array
-     */
-    private function _buildMenuData(array $list)
-    {
-        foreach ($list as &$vo) {
-            unset($vo['active'], $vo['show']);
-            if (empty($vo['sub_button'])) {
-                $vo = $this->_buildMenuItemData($vo);
-            } else {
-                $item = ['name' => $vo['name'], 'sub_button' => []];
-                foreach ($vo['sub_button'] as &$sub) {
-                    unset($sub['active'], $sub['show']);
-                    array_push($item['sub_button'], $this->_buildMenuItemData($sub));
-                }
-                $vo = $item;
-            }
-        }
-        return $list;
-    }
-
-    /**
-     * 单个微信菜单数据处理
-     * @param array $item
-     * @return array
-     */
-    private function _buildMenuItemData(array $item)
-    {
-        switch (strtolower($item['type'])) {
-            case 'pic_weixin':
-            case 'pic_sysphoto':
-            case 'scancode_push':
-            case 'location_select':
-            case 'scancode_waitmsg':
-            case 'pic_photo_or_album':
-                return ['name' => $item['name'], 'type' => $item['type'], 'key' => isset($item['key']) ? $item['key'] : $item['type']];
-            case 'click':
-                if (empty($item['key'])) $this->error('匹配规则存在空的选项');
-                return ['name' => $item['name'], 'type' => $item['type'], 'key' => $item['key']];
-            case 'view':
-                return ['name' => $item['name'], 'type' => $item['type'], 'url' => $item['url']];
-            case 'miniprogram':
-                return ['name' => $item['name'], 'type' => $item['type'], 'url' => $item['url'], 'appid' => $item['appid'], 'pagepath' => $item['pagepath']];
-        }
-    }
-
-    /**
-     * 取消微信菜单
-     * @auth true
-     */
-    public function cancel()
-    {
-        try {
-            WechatService::WeChatMenu()->delete();
-            $this->success('菜单取消成功,重新关注可立即生效!', '');
-        } catch (HttpResponseException $exception) {
-            sysoplog('微信管理', '取消微信菜单成功');
-            throw $exception;
-        } catch (\Exception $e) {
-            $this->error("菜单取消失败,请稍候再试!<br> {$e->getMessage()}");
-        }
-    }
-
-}

+ 0 - 180
application/wechat/controller/News.php

@@ -1,180 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller;
-
-use app\wechat\service\MediaService;
-use library\Controller;
-use think\Db;
-
-/**
- * 微信图文管理
- * Class News
- * @package app\wechat\controller
- */
-class News extends Controller
-{
-
-    /**
-     * 设置默认操作表
-     * @var string
-     */
-    protected $table = 'WechatNews';
-
-    /**
-     * 微信图文管理
-     * @auth true
-     * @menu true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $this->title = '微信图文列表';
-        $this->_query($this->table)->where(['is_deleted' => '0'])->order('id desc')->page();
-    }
-
-    /**
-     * 图文列表数据处理
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _index_page_filter(&$data)
-    {
-        foreach ($data as &$vo) $vo = MediaService::news($vo['id']);
-    }
-
-    /**
-     * 图文选择器
-     * @return string
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function select()
-    {
-        $this->index();
-    }
-
-    /**
-     * 图文列表数据处理
-     * @param array $data
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    protected function _select_page_filter(&$data)
-    {
-        foreach ($data as &$vo) $vo = MediaService::news($vo['id']);
-    }
-
-    /**
-     * 添加微信图文
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function add()
-    {
-        if ($this->request->isGet()) {
-            $this->title = '新建图文';
-            $this->fetch('form');
-        } else {
-            $data = $this->request->post();
-            if (($ids = $this->_apply_news_article($data['data'])) && !empty($ids)) {
-                if (data_save($this->table, ['article_id' => $ids, 'create_by' => session('user.id')], 'id') !== false) {
-                    $url = url('@admin') . '#' . url('@wechat/news/index') . '?spm=' . $this->request->get('spm');
-                    $this->success('图文添加成功!', $url);
-                }
-            }
-            $this->error('图文添加失败,请稍候再试!');
-        }
-    }
-
-    /**
-     * 编辑微信图文
-     * @auth true
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function edit()
-    {
-        if (($this->id = $this->request->get('id')) < 1) {
-            $this->error('参数错误,请稍候再试!');
-        }
-        if ($this->request->isGet()) {
-            if ($this->request->get('output') === 'json') {
-                $this->success('获取数据成功!', MediaService::news($this->id));
-            } else {
-                $this->fetch('form', ['title' => '编辑图文']);
-            }
-        } else {
-            $post = $this->request->post();
-            if (isset($post['data']) && ($ids = $this->_apply_news_article($post['data']))) {
-                if (data_save('wechat_news', ['id' => $this->id, 'article_id' => $ids], 'id')) {
-                    $this->success('图文更新成功!', url('@admin') . '#' . url('@wechat/news/index'));
-                }
-            }
-            $this->error('图文更新失败,请稍候再试!');
-        }
-    }
-
-    /**
-     * 图文更新操作
-     * @param array $data
-     * @param array $ids
-     * @return string
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    private function _apply_news_article($data, $ids = [])
-    {
-        foreach ($data as &$vo) {
-            if (empty($vo['digest'])) {
-                $vo['digest'] = mb_substr(strip_tags(str_replace(["\s", ' '], '', $vo['content'])), 0, 120);
-            }
-            $vo['create_at'] = date('Y-m-d H:i:s');
-            if (empty($vo['id'])) {
-                $result = $id = Db::name('WechatNewsArticle')->insertGetId($vo);
-            } else {
-                $id = intval($vo['id']);
-                $result = Db::name('WechatNewsArticle')->where('id', $id)->update($vo);
-            }
-            if ($result !== false) {
-                array_push($ids, $id);
-            }
-        }
-        return join(',', $ids);
-    }
-
-    /**
-     * 删除微信图文
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function remove()
-    {
-        $this->_delete($this->table);
-    }
-
-}

+ 0 - 60
application/wechat/controller/api/Js.php

@@ -1,60 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller\api;
-
-use app\wechat\service\WechatService;
-use library\Controller;
-use think\facade\Response;
-
-/**
- * 前端JS获取控制器
- * Class Js
- * @package app\wechat\controller\api
- */
-class Js extends Controller
-{
-    /**
-     * 返回生成的JS内容
-     * @return \think\Response
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function index()
-    {
-        $url = $this->request->server('http_referer', $this->request->url(true), null);
-        $wechat = WechatService::getWebOauthInfo($url, $this->request->get('mode', 1), false);
-        $openid = isset($wechat['openid']) ? $wechat['openid'] : '';
-        $unionid = empty($wechat['fansinfo']['unionid']) ? '' : $wechat['fansinfo']['unionid'];
-        $configJson = json_encode(WechatService::getWebJssdkSign($url), JSON_UNESCAPED_UNICODE);
-        $fansinfoJson = json_encode(isset($wechat['fansinfo']) ? $wechat['fansinfo'] : [], JSON_UNESCAPED_UNICODE);
-        $html = <<<EOF
-if(typeof wx === 'object'){
-    wx.openid="{$openid}";
-    wx.unionid="{$unionid}";
-    wx.config({$configJson});
-    wx.fansinfo={$fansinfoJson};
-    wx.ready(function(){
-        wx.hideOptionMenu();
-        wx.hideAllNonBaseMenuItem();
-    });
-}
-EOF;
-        return Response::create($html)->contentType('application/x-javascript');
-    }
-
-}

+ 0 - 338
application/wechat/controller/api/Push.php

@@ -1,338 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller\api;
-
-use app\wechat\service\FansService;
-use app\wechat\service\MediaService;
-use app\wechat\service\WechatService;
-use library\Controller;
-use think\Db;
-use think\facade\Log;
-
-/**
- * 微信消息推送处理
- * Class Push
- * @package app\wechat\controller\api
- */
-class Push extends Controller
-{
-
-    /**
-     * 微信APPID
-     * @var string
-     */
-    protected $appid;
-
-    /**
-     * 微信用户OPENID
-     * @var string
-     */
-    protected $openid;
-
-    /**
-     * 消息是否加密码
-     * @var boolean
-     */
-    protected $encrypt;
-
-
-    /**
-     * 微信OPENID
-     * @var string
-     */
-    protected $fromOpenid;
-
-    /**
-     * 微信消息对象
-     * @var array
-     */
-    protected $receive;
-
-    /**
-     * 微信实例对象
-     * @var \WeChat\Receive
-     */
-    protected $wechat;
-
-    /**
-     * 强制返回JSON消息
-     * @var boolean
-     */
-    protected $forceJson = false;
-
-    /**
-     * 强制客服消息回复
-     * @var boolean
-     */
-    protected $forceCustom = false;
-
-    /**
-     * 获取网络出口IP
-     * @return mixed
-     */
-    public function geoip()
-    {
-        return $this->request->ip();
-    }
-
-    /**
-     * 消息推送处理接口
-     * @return string
-     */
-    public function index()
-    {
-        try {
-            if ($this->request->has('receive', 'post') && WechatService::getType() === 'thr') {
-                $this->forceJson = true; // 强制返回JSON到Service转发
-                $this->forceCustom = false; // 强制使用客服消息模式推送
-                $this->appid = $this->request->post('appid', '', null);
-                $this->openid = $this->request->post('openid', '', null);
-                $this->encrypt = boolval($this->request->post('encrypt', 0));
-                $this->receive = $this->toLower(unserialize($this->request->post('receive', '', null)));
-                if (empty($this->appid) || empty($this->openid) || empty($this->receive)) {
-                    throw new \think\Exception('微信API实例缺失必要参数[appid,openid,receive]');
-                }
-            } else {
-                $this->forceJson = false; // 暂停返回JSON消息对象
-                $this->forceCustom = false; // 暂停使用客户消息模式
-                $this->wechat = WechatService::WeChatReceive();
-                $this->appid = WechatService::getAppid();
-                $this->openid = $this->wechat->getOpenid();
-                $this->encrypt = $this->wechat->isEncrypt();
-                $this->receive = $this->toLower($this->wechat->getReceive());
-            }
-            $this->fromOpenid = $this->receive['tousername'];
-            // text, event, image, location
-            if (method_exists($this, ($method = $this->receive['msgtype']))) {
-                if (is_string(($result = $this->$method()))) return $result;
-            }
-        } catch (\Exception $e) {
-            Log::error("{$e->getFile()}:{$e->getLine()} [{$e->getCode()}] {$e->getMessage()}");
-        }
-        return 'success';
-    }
-
-    /**
-     * 数组KEY全部转小写
-     * @param array $data
-     * @return array
-     */
-    private function toLower(array $data)
-    {
-        $data = array_change_key_case($data, CASE_LOWER);
-        foreach ($data as $key => $vo) if (is_array($vo)) {
-            $data[$key] = $this->toLower($vo);
-        }
-        return $data;
-    }
-
-    /**
-     * 文件消息处理
-     * @return boolean
-     * @throws \WeChat\Exceptions\InvalidDecryptException
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    protected function text()
-    {
-        return $this->keys("wechat_keys#keys#{$this->receive['content']}", false, $this->forceCustom);
-    }
-
-    /**
-     * 事件消息处理
-     * @return boolean|string
-     * @throws \WeChat\Exceptions\InvalidDecryptException
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    protected function event()
-    {
-        switch (strtolower($this->receive['event'])) {
-            case 'subscribe':
-                $this->updateFansinfo(true);
-                if (isset($this->receive['eventkey']) && is_string($this->receive['eventkey'])) {
-                    if (($key = preg_replace('/^qrscene_/i', '', $this->receive['eventkey']))) {
-                        return $this->keys("wechat_keys#keys#{$key}", false, true);
-                    }
-                }
-                return $this->keys('wechat_keys#keys#subscribe', true, $this->forceCustom);
-            case 'unsubscribe':
-                return $this->updateFansinfo(false);
-            case 'click':
-                return $this->keys("wechat_keys#keys#{$this->receive['eventkey']}", false, $this->forceCustom);
-            case 'scancode_push':
-            case 'scancode_waitmsg':
-                if (empty($this->receive['scancodeinfo'])) return false;
-                if (empty($this->receive['scancodeinfo']['scanresult'])) return false;
-                return $this->keys("wechat_keys#keys#{$this->receive['scancodeinfo']['scanresult']}", false, $this->forceCustom);
-            case 'scan':
-                if (empty($this->receive['eventkey'])) return false;
-                return $this->keys("wechat_keys#keys#{$this->receive['eventkey']}", false, $this->forceCustom);
-            default:
-                return false;
-        }
-    }
-
-    /**
-     * 关键字处理
-     * @param string $rule 关键字规则
-     * @param boolean $isLast 重复回复消息处理
-     * @param boolean $isCustom 是否使用客服消息发送
-     * @return boolean|string
-     * @throws \WeChat\Exceptions\InvalidDecryptException
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    private function keys($rule, $isLast = false, $isCustom = false)
-    {
-        list($table, $field, $value) = explode('#', $rule . '##');
-        $data = Db::name($table)->where([$field => $value])->find();
-        if (empty($data['type']) || (array_key_exists('status', $data) && empty($data['status']))) {
-            return $isLast ? false : $this->keys('wechat_keys#keys#default', true, $isCustom);
-        }
-        switch (strtolower($data['type'])) {
-            case 'keys':
-                $content = empty($data['content']) ? $data['name'] : $data['content'];
-                return $this->keys("wechat_keys#keys#{$content}", $isLast, $isCustom);
-            case 'text':
-                return $this->sendMessage('text', ['content' => $data['content']], $isCustom);
-            case 'customservice':
-                return $this->sendMessage('customservice', ['content' => $data['content']], false);
-            case 'voice':
-                if (empty($data['voice_url']) || !($mediaId = MediaService::upload($data['voice_url'], 'voice'))) return false;
-                return $this->sendMessage('voice', ['media_id' => $mediaId], $isCustom);
-            case 'image':
-                if (empty($data['image_url']) || !($mediaId = MediaService::upload($data['image_url'], 'image'))) return false;
-                return $this->sendMessage('image', ['media_id' => $mediaId], $isCustom);
-            case 'news':
-                list($news, $articles) = [MediaService::news($data['news_id']), []];
-                if (empty($news['articles'])) return false;
-                foreach ($news['articles'] as $vo) array_push($articles, [
-                    'url'   => url("@wechat/api.review/view", '', false, true) . "?id={$vo['id']}",
-                    'title' => $vo['title'], 'picurl' => $vo['local_url'], 'description' => $vo['digest'],
-                ]);
-                return $this->sendMessage('news', ['articles' => $articles], $isCustom);
-            case 'music':
-                if (empty($data['music_url']) || empty($data['music_title']) || empty($data['music_desc'])) return false;
-                return $this->sendMessage('music', [
-                    'thumb_media_id' => empty($data['music_image']) ? '' : MediaService::upload($data['music_image'], 'image'),
-                    'description'    => $data['music_desc'], 'title' => $data['music_title'],
-                    'hqmusicurl'     => $data['music_url'], 'musicurl' => $data['music_url'],
-                ], $isCustom);
-            case 'video':
-                if (empty($data['video_url']) || empty($data['video_desc']) || empty($data['video_title'])) return false;
-                $videoData = ['title' => $data['video_title'], 'introduction' => $data['video_desc']];
-                if (!($mediaId = MediaService::upload($data['video_url'], 'video', $videoData))) return false;
-                return $this->sendMessage('video', ['media_id' => $mediaId, 'title' => $data['video_title'], 'description' => $data['video_desc']], $isCustom);
-            default:
-                return false;
-        }
-    }
-
-    /**
-     * 发送消息到微信
-     * @param string $type 消息类型(text|image|voice|video|music|news|mpnews|wxcard)
-     * @param array $data 消息内容数据对象
-     * @param boolean $isCustom 是否使用客服消息发送
-     * @return array|boolean
-     * @throws \WeChat\Exceptions\InvalidDecryptException
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    private function sendMessage($type, $data, $isCustom = false)
-    {
-        if ($isCustom) {
-            WechatService::WeChatCustom()->send(['touser' => $this->openid, 'msgtype' => $type, "{$type}" => $data]);
-        } else switch (strtolower($type)) {
-            case 'text': // 发送文本消息
-                $reply = ['CreateTime' => time(), 'MsgType' => 'text', 'ToUserName' => $this->openid, 'FromUserName' => $this->fromOpenid, 'Content' => $data['content']];
-                return $this->forceJson ? json_encode($reply, JSON_UNESCAPED_UNICODE) : WechatService::WeChatReceive()->reply($reply, true, $this->encrypt);
-            case 'image': // 发送图片消息
-                return $this->buildMessage($type, ['MediaId' => $data['media_id']]);
-            case 'voice': // 发送语言消息
-                return $this->buildMessage($type, ['MediaId' => $data['media_id']]);
-            case 'video': // 发送视频消息
-                return $this->buildMessage($type, ['Title' => $data['title'], 'MediaId' => $data['media_id'], 'Description' => $data['description']]);
-            case 'music': // 发送音乐消息
-                return $this->buildMessage($type, ['Title' => $data['title'], 'Description' => $data['description'], 'MusicUrl' => $data['musicurl'], 'HQMusicUrl' => $data['musicurl'], 'ThumbMediaId' => $data['thumb_media_id']]);
-            case 'customservice': // 转交客服消息
-                if ($data['content']) $this->sendMessage('text', $data, true);
-                return $this->buildMessage('transfer_customer_service');
-            case 'news': // 发送图文消息
-                $articles = [];
-                foreach ($data['articles'] as $article) array_push($articles, ['PicUrl' => $article['picurl'], 'Title' => $article['title'], 'Description' => $article['description'], 'Url' => $article['url']]);
-                $reply = ['CreateTime' => time(), 'MsgType' => 'news', 'ToUserName' => $this->openid, 'FromUserName' => $this->fromOpenid, 'Articles' => $articles, 'ArticleCount' => count($articles)];
-                return $this->forceJson ? json_encode($reply, JSON_UNESCAPED_UNICODE) : WechatService::WeChatReceive()->reply($reply, true, $this->encrypt);
-            default:
-                return 'success';
-        }
-    }
-
-    /**
-     * 消息数据生成
-     * @param string $type 消息类型
-     * @param string|array $data 消息数据
-     * @return string
-     * @throws \WeChat\Exceptions\InvalidDecryptException
-     */
-    private function buildMessage($type, $data = [])
-    {
-        $reply = ['CreateTime' => time(), 'MsgType' => strtolower($type), 'ToUserName' => $this->openid, 'FromUserName' => $this->fromOpenid];
-        if (!empty($data)) $reply[ucfirst(strtolower($type))] = $data;
-        return $this->forceJson ? json_encode($reply, JSON_UNESCAPED_UNICODE) : WechatService::WeChatReceive()->reply($reply, true, $this->encrypt);
-    }
-
-    /**
-     * 同步粉丝状态
-     * @param boolean $subscribe 关注状态
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    private function updateFansinfo($subscribe = true)
-    {
-        if ($subscribe) {
-            try {
-                $user = WechatService::WeChatUser()->getUserInfo($this->openid);
-                return FansService::set(array_merge($user, ['subscribe' => '1', 'appid' => $this->appid]));
-            } catch (\Exception $e) {
-                Log::error(__METHOD__ . " {$this->openid} get userinfo faild. {$e->getMessage()}");
-                return false;
-            }
-        } else {
-            $user = ['subscribe' => '0', 'openid' => $this->openid, 'appid' => $this->appid];
-            return data_save('WechatFans', $user, 'openid', ['appid' => $this->appid]);
-        }
-    }
-
-}

+ 0 - 108
application/wechat/controller/api/Review.php

@@ -1,108 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller\api;
-
-use app\wechat\service\MediaService;
-use library\Controller;
-use think\Db;
-
-/**
- * Class Review
- * @package app\wechat\controller\api
- */
-class Review extends Controller
-{
-
-    /**
-     * 图文展示
-     * @param integer $id 图文ID
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public function news($id = 0)
-    {
-        $this->id = empty($id) ? input('id') : $id;
-        $this->news = MediaService::news($this->id);
-        $this->fetch();
-    }
-
-    /**
-     * 文章展示
-     * @param integer $id 文章ID
-     * @throws \think\Exception
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     * @throws \think\exception\PDOException
-     */
-    public function view($id = 0)
-    {
-        $where = ['id' => empty($id) ? input('id') : $id];
-        Db::name('WechatNewsArticle')->where($where)->update(['read_num' => Db::raw('read_num+1')]);
-        $this->info = Db::name('WechatNewsArticle')->where($where)->find();
-        $this->fetch();
-    }
-
-    /**
-     * 文本展示
-     */
-    public function text()
-    {
-        $this->content = strip_tags(input('content', ''), '<a><img>');
-        $this->fetch();
-    }
-
-    /**
-     * 图片展示
-     */
-    public function image()
-    {
-        $this->content = strip_tags(input('content', ''), '<a><img>');
-        $this->fetch();
-    }
-
-    /**
-     * 视频展示
-     */
-    public function video()
-    {
-        $this->url = strip_tags(input('url', ''), '<a><img>');
-        $this->title = strip_tags(input('title', ''), '<a><img>');
-        $this->fetch();
-    }
-
-    /**
-     * 语音展示
-     */
-    public function voice()
-    {
-        $this->url = strip_tags(input('url', ''), '<a><img>');
-        $this->fetch();
-    }
-
-    /**
-     * 音乐展示
-     */
-    public function music()
-    {
-        $this->url = strip_tags(input('url', ''), '<a><img>');
-        $this->desc = strip_tags(input('desc', ''), '<a><img>');
-        $this->title = strip_tags(input('title', ''), '<a><img>');
-        $this->fetch();
-    }
-
-}

+ 0 - 254
application/wechat/controller/api/Tools.php

@@ -1,254 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\controller\api;
-
-use app\wechat\service\WechatService;
-use library\Controller;
-
-/**
- * 微信测试工具
- * Class Tools
- * @package app\wechat\controller\api
- */
-class Tools extends Controller
-{
-    /**
-     * 网页授权测试
-     * @return string
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function oauth()
-    {
-        $this->url = $this->request->url(true);
-        $this->fans = WechatService::getWebOauthInfo($this->url, 1);
-        $this->fetch();
-    }
-
-    /**
-     * 显示网页授权二维码
-     * @return \think\Response
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
-     * @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
-     */
-    public function oauth_qrc()
-    {
-        $url = url('@wechat/api.tools/oauth', '', true, true);
-        return $this->showQrc($url);
-    }
-
-    /**
-     * JSSDK测试
-     * @return string
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function jssdk()
-    {
-        $this->options = WechatService::getWebJssdkSign();
-        $this->fetch();
-    }
-
-    /**
-     * 显示网页授权二维码
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
-     * @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
-     */
-    public function jssdk_qrc()
-    {
-        $this->url = url('@wechat/api.tools/jssdk', '', true, true);
-        return $this->showQrc($this->url);
-    }
-
-    /**
-     * 微信扫码支付模式一二维码显示
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
-     * @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
-     */
-    public function scanOneQrc()
-    {
-        $pay = WechatService::WePayOrder();
-        $result = $pay->qrcParams('8888888');
-        $this->showQrc($result);
-    }
-
-    /**
-     * 微信扫码支付模式一通知处理
-     * -- 注意,需要在微信商户配置支付通知地址
-     * @return string
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     */
-    public function scanOneNotify()
-    {
-        $pay = WechatService::WePayOrder();
-        $notify = $pay->getNotify();
-        p('======= 来自扫码支付1的数据 ======');
-        p($notify);
-        // 产品ID 你的业务代码,并实现下面的统一下单操作
-        $product_id = $notify['product_id'];
-        // 微信统一下单处理
-        $options = [
-            'body'             => '测试商品,产品ID:' . $product_id,
-            'out_trade_no'     => time(),
-            'total_fee'        => '1',
-            'trade_type'       => 'NATIVE',
-            'notify_url'       => url('@wechat/api.tools/notify', '', true, true),
-            'spbill_create_ip' => request()->ip(),
-        ];
-        $order = $pay->create($options);
-        p('======= 来自扫码支付1统一下单结果 ======');
-        p($order);
-        // 回复XML文本
-        $result = [
-            'return_code' => 'SUCCESS',
-            'return_msg'  => '处理成功',
-            'appid'       => $notify['appid'],
-            'mch_id'      => $notify['mch_id'],
-            'nonce_str'   => \WeChat\Contracts\Tools::createNoncestr(),
-            'prepay_id'   => $order['prepay_id'],
-            'result_code' => 'SUCCESS',
-        ];
-        $result['sign'] = $pay->getPaySign($result);
-        p('======= 来自扫码支付1返回的结果 ======');
-        p($result);
-        return \WeChat\Contracts\Tools::arr2xml($result);
-    }
-
-    /**
-     * 扫码支付模式二测试二维码
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
-     * @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     */
-    public function scanQrc()
-    {
-        $pay = WechatService::WePayOrder();
-        $result = $pay->create([
-            'body'             => '测试商品',
-            'out_trade_no'     => time(),
-            'total_fee'        => '1',
-            'trade_type'       => 'NATIVE',
-            'notify_url'       => url('@wechat/api.tools/notify', '', true, true),
-            'spbill_create_ip' => request()->ip(),
-        ]);
-        $this->showQrc($result['code_url']);
-    }
-
-
-    /**
-     * 微信JSAPI支付二维码
-     * @return \think\Response
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
-     * @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
-     */
-    public function jsapiQrc()
-    {
-        $this->url = url('@wechat/api.tools/jsapi', '', true, true);
-        return $this->showQrc($this->url);
-    }
-
-    /**
-     * 微信JSAPI支付测试
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     * @link wx-demo-jsapi
-     */
-    public function jsapi()
-    {
-        $pay = WechatService::WePayOrder();
-        $openid = WechatService::getWebOauthInfo(request()->url(true), 0)['openid'];
-        $options = [
-            'body'             => '测试商品',
-            'out_trade_no'     => time(),
-            'total_fee'        => '1',
-            'openid'           => $openid,
-            'trade_type'       => 'JSAPI',
-            'notify_url'       => url('@wechat/api.tools/notify', '', true, true),
-            'spbill_create_ip' => request()->ip(),
-        ];
-        // 生成预支付码
-        $result = $pay->create($options);
-        // 创建JSAPI参数签名
-        $options = $pay->jsapiParams($result['prepay_id']);
-        $optionJSON = json_encode($options, JSON_UNESCAPED_UNICODE);
-        // JSSDK 签名配置
-        $configJSON = json_encode(WechatService::getWebJssdkSign(), JSON_UNESCAPED_UNICODE);
-
-        echo '<pre>';
-        echo "当前用户OPENID: {$openid}";
-        echo "\n--- 创建预支付码 ---\n";
-        var_export($result);
-        echo '</pre>';
-
-        echo '<pre>';
-        echo "\n\n--- JSAPI 及 H5 参数 ---\n";
-        var_export($options);
-        echo '</pre>';
-        echo "<button id='paytest' type='button'>JSAPI支付测试</button>";
-        echo "
-        <script src='//res.wx.qq.com/open/js/jweixin-1.2.0.js'></script>
-        <script>
-            wx.config($configJSON);
-            document.getElementById('paytest').onclick = function(){
-                var options = $optionJSON;
-                options.success = function(){
-                    alert('支付成功');
-                }
-                wx.chooseWXPay(options);
-            }
-        </script>";
-    }
-
-    /**
-     * 支付通知接收处理
-     * @return string
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     */
-    public function notify()
-    {
-        $wechat = WechatService::WePayOrder();
-        p($wechat->getNotify());
-        return 'SUCCESS';
-    }
-
-    /**
-     * 创建二维码响应对应
-     * @param string $url 二维码内容
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionFailedException
-     * @throws \Endroid\QrCode\Exceptions\ImageFunctionUnknownException
-     * @throws \Endroid\QrCode\Exceptions\ImageTypeInvalidException
-     */
-    protected function showQrc($url)
-    {
-        $qrCode = new \Endroid\QrCode\QrCode();
-        $qrCode->setText($url)->setSize(300)->setPadding(20)->setImageType('png');
-        response($qrCode->get(), 200, ['Content-Type' => 'image/png'])->send();
-    }
-
-}

+ 0 - 79
application/wechat/queue/WechatQueue.php

@@ -1,79 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\queue;
-
-use app\wechat\service\FansService;
-use app\wechat\service\WechatService;
-use think\console\Input;
-use think\console\Output;
-use think\Db;
-
-/**
- * Class Jobs
- * @package app\wechat
- */
-class WechatQueue
-{
-
-    /**
-     * 当前类名
-     * @var string
-     */
-    const URI = self::class;
-
-    /**
-     * 执行任务
-     * @param Input $input
-     * @param Output $output
-     * @param array $data
-     * @throws \WeChat\Exceptions\InvalidResponseException
-     * @throws \WeChat\Exceptions\LocalCacheException
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public function execute(Input $input, Output $output, array $data = [])
-    {
-        $appid = WechatService::getAppid();
-        $wechat = WechatService::WeChatUser();
-        // 获取远程粉丝
-        list($next, $done) = ['', 0];
-        while (!is_null($next) && is_array($result = $wechat->getUserList($next)) && !empty($result['data']['openid'])) {
-            $done += $result['count'];
-            foreach (array_chunk($result['data']['openid'], 100) as $chunk) {
-                if (is_array($list = $wechat->getBatchUserInfo($chunk)) && !empty($list['user_info_list'])) {
-                    foreach ($list['user_info_list'] as $user) FansService::set($user, $appid);
-                }
-            }
-            $next = $result['total'] > $done ? $result['next_openid'] : null;
-        }
-        // 同步粉丝黑名单
-        list($next, $done) = ['', 0];
-        while (!is_null($next) && is_array($result = $wechat->getBlackList($next)) && !empty($result['data']['openid'])) {
-            $done += $result['count'];
-            foreach (array_chunk($result['data']['openid'], 100) as $chunk) {
-                Db::name('WechatFans')->where(['is_black' => '0'])->whereIn('openid', $chunk)->update(['is_black' => '1']);
-            }
-            $next = $result['total'] > $done ? $result['next_openid'] : null;
-        }
-        // 同步粉丝标签
-        if (is_array($list = WechatService::WeChatTags()->getTags()) && !empty($list['tags'])) {
-            foreach ($list['tags'] as &$tag) $tag['appid'] = $appid;
-            Db::name('WechatFansTags')->where('1=1')->delete();
-            Db::name('WechatFansTags')->insertAll($list['tags']);
-        }
-    }
-
-}

+ 0 - 62
application/wechat/service/FansService.php

@@ -1,62 +0,0 @@
-<?php
-
-// +----------------------------------------------------------------------
-// | ThinkAdmin
-// +----------------------------------------------------------------------
-// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
-// +----------------------------------------------------------------------
-// | 官方网站: http://demo.thinkadmin.top
-// +----------------------------------------------------------------------
-// | 开源协议 ( https://mit-license.org )
-// +----------------------------------------------------------------------
-// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
-// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
-// +----------------------------------------------------------------------
-
-namespace app\wechat\service;
-
-use think\Db;
-
-/**
- * 微信粉丝信息
- * Class FansService
- * @package app\wechat\service
- */
-class FansService
-{
-
-    /**
-     * 增加或更新粉丝信息
-     * @param array $user 粉丝信息
-     * @param string $appid 微信APPID
-     * @return boolean
-     * @throws \think\Exception
-     * @throws \think\exception\PDOException
-     */
-    public static function set(array $user, $appid = '')
-    {
-        if (!empty($user['subscribe_time'])) {
-            $user['subscribe_at'] = date('Y-m-d H:i:s', $user['subscribe_time']);
-        }
-        if (isset($user['tagid_list']) && is_array($user['tagid_list'])) {
-            $user['tagid_list'] = is_array($user['tagid_list']) ? join(',', $user['tagid_list']) : '';
-        }
-        if ($appid !== '') $user['appid'] = $appid;
-        unset($user['privilege'], $user['groupid']);
-        return data_save('WechatFans', $user, 'openid');
-    }
-
-    /**
-     * 获取粉丝信息
-     * @param string $openid
-     * @return array|null
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
-     */
-    public static function get($openid)
-    {
-        return Db::name('WechatFans')->where(['openid' => $openid])->find();
-    }
-
-}

Some files were not shown because too many files changed in this diff