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/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/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..16bca937 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') }}