diff --git a/CHANGELOG.md b/CHANGELOG.md index a884b950..9914dcf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### [v1.4.5](https://gitee.com/koogua/course-tencent-cloud/releases/v1.4.5)(2021-09-27) + +- 修正点击内容分享到微信会额外出现公众号二维码的问题 +- 调整登录限制(邮箱|手机)为注册限制 +- 调整订单发货为每一分钟执行一次 +- 增加微信公众号支付处理 +- 增加取消订单功能 +- 优化计划任务 + ### [v1.4.4](https://gitee.com/koogua/course-tencent-cloud/releases/v1.4.4)(2021-09-17) - 后台增加邮件手机登录选择配置 diff --git a/app/Console/Tasks/DeliverTask.php b/app/Console/Tasks/DeliverTask.php index fd868471..dd741203 100644 --- a/app/Console/Tasks/DeliverTask.php +++ b/app/Console/Tasks/DeliverTask.php @@ -293,11 +293,11 @@ class DeliverTask extends Task * @param int $limit * @return ResultsetInterface|Resultset|TaskModel[] */ - protected function findTasks($limit = 30) + protected function findTasks($limit = 100) { $itemType = TaskModel::TYPE_DELIVER; $status = TaskModel::STATUS_PENDING; - $createTime = strtotime('-3 days'); + $createTime = strtotime('-1 days'); return TaskModel::query() ->where('item_type = :item_type:', ['item_type' => $itemType]) diff --git a/app/Console/Tasks/NoticeTask.php b/app/Console/Tasks/NoticeTask.php index bfe774d5..1f8eac73 100644 --- a/app/Console/Tasks/NoticeTask.php +++ b/app/Console/Tasks/NoticeTask.php @@ -84,7 +84,7 @@ class NoticeTask extends Task $task->update(); - $logger->info('Notice Process Exception ' . kg_json_encode([ + $logger->error('Notice Process Exception ' . kg_json_encode([ 'file' => $e->getFile(), 'line' => $e->getLine(), 'message' => $e->getMessage(), diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 2ff1ef67..69450293 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -1205,7 +1205,7 @@ class AuthNode extends Service ], [ 'id' => '5-1-12', - 'title' => '登录设置', + 'title' => '注册登录', 'type' => 'menu', 'route' => 'admin.setting.oauth', ], diff --git a/app/Http/Admin/Views/setting/oauth.volt b/app/Http/Admin/Views/setting/oauth.volt index a7116e16..22b7627b 100644 --- a/app/Http/Admin/Views/setting/oauth.volt +++ b/app/Http/Admin/Views/setting/oauth.volt @@ -4,7 +4,7 @@
diff --git a/app/Services/Logic/Account/OAuthProvider.php b/app/Services/Logic/Account/OAuthProvider.php index 20b25662..6b63763d 100644 --- a/app/Services/Logic/Account/OAuthProvider.php +++ b/app/Services/Logic/Account/OAuthProvider.php @@ -21,8 +21,8 @@ class OAuthProvider extends LogicService return [ 'local' => [ - 'login_with_phone' => $local['login_with_phone'], - 'login_with_email' => $local['login_with_email'], + 'register_with_phone' => $local['register_with_phone'], + 'register_with_email' => $local['register_with_email'], ], 'weixin' => ['enabled' => $weixin['enabled']], 'weibo' => ['enabled' => $weibo['enabled']], diff --git a/app/Services/Logic/Order/OrderInfo.php b/app/Services/Logic/Order/OrderInfo.php index e8ee03f1..9bc159e9 100644 --- a/app/Services/Logic/Order/OrderInfo.php +++ b/app/Services/Logic/Order/OrderInfo.php @@ -75,11 +75,13 @@ class OrderInfo extends LogicService { $result = [ 'allow_pay' => 0, + 'allow_cancel' => 0, 'allow_refund' => 0, ]; if ($order->status == OrderModel::STATUS_PENDING) { $result['allow_pay'] = 1; + $result['allow_cancel'] = 1; } if ($order->status == OrderModel::STATUS_FINISHED) { diff --git a/config/errors.php b/config/errors.php index 7b48669d..6b283efb 100644 --- a/config/errors.php +++ b/config/errors.php @@ -369,6 +369,7 @@ $error['order.item_not_found'] = '商品不存在'; $error['order.trade_expired'] = '交易已过期'; $error['order.has_bought_course'] = '已经购买过该课程'; $error['order.has_bought_package'] = '已经购买过该套餐'; +$error['order.cancel_not_allowed'] = '当前不允许取消订单'; $error['order.close_not_allowed'] = '当前不允许关闭订单'; $error['order.refund_not_allowed'] = '当前不允许申请退款'; $error['order.refund_item_unsupported'] = '该品类不支持退款'; diff --git a/db/migrations/20210917093354.php b/db/migrations/20210917093354.php index fd513a96..08a64015 100644 --- a/db/migrations/20210917093354.php +++ b/db/migrations/20210917093354.php @@ -14,6 +14,7 @@ class V20210917093354 extends Phinx\Migration\AbstractMigration { $this->alterConnectTable(); $this->alterWechatSubscribeTable(); + $this->handleLocalAuthSetting(); } protected function alterConnectTable() @@ -91,4 +92,22 @@ class V20210917093354 extends Phinx\Migration\AbstractMigration $table->save(); } + protected function handleLocalAuthSetting() + { + $rows = [ + [ + 'section' => 'oauth.local', + 'item_key' => 'register_with_phone', + 'item_value' => '1', + ], + [ + 'section' => 'oauth.local', + 'item_key' => 'register_with_email', + 'item_value' => '1', + ] + ]; + + $this->table('kg_setting')->insert($rows)->save(); + } + } diff --git a/public/static/home/js/article.share.js b/public/static/home/js/article.share.js index 8fc93236..1845f6ad 100644 --- a/public/static/home/js/article.share.js +++ b/public/static/home/js/article.share.js @@ -10,16 +10,16 @@ layui.use(['jquery', 'helper'], function () { qrcode: $('input[name="share.qrcode"]').val() }; - $('.icon-wechat').on('click', function () { + $('.share-wechat').on('click', function () { helper.wechatShare(myShare.qrcode); }); - $('.icon-qq').on('click', function () { + $('.share-qq').on('click', function () { var title = '推荐一篇好文章:' + myShare.title + ',快来和我一起学习吧!'; helper.qqShare(title, myShare.url, myShare.pic); }); - $('.icon-weibo').on('click', function () { + $('.share-weibo').on('click', function () { var title = '推荐一篇好文章:' + myShare.title + ',快来和我一起学习吧!'; helper.weiboShare(title, myShare.url, myShare.pic); }); diff --git a/public/static/home/js/course.share.js b/public/static/home/js/course.share.js index 3ca96c2b..a2e69bfa 100644 --- a/public/static/home/js/course.share.js +++ b/public/static/home/js/course.share.js @@ -10,16 +10,16 @@ layui.use(['jquery', 'helper'], function () { qrcode: $('input[name="share.qrcode"]').val() }; - $('.icon-wechat').on('click', function () { + $('.share-wechat').on('click', function () { helper.wechatShare(myShare.qrcode); }); - $('.icon-qq').on('click', function () { + $('.share-qq').on('click', function () { var title = '推荐一门好课:' + myShare.title + ',快来和我一起学习吧!'; helper.qqShare(title, myShare.url, myShare.pic); }); - $('.icon-weibo').on('click', function () { + $('.share-weibo').on('click', function () { var title = '推荐一门好课:' + myShare.title + ',快来和我一起学习吧!'; helper.weiboShare(title, myShare.url, myShare.pic); }); diff --git a/public/static/home/js/order.info.js b/public/static/home/js/order.info.js new file mode 100644 index 00000000..8dfb9e4e --- /dev/null +++ b/public/static/home/js/order.info.js @@ -0,0 +1,27 @@ +layui.use(['jquery', 'layer', 'helper'], function () { + + var $ = layui.jquery; + var layer = layui.layer; + + var index = parent.layer.getFrameIndex(window.name); + + parent.layer.iframeAuto(index); + + $('.order-cancel').on('click', function () { + var url = $(this).data('url'); + var data = {sn: $(this).data('sn')}; + layer.confirm('确定要取消订单吗?', function () { + $.ajax({ + type: 'POST', + url: url, + data: data, + success: function () { + layer.msg('取消订单成功', {icon: 1}); + parent.layer.close(index); + top.location.href = '/uc/orders'; + } + }); + }); + }); + +}); \ No newline at end of file diff --git a/public/static/home/js/question.share.js b/public/static/home/js/question.share.js index 5096f92e..83ed9580 100644 --- a/public/static/home/js/question.share.js +++ b/public/static/home/js/question.share.js @@ -10,16 +10,16 @@ layui.use(['jquery', 'helper'], function () { qrcode: $('input[name="share.qrcode"]').val() }; - $('.icon-wechat').on('click', function () { + $('.share-wechat').on('click', function () { helper.wechatShare(myShare.qrcode); }); - $('.icon-qq').on('click', function () { + $('.share-qq').on('click', function () { var title = '分享一个好问题:' + myShare.title + ',快来和我一起学习吧!'; helper.qqShare(title, myShare.url, myShare.pic); }); - $('.icon-weibo').on('click', function () { + $('.share-weibo').on('click', function () { var title = '分享一个好问题:' + myShare.title + ',快来和我一起学习吧!'; helper.weiboShare(title, myShare.url, myShare.pic); }); diff --git a/public/static/home/js/user.share.js b/public/static/home/js/user.share.js index e44e90e3..281bd947 100644 --- a/public/static/home/js/user.share.js +++ b/public/static/home/js/user.share.js @@ -10,16 +10,16 @@ layui.use(['jquery', 'helper'], function () { qrcode: $('input[name="share.qrcode"]').val() }; - $('.icon-wechat').on('click', function () { + $('.share-wechat').on('click', function () { helper.wechatShare(myShare.qrcode); }); - $('.icon-qq').on('click', function () { + $('.share-qq').on('click', function () { var title = '推荐一个有趣的朋友:' + myShare.title + ',快来和Ta一起学习吧!'; helper.qqShare(title, myShare.url, myShare.pic); }); - $('.icon-weibo').on('click', function () { + $('.share-weibo').on('click', function () { var title = '推荐一个有趣的朋友:' + myShare.title + ',快来和Ta一起学习吧!'; helper.weiboShare(title, myShare.url, myShare.pic); }); diff --git a/public/static/lib/layui/extends/helper.js b/public/static/lib/layui/extends/helper.js index 2b475f15..2c3c686b 100644 --- a/public/static/lib/layui/extends/helper.js +++ b/public/static/lib/layui/extends/helper.js @@ -29,15 +29,6 @@ layui.define(['jquery', 'layer'], function (exports) { callback(); }; - helper.cs = function () { - layer.open({ - type: 2, - title: '在线客服', - area: ['600px', '570px'], - content: ['/im/cs', 'no'] - }); - }; - helper.wechatShare = function (qrcode) { var content = '
分享到微信
'; layer.open({ diff --git a/scheduler.php b/scheduler.php index cf8d5ffe..70217971 100644 --- a/scheduler.php +++ b/scheduler.php @@ -16,28 +16,28 @@ $script = __DIR__ . '/console.php'; $bin = '/usr/local/bin/php'; $scheduler->php($script, $bin, ['--task' => 'deliver', '--action' => 'main']) - ->at('*/3 * * * *'); + ->everyMinute(); $scheduler->php($script, $bin, ['--task' => 'vod_event', '--action' => 'main']) - ->at('*/5 * * * *'); + ->everyMinute(5); $scheduler->php($script, $bin, ['--task' => 'sync_learning', '--action' => 'main']) - ->at('*/7 * * * *'); + ->everyMinute(7); $scheduler->php($script, $bin, ['--task' => 'teacher_live_notice', '--action' => 'consume']) - ->at('*/10 * * * *'); + ->everyMinute(9); $scheduler->php($script, $bin, ['--task' => 'point_gift_deliver', '--action' => 'main']) - ->at('*/11 * * * *'); + ->everyMinute(11); $scheduler->php($script, $bin, ['--task' => 'server_monitor', '--action' => 'main']) - ->at('*/12 * * * *'); + ->everyMinute(12); $scheduler->php($script, $bin, ['--task' => 'close_trade', '--action' => 'main']) - ->at('*/13 * * * *'); + ->everyMinute(13); $scheduler->php($script, $bin, ['--task' => 'close_flash_sale_order', '--action' => 'main']) - ->at('*/15 * * * *'); + ->everyMinute(15); $scheduler->php($script, $bin, ['--task' => 'notice', '--action' => 'main']) ->everyMinute();