From 4157a75db6f309b180795b18b724e9d5c8a98244 Mon Sep 17 00:00:00 2001 From: koogua Date: Fri, 25 Sep 2020 10:35:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20LICE?= =?UTF-8?q?NSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index c5017de7..00000000 --- a/LICENSE +++ /dev/null @@ -1,5 +0,0 @@ -使用协议 - -1. 本系统属于强业务类型,非通用类库框架,不适合再次衍生发布。 -2. 在保留我们版权标识的前提下,用户可以修改以满足自己的需求,可以用于商业用途。 -3. 有限社区支持,用户对自己的行为负责。 \ No newline at end of file -- Gitee From 98a302e7962f72064d49b3c041257c77a5bb7ac0 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Fri, 25 Sep 2020 17:29:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=89=8D=E5=8F=B0?= =?UTF-8?q?=E6=94=AF=E4=BB=98=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=8B=A5=E5=B9=B2?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E8=A1=8C=E5=BF=AB=E6=8D=B7=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- app/Console/Tasks/SyncCourseIndexTask.php | 2 -- app/Console/Tasks/SyncGroupIndexTask.php | 2 -- app/Console/Tasks/SyncLearningTask.php | 2 -- app/Console/Tasks/SyncUserIndexTask.php | 2 -- app/Console/Tasks/UpgradeTask.php | 4 ++-- app/Http/Admin/Services/WxpayTest.php | 13 +++++++++++-- app/Http/Home/Controllers/OrderController.php | 5 ++++- app/Http/Home/Services/Trade.php | 13 ++++++++++++- app/Http/Home/Views/order/info.volt | 4 ++-- app/Http/Home/Views/order/pay.volt | 5 +++-- app/Http/Home/Views/partials/header.volt | 2 +- 12 files changed, 37 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 22a6034c..abfadbd8 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ #### 使用协议 -虽然尝试了解过开源协议,但是理解的模棱两可,干脆用自己的协议吧,算不算开源我也不很清楚。 +虽然尝试了解过开源协议,但是理解的模棱两可,干脆用自己的协议吧。 1. 本系统属于强业务类型,非通用类库框架,不适合再次衍生发布。 2. 在保留我们版权标识的前提下,用户可以修改以满足自己的需求,可以用于商业用途。 @@ -74,7 +74,7 @@ #### 有商业服务吗? -生存是一个问题,生存才能发展,我们为用户提供的服务包括: +生存才能发展,我们目前提供的服务包括: - 系统安装 - 系统定制 diff --git a/app/Console/Tasks/SyncCourseIndexTask.php b/app/Console/Tasks/SyncCourseIndexTask.php index 1578f036..ae1f7076 100644 --- a/app/Console/Tasks/SyncCourseIndexTask.php +++ b/app/Console/Tasks/SyncCourseIndexTask.php @@ -12,8 +12,6 @@ class SyncCourseIndexTask extends Task public function mainAction() { - $cache = $this->getCache(); - $redis = $this->getRedis(); $key = $this->getSyncKey(); diff --git a/app/Console/Tasks/SyncGroupIndexTask.php b/app/Console/Tasks/SyncGroupIndexTask.php index d48223de..a233c1a5 100644 --- a/app/Console/Tasks/SyncGroupIndexTask.php +++ b/app/Console/Tasks/SyncGroupIndexTask.php @@ -12,8 +12,6 @@ class SyncGroupIndexTask extends Task public function mainAction() { - $cache = $this->getCache(); - $redis = $this->getRedis(); $key = $this->getSyncKey(); diff --git a/app/Console/Tasks/SyncLearningTask.php b/app/Console/Tasks/SyncLearningTask.php index 8adbc36e..af1f41aa 100644 --- a/app/Console/Tasks/SyncLearningTask.php +++ b/app/Console/Tasks/SyncLearningTask.php @@ -16,8 +16,6 @@ class SyncLearningTask extends Task public function mainAction() { - $cache = $this->getCache(); - $redis = $this->getRedis(); $sync = new LearningSync(); diff --git a/app/Console/Tasks/SyncUserIndexTask.php b/app/Console/Tasks/SyncUserIndexTask.php index 7e55f3da..f792a465 100644 --- a/app/Console/Tasks/SyncUserIndexTask.php +++ b/app/Console/Tasks/SyncUserIndexTask.php @@ -12,8 +12,6 @@ class SyncUserIndexTask extends Task public function mainAction() { - $cache = $this->getCache(); - $redis = $this->getRedis(); $key = $this->getSyncKey(); diff --git a/app/Console/Tasks/UpgradeTask.php b/app/Console/Tasks/UpgradeTask.php index a8600332..13bb53fb 100644 --- a/app/Console/Tasks/UpgradeTask.php +++ b/app/Console/Tasks/UpgradeTask.php @@ -43,7 +43,7 @@ class UpgradeTask extends Task public function resetAnnotationAction() { $config = $this->getConfig(); - $cache = $this->getCache(); + $redis = $this->getRedis(); $dbIndex = $config->path('annotation.db'); @@ -74,7 +74,7 @@ class UpgradeTask extends Task public function resetMetadataAction() { $config = $this->getConfig(); - $cache = $this->getCache(); + $redis = $this->getRedis(); $dbIndex = $config->path('metadata.db'); diff --git a/app/Http/Admin/Services/WxpayTest.php b/app/Http/Admin/Services/WxpayTest.php index b6094d6e..053d3e1f 100644 --- a/app/Http/Admin/Services/WxpayTest.php +++ b/app/Http/Admin/Services/WxpayTest.php @@ -14,9 +14,18 @@ class WxpayTest extends PayTest { $wxpayService = new WxpayService(); - $qrcode = $wxpayService->scan($trade); + $code = $wxpayService->scan($trade); - return $qrcode ?: false; + $codeUrl = null; + + if ($code) { + $codeUrl = $this->url->get( + ['for' => 'home.qrcode'], + ['text' => urlencode($code)] + ); + } + + return $codeUrl ?: false; } public function status($tradeNo) diff --git a/app/Http/Home/Controllers/OrderController.php b/app/Http/Home/Controllers/OrderController.php index 9f4550cb..591c8187 100644 --- a/app/Http/Home/Controllers/OrderController.php +++ b/app/Http/Home/Controllers/OrderController.php @@ -67,7 +67,10 @@ class OrderController extends Controller $order = $service->handle(); - $location = $this->url->get(['for' => 'home.order.pay'], ['sn' => $order->sn]); + $location = $this->url->get( + ['for' => 'home.order.pay'], + ['sn' => $order->sn] + ); return $this->jsonSuccess(['location' => $location]); } diff --git a/app/Http/Home/Services/Trade.php b/app/Http/Home/Services/Trade.php index 50e176dd..629fc986 100644 --- a/app/Http/Home/Services/Trade.php +++ b/app/Http/Home/Services/Trade.php @@ -72,9 +72,20 @@ class Trade extends Service protected function getWxpayQrCode(TradeModel $trade) { + $qrCode = null; + $service = new WxpayService(); - return $service->scan($trade); + $text = $service->scan($trade); + + if ($text) { + $qrCode = $this->url->get( + ['for' => 'home.qrcode'], + ['text' => urlencode($text)] + ); + } + + return $qrCode; } } diff --git a/app/Http/Home/Views/order/info.volt b/app/Http/Home/Views/order/info.volt index 33b78cd5..c4472b16 100644 --- a/app/Http/Home/Views/order/info.volt +++ b/app/Http/Home/Views/order/info.volt @@ -21,10 +21,10 @@
- {% if order.status == 'pending' %} + {% if order.status == 1 %} 立即支付 {% endif %} - {% if (order.item_type in ['course','package']) and (order.status == 'finished') %} + {% if (order.item_type in [1,2]) and (order.status == 3) %} 申请退款 {% endif %}
diff --git a/app/Http/Home/Views/order/pay.volt b/app/Http/Home/Views/order/pay.volt index 5b0cf144..e188a029 100644 --- a/app/Http/Home/Views/order/pay.volt +++ b/app/Http/Home/Views/order/pay.volt @@ -2,6 +2,9 @@ {% block content %} + {% set create_url = url({'for':'home.trade.create'}) %} + {% set status_url = url({'for':'home.trade.status'}) %} +
- {% set create_url = url({'for':'home.trade.create'}) %} - {% set status_url = url({'for':'home.trade.status'}) %}
diff --git a/app/Http/Home/Views/partials/header.volt b/app/Http/Home/Views/partials/header.volt index 12376d7b..fbb2232b 100644 --- a/app/Http/Home/Views/partials/header.volt +++ b/app/Http/Home/Views/partials/header.volt @@ -27,7 +27,7 @@ 搜索
  • - 会员 + 会员
  • 微聊 -- Gitee From c89164cb058bc40afb5f7f2be183670ed69a3700 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Sat, 26 Sep 2020 18:14:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Views/course/add.volt | 2 +- app/Http/Admin/Views/course/list.volt | 2 +- app/Http/Admin/Views/course/search.volt | 2 +- app/Http/Admin/Views/setting/pay_wxpay.volt | 2 +- app/Http/Home/Controllers/Controller.php | 18 +++++----- app/Http/Home/Views/order/pay.volt | 4 +-- .../Home/Views/teacher/console/consults.volt | 2 +- .../Home/Views/teacher/console/courses.volt | 2 +- .../Home/Views/teacher/console/lives.volt | 2 +- app/Http/Home/Views/user/console/account.volt | 2 +- .../Home/Views/user/console/consults.volt | 2 +- app/Http/Home/Views/user/console/courses.volt | 2 +- .../Home/Views/user/console/favorites.volt | 2 +- app/Http/Home/Views/user/console/friends.volt | 2 +- app/Http/Home/Views/user/console/groups.volt | 2 +- app/Http/Home/Views/user/console/orders.volt | 2 +- app/Http/Home/Views/user/console/profile.volt | 2 +- app/Http/Home/Views/user/console/refunds.volt | 2 +- app/Http/Home/Views/user/console/reviews.volt | 2 +- app/Models/Audit.php | 5 +++ app/Models/Course.php | 2 +- app/Providers/Cookie.php | 7 ++++ app/Providers/Escaper.php | 4 +-- app/Services/Pay/Alipay.php | 1 + app/Validators/Category.php | 28 ++++++++------- app/Validators/Chapter.php | 34 ++++++++++++------- app/Validators/Course.php | 28 ++++++++------- app/Validators/Help.php | 26 +++++++------- app/Validators/ImGroup.php | 28 ++++++++------- app/Validators/Package.php | 28 ++++++++------- app/Validators/Page.php | 28 ++++++++------- app/Validators/Topic.php | 28 ++++++++------- app/Validators/User.php | 28 ++++++++------- public/static/home/css/common.css | 23 ++----------- public/static/home/js/order.pay.js | 5 ++- 35 files changed, 200 insertions(+), 159 deletions(-) diff --git a/app/Http/Admin/Views/course/add.volt b/app/Http/Admin/Views/course/add.volt index 66a731bf..a90cd2e7 100644 --- a/app/Http/Admin/Views/course/add.volt +++ b/app/Http/Admin/Views/course/add.volt @@ -11,7 +11,7 @@
    - +
    diff --git a/app/Http/Admin/Views/course/list.volt b/app/Http/Admin/Views/course/list.volt index 9580510d..450a3641 100644 --- a/app/Http/Admin/Views/course/list.volt +++ b/app/Http/Admin/Views/course/list.volt @@ -8,7 +8,7 @@ {% elseif value == 2 %} 直播 {% elseif value == 3 %} - 图文 + 专栏 {% endif %} {%- endmacro %} diff --git a/app/Http/Admin/Views/course/search.volt b/app/Http/Admin/Views/course/search.volt index 06be131d..9a8d0935 100644 --- a/app/Http/Admin/Views/course/search.volt +++ b/app/Http/Admin/Views/course/search.volt @@ -35,7 +35,7 @@
    - +
    diff --git a/app/Http/Admin/Views/setting/pay_wxpay.volt b/app/Http/Admin/Views/setting/pay_wxpay.volt index 14e7bf66..beb2c4f9 100644 --- a/app/Http/Admin/Views/setting/pay_wxpay.volt +++ b/app/Http/Admin/Views/setting/pay_wxpay.volt @@ -19,7 +19,7 @@
    - +
    diff --git a/app/Http/Home/Controllers/Controller.php b/app/Http/Home/Controllers/Controller.php index 78b8e630..30819779 100644 --- a/app/Http/Home/Controllers/Controller.php +++ b/app/Http/Home/Controllers/Controller.php @@ -3,7 +3,6 @@ namespace App\Http\Home\Controllers; use App\Caches\NavTreeList as NavCache; -use App\Caches\Setting as SettingCache; use App\Library\AppInfo as AppInfo; use App\Library\Seo as Seo; use App\Models\User as UserModel; @@ -116,9 +115,7 @@ class Controller extends \Phalcon\Mvc\Controller protected function getSiteInfo() { - $appService = new AppService(); - - return $appService->getSettings('site'); + return $this->getSettings('site'); } protected function getAppInfo() @@ -128,8 +125,6 @@ class Controller extends \Phalcon\Mvc\Controller protected function getImInfo() { - $cache = new SettingCache(); - $websocket = $this->getConfig()->get('websocket'); /** @@ -142,8 +137,8 @@ class Controller extends \Phalcon\Mvc\Controller } return [ - 'main' => $cache->get('im.main'), - 'cs' => $cache->get('im.cs'), + 'main' => $this->getSettings('im.main'), + 'cs' => $this->getSettings('im.cs'), 'ws' => $websocket, ]; } @@ -155,4 +150,11 @@ class Controller extends \Phalcon\Mvc\Controller return $appService->getConfig(); } + protected function getSettings($section) + { + $appService = new AppService(); + + return $appService->getSettings($section); + } + } diff --git a/app/Http/Home/Views/order/pay.volt b/app/Http/Home/Views/order/pay.volt index e188a029..16bca937 100644 --- a/app/Http/Home/Views/order/pay.volt +++ b/app/Http/Home/Views/order/pay.volt @@ -17,8 +17,8 @@ 支付金额:{{ '¥%0.2f'|format(order.amount) }}