rabin 4 dagen geleden
bovenliggende
commit
256f6b2268
37 gewijzigde bestanden met toevoegingen van 644 en 171 verwijderingen
  1. 2 1
      src/place/benefit/table/perk_code.php
  2. 1 0
      src/place/channel/sales/manage/offline.php
  3. 50 17
      src/place/interface/app/Api/Source.php
  4. 5 4
      src/place/order/app/Lib/Source/Pay.php
  5. 2 0
      src/place/order/manage/Lib/Excel.php
  6. 3 0
      src/place/page/manage/ad.php
  7. 2 0
      src/place/page/manage/nav.php
  8. 1 0
      src/place/set/manage/account.php
  9. 2 0
      src/place/set/manage/place.php
  10. 3 1
      src/place/set/table/account.php
  11. 40 24
      src/place/source/app/Lib/Content.php
  12. 2 2
      src/place/source/app/Lib/Info.php
  13. 24 0
      src/place/source/manage/Lib/Content.php
  14. 3 0
      src/place/source/manage/Lib/Excel.php
  15. 21 0
      src/place/source/manage/Lib/Info.php
  16. 1 1
      src/place/source/manage/Lib/Sku.php
  17. 86 47
      src/place/source/manage/content.php
  18. 2 1
      src/place/source/manage/content_cate.php
  19. 24 0
      src/place/source/manage/content_channel.php
  20. 27 0
      src/place/source/manage/content_data.php
  21. 22 0
      src/place/source/manage/content_link.php
  22. 27 0
      src/place/source/manage/content_media.php
  23. 50 9
      src/place/source/manage/info.php
  24. 1 0
      src/place/source/manage/sku.php
  25. 14 10
      src/place/source/table/content.php
  26. 6 2
      src/place/source/table/content_cate.php
  27. 30 0
      src/place/source/table/content_channel.php
  28. 38 0
      src/place/source/table/content_data.php
  29. 38 0
      src/place/source/table/content_link.php
  30. 38 0
      src/place/source/table/content_media.php
  31. 71 46
      src/place/source/table/info.php
  32. 1 0
      src/place/user/manage/Lib/Excel.php
  33. 2 2
      src/place/user/manage/gift.php
  34. 1 1
      src/place/user/manage/gift_log.php
  35. 2 2
      src/place/user/manage/perk.php
  36. 1 0
      src/place/user/manage/user.php
  37. 1 1
      src/sector/table/delivery.php

+ 2 - 1
src/place/benefit/table/perk_code.php

@@ -50,6 +50,7 @@ return [
     ],
 
     'index' => [
-        'search' => 'perk_id,code',
+        'perk_id' => 'perk_id',
+        'code' => 'code',
     ],
 ];

+ 1 - 0
src/place/channel/sales/manage/offline.php

@@ -100,6 +100,7 @@ $config = [
             /*
             'logo' => [
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => 1,
                 'yun' => true,
                 'multiple' => false,

+ 50 - 17
src/place/interface/app/Api/Source.php

@@ -178,26 +178,16 @@ class Source extends Core
             'content'       => $info['content'],
             'promotion_text' => $info['promotion_text'],
             'promotion_tag' => $info['promotion_tag'],
+            'show_page'     => $info['show_page'],
+            'show_submit'   => $info['show_submit'],
+            'show_sell'     => $info['show_sell'],
+            'show_content'  => $info['show_content'],
         ];
         $data['have_vip'] = $info['have_vip'];
         $data['help'] = $info['help'];
 
         # 是否收藏
         $data['collect'] = $info['collect'];
-        # 是否展示内容
-        $content = Dever::db('psource/content')->find(['info_id' => $source_id]);
-        $data['content'] = false;
-        if ($content) {
-            $data['content'] = true;
-        }
-
-        # 是否展示工具
-        /*
-        $tool = Dever::db('psource/tool')->find(['info_id' => $source_id]);
-        $data['tool'] = false;
-        if ($tool) {
-            $data['tool'] = true;
-        }*/
 
         # 获取评价
         $data['review'] = Act::load('review', $this->place->uid, 1, $source_id)->getList(['limit' => 3], 'content,pic,rate,open');
@@ -207,6 +197,36 @@ class Source extends Core
         # 详情页轮播、详情页信息流
         $data['ad'] = Dever::load(\Ppage\Lib\Ad::class)->gets([21,22], $info['channel_id'], $info['cate_parent_id']);
 
+
+        $view = ['id' => -1, 'name' => '详情'];
+        $data['tab'] = [];
+        # 检测是否购买过
+        $buy = Dever::db('porder/source_detail')->find(['uid' => $this->place->uid, 'info_id' => $info['id']]);
+        if (!$buy && $data['info']['content']) {
+            $data['tab'][] = $view;
+        }
+        # 是否展示内容
+        if ($info['show_content'] == 1) {
+            # 获取内容类别
+            $content_channel = Dever::db('psource/content_channel')->select(['info_id' => $info['id'], 'status' => 1]);
+            if ($content_channel) {
+                foreach ($content_channel as $v) {
+                    $num = Dever::db('psource/content')->count(['info_id' => $info['id'], 'channel_id' => $v['id'], 'status' => 1]);
+                    if ($num > 0) {
+                        if ($num > 10) {
+                            $more = 1;
+                        } else {
+                            $more = 2;
+                        }
+                        $data['tab'][] = ['id' => $v['id'], 'name' => $v['name'], 'more' => $more];
+                    }
+                }
+            }
+        }
+        if ($buy && $data['info']['content']) {
+            $data['tab'][] = $view;
+        }
+
         return $data;
     }
 
@@ -222,8 +242,9 @@ class Source extends Core
     public function content()
     {
         $source_id = Dever::input('id', 'is_numeric', '资源ID');
+        $channel_id = Dever::input('cid', 'is_numeric', '内容类别');
         $source = Dever::load(\Psource\Lib\Info::class)->getBaseInfo($source_id);
-        list($data['top'], $data['cate_id']) = Dever::load(\Psource\Lib\Content::class)->getCate($source_id);
+        list($data['top'], $data['cate_id']) = Dever::load(\Psource\Lib\Content::class)->getCate($source_id, $channel_id);
 
         $data['top'] = array_merge([['id' => 0, 'name' => '全部']], $data['top']);
 
@@ -236,8 +257,9 @@ class Source extends Core
     public function contentList()
     {
         $source_id = Dever::input('id', 'is_numeric', '资源ID');
+        $channel_id = Dever::input('cid', 'is_numeric', '内容类别');
         $cate_id = Dever::input('cate_id', 'is_numeric', '分类ID', 0);
-        $data['list'] = Dever::load(\Psource\Lib\Content::class)->getList($source_id, $cate_id);
+        $data['list'] = Dever::load(\Psource\Lib\Content::class)->getList($this->place->uid, $source_id, $channel_id, $cate_id);
         return $data;
     }
 
@@ -245,11 +267,22 @@ class Source extends Core
     public function contentInfo()
     {
         $content_id = Dever::input('id', 'is_numeric', '内容ID');
-        $data['content'] = Dever::load(\Psource\Lib\Content::class)->getInfo($content_id);
+        $data['content'] = Dever::load(\Psource\Lib\Content::class)->getInfo($this->place->uid, $content_id);
         $data['source'] = Dever::load(\Psource\Lib\Info::class)->getBaseInfo($data['content']['info_id']);
         return $data;
     }
 
+    # 资源内容购买
+    public function contentBuy()
+    {
+        $content_id = Dever::input('id', 'is_numeric', '内容ID');
+        $content = Dever::load(\Psource\Lib\Content::class)->getInfo($this->place->uid, $content_id, true);
+        if ($content['look'] == 3) {
+            return 'ok';
+        }
+        Dever::error('积分不足', -2);
+    }
+
     # 确认支付
     public function payConfirm()
     {

+ 5 - 4
src/place/order/app/Lib/Source/Pay.php

@@ -7,7 +7,7 @@ class Pay extends Core
     # 获取明细
     protected function getDetail($info)
     {
-        $source = Dever::db('psource/info')->find(['id' => $info['id']], ['col' => 'id,name,pic,cate_id,channel_id,cate_parent_id,type,have_vip']);
+        $source = Dever::db('psource/info')->find(['id' => $info['id']], ['col' => 'id,name,pic,cate_id,channel_id,cate_parent_id,type,have_vip,collect']);
         if (!$source) {
             Dever::error('资源不存在');
         }
@@ -48,13 +48,14 @@ class Pay extends Core
             'promotion' => $detail['promotion'],
             'promotion_text' => $detail['promotion_text'],
         ];
-        if ($source['type'] == 1) {
+        if ($source['type'] == 1 || $source['collect'] == 2) {
             # 实物,如果有快递发货
             $this->order['deliver_type'] = 1;
-            # 0是销售渠道配送,1是平台配送
-            $this->order['method'] = 1;
             # 1是需要填写地址,2是不需要
             $this->order['is_address'] = 1;
+            
+            # 0是销售渠道配送,1是平台配送
+            $this->order['method'] = 1;
             if ($detail['stock'] && $detail['stock']['list'] && empty($this->order['method_list'])) {
                 # 如果有店铺配送
                 $this->order['method_list'] = $detail['stock']['list'];

+ 2 - 0
src/place/order/manage/Lib/Excel.php

@@ -87,6 +87,8 @@ class Excel
             
         }
 
+        @unlink($file);
+
         return 'end';
     }
 }

+ 3 - 0
src/place/page/manage/ad.php

@@ -102,6 +102,7 @@ return [
                 'name' => '导航图标',
                 'field' => 'info',
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '1',
                 'multiple' => false,
                 'style' => 'pic',
@@ -112,6 +113,7 @@ return [
                 'name' => '图片',
                 'field' => 'info',
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '1',
                 'multiple' => false,
                 'style' => 'pic',
@@ -122,6 +124,7 @@ return [
                 'name' => '视频',
                 'field' => 'info',
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '3',
                 'multiple' => false,
                 'style' => 'list',

+ 2 - 0
src/place/page/manage/nav.php

@@ -45,6 +45,7 @@ return [
             'icon' => [
                 'tip' => '如果未上传图标,将按照类型生成默认图标',
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '1',
                 'yun' => true,
                 'multiple' => false,
@@ -54,6 +55,7 @@ return [
             'icon_select' => [
                 'tip' => '如果未上传图标,将按照类型生成默认图标',
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '1',
                 'yun' => true,
                 'multiple' => false,

+ 1 - 0
src/place/set/manage/account.php

@@ -1,4 +1,5 @@
 <?php
+Dever::load(\Api\Lib\Account::class)->sync('place');
 $id = Dever::input('id');
 $show = false;
 $account_setting = [];

+ 2 - 0
src/place/set/manage/place.php

@@ -100,6 +100,7 @@ return [
             
             'logo' => [
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => 1,
                 'yun' => true,
                 'multiple' => false,
@@ -108,6 +109,7 @@ return [
             /*
             'bg' => [
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => 1,
                 'yun' => true,
                 'multiple' => false,

+ 3 - 1
src/place/set/table/account.php

@@ -14,6 +14,7 @@ return [
         ],
     ],
 
+    /*
     'default' => [
         'field' => 'name,`key`,cdate',
         'value' => [
@@ -24,8 +25,9 @@ return [
         ],
         'num' => 1,
     ],
+    */
 
     'index' => [
-        'search' => '`key`',
+        'search' => '`key`.unique',
     ],
 ];

+ 40 - 24
src/place/source/app/Lib/Content.php

@@ -3,9 +3,9 @@ use Dever;
 class Content
 {
     # 获取内容分类以及默认分类
-    public function getCate($source_id)
+    public function getCate($source_id, $channel_id)
     {
-        $cate = Dever::db('psource/content_cate')->select(['info_id' => $source_id, 'status' => 1], ['col' => 'id,name']);
+        $cate = Dever::db('psource/content_cate')->select(['info_id' => $source_id, 'channel_id' => $channel_id, 'status' => 1], ['col' => 'id,name']);
         # 获取当前的默认分类
         $default = Dever::input('cate_id', '', '', 0);
         if (!$default && $cate) {
@@ -15,9 +15,10 @@ class Content
     }
 
     # 获取内容列表
-    public function getList($uid, $source_id, $cate_id = 0)
+    public function getList($uid, $source_id, $channel_id, $cate_id = 0)
     {
         $where['info_id'] = $source_id;
+        $where['channel_id'] = $channel_id;
         if ($cate_id > 0) {
             $where['cate_id'] = $cate_id;
         }
@@ -25,50 +26,65 @@ class Content
         if ($search) {
             $where['name'] = ['like', $search];
         }
-        $data = Dever::db('psource/content')->select($where, ['col' => 'id,name,info,info_id,sku_id,score_id,score_num,score_time,content', 'num' => 10]);
+        $score_time = Dever::db('psource/content')->config['struct']['score_time']['value'];
+        $data = Dever::db('psource/content')->select($where, ['col' => 'id,name,info,info_id,sku_id,score_id,score_num,score_time,content,udate', 'num' => 10]);
         if ($data) {
             foreach ($data as &$v) {
+                if (!$v['info'] && $v['content']) {
+                    $v['content'] = strip_tags(htmlspecialchars_decode($v['content']));
+                    $v['info'] = mb_substr($v['content'], 0, 30, 'UTF-8');
+                }
+                unset($v['content']);
+
+                $v['price'] = '';
                 $v['look'] = $this->getLook($uid, $v);
                 if ($v['look'] == 2) {
                     $v['price'] = '需解锁';
-                } else {
+                    if ($v['info']) {
+                        $v['info'] = $v['price'] . ',' . $v['info'];
+                    } else {
+                        $v['info'] = $v['price'];
+                    }
+                } elseif ($v['look'] >= 3) {
                     $v['price'] = Dever::load(\Pscore\Lib\Info::class)->getText($v['score_num'], $v['score_id']);
+                    if ($v['info']) {
+                        $v['info'] = '需付费,' . $v['info'];
+                    } else {
+                        $v['info'] = '需付费';
+                    }
                 }
-                if (!$v['info']) {
-                    $v['content'] = strip_tags(htmlspecialchars_decode($v['content']));
-                    $v['info'] = mb_substr($v['content'], 0, 30, 'UTF-8');
+                $v['cate_id'] = Dever::db('psource/info')->column($v['info_id'], 'cate_id');
+                $v['buy'] = '您需要解锁后才能继续访问,点击确定将跳转至解锁页面';
+                if ($v['price']) {
+                    $v['score_time'] = $score_time[$v['score_time']];
+                    $v['score'] = '您需要付费'.$v['price'].'才能继续访问,付费后' . $v['score_time'] . '内免费访问';
                 }
-                unset($v['content']);
             }
         }
         return $data;
     }
 
     # 获取内容信息
-    public function getInfo($uid, $content_id)
+    public function getInfo($uid, $content_id, $kou = false)
     {
-        $info = Dever::db('psource/content')->find($content_id, ['col' => 'id,name,info_id,sku_id,score_id,score_num,score_time,info,content,attachment']);
+        $info = Dever::db('psource/content')->find($content_id, ['col' => 'id,name,info_id,sku_id,score_id,score_num,score_time,info,content']);
         if (!$info) {
             Dever::error('内容不存在');
         }
-        $info['look'] = $this->getLook($uid, $info, true);
+        $info['look'] = $this->getLook($uid, $info, $kou);
         if ($info['look'] == 2) {
-            Dever::error('请先购买', -1);
+            Dever::error('请先解锁', -1);
         }
         if ($info['look'] == 4) {
             Dever::error('积分不足', -2);
         }
-        $info['content'] = htmlspecialchars_decode($info['content']);
-        $info['attachment'] = [];
-        $attachment = explode(',', $attachment);
-        if ($attachment) {
-            foreach ($attachment as $k => $v) {
-                $path = parse_url($v, PHP_URL_PATH);
-                $filename = pathinfo($path, PATHINFO_FILENAME);
-                $info = Dever::db('upload/file')->find(['name' => $filename]);
-                $info['attachment'][] = ['name' => $info['source_name'], 'link' => $v];
-            }
+        if ($kou) {
+            return $info;
         }
+        $info['content'] = htmlspecialchars_decode($info['content']);
+        $info['media'] = Dever::db('psource/content_media')->select(['content_id' => $info['id']], ['col' => 'id,name as title,file as url']);
+        $info['data'] = Dever::db('psource/content_data')->select(['content_id' => $info['id']], ['col' => 'id,name,file']);
+        $info['link'] = Dever::db('psource/content_link')->select(['content_id' => $info['id']], ['col' => 'id,name,link']);
         return $info;
     }
 
@@ -79,7 +95,7 @@ class Content
         # 先验证是否需要解锁
         if ($info['sku_id'] == -1) {
             # 免费
-            $state = -1;
+            $state = 1;
         } else {
             # 检测是否解锁
             if ($uid) {

+ 2 - 2
src/place/source/app/Lib/Info.php

@@ -20,7 +20,7 @@ class Info
         if ($search) {
             $where['name'] = ['like', $search];
         }
-        $set = ['col' => 'id,sku_id,cate_child_id,name,info,price,pic,type,view,num_sell'];
+        $set = ['col' => 'id,sku_id,cate_child_id,name,info,price,pic,type,num_sell+num_sell_add as num_sell,show_page'];
         if ($limit) {
             $set['limit'] = $limit;
         }
@@ -72,7 +72,7 @@ class Info
     # 获取资源详细信息
     public function getInfo($uid, $id)
     {
-        $info = Dever::db('psource/info')->find(['id' => $id, 'status' => 1], ['col' => 'id,name,info,price,sku_id,pic,content,channel_id,cate_parent_id,cate_id,have_vip,num_sell']);
+        $info = Dever::db('psource/info')->find(['id' => $id, 'status' => 1], ['col' => 'id,name,info,price,sku_id,pic,content,channel_id,cate_parent_id,cate_id,have_vip,num_sell+num_sell_add as num_sell,show_page,show_submit,show_sell,show_content']);
         if (!$info) {
             Dever::error('资源不存在');
         }

+ 24 - 0
src/place/source/manage/Lib/Content.php

@@ -0,0 +1,24 @@
+<?php namespace Psource\Manage\Lib;
+use Dever;
+class Content
+{
+    public function update($db, $data)
+    {
+        $data['udate'] = time();
+        return $data;
+    }
+
+    # 获取类别
+    public function getChannel()
+    {
+        $info_id = Dever::load(\Manage\Lib\Util::class)->request('info_id');
+        $data = Dever::db('psource/content_channel')->select(['info_id' => $info_id, 'status' => 1]);
+        $result = [];
+        $result[] = [
+            'id' => 'root',
+            'name' => '类别',
+            'children' => $data,
+        ];
+        return $result;
+    }
+}

+ 3 - 0
src/place/source/manage/Lib/Excel.php

@@ -212,6 +212,8 @@ class Excel
                 }
             }
         }
+
+        @unlink($file);
     }
 
     public function createCode($i)
@@ -379,5 +381,6 @@ class Excel
                 }
             }
         }
+        @unlink($file);
     }
 }

+ 21 - 0
src/place/source/manage/Lib/Info.php

@@ -52,6 +52,27 @@ class Info
         }
     }
 
+    # 获取展示信息
+    public function getView($id)
+    {
+        return Dever::load(\Manage\Lib\Util::class)->createTip(function(&$name, &$content) use ($id) {
+            $info = Dever::db('psource/info')->find($id);
+            if ($info) {
+                $name = Dever::db('psource/info')->value('show_page', $info['show_page']);
+                $sell = Dever::db('psource/info')->value('show_sell', $info['show_sell']);
+                $submit = Dever::db('psource/info')->value('show_submit', $info['show_submit']);
+                $show_content = Dever::db('psource/info')->value('show_content', $info['show_content']);
+                $content = [
+                    ['name' => '内容展示', 'content' => $show_content],
+                    ['name' => '下单按钮', 'content' => $submit],
+                    ['name' => '销量展示', 'content' => $sell],
+                    ['name' => '实际销量', 'content' => $info['num_sell'] ?: 0],
+                    ['name' => '虚拟销量', 'content' => $info['num_sell_add'] ?: 0],
+                ];
+            }
+        });
+    }
+
     # 根据资源编号获取资源id
     public function getIdByCode($value)
     {

+ 1 - 1
src/place/source/manage/Lib/Sku.php

@@ -5,7 +5,7 @@ class Sku
     # 获取基本信息
     public function getInfo($info_id)
     {
-        $data = Dever::option('psource/sku', '免费', ["info_id" => $info_id]);
+        $data = Dever::option('psource/sku', '无需解锁', ["info_id" => $info_id]);
         if ($data) {
             foreach ($data as &$v) {
                 if (isset($v['key'])) {

+ 86 - 47
src/place/source/manage/content.php

@@ -1,16 +1,67 @@
 <?php
 $info_id = Dever::load(\Manage\Lib\Util::class)->request('info_id');
-$option = Dever::db('psource/content_cate')->select(['info_id' => $info_id, 'status' => 1]);
+$channel_id = Dever::input('search')['channel_id'] ?? 0;
+if (!$channel_id) {
+    $channel = Dever::db('psource/content_channel')->find(['info_id' => $info_id, 'status' => 1]);
+    if ($channel) {
+        $channel_id = $channel['id'];
+    } else {
+        $channel_id = -1;
+    }
+}
+$button = [];
+$option = [];
+if ($channel_id && $channel_id > 0) {
+    $desc = '';
+    $button = [
+        '新增' => ['add', ['info_id' => $info_id, 'channel_id' => $channel_id]],
+        '添加章节' => ['fastadd', [
+            'path' => 'sector_place_source/content_cate',
+            'field' => ['info_id' => $info_id, 'channel_id' => $channel_id],
+        ]],
+        '章节列表' => ['route', [
+            'path' => 'sector_place_source/content_cate',
+            'param' => [
+                'set' => ['info_id' => $info_id, 'channel_id' => $channel_id, 'menu' => 'sector_place_source/info', 'parent' => 'sector_place_source/content'],
+            ],
+        ]],
+    ];
+    $option = Dever::db('psource/content_cate')->select(['info_id' => $info_id, 'channel_id' => $channel_id, 'status' => 1]);
+} else {
+    $desc = '请先新建类别';
+}
 $config = [
     'list' => [
-        'where' => ['info_id' => $info_id],
+        'where' => ['info_id' => $info_id, 'channel_id' => $channel_id],
+        'desc' => $desc,
+        # 展示左侧分栏
+        'column' => [
+            # 分栏数据来源
+            'load' => 'psource/content_channel',
+            # 分栏新增按钮
+            'add' => '新增类别',
+            # 分栏新增按钮参数
+            'add_field' => ['info_id' => $info_id],
+            # 分栏编辑按钮,这里直接用图标
+            'edit' => true,
+            # 分栏删除按钮,这里直接用图标
+            //'delete' => true,
+            # 关键字段,一般为id或者key
+            'key' => 'id',
+            # 获取数据
+            'data' => 'Psource/Manage/Lib/Content.getChannel',
+            # 默认展开
+            'active' => $channel_id,
+            # 对应的where条件的key
+            'where' => 'channel_id',
+        ],
         'field'      => [
-            'name',
             'cate_id' => [
                 'show' => 'Dever::field("psource/content_cate", "{cate_id}")',
             ],
+            'name',
             'sku_id' => [
-                'show' => 'Dever::call("Psource/manage/sku.getName", "{sku_id}")',
+                'show' => 'Dever::call("Psource/Manage/Lib/Sku.getName", "{sku_id}")',
             ],
             'score_id' => [
                 'show' => 'Dever::call("Pscore/Lib/Info.getText", ["{score_num}","{score_id}"])',
@@ -20,57 +71,38 @@ $config = [
             'status',
             'cdate',
         ],
-        'button' => [
-            '新增' => ['add', ['info_id' => $info_id]],
-            '添加分类' => ['fastadd', [
-                'path' => 'sector_place_source/content_cate',
-                'field' => ['info_id' => $info_id],
-            ]],
-            '分类列表' => ['route', [
-                'path' => 'sector_place_source/content_cate',
-                'param' => [
-                    'set' => ['info_id' => $info_id, 'menu' => 'sector_place_source/info', 'parent' => 'sector_place_source/content'],
-                ],
-            ]],
-        ],
+        'button' => $button,
         'data_button' => [
-            '编辑' => ['edit', ['info_id' => $info_id]],
+            '编辑' => ['edit', ['info_id' => $info_id, 'channel_id' => $channel_id]],
         ],
         'search'    => [
-            'name' => 'like',
             'cate_id' => [
                 'type' => 'select',
                 'option' => $option,
             ],
+            'name' => 'like',
             'status',
         ],
     ],
     'update' => [
-        /*
-        'control' => [
-            'content_1' => 'type=1',
-            'content_2' => 'type=2',
-            'content_3' => 'type=3',
-            'content_4' => 'type=4',
-            'content_5' => 'type=5',
-            'content_6' => 'type=6',
-            'content_7' => 'type=7',
-            'content_1' => [
-                'type' => 1,
-            ],
-        ],*/
+
+        'start' => 'Psource/Manage/Lib/Content.update',
 
         'tab' => [
-            '基本信息' => 'name,cate_id,info,link,attachment,content',
-            '解锁与访问' => 'sku_id,score_id,score_num,score_time',
+            '基本信息' => 'name,cate_id,info,content',
+            '访问控制' => 'sku_id,score_id,score_num,score_time',
+            '多媒体列表' => 'psource/content_media',
+            '链接列表' => 'psource/content_link',
+            '附件列表' => 'psource/content_data',
         ],
 
         'field'    => [
             'info_id',
+            'channel_id',
             'cate_id' => [
                 'rules' => true,
                 'type' => 'select',
-                'option' => 'Dever::option("psource/content_cate", true, ["info_id" => '.$info_id.'])',
+                'option' => 'Dever::option("psource/content_cate", true, ["info_id" => '.$info_id.', "channel_id" => '.$channel_id.'])',
             ],
             'sku_id' => [
                 'rules' => true,
@@ -98,26 +130,33 @@ $config = [
                 'type' => 'textarea',
                 'autosize' => ['minRows' => 4],
             ],
-            'link' => [
-                'desc' => '设置了跳转链接,用户可以点击跳转至该链接',
-                'type' => 'textarea',
-                'autosize' => ['minRows' => 4],
-            ],
-            'attachment' => [
-                'name' => '文件',
-                'type' => 'upload',
-                'upload' => '8',
-                'multiple' => true,
-                'style' => 'list',
-            ],
             'content' => [
                 'type' => 'editor',
+                'project' => 'place',
                 'editorMenu' => [
                     'uploadImage' => 1,
                     'uploadVideo' => 3,
                 ],
             ],
 
+            'psource/content_media' => [
+                'desc' => '支持图片、视频、音频,每个文件支持最大200M,如超过请分割后上传,用户点击后直接在线观看',
+                'name' => '多媒体列表',
+                'where'  => ['content_id' => 'id'],
+            ],
+
+            'psource/content_data' => [
+                'desc' => '支持pdf、office文档、压缩包、图片、视频、音频等文件,每个文件支持最大200M,如超过请分割后上传,用户点击后直接下载到本地',
+                'name' => '附件列表',
+                'where'  => ['content_id' => 'id'],
+            ],
+
+            'psource/content_link' => [
+                'desc' => '设置了跳转链接,用户可以点击跳转至该链接',
+                'name' => '链接列表',
+                'where'  => ['content_id' => 'id'],
+            ],
+
             /*
             'content_2' => [
                 'name' => '链接',

+ 2 - 1
src/place/source/manage/content_cate.php

@@ -1,7 +1,7 @@
 <?php
 $config = [
     'list' => [
-        'where' => ['info_id'],
+        'where' => ['info_id', 'channel_id'],
         'field'      => [
             'name',
             'sort',
@@ -22,6 +22,7 @@ $config = [
     'update' => [
         'field'    => [
             'info_id',
+            'channel_id',
             'name' => [
                 'rules' => true,
             ],

+ 24 - 0
src/place/source/manage/content_channel.php

@@ -0,0 +1,24 @@
+<?php
+$info_id = Dever::load(\Manage\Lib\Util::class)->request('info_id');
+return [
+    'update' => [
+        'field'    => [
+            'info_id' => [
+                'type' => 'hidden',
+                'value' => $info_id,
+            ],
+            'name' => [
+                'rules' => true,
+            ],
+            'sort' => [
+                'rules' => true,
+                'tip' => '正序排序',
+                'desc' => '“详情”的排序数字为0,默认排在最前面,',
+            ],
+            'status' => [
+                'rules' => true,
+                'type' => 'radio',
+            ],
+        ],
+    ],
+];

+ 27 - 0
src/place/source/manage/content_data.php

@@ -0,0 +1,27 @@
+<?php
+$config = [
+    'update' => [
+        'field'    => [
+            'file' => [
+                'tips' => '可以直接填入文件远程地址,支持视频、音频、图片、office、文本等等格式',
+                'name' => '文件',
+                'project' => 'place',
+                'type' => 'upload',
+                'upload' => '8',
+                'multiple' => false,
+                'style' => 'input',
+                'upload_name' => 'name',
+            ],
+            'name' => [
+                'rules' => true,
+            ],
+            'status' => [
+                'width' => '60px',
+                'type' => 'radio',
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];
+
+return $config;

+ 22 - 0
src/place/source/manage/content_link.php

@@ -0,0 +1,22 @@
+<?php
+$config = [
+    'update' => [
+        'field'    => [
+            'name' => [
+                'rules' => true,
+            ],
+            'link' => [
+                'rules' => true,
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 4],
+            ],
+            'status' => [
+                'width' => '60px',
+                'type' => 'radio',
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];
+
+return $config;

+ 27 - 0
src/place/source/manage/content_media.php

@@ -0,0 +1,27 @@
+<?php
+$config = [
+    'update' => [
+        'field'    => [
+            'file' => [
+                'tips' => '可以直接填入文件远程地址,支持视频、音频、图片、office、文本等等格式',
+                'name' => '文件',
+                'project' => 'place',
+                'type' => 'upload',
+                'upload' => '9',
+                'multiple' => false,
+                'style' => 'input',
+                'upload_name' => 'name',
+            ],
+            'name' => [
+                'rules' => true,
+            ],
+            'status' => [
+                'width' => '60px',
+                'type' => 'radio',
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];
+
+return $config;

+ 50 - 9
src/place/source/manage/info.php

@@ -25,12 +25,18 @@ $config = [
             'type' => [
                 'width' => '100px',
             ],
-            'view' => [
-                'width' => '100px',
-            ],
             'price' => [
                 'show' => 'Dever::call("Psource/Manage/Lib/Info.getPrice", {id})',
             ],
+            'show_page' => [
+                'name' => '展示',
+                'type' => 'popover',
+                'location' => 'right',
+                'align' => 'center',
+                'tag' => true,
+                'show' => 'Dever::call("Psource/Manage/Lib/Info.getView", {id})',
+                'width' => '100px',
+            ],
             'status' => [
                 'type' => 'switch',
                 'show'  => '{status}',
@@ -61,7 +67,7 @@ $config = [
                     # 打开新页面
                     //'open' => true,
                 ],
-            ]],
+            ],'', 'show_content=1'],
         ],
         # 更多按钮
         /*
@@ -88,7 +94,7 @@ $config = [
                 'option'    => 'Dever::call("Psource/Manage/Lib/Cate.getList")',
             ],
             'type',
-            'view',
+            'show_page',
             'status',
         ],
     ],
@@ -106,12 +112,13 @@ $config = [
         'tab' => [
             '基本信息' => [
                 ['name' => 12, 'cate' => 12],
-                ['type' => 12, 'view' => 12],
+                ['type' => 12, 'collect' => 12],
                 ['pic' => 24],
                 ['info' => 24],
                 ['content' => 24],
             ],
             '价格设置' => 'spec_type,psource/sku,psource/sku#',
+            '展示设置' => 'show_page,show_content,show_submit,show_sell,num_sell_add',
             '限制设置' => 'have_vip',
             //'奖励设置' => 'psource/info_benefit',
         ],
@@ -124,12 +131,17 @@ $config = [
 
             'type' => [
                 'type' => 'radio',
-                'tip' => '实物:需填写快递单号发货,如在实体店中购买且实体店有货,用户下单时可以选择自提<br />虚拟:需填写券码、网址等发货<br />服务:支付后将生成服务码,服务商完成服务后输入用户服务码完成订单<br />不发货:支付后将自动完成订单,可用于解锁内容和功能',
+                'tip' => '实物:需填写快递单号发货,如在实体店中购买且实体店有货,用户下单时可以选择自提,会收集用户收货信息
+                    <br />虚拟:需填写券码、网址等发货,默认不收集用户信息
+                    
+                    <br />不发货:支付后将自动完成订单,可用于解锁内容和功能,默认不收集用户信息',
+
+                    //<br />服务:支付后将生成服务码,服务商完成服务后输入用户服务码完成订单
             ],
 
-            'view' => [
+            'collect' => [
                 'type' => 'select',
-                'tip' => '用户查看资源详情时默认进入的页面,详情页将进入首个或者上次进入的详情',
+                'tip' => '用户下单时会自动进行用户信息收集',
             ],
 
             'cate' => [
@@ -141,6 +153,7 @@ $config = [
             'pic' => [
                 'type' => 'upload',
                 'upload' => '1',
+                'project' => 'place',
                 'multiple' => true,
                 'style' => 'pic',
             ],
@@ -152,6 +165,7 @@ $config = [
             ],
             'content' => [
                 'type' => 'editor',
+                'project' => 'place',
                 'editorMenu' => [
                     'uploadImage' => 1,
                     'uploadVideo' => 3,
@@ -211,6 +225,33 @@ $config = [
                 'tip' => '用户购买资源后并确认收货后,将发放奖励到权益中',
                 'where'  => ['info_id' => 'id'],
             ],
+
+            'show_page' => [
+                'type' => 'radio',
+                'desc' => '用户查看资源时进入的页面。
+                <br />资源介绍页:默认页面,资源详情介绍页面
+                <br />内容列表页:按照排序进入,最新内容类别下的内容列表页
+                <br />内容详情页:按照排序进入,最新内容类别下最新的内容详情页',
+            ],
+
+            'show_content' => [
+                'type' => 'radio',
+                'desc' => '设置之后,可以在资源介绍页查看内容',
+            ],
+
+            'show_submit' => [
+                'type' => 'radio',
+                'desc' => '是否展示下单按钮',
+            ],
+
+            'show_sell' => [
+                'type' => 'radio',
+                'desc' => '是否展示销量数字',
+            ],
+
+            'num_sell_add' => [
+                'desc' => '设置默认销量',
+            ],
         ],
     ],
 ];

+ 1 - 0
src/place/source/manage/sku.php

@@ -8,6 +8,7 @@ return [
             ],
             'pic' => [
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '1',
                 'multiple' => false,
                 'style' => 'spic',

+ 14 - 10
src/place/source/table/content.php

@@ -14,8 +14,13 @@ return [
             'default'   => '-1',
         ],
 
+        'channel_id' => [
+            'name'      => '类别',
+            'type'      => 'int(11)',
+        ],
+
         'cate_id' => [
-            'name'      => '分类',
+            'name'      => '章节',
             'type'      => 'int(11)',
             'default'   => '-1',
         ],
@@ -57,19 +62,14 @@ return [
             'type'      => 'varchar(500)',
         ],
 
-        'link' => [
-            'name'      => '跳转链接',
-            'type'      => 'varchar(500)',
-        ],
-
         'content'       => [
-            'name'      => '内容',
+            'name'      => '详情',
             'type'      => 'text',
         ],
 
-        'attachment'       => [
-            'name'      => '附件',
-            'type'      => 'text',
+        'udate' => [
+            'name'      => '更新时间',
+            'type'      => 'int(11)',
         ],
 
         'sort' => [
@@ -88,4 +88,8 @@ return [
             ],
         ],
     ],
+
+    'index' => [
+        'search' => 'info_id,channel_id,cate_id,status,sort',
+    ],
 ];

+ 6 - 2
src/place/source/table/content_cate.php

@@ -1,6 +1,6 @@
 <?php
 return [
-    'name' => '内容分类表',
+    'name' => '内容章节表',
     'partition' => 'Dever::call("Manage/Lib/Util.system")',
     'order' => 'sort asc',
     'struct' => [
@@ -8,8 +8,12 @@ return [
             'name'      => '资源',
             'type'      => 'int(11)',
         ],
+        'channel_id' => [
+            'name'      => '类别',
+            'type'      => 'int(11)',
+        ],
         'name' => [
-            'name'      => '分类名称',
+            'name'      => '章节名称',
             'type'      => 'varchar(32)',
         ],
         'status' => [

+ 30 - 0
src/place/source/table/content_channel.php

@@ -0,0 +1,30 @@
+<?php
+return [
+    'name' => '内容类别表',
+    'partition' => 'Dever::call("Manage/Lib/Util.system")',
+    'order' => 'sort asc,id asc',
+    'struct' => [
+        'info_id' => [
+            'name'      => '资源',
+            'type'      => 'int(11)',
+        ],
+        'name' => [
+            'name'      => '类别名称',
+            'type'      => 'varchar(32)',
+        ],
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '展示',
+                2 => '不展示',
+            ],
+        ],
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 38 - 0
src/place/source/table/content_data.php

@@ -0,0 +1,38 @@
+<?php
+return [
+    'name' => '资源内容附件表',
+    'partition' => 'Dever::call("Manage/Lib/Util.system")',
+    'order' => 'sort asc, id asc',
+    'struct' => [
+        'content_id' => [
+            'name'      => '资源内容',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '标题',
+            'type'      => 'varchar(32)',
+        ],
+
+        'file'       => [
+            'name'      => '文件',
+            'type'      => 'varchar(300)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '展示',
+                2 => '不展示',
+            ],
+        ],
+    ],
+];

+ 38 - 0
src/place/source/table/content_link.php

@@ -0,0 +1,38 @@
+<?php
+return [
+    'name' => '资源内容链接表',
+    'partition' => 'Dever::call("Manage/Lib/Util.system")',
+    'order' => 'sort asc, id asc',
+    'struct' => [
+        'content_id' => [
+            'name'      => '资源内容',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '标题',
+            'type'      => 'varchar(32)',
+        ],
+
+        'link'       => [
+            'name'      => '链接',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '展示',
+                2 => '不展示',
+            ],
+        ],
+    ],
+];

+ 38 - 0
src/place/source/table/content_media.php

@@ -0,0 +1,38 @@
+<?php
+return [
+    'name' => '资源内容多媒体表',
+    'partition' => 'Dever::call("Manage/Lib/Util.system")',
+    'order' => 'sort asc, id asc',
+    'struct' => [
+        'content_id' => [
+            'name'      => '资源内容',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '标题',
+            'type'      => 'varchar(32)',
+        ],
+
+        'file'       => [
+            'name'      => '文件',
+            'type'      => 'varchar(300)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '展示',
+                2 => '不展示',
+            ],
+        ],
+    ],
+];

+ 71 - 46
src/place/source/table/info.php

@@ -46,50 +46,25 @@ return [
             'value'     => [
                 1 => '实物',//需手动或者自动发货,如果有实体店,用户下单时可以选择上门取货还是快递发货
                 2 => '虚拟',//需手动或者自动发货
-                3 => '服务',
+                //3 => '服务',
                 10 => '不发货',//不发货,用户购买后就完成订单
             ],
         ],
 
-        # 审核返积分,适合任务类型的资源,后续完善
-        'audit' => [
-            'name'      => '审核',
-            'type'      => 'tinyint(1)',
-            'default'   => 3,
-            'value'     => [
-                1 => '需手动审核',
-                //2 => '自动审核',
-                3 => '无需审核',
-            ],
-        ],
-
-        'view' => [
-            'name'      => '展示',
+        'collect' => [
+            'name'      => '收集信息',
             'type'      => 'tinyint(1)',
             'default'   => 1,
             'value'     => [
-                1 => '资源介绍页',
-                2 => '内容列表页',
-                3 => '内容详情页',
-                4 => '功能列表页',
-                5 => '功能详情页',
+                1 => '根据类型收集信息',
+                2 => '收集用户收货信息',
+                //3 => '收集自定义信息',
             ],
         ],
 
-        'site'       => [
-            'name'      => '网址',
-            'type'      => 'varchar(2000)',
-        ],
-
         'pic' => [
             'name'      => '主图',
-            'type'      => 'varchar(2000)',
-        ],
-
-        'sort' => [
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
+            'type'      => 'text',
         ],
 
         'content'       => [
@@ -108,11 +83,6 @@ return [
             ],
         ],
 
-        'ad' => [
-            'name'      => '广告折扣',
-            'type'      => 'int(11)',
-        ],
-
         'price' => [
             'name'      => '售价',
             'type'      => 'decimal(11,2)',
@@ -129,28 +99,83 @@ return [
             'value'    => 'Dever::call("Prole/Manage/Lib/Data.getList")',
         ],
 
-        'num_sell' => [
-            'name'      => '销售数量',
+        'num_sell_add' => [
+            'name'      => '虚拟销量',
             'type'      => 'int(11)',
             'default'   => '0',
         ],
 
-        'num_collet' => [
-            'name'      => '收藏数量',
+        'num_sell' => [
+            'name'      => '销售数量',
             'type'      => 'int(11)',
             'default'   => '0',
         ],
 
-        'num_review' => [
-            'name'      => '评价数量',
+        # 审核返积分,适合任务类型的资源,后续完善
+        'audit' => [
+            'name'      => '审核',
+            'type'      => 'tinyint(1)',
+            'default'   => 3,
+            'value'     => [
+                1 => '需手动审核',
+                //2 => '自动审核',
+                3 => '无需审核',
+            ],
+        ],
+
+        'show_page' => [
+            'name'      => '展示页面',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '资源介绍页',
+                2 => '内容列表页',
+                3 => '内容详情页',
+                //4 => '功能列表页',
+                //5 => '功能详情页',
+            ],
+        ],
+
+        'show_submit' => [
+            'name'      => '下单按钮',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '显示',
+                2 => '不显示',
+            ],
+        ],
+
+        'show_sell' => [
+            'name'      => '销量展示',
+            'type'      => 'tinyint(1)',
+            'default'   => 2,
+            'value'     => [
+                1 => '显示',
+                2 => '不显示',
+            ],
+        ],
+
+        'show_content'       => [
+            'name'      => '内容展示',
+            'type'      => 'tinyint(1)',
+            'default'   => 2,
+            'value'     => [
+                1 => '显示',
+                2 => '不显示',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
             'type'      => 'int(11)',
-            'default'   => '0',
+            'default'   => '1',
         ],
         
         'status' => [
             'name'      => '状态',
             'type'      => 'tinyint(1)',
-            'default'   => 1,
+            'default'   => 2,
             'value'     => [
                 1 => '上架',
                 2 => '下架',
@@ -159,6 +184,6 @@ return [
     ],
 
     'index' => [
-        'search' => 'channel_id,cate_parent_id,cate_child_id,status',
+        'search' => 'channel_id,cate_parent_id,cate_child_id,status,sort',
     ],
 ];

+ 1 - 0
src/place/user/manage/Lib/Excel.php

@@ -145,5 +145,6 @@ class Excel
                 }
             }
         }
+        @unlink($file);
     }
 }

+ 2 - 2
src/place/user/manage/gift.php

@@ -7,10 +7,10 @@ return [
             'gift_id' => [
             ],
             'value' => [
-                'show' => 'Dever::call("Puser/gift.getValueDesc", ["{gift_id}", "{value}"])',
+                'show' => 'Dever::call("Puser/Lib/Gift.getValueDesc", ["{gift_id}", "{value}"])',
             ],
             'used' => [
-                'show' => 'Dever::call("Puser/gift.getValueDesc", ["{gift_id}", "{used}"])',
+                'show' => 'Dever::call("Puser/Lib/Gift.getValueDesc", ["{gift_id}", "{used}"])',
             ],
             'use_status',
             'status' => '',

+ 1 - 1
src/place/user/manage/gift_log.php

@@ -8,7 +8,7 @@ return [
                 
             ],
             'value' => [
-                'show' => 'Dever::call("Puser/gift.getValueDesc", ["{gift_id}", "{value}"])',
+                'show' => 'Dever::call("Puser/Lib/Gift.getValueDesc", ["{gift_id}", "{value}"])',
             ],
             'order_type',
             'order_id' => [

+ 2 - 2
src/place/user/manage/perk.php

@@ -8,12 +8,12 @@ return [
             ],
             'perk_code' => [
                 'name' => '兑换码',
-                'show' => 'Dever::call("Puser/perk.getCode", ["{perk_code_id}"])',
+                'show' => 'Dever::call("Puser/Lib/perk.getCode", ["{perk_code_id}"])',
             ],
             'source',
             'total' => [
                 'name' => '总权益',
-                'show' => 'Dever::call("Puser/perk.getCodeTotal", ["{perk_code_id}"])',
+                'show' => 'Dever::call("Puser/Lib/Perk.getCodeTotal", ["{perk_code_id}"])',
             ],
             'num' => [
                 'name' => '剩余权益',

+ 1 - 0
src/place/user/manage/user.php

@@ -187,6 +187,7 @@ $config = [
             
             'avatar' => [
                 'type' => 'upload',
+                'project' => 'place',
                 'upload' => '1',
                 'multiple' => false,
                 'style' => 'pic',

+ 1 - 1
src/sector/table/delivery.php

@@ -32,7 +32,7 @@ return [
         'value' => [
             # 自配送 & 自提
             //'"上门自提", "self_pickup", 1,' . DEVER_TIME,
-            //'"商家自配", "self_delivery", 1,' . DEVER_TIME,
+            '"商家自配", "self_delivery", 1,' . DEVER_TIME,
 
             # 实物发货
             '"顺丰", "SF", 1,' . DEVER_TIME,