582 lines
26 KiB
PHP
582 lines
26 KiB
PHP
<?php
|
|
|
|
|
|
namespace Yunshop\VideoShare;
|
|
|
|
|
|
use app\common\modules\shop\ShopConfig;
|
|
use Yunshop\VideoDemand\Listener\ChargeComplatedListener;
|
|
use Yunshop\VideoDemand\Listener\OrderReceiveListener;
|
|
use Yunshop\VideoShare\common\service\MemberCenterService;
|
|
use Yunshop\VideoShare\common\service\TimedTaskImportService;
|
|
use Yunshop\VideoShare\common\service\TimedTaskService;
|
|
|
|
class PluginApplication extends \app\common\services\PluginApplication
|
|
{
|
|
public function getMemberCenterConfig()
|
|
{
|
|
\app\common\modules\shop\MemberCenterConfig::current()->push('plugin_data',[
|
|
'code' => 'video-share',
|
|
'name' => '发现视频',
|
|
'sort' => 5,
|
|
'class' => '\Yunshop\VideoShare\common\member\MemberCenterVideoShare'
|
|
]);
|
|
}
|
|
|
|
public function storeAloneTempConfig()
|
|
{
|
|
\Yunshop\StoreAloneTemp\common\StoreAloneTempConfig::current()->push('navs',[
|
|
'sort' => 3,
|
|
'code' => 'video_share',
|
|
'name' => '发现视频',
|
|
'class' => '\Yunshop\VideoShare\common\member\StoreMemberCenterVideoShare',
|
|
]);
|
|
$set = \Setting::get('plugin.video-share');
|
|
if ($set['is_open']) {
|
|
\Yunshop\StoreAloneTemp\common\StoreAloneTempConfig::current()->push('plugins',[
|
|
'name' => 'video-share',
|
|
'title' => '发现视频',
|
|
'class' => 'icon-extension_video',
|
|
'url' => $set['list_style'] == 2 ? 'VideoDetail' : 'VideoList',
|
|
'image' => 'member_a(73).png',
|
|
'mini_url' => $set['list_style'] == 2 ? '/packageC/video_goods/VideoDetail/VideoDetail' : '/packageC/video_goods/VideoList/VideoList',
|
|
]);
|
|
}
|
|
}
|
|
|
|
public function getIncomePageItems()
|
|
{
|
|
return [
|
|
'video_share_income' => [
|
|
'class' => \Yunshop\VideoShare\common\service\IncomePageService::class,
|
|
'type' => 'marketing'
|
|
]
|
|
];
|
|
}
|
|
|
|
protected function setConfig()
|
|
{
|
|
\Config::set('widget.withdraw.tab_video_share', [
|
|
'title' => '发现视频',
|
|
'class' => \Yunshop\VideoShare\admin\withdrawWidget::class
|
|
]);
|
|
|
|
\app\common\modules\shop\ShopConfig::current()->set('get_video_access', [
|
|
'class' => 'Yunshop\VideoShare\common\service\ShopService',
|
|
'function' => 'getAccess'
|
|
]);
|
|
}
|
|
|
|
public function getIncomeItems()
|
|
{
|
|
return ['video_share' => [
|
|
'title' => '发现视频',
|
|
'type' => 'video_share_withdraw',
|
|
'class' => \Yunshop\VideoShare\common\model\Bonus::class,
|
|
'order_class' => '',
|
|
]];
|
|
}
|
|
|
|
public function getWidgetItems()
|
|
{
|
|
return ['withdraw.tab_video_share' => [
|
|
'title' => '视频分享',
|
|
'class' => 'Yunshop\VideoShare\widgets\WithdrawWidget'
|
|
]];
|
|
}
|
|
|
|
protected function setMenuConfig()
|
|
{
|
|
\app\backend\modules\menu\Menu::current()->setPluginMenu('video_share', [
|
|
'name' => '视频分享',
|
|
'type' => 'marketing',
|
|
'url' => 'plugin.video-share.admin.videoGoods.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'top_show' => 0,
|
|
'left_first_show' => 0,
|
|
'left_second_show' => 1,
|
|
'icon' => 'fa-list',
|
|
'list_icon' => 'share-chain',
|
|
'item' => 'video_share',
|
|
'parents' => [],
|
|
'child' => [
|
|
'video_goods_manage' => [
|
|
'name' => '发现管理',
|
|
'url' => 'plugin.video-share.admin.videoGoods.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_manage',
|
|
'parents' => ['video_share'],
|
|
'child' => [
|
|
'video_goods_search' => [
|
|
'name' => '搜索',
|
|
'url' => 'plugin.video-share.admin.video-goods.search',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_search',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_del' => [
|
|
'name' => '分红记录',
|
|
'url' => 'plugin.video-share.admin.video-goods.del',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_del',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_get_images' => [
|
|
'name' => '获取图片',
|
|
'url' => 'plugin.video-share.admin.set.get-images',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_get_images',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_preview' => [
|
|
'name' => '视频预览',
|
|
'url' => 'plugin.video-share.admin.video-goods.video',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_preview',
|
|
'parents' => ['video_share'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_status' => [
|
|
'name' => '审核',
|
|
'url' => 'plugin.video-share.admin.video-goods.changeStatus',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_status',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_video' => [
|
|
'name' => '预览视频',
|
|
'url' => 'plugin.video-share.admin.video-goods.video',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_video',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_recommend' => [
|
|
'name' => '推荐修改',
|
|
'url' => 'plugin.video-share.admin.video-goods.changeRecommend',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_recommend',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_category' => [
|
|
'name' => '分类修改',
|
|
'url' => 'plugin.video-share.admin.video-goods.changeCategory',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_category',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_title' => [
|
|
'name' => '标题修改',
|
|
'url' => 'plugin.video-share.admin.video-goods.edit-title',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_title',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_getGoodList' => [
|
|
'name' => '商品修改',
|
|
'url' => 'plugin.video-share.admin.video-goods.get-goods-list',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_getGoodList',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_good_video' => [
|
|
'name' => '更换视频',
|
|
'url' => 'plugin.video-share.admin.video-goods.upload-audio',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_good_video',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
'video_goods_change_url' => [
|
|
'name' => '更换视频地址',
|
|
'url' => 'plugin.video-share.admin.video-goods.change-url',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_change_good_video',
|
|
'parents' => ['video_share','video_goods_manage'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
'video_goods_bonus' => [
|
|
'name' => '分红记录',
|
|
'url' => 'plugin.video-share.admin.bonus.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_bonus',
|
|
'parents' => ['video_share'],
|
|
'child' => [
|
|
'video_goods_getListBySearch' => [
|
|
'name' => '搜索',
|
|
'url' => 'plugin.video-share.admin.bonus.getListBySearch',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_getListBySearch',
|
|
'parents' => ['video_share','video_goods_bonus'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
/*'diy_queue_log' => [
|
|
'name' => '奖励记录',
|
|
'url' => 'plugin.diy-queue.admin.diy-queue.award-log',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'diy_queue_log',
|
|
'parents' => ['diy_queue'],
|
|
'child' => [
|
|
|
|
]
|
|
],
|
|
'diy_queue_manage' => [
|
|
'name' => '队列管理',
|
|
'url' => 'plugin.diy-queue.admin.diy-queue-manage.manage',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'diy_queue_manage',
|
|
'parents' => ['diy_queue'],
|
|
'child' => [
|
|
'diy_queue_add' => [
|
|
'name' => '添加',
|
|
'url' => 'plugin.diy-queue.admin.diy-queue-manage.add',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'diy_queue_add',
|
|
'parents' => ['diy_queue', 'diy_queue_manage'],
|
|
'child' => []
|
|
],
|
|
'diy_queue_edit' => [
|
|
'name' => '修改',
|
|
'url' => 'plugin.diy-queue.admin.diy-queue-manage.edit',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'diy_queue_edit',
|
|
'parents' => ['diy_queue', 'diy_queue_manage'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],*/
|
|
'video_goods_set' => [
|
|
'name' => '基础设置',
|
|
'url' => 'plugin.video-share.admin.set.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_set',
|
|
'parents' => ['video_share'],
|
|
'child' => [
|
|
'video_members_search' => [
|
|
'name' => '会员搜索',
|
|
'url' => 'plugin.video-share.admin.set.get-member',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_set',
|
|
'parents' => ['video_share','video_goods_set'],
|
|
'child' => []
|
|
],
|
|
'videoShareGetImages' => [
|
|
'name' => '获取图片',
|
|
'url' => 'plugin.video-share.admin.set.get-images',
|
|
'url_params' => '',
|
|
'permit' => 0,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'videoShareGetImages',
|
|
'parents' => ['video_share', 'video_goods_set'],
|
|
],
|
|
'video_goods_pic' => [
|
|
'name' => '获取图片',
|
|
'url' => 'upload.uploadImage.getImage',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_pic',
|
|
'parents' => ['video_share', 'video_goods_set'],
|
|
],
|
|
|
|
'video_goods_sub' => [
|
|
'name' => '保存数据',
|
|
'url' => 'plugin.video-share.admin.set.sub',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_sub',
|
|
'parents' => ['video_share', 'video_goods_set'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
'video_goods_category' => [
|
|
'name' => '分类管理',
|
|
'url' => 'plugin.video-share.admin.category.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_category',
|
|
'parents' => ['video_share'],
|
|
'child' => [
|
|
'video_goods_category_search' => [
|
|
'name' => '分类搜索',
|
|
'url' => 'plugin.video-share.admin.category.search',
|
|
'url_params' => '',
|
|
'permit' => 0,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'video_goods_category_search',
|
|
'parents' => ['video_share', 'video_goods_category'],
|
|
],
|
|
'video_goods_category_edit' => [
|
|
'name' => '分类编辑',
|
|
'url' => 'plugin.video-share.admin.category.edit',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_category_edit',
|
|
'parents' => ['video_share', 'video_goods_category'],
|
|
],
|
|
|
|
'video_goods_category_del' => [
|
|
'name' => '分类删除',
|
|
'url' => 'plugin.video-share.admin.category.del',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_category_del',
|
|
'parents' => ['video_share', 'video_goods_category'],
|
|
'child' => []
|
|
],
|
|
|
|
'video_goods_category_change' => [
|
|
'name' => '分类上下架',
|
|
'url' => 'plugin.video-share.admin.category.changeStatus',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_category_change',
|
|
'parents' => ['video_share', 'video_goods_category'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
'video_comments_category' => [
|
|
'name' => '评论管理',
|
|
'url' => 'plugin.video-share.admin.video-comments.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_comments_category',
|
|
'parents' => ['video_share'],
|
|
'child' => [
|
|
'video_comments_search' => [
|
|
'name' => '评论列表',
|
|
'url' => 'plugin.video-share.admin.video-comments.get-comments-category-list',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_comments_search',
|
|
'parents' => ['video_share', 'video_comments_category'],
|
|
],
|
|
'video_goods_category_del' => [
|
|
'name' => '评论删除',
|
|
'url' => 'plugin.video-share.admin.video-comments.del',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_category_del',
|
|
'parents' => ['video_share', 'video_comments_category'],
|
|
'child' => []
|
|
],
|
|
'video_goods_display_comments' => [
|
|
'name' => '查看评论',
|
|
'url' => 'plugin.video-share.admin.video-comments.display-comments',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_display_comments',
|
|
'parents' => ['video_share','video_comments_category'],
|
|
'child' => []
|
|
],
|
|
'video_goods_get_display_comments_list' => [
|
|
'name' => '评论列表',
|
|
'url' => 'plugin.video-share.admin.video-comments.get-display-comments-list',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_get_display_comments_list',
|
|
'parents' => ['video_share','video_comments_category'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
'video_goods_center' => [
|
|
'name' => '短视频中心',
|
|
'url' => 'plugin.video-share.admin.center.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_center',
|
|
'parents' => ['video_share'],
|
|
'child' => [
|
|
'video_goods_center_goods_list' => [
|
|
'name' => '获取中台商品列表',
|
|
'url' => 'plugin.video-share.admin.center.goods-list',
|
|
'url_params' => '',
|
|
'permit' =>0,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'video_goods_center_goods_list',
|
|
'parents' => ['video_share','video_goods_center'],
|
|
'child' => []
|
|
],
|
|
'video_goods_center_member_list' => [
|
|
'name' => '获取会员列表',
|
|
'url' => 'plugin.video-share.admin.center.getMemberList',
|
|
'url_params' => '',
|
|
'permit' =>0,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'video_goods_center_member_list',
|
|
'parents' => ['video_share','video_goods_center'],
|
|
'child' => []
|
|
],
|
|
'video_goods_center_import' => [
|
|
'name' => '导入',
|
|
'url' => 'plugin.video-share.admin.center.select',
|
|
'url_params' => '',
|
|
'permit' =>1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_center_import',
|
|
'parents' => ['video_share','video_goods_center'],
|
|
'child' => []
|
|
],
|
|
'video_goods_center_all_import' => [
|
|
'name' => '全部导入',
|
|
'url' => 'plugin.video-share.admin.center.all-select',
|
|
'url_params' => '',
|
|
'permit' =>1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'video_goods_center_all_import',
|
|
'parents' => ['video_share','video_goods_center'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
]
|
|
]);
|
|
}
|
|
|
|
public function getFrontendWidgetConfig(): array
|
|
{
|
|
return [
|
|
'member_center.video-share' => MemberCenterService::class,
|
|
];
|
|
}
|
|
|
|
public function boot()
|
|
{
|
|
|
|
|
|
$events = app('events');
|
|
// 监听下单
|
|
$events->subscribe(\Yunshop\VideoShare\common\listeners\OrderCreatedListener::class);
|
|
|
|
// 监听完成
|
|
$events->subscribe(\Yunshop\VideoShare\common\listeners\OrderReceiveListener::class);
|
|
|
|
$events->subscribe(\Yunshop\VideoShare\common\listeners\VideoPublishListener::class);
|
|
|
|
//定时同步中台短视频
|
|
|
|
}
|
|
|
|
public function cronConfig()
|
|
{
|
|
\Event::listen('cron.collectJobs', function () {
|
|
\Cron::add('video-share-middle-update', '15 2 * * *', function () {
|
|
(new TimedTaskService())->handle();
|
|
});
|
|
\Cron::add('video-share-middle-insert', '0 0 * * *', function () {
|
|
(new TimedTaskImportService())->handle();
|
|
});
|
|
});
|
|
|
|
}
|
|
}
|