diff --git a/README.md b/README.md index 22a6034c15b009506fe4073f71d9a7c8fc9c4a8d..abfadbd8c7dc60a4ddaf224941ebf7303a7ca69e 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 1578f03631ca47eee3ba4a2c5db89ced6e191d88..ae1f707687133f854104b6e085c38f660cf6441b 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 d48223de2da4c9aeb564049025bf0a8b5fe49338..a233c1a5eb10309d9ccf546dcc6a7e2488a99ca4 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 8adbc36e247c8102e72698af3e9a1ed5de43239a..af1f41aa919eca1e11aea39b63fa442ec5906dcc 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 7e55f3da82d7a8d1725066fcff9f10ce4c016aba..f792a4658deb1880a9ab87b9c6f0101de9d61b47 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 a8600332cb6584af7d69ab87c4f8ca197ce4da2f..13bb53fb1e2c98077ac3fb64a175dbe297f26405 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 b6094d6ee0ac13cba0505d116e030b1f9bf1acfb..053d3e1f155e11dfee7d85c546e3e41db4219357 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/Admin/Views/course/add.volt b/app/Http/Admin/Views/course/add.volt index 66a731bf84edec7264d4ee5534a93f5c4b0c3eca..a90cd2e721a0fe07a682ccccd7e1e3459e0b6049 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 9580510d3a48d53304a2a2b00bc10a256518ccc6..450a3641828e609245bd902d19478ba1b07f9532 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 06be131d105d9289f23aa9b7c6f9781c7f652b84..9a8d09353b84588f8fefdddcb46e5ee323cab73c 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 14e7bf66d53208fe2cb835afe7e58ff88f9a4d67..beb2c4f91b8a63bca0e4a99c881feadca605a76c 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 78b8e630a9687a872bf7a8ddbacec8110751c006..3081977904a1442f3aab1049f1500ae1202ebf30 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/Controllers/OrderController.php b/app/Http/Home/Controllers/OrderController.php index 9f4550cb5e60e289cc4522477bfa1aadf2451af6..591c8187fec3138b34d4aee792146c34a83823ad 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 50e176ddde5f24bca8658dfed275267a7c909620..629fc9868341b788ce05d9e30e6c55553f4787ae 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 33b78cd59bb7b894f3cbeb4368ebee62e2cc1777..c4472b16945bed6e8ffb0f5e1146f2b1a76158fe 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 5b0cf1442575df7803d4eb34641a59c6232daef2..16bca937f47eb771268ebc298ca3682e95c1a80e 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'}) %} - - + {{ image('home/img/alipay.png') }} + {{ image('home/img/wxpay.png') }}