diff --git a/app/Console/Tasks/CleanAuthTokenTask.php b/app/Console/Tasks/CleanAuthTokenTask.php index f3de4d00..d982c998 100644 --- a/app/Console/Tasks/CleanAuthTokenTask.php +++ b/app/Console/Tasks/CleanAuthTokenTask.php @@ -33,8 +33,10 @@ class CleanAuthTokenTask extends Task */ protected function findAccessTokens() { + $expiryTime = strtotime('-30 days'); + return AccessTokenModel::query() - ->where('expiry_time < :expiry_time:', ['expiry_time' => time()]) + ->where('expiry_time < :expiry_time:', ['expiry_time' => $expiryTime]) ->execute(); } @@ -45,8 +47,10 @@ class CleanAuthTokenTask extends Task */ protected function findRefreshTokens() { + $expiryTime = strtotime('-30 days'); + return RefreshTokenModel::query() - ->where('expiry_time < :expiry_time:', ['expiry_time' => time()]) + ->where('expiry_time < :expiry_time:', ['expiry_time' => $expiryTime]) ->execute(); } diff --git a/app/Console/Tasks/CloseTradeTask.php b/app/Console/Tasks/CloseTradeTask.php index 0198423a..3d634679 100644 --- a/app/Console/Tasks/CloseTradeTask.php +++ b/app/Console/Tasks/CloseTradeTask.php @@ -3,8 +3,8 @@ namespace App\Console\Tasks; use App\Models\Trade as TradeModel; -use App\Services\Payment\Alipay as AlipayService; -use App\Services\Payment\Wxpay as WxpayService; +use App\Services\Pay\Alipay as AlipayService; +use App\Services\Pay\Wxpay as WxpayService; use Phalcon\Cli\Task; use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\ResultsetInterface; diff --git a/app/Console/Tasks/RefundTask.php b/app/Console/Tasks/RefundTask.php index e890759e..8880cf6c 100644 --- a/app/Console/Tasks/RefundTask.php +++ b/app/Console/Tasks/RefundTask.php @@ -11,8 +11,8 @@ use App\Repos\Order as OrderRepo; use App\Repos\Refund as RefundRepo; use App\Repos\Trade as TradeRepo; use App\Repos\User as UserRepo; -use App\Services\Payment\Alipay as AlipayService; -use App\Services\Payment\Wxpay as WxpayService; +use App\Services\Pay\Alipay as AlipayService; +use App\Services\Pay\Wxpay as WxpayService; use App\Services\Smser\Refund as RefundSmser; use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\ResultsetInterface; @@ -140,7 +140,7 @@ class RefundTask extends Task } if (!$response) { - throw new \RuntimeException('Payment Refund Failed'); + throw new \RuntimeException('Pay Refund Failed'); } } diff --git a/app/Http/Admin/Controllers/SessionController.php b/app/Http/Admin/Controllers/SessionController.php index 61f4e5fa..63d54311 100644 --- a/app/Http/Admin/Controllers/SessionController.php +++ b/app/Http/Admin/Controllers/SessionController.php @@ -39,7 +39,6 @@ class SessionController extends \Phalcon\Mvc\Controller $captcha = $settingService->getSectionSettings('captcha'); $this->view->pick('public/login'); - $this->view->setVar('captcha', $captcha); } diff --git a/app/Http/Admin/Controllers/SettingController.php b/app/Http/Admin/Controllers/SettingController.php index 2bb95dfa..c05e2673 100644 --- a/app/Http/Admin/Controllers/SettingController.php +++ b/app/Http/Admin/Controllers/SettingController.php @@ -139,9 +139,9 @@ class SettingController extends Controller } /** - * @Route("/payment", name="admin.setting.payment") + * @Route("/pay", name="admin.setting.pay") */ - public function paymentAction() + public function payAction() { $settingService = new SettingService(); @@ -157,14 +157,43 @@ class SettingController extends Controller } else { - $alipay = $settingService->getSectionSettings('payment.alipay'); - $wxpay = $settingService->getSectionSettings('payment.wxpay'); + $alipay = $settingService->getSectionSettings('pay.alipay'); + $wxpay = $settingService->getSectionSettings('pay.wxpay'); $this->view->setVar('alipay', $alipay); $this->view->setVar('wxpay', $wxpay); } } + /** + * @Route("/oauth", name="admin.setting.oauth") + */ + public function oauthAction() + { + $settingService = new SettingService(); + + if ($this->request->isPost()) { + + $section = $this->request->getPost('section'); + + $data = $this->request->getPost(); + + $settingService->updateSectionSettings($section, $data); + + return $this->jsonSuccess(['msg' => '更新配置成功']); + + } else { + + $qq = $settingService->getSectionSettings('oauth.qq'); + $weibo = $settingService->getSectionSettings('oauth.weibo'); + $weixin = $settingService->getSectionSettings('oauth.weixin'); + + $this->view->setVar('qq', $qq); + $this->view->setVar('weibo', $weibo); + $this->view->setVar('weixin', $weixin); + } + } + /** * @Route("/smser", name="admin.setting.smser") */ diff --git a/app/Http/Admin/Controllers/TestController.php b/app/Http/Admin/Controllers/TestController.php index 7ecd361b..02990141 100644 --- a/app/Http/Admin/Controllers/TestController.php +++ b/app/Http/Admin/Controllers/TestController.php @@ -72,7 +72,6 @@ class TestController extends Controller $obs->stream_code = substr($pushUrl, $position + 1); $this->view->pick('setting/live_push_test'); - $this->view->setVar('code_url', $codeUrl); $this->view->setVar('obs', $obs); } @@ -90,7 +89,6 @@ class TestController extends Controller $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); $this->view->pick('public/live_player'); - $this->view->setVar('m3u8_pull_urls', $m3u8PullUrls); $this->view->setVar('flv_pull_urls', $flvPullUrls); } @@ -183,8 +181,7 @@ class TestController extends Controller ); } - $this->view->pick('setting/payment_alipay_test'); - + $this->view->pick('setting/pay_alipay_test'); $this->view->setVar('trade_sn', $trade->sn); $this->view->setVar('code_url', $codeUrl); } @@ -236,8 +233,7 @@ class TestController extends Controller $this->db->rollback(); } - $this->view->pick('setting/payment_wxpay_test'); - + $this->view->pick('setting/pay_wxpay_test'); $this->view->setVar('trade_sn', $trade->sn); $this->view->setVar('code_url', $codeUrl); } diff --git a/app/Http/Admin/Controllers/VodController.php b/app/Http/Admin/Controllers/VodController.php index 9b7db5af..a2da513d 100644 --- a/app/Http/Admin/Controllers/VodController.php +++ b/app/Http/Admin/Controllers/VodController.php @@ -34,9 +34,7 @@ class VodController extends Controller $playUrl = $this->request->getQuery('play_url'); $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); - $this->view->pick('public/vod_player'); - $this->view->setVar('chapter_id', $chapterId); $this->view->setVar('play_url', urldecode($playUrl)); } diff --git a/app/Http/Admin/Services/AlipayTest.php b/app/Http/Admin/Services/AlipayTest.php index 9aff02cd..8269c20e 100644 --- a/app/Http/Admin/Services/AlipayTest.php +++ b/app/Http/Admin/Services/AlipayTest.php @@ -6,9 +6,9 @@ use App\Models\Order as OrderModel; use App\Models\Trade as TradeModel; use App\Repos\Order as OrderRepo; use App\Repos\Trade as TradeRepo; -use App\Services\Payment\Alipay as AlipayService; +use App\Services\Pay\Alipay as AlipayService; -class AlipayTest extends PaymentTest +class AlipayTest extends PayTest { protected $channel = TradeModel::CHANNEL_ALIPAY; diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index d6d5a126..65dcd281 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -679,10 +679,16 @@ class AuthNode extends Service 'id' => '5-1-9', 'label' => '支付设置', 'type' => 'menu', - 'route' => 'admin.setting.payment', + 'route' => 'admin.setting.pay', ], [ 'id' => '5-1-10', + 'label' => '登录设置', + 'type' => 'menu', + 'route' => 'admin.setting.oauth', + ], + [ + 'id' => '5-1-11', 'label' => '会员设置', 'type' => 'menu', 'route' => 'admin.setting.vip', diff --git a/app/Http/Admin/Services/PaymentTest.php b/app/Http/Admin/Services/PayTest.php similarity index 97% rename from app/Http/Admin/Services/PaymentTest.php rename to app/Http/Admin/Services/PayTest.php index 458c5789..35bac228 100644 --- a/app/Http/Admin/Services/PaymentTest.php +++ b/app/Http/Admin/Services/PayTest.php @@ -6,7 +6,7 @@ use App\Models\Order as OrderModel; use App\Models\Trade as TradeModel; use App\Services\Auth\Admin as AdminAuth; -abstract class PaymentTest extends Service +abstract class PayTest extends Service { /** diff --git a/app/Http/Admin/Services/WxpayTest.php b/app/Http/Admin/Services/WxpayTest.php index 14c26bc2..52a2a283 100644 --- a/app/Http/Admin/Services/WxpayTest.php +++ b/app/Http/Admin/Services/WxpayTest.php @@ -3,9 +3,9 @@ namespace App\Http\Admin\Services; use App\Models\Trade as TradeModel; -use App\Services\Payment\Wxpay as WxpayService; +use App\Services\Pay\Wxpay as WxpayService; -class WxpayTest extends PaymentTest +class WxpayTest extends PayTest { protected $channel = TradeModel::CHANNEL_WXPAY; diff --git a/app/Http/Admin/Views/public/login.volt b/app/Http/Admin/Views/public/login.volt index c1f68508..7f26dfca 100644 --- a/app/Http/Admin/Views/public/login.volt +++ b/app/Http/Admin/Views/public/login.volt @@ -57,11 +57,13 @@ $('#captcha-btn')[0], $('#captcha-btn').attr('app-id'), function (res) { - $('input[name=ticket]').val(res.ticket); - $('input[name=rand]').val(res.randstr); - $('#captcha-btn').remove(); - $('#submit-btn').removeAttr('disabled'); - $('#verify-tips').removeClass('layui-hide'); + if (res.ret === 0) { + $('input[name=ticket]').val(res.ticket); + $('input[name=rand]').val(res.randstr); + $('#captcha-btn').remove(); + $('#submit-btn').removeAttr('disabled'); + $('#verify-tips').removeClass('layui-hide'); + } } ); }); diff --git a/app/Http/Admin/Views/setting/captcha.volt b/app/Http/Admin/Views/setting/captcha.volt index 5f5bcfb5..b45cc081 100644 --- a/app/Http/Admin/Views/setting/captcha.volt +++ b/app/Http/Admin/Views/setting/captcha.volt @@ -37,16 +37,16 @@
- 前台验证 - 前台验证成功 + 前台验证 + 前台验证成功
- 后台验证 - 后台验证成功 + 后台验证 + 后台验证成功
@@ -65,25 +65,29 @@ var layer = layui.layer; var captcha = new TencentCaptcha( - $('#captcha-btn')[0], - $('input[name=app_id]').val(), + $('#front-verify-btn')[0], + $('#front-verify-btn').attr('app-id'), function (res) { - $('input[name=ticket]').val(res.ticket); - $('input[name=rand]').val(res.randstr); - $('#captcha-btn').remove(); - $('#verify-submit-btn').removeAttr('disabled'); - $('#frontend-verify-tips').removeClass('layui-hide'); + if (res.ret === 0) { + $('input[name=ticket]').val(res.ticket); + $('input[name=rand]').val(res.randstr); + $('#front-verify-btn').remove(); + $('#back-verify-btn').removeAttr('disabled'); + $('#front-verify-tips').removeClass('layui-hide'); + } } ); - form.on('submit(backend-verify)', function (data) { + form.on('submit(back-verify)', function (data) { $.ajax({ type: 'POST', url: data.form.action, data: data.field, success: function (res) { - $('#verify-submit-btn').remove(); - $('#backend-verify-tips').removeClass('layui-hide'); + if (res.code === 0) { + $('#back-verify-btn').remove(); + $('#back-verify-tips').removeClass('layui-hide'); + } layer.msg(res.msg, {icon: 1}); }, error: function (xhr) { diff --git a/app/Http/Admin/Views/setting/oauth.volt b/app/Http/Admin/Views/setting/oauth.volt new file mode 100644 index 00000000..7cae574f --- /dev/null +++ b/app/Http/Admin/Views/setting/oauth.volt @@ -0,0 +1,18 @@ +
+ +
+
+ {{ partial('setting/oauth_qq') }} +
+
+ {{ partial('setting/oauth_weibo') }} +
+
+ {{ partial('setting/oauth_weixin') }} +
+
+
\ No newline at end of file diff --git a/app/Http/Admin/Views/setting/oauth_qq.volt b/app/Http/Admin/Views/setting/oauth_qq.volt new file mode 100644 index 00000000..35619f08 --- /dev/null +++ b/app/Http/Admin/Views/setting/oauth_qq.volt @@ -0,0 +1,67 @@ +
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ +
+ 登录测试 +
+ +
+ +
+ QQ登录 +
+
+ +
+ + \ No newline at end of file diff --git a/app/Http/Admin/Views/setting/oauth_weibo.volt b/app/Http/Admin/Views/setting/oauth_weibo.volt new file mode 100644 index 00000000..2415d605 --- /dev/null +++ b/app/Http/Admin/Views/setting/oauth_weibo.volt @@ -0,0 +1,67 @@ +
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ +
+ 登录测试 +
+ +
+ +
+ 微博登录 +
+
+ +
+ + \ No newline at end of file diff --git a/app/Http/Admin/Views/setting/oauth_weixin.volt b/app/Http/Admin/Views/setting/oauth_weixin.volt new file mode 100644 index 00000000..a174498f --- /dev/null +++ b/app/Http/Admin/Views/setting/oauth_weixin.volt @@ -0,0 +1,67 @@ +
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ +
+ 登录测试 +
+ +
+ +
+ 微信登录 +
+
+ +
+ + \ No newline at end of file diff --git a/app/Http/Admin/Views/setting/payment.volt b/app/Http/Admin/Views/setting/pay.volt similarity index 75% rename from app/Http/Admin/Views/setting/payment.volt rename to app/Http/Admin/Views/setting/pay.volt index 39c6ba99..4800d472 100644 --- a/app/Http/Admin/Views/setting/payment.volt +++ b/app/Http/Admin/Views/setting/pay.volt @@ -5,10 +5,10 @@
- {{ partial('setting/payment_alipay') }} + {{ partial('setting/pay_alipay') }}
- {{ partial('setting/payment_wxpay') }} + {{ partial('setting/pay_wxpay') }}
\ No newline at end of file diff --git a/app/Http/Admin/Views/setting/payment_alipay.volt b/app/Http/Admin/Views/setting/pay_alipay.volt similarity index 90% rename from app/Http/Admin/Views/setting/payment_alipay.volt rename to app/Http/Admin/Views/setting/pay_alipay.volt index c91a8de3..701bb604 100644 --- a/app/Http/Admin/Views/setting/payment_alipay.volt +++ b/app/Http/Admin/Views/setting/pay_alipay.volt @@ -1,4 +1,4 @@ -
+
@@ -25,16 +25,14 @@
- +
- +
@@ -43,7 +41,7 @@
- +
diff --git a/app/Http/Admin/Views/setting/payment_alipay_test.volt b/app/Http/Admin/Views/setting/pay_alipay_test.volt similarity index 100% rename from app/Http/Admin/Views/setting/payment_alipay_test.volt rename to app/Http/Admin/Views/setting/pay_alipay_test.volt diff --git a/app/Http/Admin/Views/setting/payment_wxpay.volt b/app/Http/Admin/Views/setting/pay_wxpay.volt similarity index 96% rename from app/Http/Admin/Views/setting/payment_wxpay.volt rename to app/Http/Admin/Views/setting/pay_wxpay.volt index 5cc76cca..d1eb6e50 100644 --- a/app/Http/Admin/Views/setting/payment_wxpay.volt +++ b/app/Http/Admin/Views/setting/pay_wxpay.volt @@ -1,4 +1,4 @@ - +
@@ -41,7 +41,7 @@
- +
diff --git a/app/Http/Admin/Views/setting/payment_wxpay_test.volt b/app/Http/Admin/Views/setting/pay_wxpay_test.volt similarity index 100% rename from app/Http/Admin/Views/setting/payment_wxpay_test.volt rename to app/Http/Admin/Views/setting/pay_wxpay_test.volt diff --git a/app/Http/Web/Controllers/OAuthController.php b/app/Http/Web/Controllers/OAuthController.php new file mode 100644 index 00000000..9df34aed --- /dev/null +++ b/app/Http/Web/Controllers/OAuthController.php @@ -0,0 +1,63 @@ +appId = $appId; $this->appSecret = $appSecret; - $this->appCallback = $appCallback; + $this->redirectUri = $redirectUri; } public function httpGet($uri, $params = [], $headers = []) diff --git a/app/Library/OAuth/QQ.php b/app/Library/OAuth/QQ.php index cc4fc609..3515a0d9 100644 --- a/app/Library/OAuth/QQ.php +++ b/app/Library/OAuth/QQ.php @@ -16,7 +16,7 @@ class QQ extends OAuth { $params = [ 'client_id' => $this->appId, - 'redirect_uri' => $this->appCallback, + 'redirect_uri' => $this->redirectUri, 'response_type' => 'code', 'scope' => '', ]; @@ -30,7 +30,7 @@ class QQ extends OAuth 'code' => $code, 'client_id' => $this->appId, 'client_secret' => $this->appSecret, - 'redirect_uri' => $this->appCallback, + 'redirect_uri' => $this->redirectUri, 'grant_type' => 'authorization_code', 'state' => 'ok', ]; diff --git a/app/Library/OAuth/WeiBo.php b/app/Library/OAuth/WeiBo.php index fb4002ce..b7bc79ac 100644 --- a/app/Library/OAuth/WeiBo.php +++ b/app/Library/OAuth/WeiBo.php @@ -15,7 +15,7 @@ class WeiBo extends OAuth { $params = [ 'client_id' => $this->appId, - 'redirect_uri' => $this->appCallback, + 'redirect_uri' => $this->redirectUri, 'response_type' => 'code', ]; @@ -28,7 +28,7 @@ class WeiBo extends OAuth 'code' => $code, 'client_id' => $this->appId, 'client_secret' => $this->appSecret, - 'redirect_uri' => $this->appCallback, + 'redirect_uri' => $this->redirectUri, 'grant_type' => 'authorization_code', ]; diff --git a/app/Library/OAuth/WeiXin.php b/app/Library/OAuth/WeiXin.php index 200a8808..4d741276 100644 --- a/app/Library/OAuth/WeiXin.php +++ b/app/Library/OAuth/WeiXin.php @@ -15,7 +15,7 @@ class WeiXin extends OAuth { $params = [ 'appid' => $this->appId, - 'redirect_uri' => $this->appCallback, + 'redirect_uri' => $this->redirectUri, 'response_type' => 'code', 'scope' => 'snsapi_login', 'state' => 'dev', diff --git a/app/Listeners/Payment.php b/app/Listeners/Pay.php similarity index 98% rename from app/Listeners/Payment.php rename to app/Listeners/Pay.php index b1150230..ade46d93 100644 --- a/app/Listeners/Payment.php +++ b/app/Listeners/Pay.php @@ -8,7 +8,7 @@ use App\Models\Trade as TradeModel; use App\Repos\Order as OrderRepo; use Phalcon\Events\Event; -class Payment extends Listener +class Pay extends Listener { protected $logger; diff --git a/app/Services/Frontend/Chapter/ChapterInfo.php b/app/Services/Frontend/Chapter/ChapterInfo.php index 267428af..e60fcbfd 100644 --- a/app/Services/Frontend/Chapter/ChapterInfo.php +++ b/app/Services/Frontend/Chapter/ChapterInfo.php @@ -111,10 +111,10 @@ class ChapterInfo extends Service 'summary' => $chapter->summary, 'course' => $course, 'play_urls' => $playUrls, + 'user_count' => $chapter->user_count, 'agree_count' => $chapter->agree_count, 'oppose_count' => $chapter->oppose_count, 'comment_count' => $chapter->comment_count, - 'user_count' => $chapter->user_count, ]; } @@ -146,10 +146,10 @@ class ChapterInfo extends Service 'play_urls' => $playUrls, 'start_time' => $live->start_time, 'end_time' => $live->end_time, + 'user_count' => $chapter->user_count, 'agree_count' => $chapter->agree_count, 'oppose_count' => $chapter->oppose_count, 'comment_count' => $chapter->comment_count, - 'user_count' => $chapter->user_count, ]; } @@ -167,10 +167,10 @@ class ChapterInfo extends Service 'summary' => $chapter->summary, 'course' => $course, 'content' => $read->content, + 'user_count' => $chapter->user_count, 'agree_count' => $chapter->agree_count, 'oppose_count' => $chapter->oppose_count, 'comment_count' => $chapter->comment_count, - 'user_count' => $chapter->user_count, ]; } diff --git a/app/Services/Frontend/My/UserInfo.php b/app/Services/Frontend/My/UserInfo.php new file mode 100644 index 00000000..4225472e --- /dev/null +++ b/app/Services/Frontend/My/UserInfo.php @@ -0,0 +1,41 @@ +getLoginUser(); + + return $this->handleUser($user); + } + + protected function handleUser(UserModel $user) + { + $user->avatar = kg_ci_img_url($user->avatar); + + return [ + 'id' => $user->id, + 'name' => $user->name, + 'avatar' => $user->avatar, + 'title' => $user->title, + 'about' => $user->about, + 'location' => $user->location, + 'gender' => $user->gender, + 'vip' => $user->vip, + 'locked' => $user->locked, + 'vip_expiry_time' => $user->vip_expiry_time, + 'lock_expiry_time' => $user->lock_expiry_time, + 'edu_role' => $user->edu_role, + 'admin_role' => $user->admin_role, + 'notice_count' => $user->notice_count, + 'msg_count' => $user->msg_count, + ]; + } + +} diff --git a/app/Services/Frontend/Order/OrderTrade.php b/app/Services/Frontend/Order/OrderTrade.php index 85299941..c54b97ba 100644 --- a/app/Services/Frontend/Order/OrderTrade.php +++ b/app/Services/Frontend/Order/OrderTrade.php @@ -5,8 +5,8 @@ namespace App\Services\Frontend\Order; use App\Models\Trade as TradeModel; use App\Services\Frontend\OrderTrait; use App\Services\Frontend\Service; -use App\Services\Payment\Alipay as AlipayService; -use App\Services\Payment\Wxpay as WxPayService; +use App\Services\Pay\Alipay as AlipayService; +use App\Services\Pay\Wxpay as WxPayService; use App\Validators\Trade as TradeValidator; class OrderTrade extends Service diff --git a/app/Services/Frontend/Teacher/TeacherInfo.php b/app/Services/Frontend/Teacher/TeacherInfo.php index ebfdd6f3..db894d35 100644 --- a/app/Services/Frontend/Teacher/TeacherInfo.php +++ b/app/Services/Frontend/Teacher/TeacherInfo.php @@ -18,15 +18,9 @@ class TeacherInfo extends Service return $this->handleUser($user); } - /** - * @param UserModel $user - * @return array - */ - protected function handleUser($user) + protected function handleUser(UserModel $user) { $user->avatar = kg_ci_img_url($user->avatar); - $user->vip = $user->vip == 1; - $user->locked = $user->locked == 1; return [ 'id' => $user->id, @@ -38,12 +32,6 @@ class TeacherInfo extends Service 'gender' => $user->gender, 'vip' => $user->vip, 'locked' => $user->locked, - 'vip_expiry_time' => $user->vip_expiry_time, - 'lock_expiry_time' => $user->lock_expiry_time, - 'edu_role' => $user->edu_role, - 'admin_role' => $user->admin_role, - 'notice_count' => $user->notice_count, - 'msg_count' => $user->msg_count, ]; } diff --git a/app/Services/Frontend/User/UserInfo.php b/app/Services/Frontend/User/UserInfo.php index 8c6d9cea..ef900ed0 100644 --- a/app/Services/Frontend/User/UserInfo.php +++ b/app/Services/Frontend/User/UserInfo.php @@ -18,15 +18,9 @@ class UserInfo extends Service return $this->handleUser($user); } - /** - * @param UserModel $user - * @return array - */ - protected function handleUser($user) + protected function handleUser(UserModel $user) { $user->avatar = kg_ci_img_url($user->avatar); - $user->vip = $user->vip == 1; - $user->locked = $user->locked == 1; return [ 'id' => $user->id, @@ -38,12 +32,6 @@ class UserInfo extends Service 'gender' => $user->gender, 'vip' => $user->vip, 'locked' => $user->locked, - 'vip_expiry_time' => $user->vip_expiry_time, - 'lock_expiry_time' => $user->lock_expiry_time, - 'edu_role' => $user->edu_role, - 'admin_role' => $user->admin_role, - 'notice_count' => $user->notice_count, - 'msg_count' => $user->msg_count, ]; } diff --git a/app/Services/Payment.php b/app/Services/Pay.php similarity index 96% rename from app/Services/Payment.php rename to app/Services/Pay.php index 06b4662f..79184638 100644 --- a/app/Services/Payment.php +++ b/app/Services/Pay.php @@ -6,7 +6,7 @@ use App\Models\Refund as RefundModel; use App\Models\Trade as TradeModel; use App\Repos\Trade as TradeRepo; -abstract class Payment extends Service +abstract class Pay extends Service { /** diff --git a/app/Services/Payment/Alipay.php b/app/Services/Pay/Alipay.php similarity index 96% rename from app/Services/Payment/Alipay.php rename to app/Services/Pay/Alipay.php index 39ea4647..14af8803 100644 --- a/app/Services/Payment/Alipay.php +++ b/app/Services/Pay/Alipay.php @@ -1,16 +1,16 @@ settings = $this->getSectionSettings('payment.alipay'); - + $this->settings = $this->getSectionSettings('pay.alipay'); $this->gateway = $this->getGateway(); } @@ -108,7 +107,7 @@ class Alipay extends Payment $trade->channel_sn = $data->trade_no; - $this->eventsManager->fire('payment:afterPay', $this, $trade); + $this->eventsManager->fire('pay:afterPay', $this, $trade); return $this->gateway->success(); } diff --git a/app/Services/Payment/Wxpay.php b/app/Services/Pay/Wxpay.php similarity index 95% rename from app/Services/Payment/Wxpay.php rename to app/Services/Pay/Wxpay.php index 1bb2272d..d7d2aa7b 100644 --- a/app/Services/Payment/Wxpay.php +++ b/app/Services/Pay/Wxpay.php @@ -1,17 +1,17 @@ settings = $this->getSectionSettings('payment.wxpay'); - + $this->settings = $this->getSectionSettings('pay.wxpay'); $this->gateway = $this->getGateway(); } @@ -107,7 +106,7 @@ class Wxpay extends Payment $trade->channel_sn = $data->transaction_id; - $this->eventsManager->fire('payment:afterPay', $this, $trade); + $this->eventsManager->fire('pay:afterPay', $this, $trade); return $this->gateway->success(); } diff --git a/config/events.php b/config/events.php index f536fedf..e1ea86fb 100644 --- a/config/events.php +++ b/config/events.php @@ -1,11 +1,11 @@ Profiler::class, - 'payment' => Payment::class, + 'pay' => Pay::class, 'userDailyCounter' => UserDailyCounter::class, ]; \ No newline at end of file diff --git a/public/static/admin/css/common.css b/public/static/admin/css/common.css index 07511011..753b72f0 100644 --- a/public/static/admin/css/common.css +++ b/public/static/admin/css/common.css @@ -1,3 +1,7 @@ +.layui-badge, .layui-badge-rim, .layui-badge-dot { + padding-bottom: 1px; +} + .kg-body { padding: 15px; } diff --git a/public/static/web/css/common.css b/public/static/web/css/common.css index e69de29b..2a7431c1 100644 --- a/public/static/web/css/common.css +++ b/public/static/web/css/common.css @@ -0,0 +1,3 @@ +.layui-badge, .layui-badge-rim, .layui-badge-dot { + padding-bottom: 1px; +} \ No newline at end of file