diff --git a/app/Components/CaptchaVerify.php b/app/Components/CaptchaVerify.php index 32cdb8c9..b8f9e4c2 100644 --- a/app/Components/CaptchaVerify.php +++ b/app/Components/CaptchaVerify.php @@ -7,11 +7,9 @@ namespace App\Components; * * @package App\Components */ -class CaptchaVerify -{ +class CaptchaVerify { //从后台获取 hcaptcha_sitekey 和 hcaptcha_secret - public static function hCaptchaGetConfig() - { + public static function hCaptchaGetConfig() { return [ "sitekey" => Helpers::systemConfig()["hcaptcha_sitekey"], "secret" => Helpers::systemConfig()["hcaptcha_secret"], @@ -20,8 +18,7 @@ class CaptchaVerify } //从后台获取 Geetest_id 和 Geetest_key - public static function geetestCaptchaGetConfig() - { + public static function geetestCaptchaGetConfig() { return [ "geetest_id" => Helpers::systemConfig()["geetest_id"], "geetest_key" => Helpers::systemConfig()["geetest_key"] @@ -29,8 +26,7 @@ class CaptchaVerify } //从后台获取 google_captcha_sitekey 和 google_captcha_secret - public static function googleCaptchaGetConfig() - { + public static function googleCaptchaGetConfig() { return [ "sitekey" => Helpers::systemConfig()["google_captcha_sitekey"], "secret" => Helpers::systemConfig()["google_captcha_secret"], @@ -39,4 +35,4 @@ class CaptchaVerify } } -?> \ No newline at end of file +?> diff --git a/app/Components/Curl.php b/app/Components/Curl.php index 0ab79635..722203d6 100644 --- a/app/Components/Curl.php +++ b/app/Components/Curl.php @@ -2,21 +2,19 @@ namespace App\Components; -class Curl -{ +class Curl { /** - * @param string $url 请求地址 - * @param array $data 数据,如果有数据则用POST请求 + * @param string $url 请求地址 + * @param array $data 数据,如果有数据则用POST请求 * * @return mixed */ - public static function send($url, $data = []) - { + public static function send($url, $data = []) { $ch = curl_init(); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_URL, $url); if($data){ @@ -29,4 +27,4 @@ class Curl return $result; } -} \ No newline at end of file +} diff --git a/app/Components/Helpers.php b/app/Components/Helpers.php index 42a6ac02..f1f573ad 100644 --- a/app/Components/Helpers.php +++ b/app/Components/Helpers.php @@ -12,8 +12,7 @@ use App\Http\Models\UserBalanceLog; use App\Http\Models\UserSubscribe; use App\Http\Models\UserTrafficModifyLog; -class Helpers -{ +class Helpers { // 不生成的端口 private static $denyPorts = [ 1068, 1109, 1434, 3127, 3128, @@ -24,32 +23,27 @@ class Helpers ]; // 加密方式 - public static function methodList() - { + public static function methodList() { return SsConfig::type(1)->get(); } // 协议 - public static function protocolList() - { + public static function protocolList() { return SsConfig::type(2)->get(); } // 混淆 - public static function obfsList() - { + public static function obfsList() { return SsConfig::type(3)->get(); } // 等级 - public static function levelList() - { + public static function levelList() { return Level::query()->get()->sortBy('level'); } // 生成用户的订阅码 - public static function makeSubscribeCode() - { + public static function makeSubscribeCode() { $code = makeRandStr(5); if(UserSubscribe::query()->whereCode($code)->exists()){ $code = self::makeSubscribeCode(); @@ -61,16 +55,15 @@ class Helpers /** * 添加用户 * - * @param string $email 用户邮箱 - * @param string $password 用户密码 - * @param string $transfer_enable 可用流量 - * @param int $data 可使用天数 - * @param int $referral_uid 邀请人 + * @param string $email 用户邮箱 + * @param string $password 用户密码 + * @param string $transfer_enable 可用流量 + * @param int $data 可使用天数 + * @param int $referral_uid 邀请人 * * @return int */ - public static function addUser($email, $password, $transfer_enable, $data, $referral_uid = 0) - { + public static function addUser($email, $password, $transfer_enable, $data, $referral_uid = 0) { $user = new User(); $user->username = $email; $user->email = $email; @@ -91,7 +84,7 @@ class Helpers $user->expire_time = date('Y-m-d', strtotime("+".$data." days")); $user->reg_ip = getClientIp(); $user->referral_uid = $referral_uid; - $user->reset_time = NULL; + $user->reset_time = null; $user->status = 0; $user->save(); @@ -99,22 +92,20 @@ class Helpers } // 获取系统配置 - public static function systemConfig() - { + public static function systemConfig() { $config = Config::query()->get(); $data = []; foreach($config as $vo){ $data[$vo->name] = $vo->value; } - $data['is_onlinePay'] = ($data['is_AliPay'] || $data['is_QQPay'] || $data['is_WeChatPay'] || $data['is_otherPay'])? : 0; + $data['is_onlinePay'] = ($data['is_AliPay'] || $data['is_QQPay'] || $data['is_WeChatPay'] || $data['is_otherPay'])?: 0; return $data; } // 获取一个随机端口 - public static function getRandPort() - { + public static function getRandPort() { $config = self::systemConfig(); $port = mt_rand($config['min_port'], $config['max_port']); @@ -127,38 +118,34 @@ class Helpers } // 获取一个随机端口 - public static function getOnlyPort() - { + public static function getOnlyPort() { $config = self::systemConfig(); $port = $config['min_port']; $exists_port = User::query()->where('port', '>=', $port)->pluck('port')->toArray(); while(in_array($port, $exists_port) || in_array($port, self::$denyPorts)){ - $port = $port+1; + $port = $port + 1; } return $port; } // 获取默认加密方式 - public static function getDefaultMethod() - { + public static function getDefaultMethod() { $config = SsConfig::default()->type(1)->first(); return $config? $config->name : 'aes-256-cfb'; } // 获取默认协议 - public static function getDefaultProtocol() - { + public static function getDefaultProtocol() { $config = SsConfig::default()->type(2)->first(); return $config? $config->name : 'origin'; } // 获取默认混淆 - public static function getDefaultObfs() - { + public static function getDefaultObfs() { $config = SsConfig::default()->type(3)->first(); return $config? $config->name : 'plain'; @@ -167,17 +154,16 @@ class Helpers /** * 添加通知推送日志 * - * @param string $title 标题 - * @param string $content 内容 - * @param int $type 发送类型 - * @param string $address 收信方 - * @param int $status 投递状态 - * @param string $error 投递失败时记录的异常信息 + * @param string $title 标题 + * @param string $content 内容 + * @param int $type 发送类型 + * @param string $address 收信方 + * @param int $status 投递状态 + * @param string $error 投递失败时记录的异常信息 * * @return int */ - public static function addNotificationLog($title, $content, $type, $address = 'admin', $status = 1, $error = '') - { + public static function addNotificationLog($title, $content, $type, $address = 'admin', $status = 1, $error = '') { $log = new NotificationLog(); $log->type = $type; $log->address = $address; @@ -193,15 +179,14 @@ class Helpers /** * 添加优惠券操作日志 * - * @param int $couponId 优惠券ID - * @param int $goodsId 商品ID - * @param int $orderId 订单ID - * @param string $desc 备注 + * @param int $couponId 优惠券ID + * @param int $goodsId 商品ID + * @param int $orderId 订单ID + * @param string $desc 备注 * * @return int */ - public static function addCouponLog($couponId, $goodsId, $orderId, $desc = '') - { + public static function addCouponLog($couponId, $goodsId, $orderId, $desc = '') { $log = new CouponLog(); $log->coupon_id = $couponId; $log->goods_id = $goodsId; @@ -214,17 +199,16 @@ class Helpers /** * 记录余额操作日志 * - * @param int $userId 用户ID - * @param string $oid 订单ID - * @param int $before 记录前余额 - * @param int $after 记录后余额 - * @param int $amount 发生金额 - * @param string $desc 描述 + * @param int $userId 用户ID + * @param string $oid 订单ID + * @param int $before 记录前余额 + * @param int $after 记录后余额 + * @param int $amount 发生金额 + * @param string $desc 描述 * * @return int */ - public static function addUserBalanceLog($userId, $oid, $before, $after, $amount, $desc = '') - { + public static function addUserBalanceLog($userId, $oid, $before, $after, $amount, $desc = '') { $log = new UserBalanceLog(); $log->user_id = $userId; $log->order_id = $oid; @@ -240,16 +224,15 @@ class Helpers /** * 记录流量变动日志 * - * @param int $userId 用户ID - * @param string $oid 订单ID - * @param int $before 记录前的值 - * @param int $after 记录后的值 - * @param string $desc 描述 + * @param int $userId 用户ID + * @param string $oid 订单ID + * @param int $before 记录前的值 + * @param int $after 记录后的值 + * @param string $desc 描述 * * @return int */ - public static function addUserTrafficModifyLog($userId, $oid, $before, $after, $desc = '') - { + public static function addUserTrafficModifyLog($userId, $oid, $before, $after, $desc = '') { $log = new UserTrafficModifyLog(); $log->user_id = $userId; $log->order_id = $oid; @@ -259,4 +242,4 @@ class Helpers return $log->save(); } -} \ No newline at end of file +} diff --git a/app/Components/IPIP.php b/app/Components/IPIP.php index 49875f46..3e18dcf7 100644 --- a/app/Components/IPIP.php +++ b/app/Components/IPIP.php @@ -4,20 +4,18 @@ namespace App\Components; use ipip\db\City; -class IPIP -{ +class IPIP { /** * 查询IP地址的详细信息 * - * @param string $ip IPv4 + * @param string $ip IPv4 * * @return array|null */ - public static function ip($ip) - { + public static function ip($ip) { $filePath = public_path('ipip.ipdb'); $loc = new City($filePath); return $loc->findMap($ip, 'CN'); } -} \ No newline at end of file +} diff --git a/app/Components/Namesilo.php b/app/Components/Namesilo.php index 745f18e2..c8314b99 100644 --- a/app/Components/Namesilo.php +++ b/app/Components/Namesilo.php @@ -6,26 +6,22 @@ use Exception; use Log; use LSS\XML2Array; -class Namesilo -{ +class Namesilo { protected static $host; protected static $systemConfig; - function __construct() - { + function __construct() { self::$host = 'https://www.namesilo.com/api/'; self::$systemConfig = Helpers::systemConfig(); } // 列出账号下所有域名 - public function listDomains() - { + public function listDomains() { return $this->send('listDomains'); } // 发送请求 - private function send($operation, $data = []) - { + private function send($operation, $data = []) { $params = [ 'version' => 1, 'type' => 'xml', @@ -41,23 +37,27 @@ class Namesilo // 出错 if(empty($result['namesilo']) || $result['namesilo']['reply']['code'] != 300 || $result['namesilo']['reply']['detail'] != 'success'){ - Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, self::$systemConfig['webmaster_email'], 0, $result['namesilo']['reply']['detail']); + Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, + self::$systemConfig['webmaster_email'], 0, + $result['namesilo']['reply']['detail']); }else{ - Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, self::$systemConfig['webmaster_email'], 1, $result['namesilo']['reply']['detail']); + Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, + self::$systemConfig['webmaster_email'], 1, + $result['namesilo']['reply']['detail']); } return $result['namesilo']['reply']; }catch(Exception $e){ Log::error('CURL请求失败:'.$e->getMessage().' --- '.$e->getLine()); - Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, self::$systemConfig['webmaster_email'], 0, $e->getMessage()); + Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, + self::$systemConfig['webmaster_email'], 0, $e->getMessage()); - return FALSE; + return false; } } // 列出指定域名的所有DNS记录 - public function dnsListRecords($domain) - { + public function dnsListRecords($domain) { $query = [ 'domain' => $domain ]; @@ -66,8 +66,7 @@ class Namesilo } // 为指定域名添加DNS记录 - public function dnsAddRecord($domain, $host, $value, $type = 'A', $ttl = 7207) - { + public function dnsAddRecord($domain, $host, $value, $type = 'A', $ttl = 7207) { $query = [ 'domain' => $domain, 'rrtype' => $type, @@ -80,8 +79,7 @@ class Namesilo } // 更新DNS记录 - public function dnsUpdateRecord($domain, $id, $host, $value, $ttl = 7207) - { + public function dnsUpdateRecord($domain, $id, $host, $value, $ttl = 7207) { $query = [ 'domain' => $domain, 'rrid' => $id, @@ -94,8 +92,7 @@ class Namesilo } // 删除DNS记录 - public function dnsDeleteRecord($domain, $id) - { + public function dnsDeleteRecord($domain, $id) { $data = [ 'domain' => $domain, 'rrid' => $id @@ -103,4 +100,4 @@ class Namesilo return $this->send('dnsDeleteRecord', $data); } -} \ No newline at end of file +} diff --git a/app/Components/NetworkDetection.php b/app/Components/NetworkDetection.php index e52ce91a..368d2ea3 100644 --- a/app/Components/NetworkDetection.php +++ b/app/Components/NetworkDetection.php @@ -5,45 +5,43 @@ namespace App\Components; use Exception; use Log; -class NetworkDetection -{ +class NetworkDetection { /** * 用api.50network.com进行节点阻断检测 * - * @param string $ip 被检测的IP - * @param boolean $type TRUE 为ICMP,FALSE 为tcp - * @param int $port 检测端口,默认为空 + * @param string $ip 被检测的IP + * @param boolean $type TRUE 为ICMP,FALSE 为tcp + * @param int $port 检测端口,默认为空 * * @return bool|string */ - public static function networkCheck($ip, $type, $port = NULL) - { + public static function networkCheck($ip, $type, $port = null) { $url = 'https://api.50network.com/china-firewall/check/ip/'.($type? 'icmp/' : ($port? 'tcp_port/' : 'tcp_ack/')).$ip.($port? '/'.$port : ''); $checkName = $type? 'ICMP' : 'TCP'; try{ - $ret = json_decode(Curl::send($url), TRUE); + $ret = json_decode(Curl::send($url), true); if(!$ret){ Log::warning("【".$checkName."阻断检测】检测".$ip."时,接口返回异常访问链接:".$url); - return FALSE; + return false; }elseif(!$ret['success']){ if($ret['error'] == "execute timeout (3s)"){ sleep(10); return self::networkCheck($ip, $type, $port); }else{ - Log::warning("【".$checkName."阻断检测】检测".$ip.($port? : '')."时,返回".json_encode($ret)); + Log::warning("【".$checkName."阻断检测】检测".$ip.($port?: '')."时,返回".json_encode($ret)); } - return FALSE; + return false; } }catch(Exception $e){ Log::warning("【".$checkName."阻断检测】检测".$ip."时,接口请求超时".$e); - return FALSE; + return false; } if($ret['firewall-enable'] && $ret['firewall-disable']){ @@ -60,33 +58,32 @@ class NetworkDetection /** * 用api.iiwl.cc进行Ping检测 * - * @param string $ip 被检测的IP或者域名 + * @param string $ip 被检测的IP或者域名 * * @return bool|array */ - public static function ping($ip) - { + public static function ping($ip) { $url = 'https://api.iiwl.cc/api/ping.php?url='.$ip; try{ - $ret = json_decode(Curl::send($url), TRUE); + $ret = json_decode(Curl::send($url), true); if(!$ret){ Log::warning("【PING】检测".$ip."时,接口返回异常访问链接:".$url); - return FALSE; + return false; }elseif($ret['code'] != 1 || $ret['msg'] != "检测成功!"){ Log::warning("【PING】检测".$ip."时,返回".json_encode($ret)); - return FALSE; + return false; } }catch(Exception $e){ Log::warning("【Ping】检测".$ip."时,接口请求超时".$e); - return FALSE; + return false; } return $ret['data']; // 服务器宕机 } } -?> \ No newline at end of file +?> diff --git a/app/Components/PushNotification.php b/app/Components/PushNotification.php index 467db748..41434836 100644 --- a/app/Components/PushNotification.php +++ b/app/Components/PushNotification.php @@ -7,10 +7,8 @@ use Exception; use Log; use stdClass; -class PushNotification -{ - public static function send($title, $content) - { +class PushNotification { + public static function send($title, $content) { switch(Helpers::systemConfig()['is_notification']){ case 'serverChan': return self::ServerChan($title, $content); @@ -19,33 +17,32 @@ class PushNotification return self::Bark($title, $content); break; default: - return FALSE; + return false; } } /** * ServerChan推送消息 * - * @param string $title 消息标题 - * @param string $content 消息内容 + * @param string $title 消息标题 + * @param string $content 消息内容 * * @return mixed */ - private static function ServerChan($title, $content) - { - $ret = FALSE; + private static function ServerChan($title, $content) { + $ret = false; try{ // TODO:一天仅可发送不超过500条 $url = 'https://sc.ftqq.com/'.Helpers::systemConfig()['server_chan_key'].'.send?text='.$title.'&desp='.urlencode($content); $result = json_decode(Curl::send($url)); if(empty(Helpers::systemConfig()['server_chan_key'])){ $result = new stdClass(); - $result->errno = TRUE; + $result->errno = true; $result->errmsg = "未正确配置ServerChan"; } - if($result != NULL && !$result->errno){ + if($result != null && !$result->errno){ Helpers::addNotificationLog($title, $content, 2); - $ret = TRUE; + $ret = true; }else{ Helpers::addNotificationLog($title, $content, 2, 'admin', 1, $result? $result->errmsg : '未知'); } @@ -60,21 +57,20 @@ class PushNotification /** * Bark推送消息 * - * @param string $title 消息标题 - * @param string $content 消息内容 + * @param string $title 消息标题 + * @param string $content 消息内容 * * @return mixed */ - private static function Bark($title, $content) - { - $ret = FALSE; + private static function Bark($title, $content) { + $ret = false; try{ $url = 'https://api.day.app/'.Helpers::systemConfig()['bark_key'].'/'.$title.'/'.$content; $result = json_decode(Curl::send($url)); if($result){ if($result->code == 200){ Helpers::addNotificationLog($title, $content, 3); - $ret = TRUE; + $ret = true; }else{ Helpers::addNotificationLog($title, $content, 3, 'admin', $result->message); } @@ -85,4 +81,4 @@ class PushNotification return $ret; } -} \ No newline at end of file +} diff --git a/app/Components/QQInfo.php b/app/Components/QQInfo.php index a3c7eddc..6fcedde5 100644 --- a/app/Components/QQInfo.php +++ b/app/Components/QQInfo.php @@ -2,41 +2,38 @@ namespace App\Components; -class QQInfo -{ +class QQInfo { /** * 通过QQ号查询头像与昵称信息 * - * @param string $qq QQ号 + * @param string $qq QQ号 * * @return string */ - public static function getName($qq) - { + public static function getName($qq) { //向接口发起请求获取json数据 $url = 'https://r.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?get_nick=1&uins='.$qq; $ret = mb_convert_encoding(Curl::send($url), "UTF-8", "GBK"); // 接口是否异常 //echo $ret; - if(strpos($ret, $qq) !== FALSE){ + if(strpos($ret, $qq) !== false){ //对获取的json数据进行截取并解析成数组 - $ret = json_decode(substr($ret, 17, -1), TRUE); + $ret = json_decode(substr($ret, 17, -1), true); return stripslashes($ret[$qq][6]); } echo $qq.PHP_EOL; - return FALSE; + return false; } - public static function getName2($qq) - { + public static function getName2($qq) { //向接口发起请求获取json数据 $url = 'https://api.toubiec.cn/qq?qq='.$qq.'&size=100'; - $ret = json_decode(Curl::send($url), TRUE); + $ret = json_decode(Curl::send($url), true); // 接口是否异常 if($ret){ if($ret['code'] == 200){ @@ -46,14 +43,13 @@ class QQInfo echo $qq.PHP_EOL; - return FALSE; + return false; } - public static function getName3($qq) - { + public static function getName3($qq) { //向接口发起请求获取json数据 $url = 'https://api.unipay.qq.com/v1/r/1450000186/wechat_query?cmd=1&pf=mds_storeopen_qb-__mds_qqclub_tab_-html5&pfkey=pfkey&from_h5=1&from_https=1&openid=openid&openkey=openkey&session_id=hy_gameid&session_type=st_dummy&qq_appid=&offerId=1450000186&sandbox=&provide_uin='.$qq; - $ret = json_decode(Curl::send($url), TRUE); + $ret = json_decode(Curl::send($url), true); // 接口是否异常 if($ret){ if($ret['ret'] == 0){ @@ -63,6 +59,6 @@ class QQInfo echo $qq.PHP_EOL; - return FALSE; + return false; } -} \ No newline at end of file +} diff --git a/app/Components/QQWry.php b/app/Components/QQWry.php index ce3e60e0..f20b3b6c 100644 --- a/app/Components/QQWry.php +++ b/app/Components/QQWry.php @@ -4,19 +4,17 @@ namespace App\Components; use itbdw\Ip\IpLocation; -class QQWry -{ +class QQWry { /** * 查询IP地址的详细信息 * - * @param string $ip IPv4 + * @param string $ip IPv4 * * @return array */ - public static function ip($ip) - { + public static function ip($ip) { $filePath = public_path('qqwry.dat'); return IpLocation::getLocation($ip, $filePath); } -} \ No newline at end of file +} diff --git a/app/Console/Commands/AutoClearLog.php b/app/Console/Commands/AutoClearLog.php index 7d6d052d..413a7419 100644 --- a/app/Console/Commands/AutoClearLog.php +++ b/app/Console/Commands/AutoClearLog.php @@ -18,34 +18,30 @@ use Exception; use Illuminate\Console\Command; use Log; -class AutoClearLog extends Command -{ +class AutoClearLog extends Command { protected $signature = 'autoClearLog'; protected $description = '自动清除日志'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 清除日志 if(Helpers::systemConfig()['is_clear_log']){ $this->clearLog(); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } // 清除日志 - private function clearLog() - { + private function clearLog() { // 自动清除30分钟以前的节点负载信息日志 try{ SsNodeInfo::query()->where('log_time', '<=', strtotime("-30 minutes"))->delete(); @@ -60,13 +56,19 @@ class AutoClearLog extends Command UserTrafficHourly::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 days')))->delete(); // 自动清除1个月以前的用户每天流量数据日志 - UserTrafficDaily::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-1 month 5 days')))->delete(); + UserTrafficDaily::query() + ->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-1 month 5 days'))) + ->delete(); // 自动清除2个月以前的节点每小时流量数据日志 - SsNodeTrafficHourly::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-2 month')))->delete(); + SsNodeTrafficHourly::query() + ->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-2 month'))) + ->delete(); // 自动清除3个月以前的节点每天流量数据日志 - SsNodeTrafficDaily::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 month')))->delete(); + SsNodeTrafficDaily::query() + ->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 month'))) + ->delete(); // 自动清除30天以前用户封禁日志 UserBanLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-1 month")))->delete(); @@ -78,7 +80,9 @@ class AutoClearLog extends Command UserLoginLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-3 month")))->delete(); // 自动清除1个月前的用户订阅记录 - UserSubscribeLog::query()->where('request_time', '<=', date('Y-m-d H:i:s', strtotime("-1 month")))->delete(); + UserSubscribeLog::query() + ->where('request_time', '<=', date('Y-m-d H:i:s', strtotime("-1 month"))) + ->delete(); }catch(Exception $e){ Log::error('【清理日志】错误: '.$e->getMessage()); } diff --git a/app/Console/Commands/AutoJob.php b/app/Console/Commands/AutoJob.php index 7bf450f1..4eeffc1e 100644 --- a/app/Console/Commands/AutoJob.php +++ b/app/Console/Commands/AutoJob.php @@ -23,14 +23,12 @@ use Exception; use Illuminate\Console\Command; use Log; -class AutoJob extends Command -{ +class AutoJob extends Command { protected static $systemConfig; protected $signature = 'autoJob'; protected $description = '自动化任务'; - public function __construct() - { + public function __construct() { parent::__construct(); self::$systemConfig = Helpers::systemConfig(); } @@ -38,9 +36,8 @@ class AutoJob extends Command /* * 警告:除非熟悉业务流程,否则不推荐更改以下执行顺序,随意变更以下顺序可能导致系统异常 */ - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 关闭超时未支付在线订单 $this->closePayments(); @@ -74,17 +71,19 @@ class AutoJob extends Command } } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } // 关闭超时未在线支付订单 - private function closePayments() - { + private function closePayments() { // 关闭超时未支付的在线支付订单(在线支付收款二维码超过30分钟自动关闭,关闭后无法再支付,所以我们限制15分钟内必须付款) - $paymentList = Payment::query()->whereStatus(0)->where('created_at', '<=', date("Y-m-d H:i:s", strtotime("-15 minutes")))->get(); + $paymentList = Payment::query() + ->whereStatus(0) + ->where('created_at', '<=', date("Y-m-d H:i:s", strtotime("-15 minutes"))) + ->get(); if($paymentList->isNotEmpty()){ DB::beginTransaction(); try{ @@ -99,7 +98,8 @@ class AutoJob extends Command if($payment->order->coupon_id){ Coupon::query()->whereId($payment->order->coupon_id)->update(['status' => 0]); - Helpers::addCouponLog($payment->order->coupon_id, $payment->order->goods_id, $payment->oid, '在线订单超时未支付,自动退回'); + Helpers::addCouponLog($payment->order->coupon_id, $payment->order->goods_id, $payment->oid, + '在线订单超时未支付,自动退回'); } } @@ -113,10 +113,12 @@ class AutoJob extends Command } // 关闭超时未支付订单 - private function closeOrders() - { + private function closeOrders() { // 关闭超时未支付的在线支付订单(在线支付收款二维码超过30分钟自动关闭,关闭后无法再支付,所以我们限制15分钟内必须付款) - $orderList = Order::query()->whereStatus(0)->where('created_at', '<=', date("Y-m-d H:i:s", strtotime("-30 minutes")))->get(); + $orderList = Order::query() + ->whereStatus(0) + ->where('created_at', '<=', date("Y-m-d H:i:s", strtotime("-30 minutes"))) + ->get(); if($orderList->isNotEmpty()){ DB::beginTransaction(); try{ @@ -142,10 +144,12 @@ class AutoJob extends Command } // 注册验证码自动置无效 - private function expireCode() - { + private function expireCode() { // 注册验证码自动置无效 - VerifyCode::query()->whereStatus(0)->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-10 minutes")))->update(['status' => 2]); + VerifyCode::query() + ->whereStatus(0) + ->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-10 minutes"))) + ->update(['status' => 2]); // 优惠券到期自动置无效 Coupon::query()->whereStatus(0)->where('available_end', '<=', time())->update(['status' => 2]); @@ -155,17 +159,25 @@ class AutoJob extends Command } // 封禁访问异常的订阅链接 - private function blockSubscribe() - { + private function blockSubscribe() { if(self::$systemConfig['is_subscribe_ban']){ $userList = User::query()->where('status', '>=', 0)->whereEnable(1)->get(); foreach($userList as $user){ $subscribe = UserSubscribe::query()->whereUserId($user->id)->first(); if($subscribe){ // 24小时内不同IP的请求次数 - $request_times = UserSubscribeLog::query()->whereSid($subscribe->id)->where('request_time', '>=', date("Y-m-d H:i:s", strtotime("-24 hours")))->distinct('request_ip')->count('request_ip'); + $request_times = UserSubscribeLog::query() + ->whereSid($subscribe->id) + ->where('request_time', '>=', + date("Y-m-d H:i:s", strtotime("-24 hours"))) + ->distinct('request_ip') + ->count('request_ip'); if($request_times >= self::$systemConfig['subscribe_ban_times']){ - UserSubscribe::query()->whereId($subscribe->id)->update(['status' => 0, 'ban_time' => time(), 'ban_desc' => '存在异常,自动封禁']); + UserSubscribe::query()->whereId($subscribe->id)->update([ + 'status' => 0, + 'ban_time' => time(), + 'ban_desc' => '存在异常,自动封禁' + ]); // 记录封禁日志 $this->addUserBanLog($subscribe->user_id, 0, '【完全封禁订阅】-订阅24小时内请求异常'); @@ -178,12 +190,11 @@ class AutoJob extends Command /** * 添加用户封禁日志 * - * @param int $userId 用户ID - * @param int $minutes 封禁时长,单位分钟 - * @param string $desc 封禁理由 + * @param int $userId 用户ID + * @param int $minutes 封禁时长,单位分钟 + * @param string $desc 封禁理由 */ - private function addUserBanLog($userId, $minutes, $desc) - { + private function addUserBanLog($userId, $minutes, $desc) { $log = new UserBanLog(); $log->user_id = $userId; $log->minutes = $minutes; @@ -192,8 +203,7 @@ class AutoJob extends Command } // 封禁账号 - private function blockUsers() - { + private function blockUsers() { // 封禁1小时内流量异常账号 if(self::$systemConfig['is_traffic_ban']){ $userList = User::query()->whereEnable(1)->where('status', '>=', 0)->whereBanTime(0)->get(); @@ -204,9 +214,17 @@ class AutoJob extends Command } // 多往前取5分钟,防止数据统计任务执行时间过长导致没有数据 - $totalTraffic = UserTrafficHourly::query()->whereUserId($user->id)->whereNodeId(0)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->sum('total'); - if($totalTraffic >= (self::$systemConfig['traffic_ban_value']*1073741824)){ - User::query()->whereId($user->id)->update(['enable' => 0, 'ban_time' => strtotime(date('Y-m-d H:i:s', strtotime("+".self::$systemConfig['traffic_ban_time']." minutes")))]); + $totalTraffic = UserTrafficHourly::query() + ->whereUserId($user->id) + ->whereNodeId(0) + ->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900)) + ->sum('total'); + if($totalTraffic >= (self::$systemConfig['traffic_ban_value'] * 1073741824)){ + User::query()->whereId($user->id)->update([ + 'enable' => 0, + 'ban_time' => strtotime(date('Y-m-d H:i:s', + strtotime("+".self::$systemConfig['traffic_ban_time']." minutes"))) + ]); // 写入日志 $this->addUserBanLog($user->id, self::$systemConfig['traffic_ban_time'], '【临时封禁代理】-1小时内流量异常'); @@ -215,7 +233,12 @@ class AutoJob extends Command } // 禁用流量超限用户 - $userList = User::query()->whereEnable(1)->where('status', '>=', 0)->whereBanTime(0)->whereRaw("u + d >= transfer_enable")->get(); + $userList = User::query() + ->whereEnable(1) + ->where('status', '>=', 0) + ->whereBanTime(0) + ->whereRaw("u + d >= transfer_enable") + ->get(); foreach($userList as $user){ User::query()->whereId($user->id)->update(['enable' => 0]); @@ -225,8 +248,7 @@ class AutoJob extends Command } // 解封被临时封禁的账号 - private function unblockUsers() - { + private function unblockUsers() { // 解封被临时封禁的账号 $userList = User::query()->whereEnable(0)->where('status', '>=', 0)->where('ban_time', '>', 0)->get(); foreach($userList as $user){ @@ -239,7 +261,13 @@ class AutoJob extends Command } // 可用流量大于已用流量也解封(比如:邀请返利自动加了流量) - $userList = User::query()->whereEnable(0)->where('status', '>=', 0)->whereBanTime(0)->where('expire_time', '>=', date('Y-m-d'))->whereRaw("u + d < transfer_enable")->get(); + $userList = User::query() + ->whereEnable(0) + ->where('status', '>=', 0) + ->whereBanTime(0) + ->where('expire_time', '>=', date('Y-m-d')) + ->whereRaw("u + d < transfer_enable") + ->get(); foreach($userList as $user){ User::query()->whereId($user->id)->update(['enable' => 1]); @@ -249,8 +277,7 @@ class AutoJob extends Command } // 端口回收与分配 - private function dispatchPort() - { + private function dispatchPort() { if(self::$systemConfig['auto_release_port']){ ## 自动分配端口 $userList = User::query()->whereEnable(1)->where('status', '>=', 0)->wherePort(0)->get(); @@ -264,18 +291,25 @@ class AutoJob extends Command User::query()->whereEnable(0)->whereStatus(-1)->where('port', '!=', 0)->update(['port' => 0]); ## 过期一个月的账户自动释放端口 - User::query()->whereEnable(0)->where('port', '!=', 0)->where('expire_time', '<=', date("Y-m-d", strtotime("-30 days")))->update(['port' => 0]); + User::query() + ->whereEnable(0) + ->where('port', '!=', 0) + ->where('expire_time', '<=', date("Y-m-d", strtotime("-30 days"))) + ->update(['port' => 0]); } } // 检测节点是否离线 - private function checkNodeStatus() - { + private function checkNodeStatus() { if(self::$systemConfig['is_node_offline']){ $nodeList = SsNode::query()->whereIsTransit(0)->whereStatus(1)->get(); foreach($nodeList as $node){ // 10分钟内无节点负载信息则认为是后端炸了 - $nodeTTL = SsNodeInfo::query()->whereNodeId($node->id)->where('log_time', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->doesntExist(); + $nodeTTL = SsNodeInfo::query() + ->whereNodeId($node->id) + ->where('log_time', '>=', strtotime("-10 minutes")) + ->orderBy('id', 'desc') + ->doesntExist(); if($nodeTTL){ if(self::$systemConfig['offline_check_times']){ // 已通知次数 diff --git a/app/Console/Commands/AutoPingNode.php b/app/Console/Commands/AutoPingNode.php index e15b180b..c2cfc16d 100644 --- a/app/Console/Commands/AutoPingNode.php +++ b/app/Console/Commands/AutoPingNode.php @@ -8,34 +8,30 @@ use App\Http\Models\SsNodePing; use Illuminate\Console\Command; use Log; -class AutoPingNode extends Command -{ +class AutoPingNode extends Command { protected $signature = 'autoPingNode'; protected $description = '节点定时Ping测速'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); $nodeList = SsNode::query()->whereIsTransit(0)->whereStatus(1)->get(); foreach($nodeList as $node){ $this->pingNode($node->id, $node->is_ddns? $node->server : $node->ip); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } // 节点Ping测速 - private function pingNode($nodeId, $ip) - { + private function pingNode($nodeId, $ip) { $result = NetworkDetection::ping($ip); if($result){ diff --git a/app/Console/Commands/AutoReportNode.php b/app/Console/Commands/AutoReportNode.php index b7c91be2..d32c8b08 100644 --- a/app/Console/Commands/AutoReportNode.php +++ b/app/Console/Commands/AutoReportNode.php @@ -9,19 +9,16 @@ use App\Http\Models\SsNodeTrafficDaily; use Illuminate\Console\Command; use Log; -class AutoReportNode extends Command -{ +class AutoReportNode extends Command { protected $signature = 'autoReportNode'; protected $description = '自动报告节点昨日使用情况'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); if(Helpers::systemConfig()['node_daily_report']){ $nodeList = SsNode::query()->whereStatus(1)->get(); @@ -29,10 +26,10 @@ class AutoReportNode extends Command $msg = "|节点|上行流量|下行流量|合计|\r\n| :------ | :------ | :------ |\r\n"; foreach($nodeList as $node){ $log = SsNodeTrafficDaily::query() - ->whereNodeId($node->id) - ->where('created_at', '>=', date('Y-m-d 00:00:00', strtotime("-1 day"))) - ->where('created_at', '<=', date('Y-m-d 23:59:59', strtotime("-1 day"))) - ->first(); + ->whereNodeId($node->id) + ->where('created_at', '>=', date('Y-m-d 00:00:00', strtotime("-1 day"))) + ->where('created_at', '<=', date('Y-m-d 23:59:59', strtotime("-1 day"))) + ->first(); if($log){ $msg .= '|'.$node->name.'|'.flowAutoShow($log->u).'|'.flowAutoShow($log->d).'|'.$log->traffic."\r\n"; @@ -45,8 +42,8 @@ class AutoReportNode extends Command } } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } diff --git a/app/Console/Commands/AutoStatisticsNodeDailyTraffic.php b/app/Console/Commands/AutoStatisticsNodeDailyTraffic.php index cf0e4d07..eccd870a 100644 --- a/app/Console/Commands/AutoStatisticsNodeDailyTraffic.php +++ b/app/Console/Commands/AutoStatisticsNodeDailyTraffic.php @@ -8,33 +8,29 @@ use App\Http\Models\UserTrafficLog; use Illuminate\Console\Command; use Log; -class AutoStatisticsNodeDailyTraffic extends Command -{ +class AutoStatisticsNodeDailyTraffic extends Command { protected $signature = 'autoStatisticsNodeDailyTraffic'; protected $description = '自动统计节点每日流量'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); $nodeList = SsNode::query()->whereStatus(1)->orderBy('id', 'asc')->get(); foreach($nodeList as $node){ $this->statisticsByNode($node->id); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } - private function statisticsByNode($node_id) - { + private function statisticsByNode($node_id) { $start_time = strtotime(date('Y-m-d 00:00:00', strtotime("-1 day"))); $end_time = strtotime(date('Y-m-d 23:59:59', strtotime("-1 day"))); @@ -42,7 +38,7 @@ class AutoStatisticsNodeDailyTraffic extends Command $u = $query->sum('u'); $d = $query->sum('d'); - $total = $u+$d; + $total = $u + $d; $traffic = flowAutoShow($total); if($total){ // 有数据才记录 diff --git a/app/Console/Commands/AutoStatisticsNodeHourlyTraffic.php b/app/Console/Commands/AutoStatisticsNodeHourlyTraffic.php index bec85af7..17f876e6 100644 --- a/app/Console/Commands/AutoStatisticsNodeHourlyTraffic.php +++ b/app/Console/Commands/AutoStatisticsNodeHourlyTraffic.php @@ -8,33 +8,29 @@ use App\Http\Models\UserTrafficLog; use Illuminate\Console\Command; use Log; -class AutoStatisticsNodeHourlyTraffic extends Command -{ +class AutoStatisticsNodeHourlyTraffic extends Command { protected $signature = 'autoStatisticsNodeHourlyTraffic'; protected $description = '自动统计节点每小时流量'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); $nodeList = SsNode::query()->whereStatus(1)->orderBy('id', 'asc')->get(); foreach($nodeList as $node){ $this->statisticsByNode($node->id); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } - private function statisticsByNode($node_id) - { + private function statisticsByNode($node_id) { $start_time = strtotime(date('Y-m-d H:i:s', strtotime("-1 hour"))); $end_time = time(); @@ -42,7 +38,7 @@ class AutoStatisticsNodeHourlyTraffic extends Command $u = $query->sum('u'); $d = $query->sum('d'); - $total = $u+$d; + $total = $u + $d; $traffic = flowAutoShow($total); if($total){ // 有数据才记录 diff --git a/app/Console/Commands/AutoStatisticsUserDailyTraffic.php b/app/Console/Commands/AutoStatisticsUserDailyTraffic.php index df05803d..c5cbd25f 100644 --- a/app/Console/Commands/AutoStatisticsUserDailyTraffic.php +++ b/app/Console/Commands/AutoStatisticsUserDailyTraffic.php @@ -9,19 +9,16 @@ use App\Http\Models\UserTrafficLog; use Illuminate\Console\Command; use Log; -class AutoStatisticsUserDailyTraffic extends Command -{ +class AutoStatisticsUserDailyTraffic extends Command { protected $signature = 'autoStatisticsUserDailyTraffic'; protected $description = '自动统计用户每日流量'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); $userList = User::query()->where('status', '>=', 0)->whereEnable(1)->get(); foreach($userList as $user){ @@ -35,14 +32,13 @@ class AutoStatisticsUserDailyTraffic extends Command } } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } - private function statisticsByNode($user_id, $node_id = 0) - { + private function statisticsByNode($user_id, $node_id = 0) { $start_time = strtotime(date('Y-m-d 00:00:00', strtotime("-1 day"))); $end_time = strtotime(date('Y-m-d 23:59:59', strtotime("-1 day"))); @@ -54,7 +50,7 @@ class AutoStatisticsUserDailyTraffic extends Command $u = $query->sum('u'); $d = $query->sum('d'); - $total = $u+$d; + $total = $u + $d; $traffic = flowAutoShow($total); if($total){ // 有数据才记录 diff --git a/app/Console/Commands/AutoStatisticsUserHourlyTraffic.php b/app/Console/Commands/AutoStatisticsUserHourlyTraffic.php index dfe28490..7745d925 100644 --- a/app/Console/Commands/AutoStatisticsUserHourlyTraffic.php +++ b/app/Console/Commands/AutoStatisticsUserHourlyTraffic.php @@ -9,19 +9,16 @@ use App\Http\Models\UserTrafficLog; use Illuminate\Console\Command; use Log; -class AutoStatisticsUserHourlyTraffic extends Command -{ +class AutoStatisticsUserHourlyTraffic extends Command { protected $signature = 'autoStatisticsUserHourlyTraffic'; protected $description = '自动统计用户每小时流量'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); $userList = User::query()->where('status', '>=', 0)->whereEnable(1)->get(); foreach($userList as $user){ @@ -35,14 +32,13 @@ class AutoStatisticsUserHourlyTraffic extends Command } } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } - private function statisticsByNode($user_id, $node_id = 0) - { + private function statisticsByNode($user_id, $node_id = 0) { $start_time = strtotime(date('Y-m-d H:i:s', strtotime("-1 hour"))); $end_time = time(); @@ -54,7 +50,7 @@ class AutoStatisticsUserHourlyTraffic extends Command $u = $query->sum('u'); $d = $query->sum('d'); - $total = $u+$d; + $total = $u + $d; $traffic = flowAutoShow($total); if($total){ // 有数据才记录 diff --git a/app/Console/Commands/DailyJob.php b/app/Console/Commands/DailyJob.php index f7f50283..386fd6a5 100644 --- a/app/Console/Commands/DailyJob.php +++ b/app/Console/Commands/DailyJob.php @@ -13,21 +13,18 @@ use App\Http\Models\UserLabel; use Illuminate\Console\Command; use Log; -class DailyJob extends Command -{ +class DailyJob extends Command { protected static $systemConfig; protected $signature = 'dailyJob'; protected $description = '每日任务'; - public function __construct() - { + public function __construct() { parent::__construct(); self::$systemConfig = Helpers::systemConfig(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 过期用户处理 $this->expireUser(); @@ -40,27 +37,30 @@ class DailyJob extends Command $this->resetUserTraffic(); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } - private function expireUser() - { + private function expireUser() { // 过期用户处理 - $userList = User::query()->where('status', '>=', 0)->whereEnable(1)->where('expire_time', '<', date('Y-m-d'))->get(); + $userList = User::query() + ->where('status', '>=', 0) + ->whereEnable(1) + ->where('expire_time', '<', date('Y-m-d')) + ->get(); foreach($userList as $user){ if(self::$systemConfig['is_ban_status']){ User::query()->whereId($user->id)->update([ - 'u' => 0, - 'd' => 0, - 'transfer_enable' => 0, - 'enable' => 0, - 'reset_time' => NULL, - 'ban_time' => 0, - 'status' => -1 - ]); + 'u' => 0, + 'd' => 0, + 'transfer_enable' => 0, + 'enable' => 0, + 'reset_time' => null, + 'ban_time' => 0, + 'status' => -1 + ]); $this->addUserBanLog($user->id, 0, '【禁止登录,清空账户】-账号已过期'); @@ -71,13 +71,13 @@ class DailyJob extends Command Helpers::addUserTrafficModifyLog($user->id, 0, $user->transfer_enable, 0, '[定时任务]账号已过期(禁止登录,清空账户)'); }else{ User::query()->whereId($user->id)->update([ - 'u' => 0, - 'd' => 0, - 'transfer_enable' => 0, - 'enable' => 0, - 'reset_time' => NULL, - 'ban_time' => 0 - ]); + 'u' => 0, + 'd' => 0, + 'transfer_enable' => 0, + 'enable' => 0, + 'reset_time' => null, + 'ban_time' => 0 + ]); $this->addUserBanLog($user->id, 0, '【封禁代理,清空账户】-账号已过期'); @@ -93,12 +93,11 @@ class DailyJob extends Command /** * 添加用户封禁日志 * - * @param int $userId 用户ID - * @param int $minutes 封禁时长,单位分钟 - * @param string $desc 封禁理由 + * @param int $userId 用户ID + * @param int $minutes 封禁时长,单位分钟 + * @param string $desc 封禁理由 */ - private function addUserBanLog($userId, $minutes, $desc) - { + private function addUserBanLog($userId, $minutes, $desc) { $log = new UserBanLog(); $log->user_id = $userId; $log->minutes = $minutes; @@ -107,9 +106,11 @@ class DailyJob extends Command } // 关闭超过72小时未处理的工单 - private function closeTickets() - { - $ticketList = Ticket::query()->where('updated_at', '<=', date('Y-m-d', strtotime("-3 days")))->whereStatus(1)->get(); + private function closeTickets() { + $ticketList = Ticket::query() + ->where('updated_at', '<=', date('Y-m-d', strtotime("-3 days"))) + ->whereStatus(1) + ->get(); foreach($ticketList as $ticket){ $ret = Ticket::query()->whereId($ticket->id)->update(['status' => 2]); if($ret){ @@ -119,9 +120,12 @@ class DailyJob extends Command } // 重置用户流量 - private function resetUserTraffic() - { - $userList = User::query()->where('status', '>=', 0)->where('expire_time', '>', date('Y-m-d'))->where('reset_time', '<=', date('Y-m-d'))->get(); + private function resetUserTraffic() { + $userList = User::query() + ->where('status', '>=', 0) + ->where('expire_time', '>', date('Y-m-d')) + ->where('reset_time', '<=', date('Y-m-d')) + ->get(); foreach($userList as $user){ // 跳过 没有重置日期的账号 if(!$user->reset_time){ @@ -130,14 +134,14 @@ class DailyJob extends Command // 取出用户正在使用的套餐 $order = Order::query() - ->with(['goods']) - ->whereUserId($user->id) - ->whereStatus(2) - ->whereIsExpire(0) - ->whereHas('goods', function($q){ - $q->whereType(2); - }) - ->first(); + ->with(['goods']) + ->whereUserId($user->id) + ->whereStatus(2) + ->whereIsExpire(0) + ->whereHas('goods', function($q) { + $q->whereType(2); + }) + ->first(); // 无订单的免费/特殊用户跳过 if(!$order){ @@ -146,26 +150,33 @@ class DailyJob extends Command // 过期生效中的加油包 Order::query() - ->with(['goods']) - ->whereUserId($user->id) - ->whereStatus(2) - ->whereIsExpire(0) - ->whereHas('goods', function($q){ - $q->whereType(1); - })->update(['is_expire' => 1]); + ->with(['goods']) + ->whereUserId($user->id) + ->whereStatus(2) + ->whereIsExpire(0) + ->whereHas('goods', function($q) { + $q->whereType(1); + }) + ->update(['is_expire' => 1]); //账号下一个重置时间 $nextResetTime = date('Y-m-d', strtotime("+".$order->goods->period." days")); if($nextResetTime >= $user->expire_time){ - $nextResetTime = NULL; + $nextResetTime = null; } // 可用流量 变动日志 - if($user->transfer_enable != $order->goods->traffic*1048576){ - Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, $order->goods->traffic*1048576, '【流量重置】重置可用流量'); + if($user->transfer_enable != $order->goods->traffic * 1048576){ + Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, + $order->goods->traffic * 1048576, '【流量重置】重置可用流量'); } // 重置流量 - User::query()->whereId($user->id)->update(['u' => 0, 'd' => 0, 'transfer_enable' => $order->goods->traffic*1048576, 'reset_time' => $nextResetTime]); - Log::info('用户[ID:'.$user->id.' 昵称: '.$user->username.' 邮箱: '.$user->email.'] 流量重置为 '.($order->goods->traffic*1048576).'. 重置日期为 '.($nextResetTime? : '【无】')); + User::query()->whereId($user->id)->update([ + 'u' => 0, + 'd' => 0, + 'transfer_enable' => $order->goods->traffic * 1048576, + 'reset_time' => $nextResetTime + ]); + Log::info('用户[ID:'.$user->id.' 昵称: '.$user->username.' 邮箱: '.$user->email.'] 流量重置为 '.($order->goods->traffic * 1048576).'. 重置日期为 '.($nextResetTime?: '【无】')); } } -} \ No newline at end of file +} diff --git a/app/Console/Commands/NodeBlockedDetection.php b/app/Console/Commands/NodeBlockedDetection.php index df2c5efd..565b2672 100644 --- a/app/Console/Commands/NodeBlockedDetection.php +++ b/app/Console/Commands/NodeBlockedDetection.php @@ -12,21 +12,18 @@ use Illuminate\Console\Command; use Log; use Mail; -class NodeBlockedDetection extends Command -{ +class NodeBlockedDetection extends Command { protected static $systemConfig; protected $signature = 'nodeBlockedDetection'; protected $description = '节点阻断检测'; - public function __construct() - { + public function __construct() { parent::__construct(); self::$systemConfig = Helpers::systemConfig(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); if(self::$systemConfig['nodes_detection']){ if(!Cache::has('LastCheckTime')){ $this->checkNodes(); @@ -37,21 +34,20 @@ class NodeBlockedDetection extends Command } } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info("---【{$this->description}】完成---,耗时 {$jobUsedTime} 秒"); } // 监测节点状态 - private function checkNodes() - { + private function checkNodes() { $nodeList = SsNode::query()->whereIsTransit(0)->whereStatus(1)->where('detectionType', '>', 0)->get(); - $sendText = FALSE; + $sendText = false; $message = "| 线路 | 协议 | 状态 |\r\n| ------ | ------ | ------ |\r\n"; $additionalMessage = ''; foreach($nodeList as $node){ - $info = FALSE; + $info = false; if($node->detectionType == 0){ continue; } @@ -66,19 +62,19 @@ class NodeBlockedDetection extends Command } } if($node->detectionType != 1){ - $icmpCheck = NetworkDetection::networkCheck($node->ip, TRUE); - if($icmpCheck != FALSE && $icmpCheck != "通讯正常"){ + $icmpCheck = NetworkDetection::networkCheck($node->ip, true); + if($icmpCheck != false && $icmpCheck != "通讯正常"){ $message .= "| ".$node->name." | ICMP | ".$icmpCheck." |\r\n"; - $sendText = TRUE; - $info = TRUE; + $sendText = true; + $info = true; } } if($node->detectionType != 2){ - $tcpCheck = NetworkDetection::networkCheck($node->ip, FALSE, $node->single? $node->port : NULL); - if($tcpCheck != FALSE && $tcpCheck != "通讯正常"){ + $tcpCheck = NetworkDetection::networkCheck($node->ip, false, $node->single? $node->port : null); + if($tcpCheck != false && $tcpCheck != "通讯正常"){ $message .= "| ".$node->name." | TCP | ".$tcpCheck." |\r\n"; - $sendText = TRUE; - $info = TRUE; + $sendText = true; + $info = true; } } @@ -113,18 +109,17 @@ class NodeBlockedDetection extends Command } // 随机生成下次检测时间 - Cache::put('LastCheckTime', time()+mt_rand(3000, 3600), 4000); + Cache::put('LastCheckTime', time() + mt_rand(3000, 3600), 4000); } /** * 通知管理员 * - * @param string $title 消息标题 - * @param string $content 消息内容 + * @param string $title 消息标题 + * @param string $content 消息内容 * */ - private function notifyMaster($title, $content) - { + private function notifyMaster($title, $content) { $result = PushNotification::send($title, $content); if(!$result && self::$systemConfig['webmaster_email']){ $logId = Helpers::addNotificationLog($title, $content, 1, self::$systemConfig['webmaster_email']); diff --git a/app/Console/Commands/ServiceTimer.php b/app/Console/Commands/ServiceTimer.php index fc4d73f1..2f327d77 100644 --- a/app/Console/Commands/ServiceTimer.php +++ b/app/Console/Commands/ServiceTimer.php @@ -12,34 +12,32 @@ use Exception; use Illuminate\Console\Command; use Log; -class ServiceTimer extends Command -{ +class ServiceTimer extends Command { protected $signature = 'serviceTimer'; protected $description = '服务计时器'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 扣减用户到期商品的流量 $this->decGoodsTraffic(); - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } // 扣减用户到期商品的流量 - private function decGoodsTraffic() - { + private function decGoodsTraffic() { //获取失效的套餐 - $orderList = Order::query()->with(['goods'])->whereStatus(2)->whereIsExpire(0)->whereHas('goods', function($q){ $q->whereType(2); })->where('expire_at', '<=', date('Y-m-d H:i:s'))->get(); + $orderList = Order::query()->with(['goods'])->whereStatus(2)->whereIsExpire(0)->whereHas('goods', function($q) { + $q->whereType(2); + })->where('expire_at', '<=', date('Y-m-d H:i:s'))->get(); if($orderList->isNotEmpty()){ try{ DB::beginTransaction(); @@ -49,27 +47,38 @@ class ServiceTimer extends Command // 过期生效中的加油包 Order::query() - ->with(['goods']) - ->whereUserId($order->user_id) - ->whereStatus(2) - ->whereIsExpire(0) - ->whereHas('goods', function($q){ - $q->whereType(1); - })->update(['is_expire' => 1]); + ->with(['goods']) + ->whereUserId($order->user_id) + ->whereStatus(2) + ->whereIsExpire(0) + ->whereHas('goods', function($q) { + $q->whereType(1); + }) + ->update(['is_expire' => 1]); if(empty($order->user) || empty($order->goods)){ continue; } // 清理全部流量 - Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $order->user->transfer_enable, 0, '[定时任务]用户所购商品到期,扣减商品对应的流量'); - User::query()->whereId($order->user_id)->update(['u' => 0, 'd' => 0, 'transfer_enable' => 0, 'reset_time' => NULL]); + Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $order->user->transfer_enable, 0, + '[定时任务]用户所购商品到期,扣减商品对应的流量'); + User::query()->whereId($order->user_id)->update([ + 'u' => 0, + 'd' => 0, + 'transfer_enable' => 0, + 'reset_time' => null + ]); // 删除对应用户的所有标签 UserLabel::query()->whereUserId($order->user_id)->delete(); // 检查该订单对应用户是否有预支付套餐 - $prepaidOrder = Order::query()->whereUserId($order->user_id)->whereStatus(3)->orderBy('oid', 'asc')->first(); + $prepaidOrder = Order::query() + ->whereUserId($order->user_id) + ->whereStatus(3) + ->orderBy('oid', 'asc') + ->first(); if($prepaidOrder){ (new ServiceController)->activePrepaidOrder($prepaidOrder->oid); diff --git a/app/Console/Commands/UserExpireAutoWarning.php b/app/Console/Commands/UserExpireAutoWarning.php index 679020af..d92ba194 100644 --- a/app/Console/Commands/UserExpireAutoWarning.php +++ b/app/Console/Commands/UserExpireAutoWarning.php @@ -10,45 +10,41 @@ use Illuminate\Console\Command; use Log; use Mail; -class UserExpireAutoWarning extends Command -{ +class UserExpireAutoWarning extends Command { protected static $systemConfig; protected $signature = 'userExpireAutoWarning'; protected $description = '用户临近到期自动发邮件提醒'; - public function __construct() - { + public function __construct() { parent::__construct(); self::$systemConfig = Helpers::systemConfig(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 用户临近到期自动发邮件提醒 if(self::$systemConfig['expire_warning']){ $this->userExpireWarning(); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } - private function userExpireWarning() - { + private function userExpireWarning() { // 只取SSR没被禁用的用户,其他不用管 $userList = User::query()->whereEnable(1)->get(); foreach($userList as $user){ // 用户名不是邮箱的跳过 - if(FALSE === filter_var($user->email, FILTER_VALIDATE_EMAIL)){ + if(false === filter_var($user->email, FILTER_VALIDATE_EMAIL)){ continue; } // 计算剩余可用时间 - $lastCanUseDays = ceil(round(strtotime($user->expire_time)-strtotime(date('Y-m-d H:i:s')))/3600/24); + $lastCanUseDays = ceil(round(strtotime($user->expire_time) - strtotime(date('Y-m-d H:i:s'))) / 3600 / 24); if($lastCanUseDays == 0){ $title = '账号过期提醒'; $content = '您的账号将于今天晚上【24:00】过期。'; diff --git a/app/Console/Commands/UserTrafficAbnormalAutoWarning.php b/app/Console/Commands/UserTrafficAbnormalAutoWarning.php index bee39b35..a12fad12 100644 --- a/app/Console/Commands/UserTrafficAbnormalAutoWarning.php +++ b/app/Console/Commands/UserTrafficAbnormalAutoWarning.php @@ -9,36 +9,38 @@ use App\Http\Models\UserTrafficHourly; use Illuminate\Console\Command; use Log; -class UserTrafficAbnormalAutoWarning extends Command -{ +class UserTrafficAbnormalAutoWarning extends Command { protected static $systemConfig; protected $signature = 'userTrafficAbnormalAutoWarning'; protected $description = '用户流量异常警告'; - public function __construct() - { + public function __construct() { parent::__construct(); self::$systemConfig = Helpers::systemConfig(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 用户流量异常警告 $this->userTrafficAbnormalWarning(); - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } // 用户流量异常警告 - private function userTrafficAbnormalWarning() - { + private function userTrafficAbnormalWarning() { // 1小时内流量异常用户(多往前取5分钟,防止数据统计任务执行时间过长导致没有数据) - $userTotalTrafficList = UserTrafficHourly::query()->whereNodeId(0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快查询速度 + $userTotalTrafficList = UserTrafficHourly::query() + ->whereNodeId(0) + ->where('total', '>', 104857600) + ->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900)) + ->groupBy('user_id') + ->selectRaw("user_id, sum(total) as totalTraffic") + ->get(); // 只统计100M以上的记录,加快查询速度 if(!$userTotalTrafficList->isEmpty()){ $title = "流量异常用户提醒"; @@ -46,8 +48,13 @@ class UserTrafficAbnormalAutoWarning extends Command $user = User::query()->whereId($vo->user_id)->first(); // 推送通知管理员 - if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value']*1073741824)){ - $traffic = UserTrafficHourly::query()->whereNodeId(0)->whereUserId($vo->user_id)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->selectRaw("user_id, sum(`u`) as totalU, sum(`d`) as totalD, sum(total) as totalTraffic")->first(); + if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value'] * 1073741824)){ + $traffic = UserTrafficHourly::query() + ->whereNodeId(0) + ->whereUserId($vo->user_id) + ->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900)) + ->selectRaw("user_id, sum(`u`) as totalU, sum(`d`) as totalD, sum(total) as totalTraffic") + ->first(); $content = "用户**{$user->email}(ID:{$user->id})**,最近1小时**上行流量:".flowAutoShow($traffic->totalU).",下行流量:".flowAutoShow($traffic->totalD).",共计:".flowAutoShow($traffic->totalTraffic)."**。"; diff --git a/app/Console/Commands/UserTrafficAutoWarning.php b/app/Console/Commands/UserTrafficAutoWarning.php index 3ae4d3d8..687a8e5c 100644 --- a/app/Console/Commands/UserTrafficAutoWarning.php +++ b/app/Console/Commands/UserTrafficAutoWarning.php @@ -9,44 +9,40 @@ use Illuminate\Console\Command; use Log; use Mail; -class UserTrafficAutoWarning extends Command -{ +class UserTrafficAutoWarning extends Command { protected static $systemConfig; protected $signature = 'userTrafficAutoWarning'; protected $description = '用户流量超过警告阈值自动发邮件提醒'; - public function __construct() - { + public function __construct() { parent::__construct(); self::$systemConfig = Helpers::systemConfig(); } - public function handle() - { - $jobStartTime = microtime(TRUE); + public function handle() { + $jobStartTime = microtime(true); // 用户流量超过警告阈值自动发邮件提醒 if(self::$systemConfig['traffic_warning']){ $this->userTrafficWarning(); } - $jobEndTime = microtime(TRUE); - $jobUsedTime = round(($jobEndTime-$jobStartTime), 4); + $jobEndTime = microtime(true); + $jobUsedTime = round(($jobEndTime - $jobStartTime), 4); Log::info('---【'.$this->description.'】完成---,耗时'.$jobUsedTime.'秒'); } // 用户流量超过警告阈值自动发邮件提醒 - private function userTrafficWarning() - { + private function userTrafficWarning() { $userList = User::query()->where('status', '>=', 0)->whereEnable(1)->where('transfer_enable', '>', 0)->get(); foreach($userList as $user){ // 用户名不是邮箱的跳过 - if(FALSE === filter_var($user->email, FILTER_VALIDATE_EMAIL)){ + if(false === filter_var($user->email, FILTER_VALIDATE_EMAIL)){ continue; } - $usedPercent = round(($user->d+$user->u)/$user->transfer_enable, 2)*100; // 已使用流量百分比 + $usedPercent = round(($user->d + $user->u) / $user->transfer_enable, 2) * 100; // 已使用流量百分比 if($usedPercent >= self::$systemConfig['traffic_warning_percent']){ $title = '流量提醒'; $content = '流量已使用:'.$usedPercent.'%,请保持关注。'; diff --git a/app/Console/Commands/updateUserName.php b/app/Console/Commands/updateUserName.php index 1fd73f48..50e88662 100644 --- a/app/Console/Commands/updateUserName.php +++ b/app/Console/Commands/updateUserName.php @@ -7,18 +7,15 @@ use App\Http\Models\User; use Illuminate\Console\Command; use Log; -class updateUserName extends Command -{ +class updateUserName extends Command { protected $signature = 'updateUserName'; protected $description = '升级用户昵称'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { + public function handle() { Log::info('----------------------------【升级用户昵称】开始----------------------------'); $userList = User::query()->get(); @@ -43,8 +40,7 @@ class updateUserName extends Command } } -function process($id) -{ +function process($id) { $user = User::query()->whereId($id)->first(); // 先设个默认值 $name = $user->email; @@ -52,14 +48,14 @@ function process($id) if($user->qq){ $name = QQInfo::getName3($user->qq); // 检测用户注册是否为QQ邮箱 - }elseif(strpos(strtolower($user->email), '@qq') != FALSE){ + }elseif(strpos(strtolower($user->email), '@qq') != false){ // 分离QQ邮箱后缀 $email = explode('@', $user->email); if(is_numeric($email[0])){ $name = QQInfo::getName3($email[0]); }else{ // 分离www前缀 - if(strpos($email[0], '.') != FALSE){ + if(strpos($email[0], '.') != false){ $temp = explode('.', $email[0]); if(is_numeric($temp[1])){ $name = QQInfo::getName3($temp[1]); @@ -69,7 +65,7 @@ function process($id) } } } - if($name == FALSE){ + if($name == false){ $name = $user->email; } diff --git a/app/Console/Commands/upgradeUserResetTime.php b/app/Console/Commands/upgradeUserResetTime.php index 7d50f81f..63874f06 100644 --- a/app/Console/Commands/upgradeUserResetTime.php +++ b/app/Console/Commands/upgradeUserResetTime.php @@ -6,23 +6,20 @@ use App\Http\Models\User; use Illuminate\Console\Command; use Log; -class upgradeUserResetTime extends Command -{ +class upgradeUserResetTime extends Command { protected $signature = 'upgradeUserResetTime'; protected $description = '升级用户重置日期'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { + public function handle() { Log::info('----------------------------【升级用户重置日期】开始----------------------------'); $userList = User::query()->get(); foreach($userList as $user){ - $reset_time = NULL; + $reset_time = null; if($user->traffic_reset_day){ $today = date('d');// 今天 日期 $last_day = date('t'); //本月最后一天 @@ -31,7 +28,7 @@ class upgradeUserResetTime extends Command // 案例:31 29,重置日 大于 本月最后一天 if($resetDay > $last_day){ //往后推一个月 - $resetDay = $resetDay-$last_day; + $resetDay = $resetDay - $last_day; $reset_time = date('Y-m-'.$resetDay, strtotime("+1 month")); //案例:20<30<31 }elseif($resetDay < $last_day && $resetDay > $today){ @@ -43,7 +40,7 @@ class upgradeUserResetTime extends Command }elseif($resetDay < $today){ //类似第一种情况,向后推一月 if($resetDay > $next_last_day){ - $resetDay = $resetDay-$next_last_day; + $resetDay = $resetDay - $next_last_day; $reset_time = date('Y-m-'.$resetDay, strtotime("+1 month")); }else{ $reset_time = date('Y-m-'.$resetDay, strtotime("+1 month")); @@ -51,12 +48,12 @@ class upgradeUserResetTime extends Command } // 用户账号有效期大于重置日期 if($reset_time > $user->expire_time){ - $reset_time = NULL; + $reset_time = null; } User::query()->whereId($user->id)->update(['reset_time' => $reset_time]); } - Log::info('---用户[ID:'.$user->id.' - '.$user->username.' ('.$user->email.')]的新重置日期为'.($reset_time != NULL? '【'.$reset_time.'】' : '【无】').'---'); + Log::info('---用户[ID:'.$user->id.' - '.$user->username.' ('.$user->email.')]的新重置日期为'.($reset_time != null? '【'.$reset_time.'】' : '【无】').'---'); } Log::info('----------------------------【升级用户重置日期】结束----------------------------'); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b1461610..61fb44eb 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -20,8 +20,7 @@ use App\Console\Commands\UserTrafficAutoWarning; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; -class Kernel extends ConsoleKernel -{ +class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * @@ -48,12 +47,11 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param Schedule $schedule + * @param Schedule $schedule * * @return void */ - protected function schedule(Schedule $schedule) - { + protected function schedule(Schedule $schedule) { $schedule->command('autoJob')->everyMinute(); $schedule->command('serviceTimer')->everyTenMinutes(); $schedule->command('autoClearLog')->everyThirtyMinutes(); @@ -75,8 +73,7 @@ class Kernel extends ConsoleKernel * * @return void */ - protected function commands() - { + protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); diff --git a/app/Events/Event.php b/app/Events/Event.php index e3183026..009f0fe3 100644 --- a/app/Events/Event.php +++ b/app/Events/Event.php @@ -8,8 +8,7 @@ use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class Event -{ +class Event { use Dispatchable, InteractsWithSockets, SerializesModels; /** @@ -17,8 +16,7 @@ class Event * * @return void */ - public function __construct() - { + public function __construct() { // } @@ -27,8 +25,7 @@ class Event * * @return Channel|array */ - public function broadcastOn() - { + public function broadcastOn() { return new PrivateChannel('channel-name'); } } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3e837d58..124cdebb 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -13,16 +13,13 @@ use Log; use ReflectionException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -class Handler extends ExceptionHandler -{ +class Handler extends ExceptionHandler { /** * A list of the exception types that are not reported. * * @var array */ - protected $dontReport = [ - // - ]; + protected $dontReport = []; /** * A list of the inputs that are never flashed for validation exceptions. @@ -37,13 +34,12 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * @param Exception $exception + * @param Exception $exception * * @return mixed|void * @throws Exception */ - public function report(Exception $exception) - { + public function report(Exception $exception) { // 记录异常来源 Log::info('异常来源:'.get_class($exception)); @@ -58,13 +54,12 @@ class Handler extends ExceptionHandler /** * Render an exception into an HTTP response. * - * @param Request $request - * @param Exception $exception + * @param Request $request + * @param Exception $exception * * @return Response */ - public function render($request, Exception $exception) - { + public function render($request, Exception $exception) { // 调试模式下直接返回错误信息 if(config('app.debug')){ return parent::render($request, $exception); @@ -93,9 +88,15 @@ class Handler extends ExceptionHandler // 捕获CSRF异常 if($exception instanceof TokenMismatchException){ if($request->ajax()){ - return response()->json(['status' => 'fail', 'data' => '', 'message' => trans('error.RefreshPage').''.trans('error.Refresh').'']); + return response()->json([ + 'status' => 'fail', + 'data' => '', + 'message' => trans('error.RefreshPage').''.trans('error.Refresh').'' + ]); }else{ - return response()->view('auth.error', ['message' => trans('error.RefreshPage').''.trans('error.Refresh').'']); + return response()->view('auth.error', [ + 'message' => trans('error.RefreshPage').''.trans('error.Refresh').'' + ]); } } @@ -111,9 +112,15 @@ class Handler extends ExceptionHandler // 捕获系统错误异常 if($exception instanceof ErrorException){ if($request->ajax()){ - return response()->json(['status' => 'fail', 'data' => '', 'message' => trans('error.SystemError').', '.trans('error.Visit').''.trans('error.log').'']); + return response()->json([ + 'status' => 'fail', + 'data' => '', + 'message' => trans('error.SystemError').', '.trans('error.Visit').''.trans('error.log').'' + ]); }else{ - return response()->view('auth.error', ['message' => trans('error.SystemError').', '.trans('error.Visit').''.trans('error.log').'']); + return response()->view('auth.error', [ + 'message' => trans('error.SystemError').', '.trans('error.Visit').''.trans('error.log').'' + ]); } } diff --git a/app/Http/Controllers/Admin/AffiliateController.php b/app/Http/Controllers/Admin/AffiliateController.php index a0d68057..38dcb4c6 100644 --- a/app/Http/Controllers/Admin/AffiliateController.php +++ b/app/Http/Controllers/Admin/AffiliateController.php @@ -16,24 +16,21 @@ use Response; * * @package App\Http\Controllers\Controller */ -class AffiliateController extends Controller -{ +class AffiliateController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 提现申请列表 - public function affiliateList(Request $request) - { + public function affiliateList(Request $request) { $email = $request->input('email'); $status = $request->input('status'); $query = ReferralApply::with('user'); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -48,15 +45,18 @@ class AffiliateController extends Controller } // 提现申请详情 - public function affiliateDetail(Request $request) - { + public function affiliateDetail(Request $request) { $id = $request->input('id'); - $list = NULL; + $list = null; $apply = ReferralApply::query()->with(['user'])->whereId($id)->first(); if($apply && $apply->link_logs){ $link_logs = explode(',', $apply->link_logs); - $list = ReferralLog::query()->with(['user', 'order.goods'])->whereIn('id', $link_logs)->paginate(15)->appends($request->except('page')); + $list = ReferralLog::query() + ->with(['user', 'order.goods']) + ->whereIn('id', $link_logs) + ->paginate(15) + ->appends($request->except('page')); } $view['info'] = $apply; @@ -66,8 +66,7 @@ class AffiliateController extends Controller } // 设置提现申请状态 - public function setAffiliateStatus(Request $request) - { + public function setAffiliateStatus(Request $request) { $id = $request->input('id'); $status = $request->input('status'); @@ -87,8 +86,7 @@ class AffiliateController extends Controller } // 用户返利流水记录 - public function userRebateList(Request $request) - { + public function userRebateList(Request $request) { $email = $request->input('email'); $ref_email = $request->input('ref_email'); $status = $request->input('status'); @@ -96,13 +94,13 @@ class AffiliateController extends Controller $query = ReferralLog::query()->with(['user', 'order'])->orderBy('status', 'asc')->orderBy('id', 'desc'); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } if(isset($ref_email)){ - $query->whereHas('ref_user', function($q) use ($ref_email){ + $query->whereHas('ref_user', function($q) use ($ref_email) { $q->where('email', 'like', '%'.$ref_email.'%'); }); } diff --git a/app/Http/Controllers/Admin/CouponController.php b/app/Http/Controllers/Admin/CouponController.php index ad4d40b7..747bcc3f 100644 --- a/app/Http/Controllers/Admin/CouponController.php +++ b/app/Http/Controllers/Admin/CouponController.php @@ -20,11 +20,9 @@ use Response; * * @package App\Http\Controllers\Controller */ -class CouponController extends Controller -{ +class CouponController extends Controller { // 优惠券列表 - public function couponList(Request $request) - { + public function couponList(Request $request) { $sn = $request->input('sn'); $type = $request->input('type'); $status = $request->input('status'); @@ -49,8 +47,7 @@ class CouponController extends Controller } // 添加商品 - public function addCoupon(Request $request) - { + public function addCoupon(Request $request) { if($request->isMethod('POST')){ $this->validate($request, [ 'name' => 'required', @@ -63,29 +60,29 @@ class CouponController extends Controller 'available_start' => 'required|date|before_or_equal:available_end', 'available_end' => 'required|date|after_or_equal:available_start', ], [ - 'name.required' => '请填入卡券名称', - 'type.required' => '请选择卡券类型', - 'type.integer' => '卡券类型不合法,请重选', - 'type.between' => '卡券类型不合法,请重选', - 'usage.required' => '请选择卡券用途', - 'usage.integer' => '卡券用途不合法,请重选', - 'usage.between' => '卡券用途不合法,请重选', - 'num.required' => '请填写卡券数量', - 'num.integer' => '卡券数量不合法', - 'num.min' => '卡券数量不合法,最小1', - 'amount.required_unless' => '请填入卡券面值', - 'amount.numeric' => '卡券金额不合法', - 'amount.min' => '卡券金额不合法,最小0.01', - 'discount.required_if' => '请填入卡券折扣', - 'discount.numeric' => '卡券折扣不合法', - 'discount.between' => '卡券折扣不合法,有效范围:1 ~ 9.9', - 'available_start.required' => '请填入有效期', - 'available_start.date' => '有效期不合法', - 'available_start.before_or_equal' => '有效期不合法', - 'available_end.required' => '请填入有效期', - 'available_end.date' => '有效期不合法', - 'available_end.after_or_equal' => '有效期不合法' - ]); + 'name.required' => '请填入卡券名称', + 'type.required' => '请选择卡券类型', + 'type.integer' => '卡券类型不合法,请重选', + 'type.between' => '卡券类型不合法,请重选', + 'usage.required' => '请选择卡券用途', + 'usage.integer' => '卡券用途不合法,请重选', + 'usage.between' => '卡券用途不合法,请重选', + 'num.required' => '请填写卡券数量', + 'num.integer' => '卡券数量不合法', + 'num.min' => '卡券数量不合法,最小1', + 'amount.required_unless' => '请填入卡券面值', + 'amount.numeric' => '卡券金额不合法', + 'amount.min' => '卡券金额不合法,最小0.01', + 'discount.required_if' => '请填入卡券折扣', + 'discount.numeric' => '卡券折扣不合法', + 'discount.between' => '卡券折扣不合法,有效范围:1 ~ 9.9', + 'available_start.required' => '请填入有效期', + 'available_start.date' => '有效期不合法', + 'available_start.before_or_equal' => '有效期不合法', + 'available_end.required' => '请填入有效期', + 'available_end.date' => '有效期不合法', + 'available_end.after_or_equal' => '有效期不合法' + ]); $type = $request->input('type'); @@ -111,15 +108,17 @@ class CouponController extends Controller for($i = 0; $i < $request->input('num'); $i++){ $obj = new Coupon(); $obj->name = $request->input('name'); - $obj->sn = $request->input('sn')? : strtoupper(makeRandStr(8)); + $obj->sn = $request->input('sn')?: strtoupper(makeRandStr(8)); $obj->logo = $logo; $obj->type = $type; $obj->usage = $request->input('usage'); $obj->amount = $type == 2? 0 : $request->input('amount'); $obj->discount = $type != 2? 0 : $request->input('discount'); $obj->rule = $request->input('rule'); - $obj->available_start = strtotime(date('Y-m-d 00:00:00', strtotime($request->input('available_start')))); - $obj->available_end = strtotime(date('Y-m-d 23:59:59', strtotime($request->input('available_end')))); + $obj->available_start = strtotime(date('Y-m-d 00:00:00', + strtotime($request->input('available_start')))); + $obj->available_end = strtotime(date('Y-m-d 23:59:59', + strtotime($request->input('available_end')))); $obj->status = 0; $obj->save(); } @@ -140,33 +139,38 @@ class CouponController extends Controller } // 删除优惠券 - public function delCoupon(Request $request) - { + public function delCoupon(Request $request) { Coupon::query()->whereId($request->input('id'))->delete(); return Response::json(['status' => 'success', 'data' => '', 'message' => '删除成功']); } // 导出卡券 - public function exportCoupon() - { + public function exportCoupon() { $voucherList = Coupon::type(1)->whereStatus(0)->get(); $discountCouponList = Coupon::type(2)->whereStatus(0)->get(); $refillList = Coupon::type(3)->whereStatus(0)->get(); $filename = '卡券'.date('Ymd').'.xlsx'; $spreadsheet = new Spreadsheet(); - $spreadsheet->getProperties()->setCreator('SSRPanel')->setLastModifiedBy('SSRPanel')->setTitle('邀请码')->setSubject('邀请码')->setDescription('')->setKeywords('')->setCategory(''); + $spreadsheet->getProperties() + ->setCreator('SSRPanel') + ->setLastModifiedBy('SSRPanel') + ->setTitle('邀请码') + ->setSubject('邀请码') + ->setDescription('') + ->setKeywords('') + ->setCategory(''); // 抵用券 $spreadsheet->setActiveSheetIndex(0); $sheet = $spreadsheet->getActiveSheet(); $sheet->setTitle('抵用券'); - $sheet->fromArray(['名称', '类型', '有效期', '券码', '金额(元)', '使用限制(元)'], NULL); + $sheet->fromArray(['名称', '类型', '有效期', '券码', '金额(元)', '使用限制(元)'], null); foreach($voucherList as $k => $vo){ $usage = $vo->usage == 1? '一次性' : '重复使用'; $dateRange = date('Y-m-d', $vo->available_start).' ~ '.date('Y-m-d', $vo->available_end); - $sheet->fromArray([$vo->name, $usage, $dateRange, $vo->sn, $vo->amount, $vo->rule], NULL, 'A'.($k+2)); + $sheet->fromArray([$vo->name, $usage, $dateRange, $vo->sn, $vo->amount, $vo->rule], null, 'A'.($k + 2)); } // 折扣券 @@ -174,11 +178,11 @@ class CouponController extends Controller $spreadsheet->setActiveSheetIndex(1); $sheet = $spreadsheet->getActiveSheet(); $sheet->setTitle('折扣券'); - $sheet->fromArray(['名称', '类型', '有效期', '券码', '折扣(折)', '使用限制(元)'], NULL); + $sheet->fromArray(['名称', '类型', '有效期', '券码', '折扣(折)', '使用限制(元)'], null); foreach($discountCouponList as $k => $vo){ $usage = $vo->usage == 1? '一次性' : '重复使用'; $dateRange = date('Y-m-d', $vo->available_start).' ~ '.date('Y-m-d', $vo->available_end); - $sheet->fromArray([$vo->name, $usage, $dateRange, $vo->sn, $vo->discount, $vo->rule], NULL, 'A'.($k+2)); + $sheet->fromArray([$vo->name, $usage, $dateRange, $vo->sn, $vo->discount, $vo->rule], null, 'A'.($k + 2)); } // 充值券 @@ -186,11 +190,11 @@ class CouponController extends Controller $spreadsheet->setActiveSheetIndex(2); $sheet = $spreadsheet->getActiveSheet(); $sheet->setTitle('充值券'); - $sheet->fromArray(['名称', '类型', '有效期', '券码', '金额(元)'], NULL); + $sheet->fromArray(['名称', '类型', '有效期', '券码', '金额(元)'], null); foreach($refillList as $k => $vo){ $usage = '一次性'; $dateRange = date('Y-m-d', $vo->available_start).' ~ '.date('Y-m-d', $vo->available_end); - $sheet->fromArray([$vo->name, $usage, $dateRange, $vo->sn, $vo->amount], NULL, 'A'.($k+2)); + $sheet->fromArray([$vo->name, $usage, $dateRange, $vo->sn, $vo->amount], null, 'A'.($k + 2)); } // 指针切换回第一个sheet diff --git a/app/Http/Controllers/Admin/MarketingController.php b/app/Http/Controllers/Admin/MarketingController.php index 0635dce9..8146fc08 100644 --- a/app/Http/Controllers/Admin/MarketingController.php +++ b/app/Http/Controllers/Admin/MarketingController.php @@ -19,18 +19,15 @@ use Response; * * @package App\Http\Controllers\Controller */ -class MarketingController extends Controller -{ +class MarketingController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 邮件群发消息列表 - public function emailList(Request $request) - { + public function emailList(Request $request) { $status = $request->input('status'); $query = Marketing::query()->whereType(1); @@ -45,8 +42,7 @@ class MarketingController extends Controller } // 消息通道群发列表 - public function pushList(Request $request) - { + public function pushList(Request $request) { $status = $request->input('status'); $query = Marketing::query()->whereType(2); @@ -61,8 +57,7 @@ class MarketingController extends Controller } // 添加推送消息 - public function addPushMarketing(Request $request) - { + public function addPushMarketing(Request $request) { $title = trim($request->input('title')); $content = $request->input('content'); @@ -73,7 +68,13 @@ class MarketingController extends Controller DB::beginTransaction(); try{ $client = new Client(); - $response = $client->request('GET', 'https://pushbear.ftqq.com/sub', ['query' => ['sendkey' => self::$systemConfig['push_bear_send_key'], 'text' => $title, 'desp' => $content]]); + $response = $client->request('GET', 'https://pushbear.ftqq.com/sub', [ + 'query' => [ + 'sendkey' => self::$systemConfig['push_bear_send_key'], + 'text' => $title, + 'desp' => $content + ] + ]); $result = json_decode($response->getBody()); if($result->code){ // 失败 @@ -96,8 +97,7 @@ class MarketingController extends Controller } } - private function addMarketing($type = 1, $title = '', $content = '', $status = 1, $error = '', $receiver = '') - { + private function addMarketing($type = 1, $title = '', $content = '', $status = 1, $error = '', $receiver = '') { $marketing = new Marketing(); $marketing->type = $type; $marketing->receiver = $receiver; @@ -108,4 +108,4 @@ class MarketingController extends Controller return $marketing->save(); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Admin/SensitiveWordsController.php b/app/Http/Controllers/Admin/SensitiveWordsController.php index c3526901..84d6c135 100644 --- a/app/Http/Controllers/Admin/SensitiveWordsController.php +++ b/app/Http/Controllers/Admin/SensitiveWordsController.php @@ -15,28 +15,29 @@ use Validator; * * @package App\Http\Controllers\Controller */ -class SensitiveWordsController extends Controller -{ +class SensitiveWordsController extends Controller { // 敏感词列表 - public function sensitiveWordsList() - { + public function sensitiveWordsList() { $view['list'] = SensitiveWords::query()->orderBy('id', 'desc')->paginate(15); return Response::view('admin.sensitiveWords.sensitiveWordsList', $view); } // 添加敏感词 - public function addSensitiveWords(Request $request) - { + public function addSensitiveWords(Request $request) { $validator = Validator::make($request->all(), [ 'words' => 'required|unique:sensitive_words' ], [ - 'words.required' => '添加失败:请填写敏感词', - 'words.unique' => '添加失败:敏感词已存在' - ]); + 'words.required' => '添加失败:请填写敏感词', + 'words.unique' => '添加失败:敏感词已存在' + ]); if($validator->fails()){ - return Response::json(['status' => 'fail', 'data' => '', 'message' => $validator->getMessageBag()->first()]); + return Response::json([ + 'status' => 'fail', + 'data' => '', + 'message' => $validator->getMessageBag()->first() + ]); } $obj = new SensitiveWords(); @@ -51,8 +52,7 @@ class SensitiveWordsController extends Controller } // 删除敏感词 - public function delSensitiveWords(Request $request) - { + public function delSensitiveWords(Request $request) { $result = SensitiveWords::query()->whereId($request->input('id'))->delete(); if($result){ return Response::json(['status' => 'success', 'data' => '', 'message' => '删除成功']); diff --git a/app/Http/Controllers/Admin/ShopController.php b/app/Http/Controllers/Admin/ShopController.php index 96215a49..866a6fa8 100644 --- a/app/Http/Controllers/Admin/ShopController.php +++ b/app/Http/Controllers/Admin/ShopController.php @@ -21,11 +21,9 @@ use Session; * * @package App\Http\Controllers\Controller */ -class ShopController extends Controller -{ +class ShopController extends Controller { // 商品列表 - public function goodsList(Request $request) - { + public function goodsList(Request $request) { $type = $request->input('type'); $status = $request->input('status'); @@ -45,10 +43,27 @@ class ShopController extends Controller } // 添加商品 - public function addGoods(Request $request) - { + public function addGoods(Request $request) { if($request->isMethod('POST')){ - $this->validate($request, ['name' => 'required', 'traffic' => 'required_unless:type,3|integer|min:1024|max:10240000|nullable', 'price' => 'required|numeric|min:0', 'type' => 'required', 'days' => 'required|integer',], ['name.required' => '请填入名称', 'traffic.required_unless' => '请填入流量', 'traffic.integer' => '内含流量必须是整数值', 'traffic.min' => '内含流量不能低于1MB', 'traffic.max' => '内含流量不能超过10TB', 'price.required' => '请填入价格', 'price.numeric' => '价格不合法', 'price.min' => '价格最低0', 'type.required' => '请选择类型', 'days.required' => '请填入有效期', 'days.integer' => '有效期不合法',]); + $this->validate($request, [ + 'name' => 'required', + 'traffic' => 'required_unless:type,3|integer|min:1024|max:10240000|nullable', + 'price' => 'required|numeric|min:0', + 'type' => 'required', + 'days' => 'required|integer', + ], [ + 'name.required' => '请填入名称', + 'traffic.required_unless' => '请填入流量', + 'traffic.integer' => '内含流量必须是整数值', + 'traffic.min' => '内含流量不能低于1MB', + 'traffic.max' => '内含流量不能超过10TB', + 'price.required' => '请填入价格', + 'price.numeric' => '价格不合法', + 'price.min' => '价格最低0', + 'type.required' => '请选择类型', + 'days.required' => '请填入有效期', + 'days.integer' => '有效期不合法', + ]); $type = $request->input('type'); $price = $request->input('price'); @@ -136,8 +151,7 @@ class ShopController extends Controller } // 编辑商品 - public function editGoods(Request $request, $id) - { + public function editGoods(Request $request, $id) { if($request->isMethod('POST')){ $name = $request->input('name'); $info = $request->input('info'); @@ -201,13 +215,14 @@ class ShopController extends Controller 'name' => $name, 'info' => $info, 'desc' => $desc, - 'price' => $price*100, - 'renew' => $renew*100, + 'price' => $price * 100, + 'renew' => $renew * 100, 'sort' => $sort, 'color' => $color, 'is_hot' => $is_hot, 'limit_num' => $limit_num, - 'status' => $status]; + 'status' => $status + ]; if($logo){ $data['logo'] = $logo; @@ -256,8 +271,7 @@ class ShopController extends Controller } // 删除商品 - public function delGoods(Request $request) - { + public function delGoods(Request $request) { Goods::query()->whereId($request->input('id'))->delete(); return Response::json(['status' => 'success', 'data' => '', 'message' => '删除成功']); diff --git a/app/Http/Controllers/Admin/SubscribeController.php b/app/Http/Controllers/Admin/SubscribeController.php index 380e7c55..f2968603 100644 --- a/app/Http/Controllers/Admin/SubscribeController.php +++ b/app/Http/Controllers/Admin/SubscribeController.php @@ -17,18 +17,15 @@ use Response; * * @package App\Http\Controllers\Controller */ -class SubscribeController extends Controller -{ +class SubscribeController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 订阅码列表 - public function subscribeList(Request $request) - { + public function subscribeList(Request $request) { $user_id = $request->input('user_id'); $email = $request->input('email'); $status = $request->input('status'); @@ -40,7 +37,7 @@ class SubscribeController extends Controller } if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -55,8 +52,7 @@ class SubscribeController extends Controller } //订阅记录 - public function subscribeLog(Request $request) - { + public function subscribeLog(Request $request) { $id = $request->input('id'); $query = UserSubscribeLog::with('user:email'); @@ -70,8 +66,7 @@ class SubscribeController extends Controller } // 订阅设备列表 - public function deviceList(Request $request) - { + public function deviceList(Request $request) { $type = $request->input('type'); $platform = $request->input('platform'); $name = $request->input('name'); @@ -101,8 +96,7 @@ class SubscribeController extends Controller } // 设置用户的订阅的状态 - public function setSubscribeStatus(Request $request) - { + public function setSubscribeStatus(Request $request) { $id = $request->input('id'); $status = $request->input('status', 0); @@ -120,8 +114,7 @@ class SubscribeController extends Controller } // 设置设备是否允许订阅的状态 - public function setDeviceStatus(Request $request) - { + public function setDeviceStatus(Request $request) { $id = $request->input('id'); $status = $request->input('status', 0); diff --git a/app/Http/Controllers/Admin/TicketController.php b/app/Http/Controllers/Admin/TicketController.php index 755bc317..01dc7a2a 100644 --- a/app/Http/Controllers/Admin/TicketController.php +++ b/app/Http/Controllers/Admin/TicketController.php @@ -21,24 +21,21 @@ use Response; * * @package App\Http\Controllers\Controller */ -class TicketController extends Controller -{ +class TicketController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 工单列表 - public function ticketList(Request $request) - { + public function ticketList(Request $request) { $email = $request->input('email'); $query = Ticket::query(); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -49,8 +46,7 @@ class TicketController extends Controller } // 回复工单 - public function replyTicket(Request $request) - { + public function replyTicket(Request $request) { $id = $request->input('id'); if($request->isMethod('POST')){ @@ -77,8 +73,10 @@ class TicketController extends Controller // 发通知邮件 if(!Auth::user()->is_admin){ if(self::$systemConfig['webmaster_email']){ - $logId = Helpers::addNotificationLog($title, $content, 1, self::$systemConfig['webmaster_email']); - Mail::to(self::$systemConfig['webmaster_email'])->send(new replyTicket($logId, $title, $content)); + $logId = Helpers::addNotificationLog($title, $content, 1, + self::$systemConfig['webmaster_email']); + Mail::to(self::$systemConfig['webmaster_email'])->send(new replyTicket($logId, $title, + $content)); } }else{ $logId = Helpers::addNotificationLog($title, $content, 1, $ticket->user->email); @@ -103,8 +101,7 @@ class TicketController extends Controller } // 关闭工单 - public function closeTicket(Request $request) - { + public function closeTicket(Request $request) { $id = $request->input('id'); $ticket = Ticket::query()->with(['user'])->whereId($id)->first(); diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 8f2c6d4c..6503ce94 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -57,34 +57,48 @@ use Session; * * @package App\Http\Controllers */ -class AdminController extends Controller -{ +class AdminController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } - public function index() - { + public function index() { $past = strtotime(date('Y-m-d', strtotime("-".self::$systemConfig['expire_days']." days"))); $view['expireDays'] = self::$systemConfig['expire_days']; $view['totalUserCount'] = User::query()->count(); // 总用户数 $view['enableUserCount'] = User::query()->whereEnable(1)->count(); // 有效用户数 $view['activeUserCount'] = User::query()->where('t', '>=', $past)->count(); // 活跃用户数 - $view['unActiveUserCount'] = User::query()->where('t', '<=', $past)->whereEnable(1)->where('t', '>', 0)->count(); // 不活跃用户数 - $view['onlineUserCount'] = User::query()->where('t', '>=', time()-600)->count(); // 10分钟内在线用户数 - $view['expireWarningUserCount'] = User::query()->where('expire_time', '>=', date('Y-m-d', strtotime("now")))->where('expire_time', '<=', date('Y-m-d', strtotime("+".self::$systemConfig['expire_days']." days")))->count(); // 临近过期用户数 - $view['largeTrafficUserCount'] = User::query()->whereRaw('(u + d) >= 107374182400')->whereIn('status', [0, 1])->count(); // 流量超过100G的用户 + $view['unActiveUserCount'] = User::query() + ->where('t', '<=', $past) + ->whereEnable(1) + ->where('t', '>', 0) + ->count(); // 不活跃用户数 + $view['onlineUserCount'] = User::query()->where('t', '>=', time() - 600)->count(); // 10分钟内在线用户数 + $view['expireWarningUserCount'] = User::query() + ->where('expire_time', '>=', date('Y-m-d', strtotime("now"))) + ->where('expire_time', '<=', date('Y-m-d', + strtotime("+".self::$systemConfig['expire_days']." days"))) + ->count(); // 临近过期用户数 + $view['largeTrafficUserCount'] = User::query() + ->whereRaw('(u + d) >= 107374182400') + ->whereIn('status', [0, 1]) + ->count(); // 流量超过100G的用户 // 1小时内流量异常用户 $tempUsers = []; - $userTotalTrafficList = UserTrafficHourly::query()->whereNodeId(0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快速度 + $userTotalTrafficList = UserTrafficHourly::query() + ->whereNodeId(0) + ->where('total', '>', 104857600) + ->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900)) + ->groupBy('user_id') + ->selectRaw("user_id, sum(total) as totalTraffic") + ->get(); // 只统计100M以上的记录,加快速度 if(!$userTotalTrafficList->isEmpty()){ foreach($userTotalTrafficList as $vo){ - if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value']*1073741824)){ + if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value'] * 1073741824)){ $tempUsers[] = $vo->user_id; } } @@ -92,24 +106,29 @@ class AdminController extends Controller $view['flowAbnormalUserCount'] = User::query()->whereIn('id', $tempUsers)->count(); $view['nodeCount'] = SsNode::query()->count(); $view['unnormalNodeCount'] = SsNode::query()->whereStatus(0)->count(); - $flowCount = SsNodeTrafficDaily::query()->where('created_at', '>=', date('Y-m-d 00:00:00', strtotime("-30 days")))->sum('total'); + $flowCount = SsNodeTrafficDaily::query() + ->where('created_at', '>=', date('Y-m-d 00:00:00', strtotime("-30 days"))) + ->sum('total'); $view['flowCount'] = flowAutoShow($flowCount); $totalFlowCount = SsNodeTrafficDaily::query()->sum('total'); $view['totalFlowCount'] = flowAutoShow($totalFlowCount); - $view['totalBalance'] = User::query()->sum('balance')/100; - $view['totalWaitRefAmount'] = ReferralLog::query()->whereIn('status', [0, 1])->sum('ref_amount')/100; - $view['totalRefAmount'] = ReferralApply::query()->whereStatus(2)->sum('amount')/100; + $view['totalBalance'] = User::query()->sum('balance') / 100; + $view['totalWaitRefAmount'] = ReferralLog::query()->whereIn('status', [0, 1])->sum('ref_amount') / 100; + $view['totalRefAmount'] = ReferralApply::query()->whereStatus(2)->sum('amount') / 100; $view['totalOrder'] = Order::query()->count(); $view['totalOnlinePayOrder'] = Order::query()->wherePayWay(2)->count(); $view['totalSuccessOrder'] = Order::query()->whereStatus(2)->count(); - $view['todaySuccessOrder'] = Order::query()->whereStatus(2)->where('created_at', '>=', date('Y-m-d 00:00:00'))->where('created_at', '<=', date('Y-m-d 23:59:59'))->count(); + $view['todaySuccessOrder'] = Order::query() + ->whereStatus(2) + ->where('created_at', '>=', date('Y-m-d 00:00:00')) + ->where('created_at', '<=', date('Y-m-d 23:59:59')) + ->count(); return Response::view('admin.index', $view); } // 用户列表 - public function userList(Request $request) - { + public function userList(Request $request) { $id = $request->input('id'); $email = $request->input('email'); $wechat = $request->input('wechat'); @@ -164,26 +183,37 @@ class AdminController extends Controller // 临近过期提醒 if($expireWarning){ - $query->where('expire_time', '>=', date('Y-m-d'))->where('expire_time', '<=', date('Y-m-d', strtotime("+".self::$systemConfig['expire_days']." days"))); + $query->where('expire_time', '>=', date('Y-m-d')) + ->where('expire_time', '<=', + date('Y-m-d', strtotime("+".self::$systemConfig['expire_days']." days"))); } // 当前在线 if($online){ - $query->where('t', '>=', time()-600); + $query->where('t', '>=', time() - 600); } // 不活跃用户 if($unActive){ - $query->where('t', '>', 0)->where('t', '<=', strtotime(date('Y-m-d', strtotime("-".self::$systemConfig['expire_days']." days"))))->whereEnable(1); + $query->where('t', '>', 0) + ->where('t', '<=', + strtotime(date('Y-m-d', strtotime("-".self::$systemConfig['expire_days']." days")))) + ->whereEnable(1); } // 1小时内流量异常用户 if($flowAbnormal){ $tempUsers = []; - $userTotalTrafficList = UserTrafficHourly::query()->whereNodeId(0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快速度 + $userTotalTrafficList = UserTrafficHourly::query() + ->whereNodeId(0) + ->where('total', '>', 104857600) + ->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900)) + ->groupBy('user_id') + ->selectRaw("user_id, sum(total) as totalTraffic") + ->get(); // 只统计100M以上的记录,加快速度 if(!$userTotalTrafficList->isEmpty()){ foreach($userTotalTrafficList as $vo){ - if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value']*1024*1024*1024)){ + if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value'] * 1024 * 1024 * 1024)){ $tempUsers[] = $vo->user_id; } } @@ -194,7 +224,7 @@ class AdminController extends Controller $userList = $query->orderBy('id', 'desc')->paginate(15)->appends($request->except('page')); foreach($userList as $user){ $user->transfer_enable = flowAutoShow($user->transfer_enable); - $user->used_flow = flowAutoShow($user->u+$user->d); + $user->used_flow = flowAutoShow($user->u + $user->d); if($user->expire_time < date('Y-m-d')){ $user->expireWarning = -1; // 已过期 }elseif($user->expire_time == date('Y-m-d')){ @@ -206,9 +236,13 @@ class AdminController extends Controller } // 流量异常警告 - $time = date('Y-m-d H:i:s', time()-3900); - $totalTraffic = UserTrafficHourly::query()->whereUserId($user->id)->whereNodeId(0)->where('created_at', '>=', $time)->sum('total'); - $user->trafficWarning = $totalTraffic > (self::$systemConfig['traffic_ban_value']*1024*1024*1024)? 1 : 0; + $time = date('Y-m-d H:i:s', time() - 3900); + $totalTraffic = UserTrafficHourly::query() + ->whereUserId($user->id) + ->whereNodeId(0) + ->where('created_at', '>=', $time) + ->sum('total'); + $user->trafficWarning = $totalTraffic > (self::$systemConfig['traffic_ban_value'] * 1024 * 1024 * 1024)? 1 : 0; // 订阅地址 $user->link = (self::$systemConfig['subscribe_domain']? self::$systemConfig['subscribe_domain'] : self::$systemConfig['website_url']).'/s/'.$user->subscribe->code; @@ -220,8 +254,7 @@ class AdminController extends Controller } // 添加账号 - public function addUser(Request $request) - { + public function addUser(Request $request) { if($request->isMethod('POST')){ // 校验email是否已存在 $exists = User::query()->whereEmail($request->input('email'))->first(); @@ -235,33 +268,34 @@ class AdminController extends Controller $user = new User(); $user->email = trim($request->input('email')); - $user->password = Hash::make(trim($request->input('password'))? : makeRandStr()); + $user->password = Hash::make(trim($request->input('password'))?: makeRandStr()); $user->port = $request->input('port'); $user->passwd = empty($request->input('passwd'))? makeRandStr() : $request->input('passwd'); - $user->vmess_id = $request->input('vmess_id')? : createGuid(); + $user->vmess_id = $request->input('vmess_id')?: createGuid(); $user->transfer_enable = toGB($request->input('transfer_enable', 0)); $user->enable = $request->input('enable', 0); $user->method = $request->input('method'); $user->protocol = $request->input('protocol'); - $user->protocol_param = $request->input('protocol_param')? : ''; + $user->protocol_param = $request->input('protocol_param')?: ''; $user->obfs = $request->input('obfs'); - $user->obfs_param = $request->input('obfs_param')? : ''; + $user->obfs_param = $request->input('obfs_param')?: ''; $user->speed_limit_per_con = $request->input('speed_limit_per_con'); $user->speed_limit_per_user = $request->input('speed_limit_per_user'); - $user->wechat = $request->input('wechat')? : ''; - $user->qq = $request->input('qq')? : ''; + $user->wechat = $request->input('wechat')?: ''; + $user->qq = $request->input('qq')?: ''; $user->usage = $request->input('usage'); $user->pay_way = $request->input('pay_way'); $user->balance = 0; $user->enable_time = empty($request->input('enable_time'))? date('Y-m-d') : $request->input('enable_time'); - $user->expire_time = empty($request->input('expire_time'))? date('Y-m-d', strtotime("+365 days")) : $request->input('expire_time'); + $user->expire_time = empty($request->input('expire_time'))? date('Y-m-d', + strtotime("+365 days")) : $request->input('expire_time'); $user->remark = str_replace("eval", "", str_replace("atob", "", $request->input('remark'))); - $user->level = $request->input('level')? : 1; + $user->level = $request->input('level')?: 1; $user->is_admin = 0; $user->reg_ip = getClientIp(); $user->referral_uid = 0; - $user->reset_time = $request->input('reset_time') > date('Y-m-d')? $request->input('reset_time') : NULL; - $user->status = $request->input('status')? : 1; + $user->reset_time = $request->input('reset_time') > date('Y-m-d')? $request->input('reset_time') : null; + $user->status = $request->input('status')?: 1; $user->save(); if($user->id){ @@ -276,7 +310,8 @@ class AdminController extends Controller $this->makeUserLabels($user->id, $request->input('labels')); // 写入用户流量变动记录 - Helpers::addUserTrafficModifyLog($user->id, 0, 0, toGB($request->input('transfer_enable', 0)), '后台手动添加用户'); + Helpers::addUserTrafficModifyLog($user->id, 0, 0, toGB($request->input('transfer_enable', 0)), + '后台手动添加用户'); return Response::json(['status' => 'success', 'data' => '', 'message' => '添加成功']); }else{ @@ -297,8 +332,7 @@ class AdminController extends Controller } // 生成用户标签 - private function makeUserLabels($userId, $labels) - { + private function makeUserLabels($userId, $labels) { // 先删除该用户所有的标签 UserLabel::query()->whereUserId($userId)->delete(); @@ -313,8 +347,7 @@ class AdminController extends Controller } // 批量生成账号 - public function batchAddUsers(Request $request) - { + public function batchAddUsers(Request $request) { $amount = $request->input('amount'); DB::beginTransaction(); try{ @@ -352,8 +385,7 @@ class AdminController extends Controller } // 编辑账号 - public function editUser(Request $request, $id) - { + public function editUser(Request $request, $id) { if($request->isMethod('POST')){ $username = trim($request->input('username')); $email = trim($request->input('email')); @@ -429,7 +461,7 @@ class AdminController extends Controller 'usage' => $usage, 'pay_way' => $pay_way, 'status' => $status, - 'reset_time' => empty($reset_time)? NULL : $reset_time, + 'reset_time' => empty($reset_time)? null : $reset_time, 'enable_time' => empty($enable_time)? date('Y-m-d') : $enable_time, 'expire_time' => empty($expire_time)? date('Y-m-d', strtotime("+365 days")) : $expire_time, 'remark' => $remark, @@ -454,7 +486,8 @@ class AdminController extends Controller // 写入用户流量变动记录 if($user->transfer_enable != toGB($transfer_enable)){ - Helpers::addUserTrafficModifyLog($id, 0, $user->transfer_enable, toGB($transfer_enable), '后台手动编辑用户'); + Helpers::addUserTrafficModifyLog($id, 0, $user->transfer_enable, toGB($transfer_enable), + '后台手动编辑用户'); } DB::commit(); @@ -494,8 +527,7 @@ class AdminController extends Controller } // 删除用户 - public function delUser(Request $request) - { + public function delUser(Request $request) { $id = $request->input('id'); if($id <= 1){ @@ -524,8 +556,7 @@ class AdminController extends Controller } // 节点列表 - public function nodeList(Request $request) - { + public function nodeList(Request $request) { if($request->isMethod('POST')){ $id = $request->input('id'); $node = SsNode::query()->whereId($id)->first(); @@ -538,8 +569,8 @@ class AdminController extends Controller return Response::json(['status' => 'fail', 'title' => 'IP获取错误', 'message' => $node->name.'IP获取失败']); } } - $data[0] = NetworkDetection::networkCheck($node->ip, TRUE); //ICMP - $data[1] = NetworkDetection::networkCheck($node->ip, FALSE, $node->single? $node->port : NULL); //TCP + $data[0] = NetworkDetection::networkCheck($node->ip, true); //ICMP + $data[1] = NetworkDetection::networkCheck($node->ip, false, $node->single? $node->port : null); //TCP return Response::json(['status' => 'success', 'title' => '['.$node->name.']阻断信息', 'message' => $data]); }else{ @@ -551,10 +582,17 @@ class AdminController extends Controller $query->whereStatus($status); } - $nodeList = $query->orderBy('status', 'desc')->orderBy('id', 'asc')->paginate(15)->appends($request->except('page')); + $nodeList = $query->orderBy('status', 'desc') + ->orderBy('id', 'asc') + ->paginate(15) + ->appends($request->except('page')); foreach($nodeList as $node){ // 在线人数 - $online_log = SsNodeOnlineLog::query()->whereNodeId($node->id)->where('log_time', '>=', strtotime("-5 minutes"))->orderBy('id', 'desc')->first(); + $online_log = SsNodeOnlineLog::query() + ->whereNodeId($node->id) + ->where('log_time', '>=', strtotime("-5 minutes")) + ->orderBy('id', 'desc') + ->first(); $node->online_users = empty($online_log)? 0 : $online_log->online_user; // 已产生流量 @@ -562,7 +600,11 @@ class AdminController extends Controller $node->transfer = flowAutoShow($totalTraffic); // 负载(10分钟以内) - $node_info = SsNodeInfo::query()->whereNodeId($node->id)->where('log_time', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->first(); + $node_info = SsNodeInfo::query() + ->whereNodeId($node->id) + ->where('log_time', '>=', strtotime("-10 minutes")) + ->orderBy('id', 'desc') + ->first(); $node->isOnline = empty($node_info) || empty($node_info->load)? 0 : 1; $node->load = $node->isOnline? $node_info->load : '离线'; $node->uptime = empty($node_info)? 0 : seconds2time($node_info->uptime); @@ -575,18 +617,18 @@ class AdminController extends Controller } // 添加节点 - public function addNode(Request $request) - { + public function addNode(Request $request) { if($request->isMethod('POST')){ if($request->input('ssh_port') <= 0 || $request->input('ssh_port') >= 65535){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '添加失败:SSH端口不合法']); } - if(FALSE === filter_var($request->input('ip'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ + if(false === filter_var($request->input('ip'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '添加失败:IPv4地址不合法']); } - if($request->input('ipv6') && FALSE === filter_var($request->input('ipv6'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ + if($request->input('ipv6') + && false === filter_var($request->input('ipv6'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '添加失败:IPv6地址不合法']); } @@ -607,42 +649,42 @@ class AdminController extends Controller $ssNode = new SsNode(); $ssNode->type = $request->input('type'); $ssNode->name = $request->input('name'); - $ssNode->group_id = $request->input('group_id')? : 0; - $ssNode->country_code = $request->input('country_code')? : 'un'; - $ssNode->server = $request->input('server')? : ''; + $ssNode->group_id = $request->input('group_id')?: 0; + $ssNode->country_code = $request->input('country_code')?: 'un'; + $ssNode->server = $request->input('server')?: ''; $ssNode->ip = $request->input('ip'); $ssNode->ipv6 = $request->input('ipv6'); - $ssNode->desc = $request->input('desc')? : ''; + $ssNode->desc = $request->input('desc')?: ''; $ssNode->method = $request->input('method'); $ssNode->protocol = $request->input('protocol'); - $ssNode->protocol_param = $request->input('protocol_param')? : ''; - $ssNode->obfs = $request->input('obfs')? : ''; - $ssNode->obfs_param = $request->input('obfs_param')? : ''; - $ssNode->traffic_rate = $request->input('traffic_rate')? : 1; - $ssNode->bandwidth = $request->input('bandwidth')? : 1000; - $ssNode->traffic = $request->input('traffic')? : 1000; - $ssNode->monitor_url = $request->input('monitor_url')? : ''; + $ssNode->protocol_param = $request->input('protocol_param')?: ''; + $ssNode->obfs = $request->input('obfs')?: ''; + $ssNode->obfs_param = $request->input('obfs_param')?: ''; + $ssNode->traffic_rate = $request->input('traffic_rate')?: 1; + $ssNode->bandwidth = $request->input('bandwidth')?: 1000; + $ssNode->traffic = $request->input('traffic')?: 1000; + $ssNode->monitor_url = $request->input('monitor_url')?: ''; $ssNode->is_subscribe = $request->input('is_subscribe'); $ssNode->is_ddns = $request->input('is_ddns'); $ssNode->is_transit = $request->input('is_transit'); - $ssNode->ssh_port = $request->input('ssh_port')? : 22; + $ssNode->ssh_port = $request->input('ssh_port')?: 22; $ssNode->detectionType = $request->input('detectionType'); $ssNode->compatible = $request->input('type') == 2? 0 : ($request->input('is_ddns')? 0 : $request->input('compatible')); $ssNode->single = $request->input('single'); - $ssNode->port = $request->input('single')? ($request->input('port')? : 443) : ''; - $ssNode->passwd = $request->input('single')? ($request->input('passwd')? : 'password') : ''; - $ssNode->sort = $request->input('sort')? : 0; - $ssNode->status = $request->input('status')? : 1; - $ssNode->v2_alter_id = $request->input('v2_alter_id')? : 16; - $ssNode->v2_port = $request->input('v2_port')? : 10087; - $ssNode->v2_method = $request->input('v2_method')? : 'aes-128-gcm'; - $ssNode->v2_net = $request->input('v2_net')? : 'tcp'; - $ssNode->v2_type = $request->input('v2_type')? : 'none'; - $ssNode->v2_host = $request->input('v2_host')? : ''; - $ssNode->v2_path = $request->input('v2_path')? : ''; - $ssNode->v2_tls = $request->input('v2_tls')? : 0; - $ssNode->v2_insider_port = $request->input('v2_insider_port')? : 10550; - $ssNode->v2_outsider_port = $request->input('v2_outsider_port')? : 443; + $ssNode->port = $request->input('single')? ($request->input('port')?: 443) : ''; + $ssNode->passwd = $request->input('single')? ($request->input('passwd')?: 'password') : ''; + $ssNode->sort = $request->input('sort')?: 0; + $ssNode->status = $request->input('status')?: 1; + $ssNode->v2_alter_id = $request->input('v2_alter_id')?: 16; + $ssNode->v2_port = $request->input('v2_port')?: 10087; + $ssNode->v2_method = $request->input('v2_method')?: 'aes-128-gcm'; + $ssNode->v2_net = $request->input('v2_net')?: 'tcp'; + $ssNode->v2_type = $request->input('v2_type')?: 'none'; + $ssNode->v2_host = $request->input('v2_host')?: ''; + $ssNode->v2_path = $request->input('v2_path')?: ''; + $ssNode->v2_tls = $request->input('v2_tls')?: 0; + $ssNode->v2_insider_port = $request->input('v2_insider_port')?: 10550; + $ssNode->v2_outsider_port = $request->input('v2_outsider_port')?: 443; $ssNode->save(); // 建立分组关联 @@ -687,8 +729,7 @@ class AdminController extends Controller } // 编辑节点 - public function editNode(Request $request) - { + public function editNode(Request $request) { $id = $request->input('id'); if($request->isMethod('POST')){ @@ -696,11 +737,12 @@ class AdminController extends Controller return Response::json(['status' => 'fail', 'data' => '', 'message' => '编辑失败:SSH端口不合法']); } - if(FALSE === filter_var($request->input('ip'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ + if(false === filter_var($request->input('ip'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '编辑失败:IPv4地址不合法']); } - if($request->input('ipv6') && FALSE === filter_var($request->input('ipv6'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ + if($request->input('ipv6') + && false === filter_var($request->input('ipv6'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '编辑失败:IPv6地址不合法']); } @@ -747,12 +789,15 @@ class AdminController extends Controller 'single' => $request->input('single'), 'port' => $request->input('single')? ($request->input('port')? $request->input('port') : 443) : '', 'passwd' => $request->input('single')? ($request->input('passwd')? $request->input('passwd') : 'password') : '', - 'sort' => $request->input('sort'), 'status' => $request->input('status'), + 'sort' => $request->input('sort'), + 'status' => $request->input('status'), 'v2_alter_id' => $request->input('v2_alter_id')? $request->input('v2_alter_id') : 16, 'v2_port' => $request->input('v2_port')? $request->input('v2_port') : 10087, 'v2_method' => $request->input('v2_method')? $request->input('v2_method') : 'aes-128-gcm', - 'v2_net' => $request->input('v2_net'), 'v2_type' => $request->input('v2_type'), - 'v2_host' => $request->input('v2_host'), 'v2_path' => $request->input('v2_path'), + 'v2_net' => $request->input('v2_net'), + 'v2_type' => $request->input('v2_type'), + 'v2_host' => $request->input('v2_host'), + 'v2_path' => $request->input('v2_path'), 'v2_tls' => $request->input('v2_tls'), 'v2_insider_port' => $request->input('v2_insider_port', 10550), 'v2_outsider_port' => $request->input('v2_outsider_port', 443) @@ -810,8 +855,7 @@ class AdminController extends Controller } // 生成节点标签 - private function makeNodeLabels($nodeId, $labels) - { + private function makeNodeLabels($nodeId, $labels) { // 先删除所有该节点的标签 SsNodeLabel::query()->whereNodeId($nodeId)->delete(); @@ -826,8 +870,7 @@ class AdminController extends Controller } // 删除节点 - public function delNode(Request $request) - { + public function delNode(Request $request) { $id = $request->input('id'); $node = SsNode::query()->whereId($id)->first(); @@ -862,8 +905,7 @@ class AdminController extends Controller } // 节点流量监控 - public function nodeMonitor($node_id) - { + public function nodeMonitor($node_id) { $node = SsNode::query()->whereId($node_id)->orderBy('sort', 'desc')->first(); if(!$node){ Session::flash('errorMsg', '节点不存在,请重试'); @@ -876,25 +918,37 @@ class AdminController extends Controller $hourlyData = []; // 节点一个月内的流量 - $nodeTrafficDaily = SsNodeTrafficDaily::query()->with(['info'])->whereNodeId($node->id)->where('created_at', '>=', date('Y-m', time()))->orderBy('created_at', 'asc')->pluck('total')->toArray(); - $dailyTotal = date('d', time())-1;//今天不算,减一 + $nodeTrafficDaily = SsNodeTrafficDaily::query() + ->with(['info']) + ->whereNodeId($node->id) + ->where('created_at', '>=', date('Y-m', time())) + ->orderBy('created_at', 'asc') + ->pluck('total') + ->toArray(); + $dailyTotal = date('d', time()) - 1;//今天不算,减一 $dailyCount = count($nodeTrafficDaily); - for($x = 0; $x < ($dailyTotal-$dailyCount); $x++){ + for($x = 0; $x < ($dailyTotal - $dailyCount); $x++){ $dailyData[$x] = 0; } - for($x = ($dailyTotal-$dailyCount); $x < $dailyTotal; $x++){ - $dailyData[$x] = round($nodeTrafficDaily[$x-($dailyTotal-$dailyCount)]/(1024*1024*1024), 3); + for($x = ($dailyTotal - $dailyCount); $x < $dailyTotal; $x++){ + $dailyData[$x] = round($nodeTrafficDaily[$x - ($dailyTotal - $dailyCount)] / (1024 * 1024 * 1024), 3); } // 节点一天内的流量 - $nodeTrafficHourly = SsNodeTrafficHourly::query()->with(['info'])->whereNodeId($node->id)->where('created_at', '>=', date('Y-m-d', time()))->orderBy('created_at', 'asc')->pluck('total')->toArray(); + $nodeTrafficHourly = SsNodeTrafficHourly::query() + ->with(['info']) + ->whereNodeId($node->id) + ->where('created_at', '>=', date('Y-m-d', time())) + ->orderBy('created_at', 'asc') + ->pluck('total') + ->toArray(); $hourlyTotal = date('H', time()); $hourlyCount = count($nodeTrafficHourly); - for($x = 0; $x < ($hourlyTotal-$hourlyCount); $x++){ + for($x = 0; $x < ($hourlyTotal - $hourlyCount); $x++){ $hourlyData[$x] = 0; } - for($x = ($hourlyTotal-$hourlyCount); $x < $hourlyTotal; $x++){ - $hourlyData[$x] = round($nodeTrafficHourly[$x-($hourlyTotal-$hourlyCount)]/(1024*1024*1024), 3); + for($x = ($hourlyTotal - $hourlyCount); $x < $hourlyTotal; $x++){ + $hourlyData[$x] = round($nodeTrafficHourly[$x - ($hourlyTotal - $hourlyCount)] / (1024 * 1024 * 1024), 3); } $view['trafficDaily'] = ['nodeName' => $node->name, 'dailyData' => "'".implode("','", $dailyData)."'"]; @@ -922,8 +976,7 @@ class AdminController extends Controller } // Ping节点延迟 - public function pingNode(Request $request) - { + public function pingNode(Request $request) { $node = SsNode::query()->whereId($request->input('id'))->first(); if(!$node){ return Response::json(['status' => 'fail', 'message' => '节点不存在,请重试']); @@ -932,10 +985,10 @@ class AdminController extends Controller $result = NetworkDetection::ping($node->is_ddns? $node->server : $node->ip); if($result){ - $data[0] = $result['China Telecom']['time']? : '无'; - $data[1] = $result['China Unicom']['time']? : '无'; - $data[2] = $result['China Mobile']['time']? : '无'; - $data[3] = $result['Hong Kong']['time']? : '无'; + $data[0] = $result['China Telecom']['time']?: '无'; + $data[1] = $result['China Unicom']['time']?: '无'; + $data[2] = $result['China Mobile']['time']?: '无'; + $data[3] = $result['Hong Kong']['time']?: '无'; return Response::json(['status' => 'success', 'message' => $data]); }else{ @@ -943,8 +996,7 @@ class AdminController extends Controller } } - public function nodePingLog(Request $request) - { + public function nodePingLog(Request $request) { $node_id = $request->input('nodeId'); $query = SsNodePing::query(); @@ -960,16 +1012,14 @@ class AdminController extends Controller // 文章列表 - public function articleList(Request $request) - { + public function articleList(Request $request) { $view['list'] = Article::query()->orderBy('sort', 'desc')->paginate(15)->appends($request->except('page')); return Response::view('admin.article.articleList', $view); } // 添加文章 - public function addArticle(Request $request) - { + public function addArticle(Request $request) { if($request->isMethod('POST')){ $article = new Article(); $article->title = $request->input('title'); @@ -1020,8 +1070,7 @@ class AdminController extends Controller } // 编辑文章 - public function editArticle(Request $request) - { + public function editArticle(Request $request) { $id = $request->input('id'); if($request->isMethod('POST')){ @@ -1075,8 +1124,7 @@ class AdminController extends Controller } // 删除文章 - public function delArticle(Request $request) - { + public function delArticle(Request $request) { $id = $request->input('id'); $ret = Article::query()->whereId($id)->delete(); @@ -1088,8 +1136,7 @@ class AdminController extends Controller } // 节点分组列表 - public function groupList(Request $request) - { + public function groupList(Request $request) { $view['groupList'] = SsGroup::query()->paginate(15)->appends($request->except('page')); $levelList = Helpers::levelList(); @@ -1103,8 +1150,7 @@ class AdminController extends Controller } // 添加节点分组 - public function addGroup(Request $request) - { + public function addGroup(Request $request) { if($request->isMethod('POST')){ $ssGroup = new SsGroup(); $ssGroup->name = $request->input('name'); @@ -1120,8 +1166,7 @@ class AdminController extends Controller } // 编辑节点分组 - public function editGroup(Request $request, $id) - { + public function editGroup(Request $request, $id) { if($request->isMethod('POST')){ $name = $request->input('name'); $level = $request->input('level'); @@ -1143,8 +1188,7 @@ class AdminController extends Controller } // 删除节点分组 - public function delGroup(Request $request) - { + public function delGroup(Request $request) { $id = $request->input('id'); // 检查是否该分组下是否有节点 @@ -1162,8 +1206,7 @@ class AdminController extends Controller } // 流量日志 - public function trafficLog(Request $request) - { + public function trafficLog(Request $request) { $port = $request->input('port'); $user_id = $request->input('user_id'); $email = $request->input('email'); @@ -1174,7 +1217,7 @@ class AdminController extends Controller $query = UserTrafficLog::query()->with(['user', 'node']); if(isset($port)){ - $query->whereHas('user', function($q) use ($port){ + $query->whereHas('user', function($q) use ($port) { $q->wherePort($port); }); } @@ -1184,7 +1227,7 @@ class AdminController extends Controller } if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -1202,7 +1245,7 @@ class AdminController extends Controller } // 已使用流量 - $view['totalTraffic'] = flowAutoShow($query->sum('u')+$query->sum('d')); + $view['totalTraffic'] = flowAutoShow($query->sum('u') + $query->sum('d')); $list = $query->orderBy('id', 'desc')->paginate(20)->appends($request->except('page')); foreach($list as $vo){ @@ -1218,8 +1261,7 @@ class AdminController extends Controller } // SS(R)链接反解析 - public function decompile(Request $request) - { + public function decompile(Request $request) { if($request->isMethod('POST')){ $content = $request->input('content'); @@ -1234,9 +1276,9 @@ class AdminController extends Controller foreach($content as $item){ // 判断是SS还是SSR链接 $str = ''; - if(FALSE !== strpos($item, 'ssr://')){ + if(false !== strpos($item, 'ssr://')){ $str = mb_substr($item, 6); - }elseif(FALSE !== strpos($item, 'ss://')){ + }elseif(false !== strpos($item, 'ss://')){ $str = mb_substr($item, 5); } @@ -1253,8 +1295,7 @@ class AdminController extends Controller } // 格式转换(SS转SSR) - public function convert(Request $request) - { + public function convert(Request $request) { if($request->isMethod('POST')){ $method = $request->input('method'); $transfer_enable = $request->input('transfer_enable'); @@ -1271,13 +1312,30 @@ class AdminController extends Controller // 校验格式 $content = json_decode($content); if(empty($content->port_password)){ - return Response::json(['status' => 'fail', 'data' => '', 'message' => '转换失败:配置信息里缺少【port_password】字段,或者该字段为空']); + return Response::json([ + 'status' => 'fail', + 'data' => '', + 'message' => '转换失败:配置信息里缺少【port_password】字段,或者该字段为空' + ]); } // 转换成SSR格式JSON $data = []; foreach($content->port_password as $port => $passwd){ - $data[] = ['d' => 0, 'enable' => 1, 'method' => $method, 'obfs' => $obfs, 'obfs_param' => empty($obfs_param)? "" : $obfs_param, 'passwd' => $passwd, 'port' => $port, 'protocol' => $protocol, 'protocol_param' => empty($protocol_param)? "" : $protocol_param, 'transfer_enable' => toGB($transfer_enable), 'u' => 0, 'user' => date('Ymd').'_IMPORT_'.$port,]; + $data[] = [ + 'd' => 0, + 'enable' => 1, + 'method' => $method, + 'obfs' => $obfs, + 'obfs_param' => empty($obfs_param)? "" : $obfs_param, + 'passwd' => $passwd, + 'port' => $port, + 'protocol' => $protocol, + 'protocol_param' => empty($protocol_param)? "" : $protocol_param, + 'transfer_enable' => toGB($transfer_enable), + 'u' => 0, + 'user' => date('Ymd').'_IMPORT_'.$port, + ]; } $json = json_encode($data); @@ -1297,8 +1355,7 @@ class AdminController extends Controller } // 下载转换好的JSON文件 - public function download(Request $request) - { + public function download(Request $request) { $type = $request->input('type'); if(empty($type)){ exit('参数异常'); @@ -1318,8 +1375,7 @@ class AdminController extends Controller } // 数据导入 - public function import(Request $request) - { + public function import(Request $request) { if($request->isMethod('POST')){ if(!$request->hasFile('uploadFile')){ Session::flash('errorMsg', '请选择要上传的文件'); @@ -1409,8 +1465,7 @@ class AdminController extends Controller } // 导出配置信息 - public function export(Request $request, $id) - { + public function export(Request $request, $id) { if(empty($id)){ return Redirect::to('admin/userList'); } @@ -1431,7 +1486,12 @@ class AdminController extends Controller return Response::json(['status' => 'success', 'data' => $data, 'title' => $proxyType]); }else{ - $view['nodeList'] = SsNode::query()->whereStatus(1)->orderBy('sort', 'desc')->orderBy('id', 'asc')->paginate(15)->appends($request->except('page')); + $view['nodeList'] = SsNode::query() + ->whereStatus(1) + ->orderBy('sort', 'desc') + ->orderBy('id', 'asc') + ->paginate(15) + ->appends($request->except('page')); $view['user'] = $user; } @@ -1439,8 +1499,7 @@ class AdminController extends Controller } // 导出原版SS用户配置信息 - public function exportSSJson() - { + public function exportSSJson() { $userList = User::query()->where('port', '>', 0)->get(); $defaultMethod = Helpers::getDefaultMethod(); @@ -1480,8 +1539,7 @@ EOF; } // 修改个人资料 - public function profile(Request $request) - { + public function profile(Request $request) { if($request->isMethod('POST')){ $old_password = trim($request->input('old_password')); $new_password = trim($request->input('new_password')); @@ -1504,8 +1562,7 @@ EOF; } // 用户流量监控 - public function userMonitor($id) - { + public function userMonitor($id) { if(empty($id)){ return Redirect::to('admin/userList'); } @@ -1519,26 +1576,38 @@ EOF; $dailyData = []; $hourlyData = []; // 节点一个月内的流量 - $userTrafficDaily = UserTrafficDaily::query()->whereUserId($user->id)->whereNodeId(0)->where('created_at', '>=', date('Y-m', time()))->orderBy('created_at', 'asc')->pluck('total')->toArray(); + $userTrafficDaily = UserTrafficDaily::query() + ->whereUserId($user->id) + ->whereNodeId(0) + ->where('created_at', '>=', date('Y-m', time())) + ->orderBy('created_at', 'asc') + ->pluck('total') + ->toArray(); - $dailyTotal = date('d')-1; // 今天不算,减一 + $dailyTotal = date('d') - 1; // 今天不算,减一 $dailyCount = count($userTrafficDaily); - for($x = 0; $x < $dailyTotal-$dailyCount; $x++){ + for($x = 0; $x < $dailyTotal - $dailyCount; $x++){ $dailyData[$x] = 0; } - for($x = $dailyTotal-$dailyCount; $x < $dailyTotal; $x++){ - $dailyData[$x] = round($userTrafficDaily[$x-($dailyTotal-$dailyCount)]/(1024*1024*1024), 3); + for($x = $dailyTotal - $dailyCount; $x < $dailyTotal; $x++){ + $dailyData[$x] = round($userTrafficDaily[$x - ($dailyTotal - $dailyCount)] / (1024 * 1024 * 1024), 3); } // 节点一天内的流量 - $userTrafficHourly = UserTrafficHourly::query()->whereUserId($user->id)->whereNodeId(0)->where('created_at', '>=', date('Y-m-d', time()))->orderBy('created_at', 'asc')->pluck('total')->toArray(); + $userTrafficHourly = UserTrafficHourly::query() + ->whereUserId($user->id) + ->whereNodeId(0) + ->where('created_at', '>=', date('Y-m-d', time())) + ->orderBy('created_at', 'asc') + ->pluck('total') + ->toArray(); $hourlyTotal = date('H'); $hourlyCount = count($userTrafficHourly); - for($x = 0; $x < $hourlyTotal-$hourlyCount; $x++){ + for($x = 0; $x < $hourlyTotal - $hourlyCount; $x++){ $hourlyData[$x] = 0; } - for($x = ($hourlyTotal-$hourlyCount); $x < $hourlyTotal; $x++){ - $hourlyData[$x] = round($userTrafficHourly[$x-($hourlyTotal-$hourlyCount)]/(1024*1024*1024), 3); + for($x = ($hourlyTotal - $hourlyCount); $x < $hourlyTotal; $x++){ + $hourlyData[$x] = round($userTrafficHourly[$x - ($hourlyTotal - $hourlyCount)] / (1024 * 1024 * 1024), 3); } // 本月天数数据 @@ -1562,14 +1631,12 @@ EOF; } // 生成端口 - public function makePort() - { + public function makePort() { return self::$systemConfig['is_rand_port']? Helpers::getRandPort() : Helpers::getOnlyPort(); } // 加密方式、混淆、协议、等级、国家地区 - public function config(Request $request) - { + public function config(Request $request) { if($request->isMethod('POST')){ $name = $request->input('name'); $type = $request->input('type', 1); // 类型:1-加密方式(method)、2-协议(protocol)、3-混淆(obfs) @@ -1606,8 +1673,7 @@ EOF; } // 删除配置 - public function delConfig(Request $request) - { + public function delConfig(Request $request) { $id = $request->input('id'); $ret = SsConfig::query()->whereId($id)->delete(); @@ -1619,8 +1685,7 @@ EOF; } // 设置默认配置 - public function setDefaultConfig(Request $request) - { + public function setDefaultConfig(Request $request) { $id = $request->input('id'); if(empty($id)){ @@ -1642,8 +1707,7 @@ EOF; } // 设置系统扩展信息,例如客服、统计代码 - public function setExtend(Request $request) - { + public function setExtend(Request $request) { $websiteAnalytics = $request->input('website_analytics'); $websiteCustomerService = $request->input('website_customer_service'); @@ -1705,8 +1769,7 @@ EOF; } // 日志分析 - public function analysis() - { + public function analysis() { $file = storage_path('app/ssserver.log'); if(!file_exists($file)){ Session::flash('analysisErrorMsg', $file.' 不存在,请先创建文件'); @@ -1715,7 +1778,7 @@ EOF; } $logs = $this->tail($file, 10000); - if(FALSE === $logs){ + if(false === $logs){ $view['urlList'] = []; }else{ $url = []; @@ -1728,7 +1791,8 @@ EOF; if(!empty($tcp_matches)){ $url[] = str_replace('TCP request ', '[TCP] ', $tcp_matches[0]); }else{ - preg_match('/UDP data to (25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/', $log, $udp_matches); + preg_match('/UDP data to (25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/', + $log, $udp_matches); if(!empty($udp_matches)){ $url[] = str_replace('UDP data to ', '[UDP] ', $udp_matches[0]); } @@ -1742,8 +1806,7 @@ EOF; } // 添加等级 - public function addLevel(Request $request) - { + public function addLevel(Request $request) { $level = $request->input('level'); $level_name = trim($request->input('level_name')); @@ -1773,8 +1836,7 @@ EOF; } // 编辑等级 - public function updateLevel(Request $request) - { + public function updateLevel(Request $request) { $id = $request->input('id'); $level = $request->input('level'); $level_name = $request->input('level_name'); @@ -1814,8 +1876,7 @@ EOF; } // 删除等级 - public function delLevel(Request $request) - { + public function delLevel(Request $request) { $id = $request->input('id'); if(empty($id)){ @@ -1838,7 +1899,7 @@ EOF; if(!$existUsers->isEmpty()){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '该等级下存在关联账号,请先取消关联']); } - $ret = FALSE; + $ret = false; try{ $ret = Level::query()->whereId($id)->delete(); }catch(Exception $e){ @@ -1852,8 +1913,7 @@ EOF; } // 添加国家/地区 - public function addCountry(Request $request) - { + public function addCountry(Request $request) { $name = $request->input('country_name'); $code = $request->input('country_code'); @@ -1883,8 +1943,7 @@ EOF; } // 编辑国家/地区 - public function updateCountry(Request $request) - { + public function updateCountry(Request $request) { $id = $request->input('id'); $name = $request->input('country_name'); $code = $request->input('country_code'); @@ -1921,8 +1980,7 @@ EOF; } // 删除国家/地区 - public function delCountry(Request $request) - { + public function delCountry(Request $request) { $id = $request->input('id'); if(empty($id)){ @@ -1939,7 +1997,7 @@ EOF; if(!$existNode->isEmpty()){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '该国家/地区下存在关联节点,请先取消关联']); } - $ret = FALSE; + $ret = false; try{ $ret = Country::query()->whereId($id)->delete(); }catch(Exception $e){ @@ -1953,8 +2011,7 @@ EOF; } // 系统设置 - public function system() - { + public function system() { $view = self::$systemConfig; $view['label_list'] = Label::query()->orderBy('sort', 'desc')->orderBy('id', 'asc')->get(); @@ -1962,8 +2019,7 @@ EOF; } // 设置某个配置项 - public function setConfig(Request $request) - { + public function setConfig(Request $request) { $name = $request->input('name'); $value = trim($request->input('value')); @@ -1977,7 +2033,8 @@ EOF; } // 如果开启用户邮件重置密码,则先设置网站名称和网址 - if(in_array($name, ['is_reset_password', 'is_activate_account', 'expire_warning', 'traffic_warning']) && $value != '0'){ + if(in_array($name, ['is_reset_password', 'is_activate_account', 'expire_warning', 'traffic_warning']) + && $value != '0'){ $config = Config::query()->whereName('website_name')->first(); if($config->value == ''){ return Response::json(['status' => 'fail', 'message' => '设置失败:启用该配置需要先设置【网站名称】']); @@ -1993,12 +2050,14 @@ EOF; if(in_array($name, ['is_AliPay', 'is_QQPay', 'is_WeChatPay', 'is_otherPay']) && $value != ''){ switch($value){ case 'f2fpay': - if(!self::$systemConfig['f2fpay_app_id'] || !self::$systemConfig['f2fpay_private_key'] || !self::$systemConfig['f2fpay_public_key']){ + if(!self::$systemConfig['f2fpay_app_id'] || !self::$systemConfig['f2fpay_private_key'] + || !self::$systemConfig['f2fpay_public_key']){ return Response::json(['status' => 'fail', 'message' => '请先设置【支付宝F2F】必要参数']); } break; case 'codepay': - if(!self::$systemConfig['codepay_url'] || !self::$systemConfig['codepay_id'] || !self::$systemConfig['codepay_key']){ + if(!self::$systemConfig['codepay_url'] || !self::$systemConfig['codepay_id'] + || !self::$systemConfig['codepay_key']){ return Response::json(['status' => 'fail', 'message' => '请先设置【码支付】必要参数']); } break; @@ -2013,7 +2072,8 @@ EOF; } break; case 'paypal': - if(!self::$systemConfig['paypal_username'] || !self::$systemConfig['paypal_password'] || !self::$systemConfig['paypal_secret']){ + if(!self::$systemConfig['paypal_username'] || !self::$systemConfig['paypal_password'] + || !self::$systemConfig['paypal_secret']){ return Response::json(['status' => 'fail', 'message' => '请先设置【PayPal】必要参数']); } break; @@ -2025,7 +2085,15 @@ EOF; // 演示环境禁止修改特定配置项 if(env('APP_DEMO')){ - $denyConfig = ['website_url', 'min_rand_traffic', 'max_rand_traffic', 'push_bear_send_key', 'push_bear_qrcode', 'is_forbid_china', 'website_security_code']; + $denyConfig = [ + 'website_url', + 'min_rand_traffic', + 'max_rand_traffic', + 'push_bear_send_key', + 'push_bear_qrcode', + 'is_forbid_china', + 'website_security_code' + ]; if(in_array($name, $denyConfig)){ return Response::json(['status' => 'fail', 'message' => '演示环境禁止修改该配置']); @@ -2034,7 +2102,7 @@ EOF; // 如果是返利比例,则需要除100 if(in_array($name, ['referral_percent'])){ - $value = intval($value)/100; + $value = intval($value) / 100; } // 更新配置 @@ -2044,11 +2112,10 @@ EOF; } //推送通知测试 - public function sendTestNotification() - { + public function sendTestNotification() { if(self::$systemConfig['is_notification']){ $result = PushNotification::send('这是测试的标题', 'SSRPanel_OM测试内容'); - if($result == FALSE){ + if($result == false){ return Response::json(['status' => 'fail', 'message' => '发送失败,请重新尝试!']); } switch(self::$systemConfig['is_notification']){ @@ -2074,16 +2141,19 @@ EOF; } // 邀请码列表 - public function inviteList(Request $request) - { - $view['inviteList'] = Invite::query()->with(['generator', 'user'])->orderBy('status', 'asc')->orderBy('id', 'desc')->paginate(15)->appends($request->except('page')); + public function inviteList(Request $request) { + $view['inviteList'] = Invite::query() + ->with(['generator', 'user']) + ->orderBy('status', 'asc') + ->orderBy('id', 'desc') + ->paginate(15) + ->appends($request->except('page')); return Response::view('admin.inviteList', $view); } // 生成邀请码 - public function makeInvite() - { + public function makeInvite() { for($i = 0; $i < 10; $i++){ $obj = new Invite(); $obj->uid = 0; @@ -2098,23 +2168,29 @@ EOF; } // 导出邀请码 - public function exportInvite() - { + public function exportInvite() { $inviteList = Invite::query()->whereStatus(0)->orderBy('id', 'asc')->get(); $filename = '邀请码'.date('Ymd').'.xlsx'; $spreadsheet = new Spreadsheet(); - $spreadsheet->getProperties()->setCreator('SSRPanel')->setLastModifiedBy('SSRPanel')->setTitle('邀请码')->setSubject('邀请码')->setDescription('')->setKeywords('')->setCategory(''); + $spreadsheet->getProperties() + ->setCreator('SSRPanel') + ->setLastModifiedBy('SSRPanel') + ->setTitle('邀请码') + ->setSubject('邀请码') + ->setDescription('') + ->setKeywords('') + ->setCategory(''); try{ $spreadsheet->setActiveSheetIndex(0); $sheet = $spreadsheet->getActiveSheet(); $sheet->setTitle('邀请码'); - $sheet->fromArray(['邀请码', '有效期'], NULL); + $sheet->fromArray(['邀请码', '有效期'], null); foreach($inviteList as $k => $vo){ - $sheet->fromArray([$vo->code, $vo->dateline], NULL, 'A'.($k+2)); + $sheet->fromArray([$vo->code, $vo->dateline], null, 'A'.($k + 2)); } header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); // 输出07Excel文件 @@ -2129,8 +2205,7 @@ EOF; } // 订单列表 - public function orderList(Request $request) - { + public function orderList(Request $request) { $email = $request->input('email'); $order_sn = $request->input('order_sn'); $is_coupon = $request->input('is_coupon'); @@ -2144,7 +2219,7 @@ EOF; $query = Order::query()->with(['user', 'goods', 'coupon']); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -2193,8 +2268,7 @@ EOF; } // 重置用户流量 - public function resetUserTraffic(Request $request) - { + public function resetUserTraffic(Request $request) { $id = $request->input('id'); User::query()->whereId($id)->update(['u' => 0, 'd' => 0]); @@ -2203,8 +2277,7 @@ EOF; } // 操作用户余额 - public function handleUserBalance(Request $request) - { + public function handleUserBalance(Request $request) { if($request->isMethod('POST')){ $userId = $request->input('user_id'); $amount = $request->input('amount'); @@ -2218,13 +2291,13 @@ EOF; $user = User::query()->whereId($userId)->first(); // 写入余额变动日志 - Helpers::addUserBalanceLog($userId, 0, $user->balance, $user->balance+$amount, $amount, '后台手动充值'); + Helpers::addUserBalanceLog($userId, 0, $user->balance, $user->balance + $amount, $amount, '后台手动充值'); // 加减余额 if($amount < 0){ - $user->decrement('balance', abs($amount)*100); + $user->decrement('balance', abs($amount) * 100); }else{ - $user->increment('balance', abs($amount)*100); + $user->increment('balance', abs($amount) * 100); } DB::commit(); @@ -2241,14 +2314,13 @@ EOF; } // 用户余额变动记录 - public function userBalanceLogList(Request $request) - { + public function userBalanceLogList(Request $request) { $email = $request->input('email'); $query = UserBalanceLog::query()->with(['user'])->orderBy('id', 'desc'); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -2259,14 +2331,13 @@ EOF; } // 用户封禁记录 - public function userBanLogList(Request $request) - { + public function userBanLogList(Request $request) { $email = $request->input('email'); $query = UserBanLog::query()->with(['user'])->orderBy('id', 'desc'); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -2277,14 +2348,13 @@ EOF; } // 用户流量变动记录 - public function userTrafficLogList(Request $request) - { + public function userTrafficLogList(Request $request) { $email = $request->input('email'); $query = UserTrafficModifyLog::query()->with(['user', 'order', 'order.goods']); if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } @@ -2295,8 +2365,7 @@ EOF; } // 用户在线IP记录 - public function userOnlineIPList(Request $request) - { + public function userOnlineIPList(Request $request) { $email = $request->input('email'); $port = $request->input('port'); $wechat = $request->input('wechat'); @@ -2324,7 +2393,14 @@ EOF; if(!$userList->isEmpty()){ foreach($userList as $user){ // 最近5条在线IP记录,如果后端设置为60秒上报一次,则为10分钟内的在线IP - $user->onlineIPList = SsNodeIp::query()->with(['node'])->whereType('tcp')->wherePort($user->port)->where('created_at', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->limit(5)->get(); + $user->onlineIPList = SsNodeIp::query() + ->with(['node']) + ->whereType('tcp') + ->wherePort($user->port) + ->where('created_at', '>=', strtotime("-10 minutes")) + ->orderBy('id', 'desc') + ->limit(5) + ->get(); } } @@ -2334,8 +2410,7 @@ EOF; } // 转换成某个用户的身份 - public function switchToUser(Request $request) - { + public function switchToUser(Request $request) { $id = $request->input('user_id'); $user = User::query()->find($id); @@ -2351,8 +2426,7 @@ EOF; } // 标签列表 - public function labelList(Request $request) - { + public function labelList(Request $request) { $labelList = Label::query()->paginate(15)->appends($request->except('page')); foreach($labelList as $label){ $label->userCount = UserLabel::query()->whereLabelId($label->id)->groupBy('label_id')->count(); @@ -2365,8 +2439,7 @@ EOF; } // 添加标签 - public function addLabel(Request $request) - { + public function addLabel(Request $request) { if($request->isMethod('POST')){ $name = $request->input('name'); $sort = $request->input('sort'); @@ -2383,8 +2456,7 @@ EOF; } // 编辑标签 - public function editLabel(Request $request) - { + public function editLabel(Request $request) { if($request->isMethod('POST')){ $id = $request->input('id'); $name = $request->input('name'); @@ -2402,8 +2474,7 @@ EOF; } // 删除标签 - public function delLabel(Request $request) - { + public function delLabel(Request $request) { $id = $request->input('id'); DB::beginTransaction(); @@ -2423,8 +2494,7 @@ EOF; } // 邮件发送日志列表 - public function notificationLog(Request $request) - { + public function notificationLog(Request $request) { $email = $request->input('email'); $type = $request->input('type'); @@ -2444,40 +2514,42 @@ EOF; } // 在线IP监控(实时) - public function onlineIPMonitor(Request $request) - { + public function onlineIPMonitor(Request $request) { $ip = $request->input('ip'); $email = $request->input('email'); $port = $request->input('port'); $nodeId = $request->input('nodeId'); $userId = $request->input('id'); - $query = SsNodeIp::query()->with(['node', 'user'])->whereType('tcp')->where('created_at', '>=', strtotime("-120 seconds")); + $query = SsNodeIp::query() + ->with(['node', 'user']) + ->whereType('tcp') + ->where('created_at', '>=', strtotime("-120 seconds")); if(isset($ip)){ $query->whereIp($ip); } if(isset($email)){ - $query->whereHas('user', function($q) use ($email){ + $query->whereHas('user', function($q) use ($email) { $q->where('email', 'like', '%'.$email.'%'); }); } if(isset($port)){ - $query->whereHas('user', function($q) use ($port){ + $query->whereHas('user', function($q) use ($port) { $q->wherePort($port); }); } if(isset($nodeId)){ - $query->whereHas('node', function($q) use ($nodeId){ + $query->whereHas('node', function($q) use ($nodeId) { $q->whereId($nodeId); }); } if(isset($userId)){ - $query->whereHas('user', function($q) use ($userId){ + $query->whereHas('user', function($q) use ($userId) { $q->whereId($userId); }); } @@ -2486,7 +2558,7 @@ EOF; foreach($list as $vo){ // 跳过上报多IP的 - if(strpos($vo->ip, ',') == TRUE){ + if(strpos($vo->ip, ',') == true){ continue; } @@ -2494,7 +2566,11 @@ EOF; if(isset($ipInfo['error'])){ // 用IPIP的库再试一下 $ipip = IPIP::ip($vo->ip); - $ipInfo = ['country' => $ipip['country_name'], 'province' => $ipip['region_name'], 'city' => $ipip['city_name']]; + $ipInfo = [ + 'country' => $ipip['country_name'], + 'province' => $ipip['region_name'], + 'city' => $ipip['city_name'] + ]; } $vo->ipInfo = $ipInfo['country'].' '.$ipInfo['province'].' '.$ipInfo['city']; diff --git a/app/Http/Controllers/Api/LoginController.php b/app/Http/Controllers/Api/LoginController.php index fa6459fc..91943a68 100644 --- a/app/Http/Controllers/Api/LoginController.php +++ b/app/Http/Controllers/Api/LoginController.php @@ -21,18 +21,15 @@ use Response; * * @package App\Http\Controllers */ -class LoginController extends Controller -{ +class LoginController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 登录返回订阅信息 - public function login(Request $request) - { + public function login(Request $request) { $email = trim($request->input('email')); $password = trim($request->input('password')); $cacheKey = 'request_times_'.md5(getClientIp()); @@ -82,14 +79,14 @@ class LoginController extends Controller } $nodeList = DB::table('ss_node') - ->selectRaw('ss_node.*') - ->leftJoin('ss_node_label', 'ss_node.id', '=', 'ss_node_label.node_id') - ->whereIn('ss_node_label.label_id', $userLabelIds) - ->where('ss_node.status', 1) - ->groupBy('ss_node.id') - ->orderBy('ss_node.sort', 'desc') - ->orderBy('ss_node.id', 'asc') - ->get(); + ->selectRaw('ss_node.*') + ->leftJoin('ss_node_label', 'ss_node.id', '=', 'ss_node_label.node_id') + ->whereIn('ss_node_label.label_id', $userLabelIds) + ->where('ss_node.status', 1) + ->groupBy('ss_node.id') + ->orderBy('ss_node.sort', 'desc') + ->orderBy('ss_node.id', 'asc') + ->get(); $c_nodes = collect(); foreach($nodeList as $node){ @@ -119,7 +116,7 @@ class LoginController extends Controller 'buy_link' => '', 'money' => '0.00', 'sspannelName' => 'ssrpanel', - 'usedTraffic' => flowAutoShow($user->u+$user->d), + 'usedTraffic' => flowAutoShow($user->u + $user->d), 'Traffic' => flowAutoShow($user->transfer_enable), 'all' => 1, 'residue' => '', @@ -136,4 +133,4 @@ class LoginController extends Controller return Response::json(['status' => 'success', 'data' => [], 'message' => '登录失败']); } } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Api/PingController.php b/app/Http/Controllers/Api/PingController.php index c9f17932..e6db0e93 100644 --- a/app/Http/Controllers/Api/PingController.php +++ b/app/Http/Controllers/Api/PingController.php @@ -14,10 +14,8 @@ use Log; * * @package App\Http\Controllers\Api */ -class PingController extends Controller -{ - public function ping(Request $request) - { +class PingController extends Controller { + public function ping(Request $request) { $token = $request->input('token'); $host = $request->input('host'); $port = $request->input('port', 22); @@ -51,7 +49,7 @@ class PingController extends Controller } // 如果不是IPv4 - if(FALSE === filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ + if(false === filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ // 如果是IPv6 if(filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ $host = '['.$host.']'; diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 5873bd2f..d5de22f7 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -36,26 +36,23 @@ use Validator; * * @package App\Http\Controllers */ -class AuthController extends Controller -{ +class AuthController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 登录 - public function login(Request $request) - { + public function login(Request $request) { if($request->isMethod('POST')){ $this->validate($request, [ 'email' => 'required', 'password' => 'required' ], [ - 'email.required' => trans('auth.email_null'), - 'password.required' => trans('auth.password_null') - ]); + 'email.required' => trans('auth.email_null'), + 'password.required' => trans('auth.password_null') + ]); $email = $request->input('email'); $password = $request->input('password'); @@ -63,7 +60,7 @@ class AuthController extends Controller // 是否校验验证码 $captcha = $this->check_captcha($request); - if($captcha != FALSE){ + if($captcha != false){ return $captcha; } @@ -77,11 +74,14 @@ class AuthController extends Controller if(Auth::user()->status < 0){ Auth::logout(); // 强制销毁会话,因为Auth::attempt的时候会产生会话 - return Redirect::back()->withInput()->withErrors(trans('auth.login_ban', ['email' => self::$systemConfig['webmaster_email']])); + return Redirect::back()->withInput()->withErrors(trans('auth.login_ban', + ['email' => self::$systemConfig['webmaster_email']])); }elseif(Auth::user()->status == 0 && self::$systemConfig['is_activate_account']){ Auth::logout(); // 强制销毁会话,因为Auth::attempt的时候会产生会话 - return Redirect::back()->withInput()->withErrors(trans('auth.active_tip').'【'.trans('auth.active_account').'】'); + return Redirect::back() + ->withInput() + ->withErrors(trans('auth.active_tip').'【'.trans('auth.active_account').'】'); } } @@ -111,8 +111,7 @@ class AuthController extends Controller } // 校验验证码 - private function check_captcha($request) - { + private function check_captcha($request) { switch(self::$systemConfig['is_captcha']){ case 1: // 默认图形验证码 if(!Captcha::check($request->input('captcha'))){ @@ -123,8 +122,8 @@ class AuthController extends Controller $result = $this->validate($request, [ 'geetest_challenge' => 'required|geetest' ], [ - 'geetest' => trans('auth.captcha_fail') - ]); + 'geetest' => trans('auth.captcha_fail') + ]); if(!$result){ return Redirect::back()->withInput()->withErrors(trans('auth.fail_captcha')); @@ -158,11 +157,10 @@ class AuthController extends Controller /** * 添加用户登录日志 * - * @param string $userId 用户ID - * @param string $ip IP地址 + * @param string $userId 用户ID + * @param string $ip IP地址 */ - private function addUserLoginLog($userId, $ip) - { + private function addUserLoginLog($userId, $ip) { if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ Log::info('识别到IPv6,尝试解析:'.$ip); $ipInfo = getIPv6($ip); @@ -206,16 +204,14 @@ class AuthController extends Controller // 退出 - public function logout() - { + public function logout() { Auth::logout(); return Redirect::to('login'); } // 注册 - public function register(Request $request) - { + public function register(Request $request) { $cacheKey = 'register_times_'.md5(getClientIp()); // 注册限制缓存key if($request->isMethod('POST')){ @@ -226,16 +222,16 @@ class AuthController extends Controller 'confirmPassword' => 'required|same:password', 'term' => 'accepted' ], [ - 'username.required' => trans('auth.email_null'), - 'email.required' => trans('auth.email_null'), - 'email.email' => trans('auth.email_legitimate'), - 'email.unique' => trans('auth.email_exist'), - 'password.required' => trans('auth.password_null'), - 'password.min' => trans('auth.password_limit'), - 'confirmPassword.required' => trans('auth.confirm_password'), - 'confirmPassword.same' => trans('auth.password_same'), - 'term.accepted' => trans('auth.unaccepted') - ]); + 'username.required' => trans('auth.email_null'), + 'email.required' => trans('auth.email_null'), + 'email.email' => trans('auth.email_legitimate'), + 'email.unique' => trans('auth.email_exist'), + 'password.required' => trans('auth.password_null'), + 'password.min' => trans('auth.password_limit'), + 'confirmPassword.required' => trans('auth.confirm_password'), + 'confirmPassword.same' => trans('auth.password_same'), + 'term.accepted' => trans('auth.unaccepted') + ]); $username = $request->input('username'); $email = $request->input('email'); @@ -260,7 +256,7 @@ class AuthController extends Controller // 校验域名邮箱黑白名单 if(self::$systemConfig['is_email_filtering']){ $result = $this->emailChecker($email); - if($result != FALSE){ + if($result != false){ return $result; } } @@ -276,7 +272,9 @@ class AuthController extends Controller if($code){ $codeEnable = Invite::query()->whereCode($code)->whereStatus(0)->doesntExist(); if($codeEnable){ - return Redirect::back()->withInput($request->except(['code']))->withErrors(trans('auth.code_error')); + return Redirect::back() + ->withInput($request->except(['code'])) + ->withErrors(trans('auth.code_error')); } } } @@ -284,11 +282,19 @@ class AuthController extends Controller // 注册前发送激活码 if(self::$systemConfig['is_activate_account'] == 1){ if(!$verify_code){ - return Redirect::back()->withInput($request->except(['verify_code']))->withErrors(trans('auth.captcha_null')); + return Redirect::back() + ->withInput($request->except(['verify_code'])) + ->withErrors(trans('auth.captcha_null')); }else{ - $verifyCode = VerifyCode::query()->whereAddress($email)->whereCode($verify_code)->whereStatus(0)->firstOrFail(); + $verifyCode = VerifyCode::query() + ->whereAddress($email) + ->whereCode($verify_code) + ->whereStatus(0) + ->firstOrFail(); if(!$verifyCode){ - return Redirect::back()->withInput($request->except(['verify_code']))->withErrors(trans('auth.captcha_overtime')); + return Redirect::back() + ->withInput($request->except(['verify_code'])) + ->withErrors(trans('auth.captcha_overtime')); } $verifyCode->status = 1; @@ -298,7 +304,7 @@ class AuthController extends Controller // 是否校验验证码 $captcha = $this->check_captcha($request); - if($captcha != FALSE){ + if($captcha != false){ return $captcha; } @@ -307,7 +313,9 @@ class AuthController extends Controller if(Cache::has($cacheKey)){ $registerTimes = Cache::get($cacheKey); if($registerTimes >= self::$systemConfig['register_ip_limit']){ - return Redirect::back()->withInput($request->except(['code']))->withErrors(trans('auth.register_anti')); + return Redirect::back() + ->withInput($request->except(['code'])) + ->withErrors(trans('auth.register_anti')); } } } @@ -322,10 +330,11 @@ class AuthController extends Controller $affArr = $this->getAff($code, $aff); $referral_uid = $affArr['referral_uid']; - $transfer_enable = 1048576*(self::$systemConfig['default_traffic']+($referral_uid? self::$systemConfig['referral_traffic'] : 0)); + $transfer_enable = 1048576 * (self::$systemConfig['default_traffic'] + ($referral_uid? self::$systemConfig['referral_traffic'] : 0)); // 创建新用户 - $uid = Helpers::addUser($email, Hash::make($password), $transfer_enable, self::$systemConfig['default_days'], $referral_uid); + $uid = Helpers::addUser($email, Hash::make($password), $transfer_enable, + self::$systemConfig['default_days'], $referral_uid); // 注册失败,抛出异常 if(!$uid){ @@ -383,7 +392,9 @@ class AuthController extends Controller $referralUser = User::query()->whereId($referral_uid)->first(); if($referralUser){ if($referralUser->expire_time >= date('Y-m-d')){ - User::query()->whereId($referral_uid)->increment('transfer_enable', self::$systemConfig['referral_traffic']*1048576); + User::query() + ->whereId($referral_uid) + ->increment('transfer_enable', self::$systemConfig['referral_traffic'] * 1048576); } } } @@ -397,7 +408,9 @@ class AuthController extends Controller return Redirect::to('login')->withInput(); }else{ - $view['emailList'] = self::$systemConfig['is_email_filtering'] != 2? FALSE : SensitiveWords::query()->whereType(2)->get(); + $view['emailList'] = self::$systemConfig['is_email_filtering'] != 2? false : SensitiveWords::query() + ->whereType(2) + ->get(); Session::put('register_token', makeRandStr(16)); return Response::view('auth.register', $view); @@ -405,8 +418,7 @@ class AuthController extends Controller } //邮箱检查 - private function emailChecker($email) - { + private function emailChecker($email) { $sensitiveWords = $this->sensitiveWords(self::$systemConfig['is_email_filtering']); $emailSuffix = explode('@', $email); // 提取邮箱后缀 switch(self::$systemConfig['is_email_filtering']){ @@ -426,19 +438,18 @@ class AuthController extends Controller return Response::json(['status' => 'fail', 'message' => trans('auth.email_invalid')]); } - return FALSE; + return false; } /** * 获取AFF * - * @param string $code 邀请码 - * @param int $aff URL中的aff参数 + * @param string $code 邀请码 + * @param int $aff URL中的aff参数 * * @return array */ - private function getAff($code = '', $aff = NULL) - { + private function getAff($code = '', $aff = null) { // 邀请人ID $referral_uid = 0; @@ -474,8 +485,7 @@ class AuthController extends Controller } // 生成申请的请求地址 - private function addVerifyUrl($uid, $email) - { + private function addVerifyUrl($uid, $email) { $token = md5(self::$systemConfig['website_name'].$email.microtime()); $verify = new Verify(); $verify->type = 1; @@ -488,22 +498,22 @@ class AuthController extends Controller } // 重设密码页 - public function resetPassword(Request $request) - { + public function resetPassword(Request $request) { if($request->isMethod('POST')){ // 校验请求 $this->validate($request, [ 'email' => 'required|email' ], [ - 'email.required' => trans('auth.email_null'), - 'email.email' => trans('auth.email_legitimate') - ]); + 'email.required' => trans('auth.email_null'), + 'email.email' => trans('auth.email_legitimate') + ]); $email = $request->input('email'); // 是否开启重设密码 if(!self::$systemConfig['is_reset_password']){ - return Redirect::back()->withErrors(trans('auth.reset_password_close', ['email' => self::$systemConfig['webmaster_email']])); + return Redirect::back()->withErrors(trans('auth.reset_password_close', + ['email' => self::$systemConfig['webmaster_email']])); } // 查找账号 @@ -517,7 +527,8 @@ class AuthController extends Controller if(Cache::has('resetPassword_'.md5($email))){ $resetTimes = Cache::get('resetPassword_'.md5($email)); if($resetTimes >= self::$systemConfig['reset_password_times']){ - return Redirect::back()->withErrors(trans('auth.reset_password_limit', ['time' => self::$systemConfig['reset_password_times']])); + return Redirect::back()->withErrors(trans('auth.reset_password_limit', + ['time' => self::$systemConfig['reset_password_times']])); } } @@ -530,7 +541,7 @@ class AuthController extends Controller $logId = Helpers::addNotificationLog('重置密码', '请求地址:'.$resetPasswordUrl, 1, $email); Mail::to($email)->send(new resetPassword($logId, $resetPasswordUrl)); - Cache::put('resetPassword_'.md5($email), $resetTimes+1, 86400); + Cache::put('resetPassword_'.md5($email), $resetTimes + 1, 86400); return Redirect::back()->with('successMsg', trans('auth.reset_password_success_tip')); }else{ @@ -539,8 +550,7 @@ class AuthController extends Controller } // 重设密码 - public function reset(Request $request, $token) - { + public function reset(Request $request, $token) { if(!$token){ return Redirect::to('login'); } @@ -550,12 +560,12 @@ class AuthController extends Controller 'password' => 'required|min:6', 'confirmPassword' => 'required|same:password' ], [ - 'password.required' => trans('auth.password_null'), - 'password.min' => trans('auth.password_limit'), - 'confirmPassword.required' => trans('auth.password_null'), - 'confirmPassword.min' => trans('auth.password_limit'), - 'confirmPassword.same' => trans('auth.password_same'), - ]); + 'password.required' => trans('auth.password_null'), + 'password.min' => trans('auth.password_limit'), + 'confirmPassword.required' => trans('auth.password_null'), + 'confirmPassword.min' => trans('auth.password_limit'), + 'confirmPassword.same' => trans('auth.password_same'), + ]); $password = $request->input('password'); // 校验账号 $verify = Verify::type(1)->with('user')->whereToken($token)->first(); @@ -584,7 +594,7 @@ class AuthController extends Controller $verify = Verify::type(1)->whereToken($token)->first(); if(!$verify){ return Redirect::to('login'); - }elseif(time()-strtotime($verify->created_at) >= 1800){ + }elseif(time() - strtotime($verify->created_at) >= 1800){ // 置为已失效 $verify->status = 2; $verify->save(); @@ -598,27 +608,28 @@ class AuthController extends Controller } // 激活账号页 - public function activeUser(Request $request) - { + public function activeUser(Request $request) { if($request->isMethod('POST')){ $this->validate($request, [ 'email' => 'required|email|exists:user,email' ], [ - 'email.required' => trans('auth.email_null'), - 'email.email' => trans('auth.email_legitimate'), - 'email.exists' => trans('auth.email_notExist') - ]); + 'email.required' => trans('auth.email_null'), + 'email.email' => trans('auth.email_legitimate'), + 'email.exists' => trans('auth.email_notExist') + ]); $email = $request->input('email'); // 是否开启账号激活 if(self::$systemConfig['is_activate_account'] != 2){ - return Redirect::back()->withInput()->withErrors(trans('auth.active_close', ['email' => self::$systemConfig['webmaster_email']])); + return Redirect::back()->withInput()->withErrors(trans('auth.active_close', + ['email' => self::$systemConfig['webmaster_email']])); } // 查找账号 $user = User::query()->whereEmail($email)->first(); if($user->status < 0){ - return Redirect::back()->withErrors(trans('auth.login_ban', ['email' => self::$systemConfig['webmaster_email']])); + return Redirect::back()->withErrors(trans('auth.login_ban', + ['email' => self::$systemConfig['webmaster_email']])); }elseif($user->status > 0){ return Redirect::back()->withErrors(trans('auth.email_normal')); } @@ -628,7 +639,8 @@ class AuthController extends Controller if(Cache::has('activeUser_'.md5($email))){ $activeTimes = Cache::get('activeUser_'.md5($email)); if($activeTimes >= self::$systemConfig['active_times']){ - return Redirect::back()->withErrors(trans('auth.active_limit', ['time' => self::$systemConfig['webmaster_email']])); + return Redirect::back()->withErrors(trans('auth.active_limit', + ['time' => self::$systemConfig['webmaster_email']])); } } @@ -641,7 +653,7 @@ class AuthController extends Controller $logId = Helpers::addNotificationLog('激活账号', '请求地址:'.$activeUserUrl, 1, $email); Mail::to($email)->send(new activeUser($logId, $activeUserUrl)); - Cache::put('activeUser_'.md5($email), $activeTimes+1, 86400); + Cache::put('activeUser_'.md5($email), $activeTimes + 1, 86400); return Redirect::back()->with('successMsg', trans('auth.register_active_tip')); }else{ @@ -650,8 +662,7 @@ class AuthController extends Controller } // 激活账号 - public function active($token) - { + public function active($token) { if(!$token){ return Redirect::to('login'); } @@ -671,7 +682,7 @@ class AuthController extends Controller Session::flash('errorMsg', trans('auth.email_normal')); return Response::view('auth.active'); - }elseif(time()-strtotime($verify->created_at) >= 1800){ + }elseif(time() - strtotime($verify->created_at) >= 1800){ Session::flash('errorMsg', trans('auth.overtime')); // 置为已失效 @@ -695,9 +706,11 @@ class AuthController extends Controller // 账号激活后给邀请人送流量 if($verify->user->referral_uid){ - $transfer_enable = self::$systemConfig['referral_traffic']*1048576; + $transfer_enable = self::$systemConfig['referral_traffic'] * 1048576; - User::query()->whereId($verify->user->referral_uid)->increment('transfer_enable', $transfer_enable, ['enable' => 1]); + User::query() + ->whereId($verify->user->referral_uid) + ->increment('transfer_enable', $transfer_enable, ['enable' => 1]); } Session::flash('successMsg', trans('auth.active_success')); @@ -706,15 +719,14 @@ class AuthController extends Controller } // 发送注册验证码 - public function sendCode(Request $request) - { + public function sendCode(Request $request) { $validator = Validator::make($request->all(), [ 'email' => 'required|email|unique:user' ], [ - 'email.required' => trans('auth.email_null'), - 'email.email' => trans('auth.email_legitimate'), - 'email.unique' => trans('auth.email_exist') - ]); + 'email.required' => trans('auth.email_null'), + 'email.email' => trans('auth.email_legitimate'), + 'email.unique' => trans('auth.email_exist') + ]); $email = $request->input('email'); @@ -725,7 +737,7 @@ class AuthController extends Controller // 校验域名邮箱黑白名单 if(self::$systemConfig['is_email_filtering']){ $result = $this->emailChecker($email); - if($result != FALSE){ + if($result != false){ return $result; } } @@ -741,7 +753,7 @@ class AuthController extends Controller } // 发送邮件 - $code = makeRandStr(6, TRUE); + $code = makeRandStr(6, true); $logId = Helpers::addNotificationLog('发送注册验证码', '验证码:'.$code, 1, $email); Mail::to($email)->send(new sendVerifyCode($logId, $code)); @@ -753,8 +765,7 @@ class AuthController extends Controller } // 生成注册验证码 - private function addVerifyCode($email, $code) - { + private function addVerifyCode($email, $code) { $verify = new VerifyCode(); $verify->address = $email; $verify->code = $code; @@ -763,18 +774,16 @@ class AuthController extends Controller } // 公开的邀请码列表 - public function free() - { + public function free() { $view['inviteList'] = Invite::query()->whereUid(0)->whereStatus(0)->paginate(); return Response::view('auth.free', $view); } // 切换语言 - public function switchLang($locale) - { + public function switchLang($locale) { Session::put("locale", $locale); return Redirect::back(); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index dc1e2511..2c48a4f7 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -14,39 +14,34 @@ use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; -class Controller extends BaseController -{ +class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; // 生成随机密码 - public function makePasswd() - { + public function makePasswd() { return makeRandStr(); } // 生成VmessId - public function makeVmessId() - { + public function makeVmessId() { return createGuid(); } // 生成网站安全码 - public function makeSecurityCode() - { + public function makeSecurityCode() { return strtolower(makeRandStr(8)); } // 类似Linux中的tail命令 - public function tail($file, $n, $base = 5) - { + public function tail($file, $n, $base = 5) { $fileLines = $this->countLine($file); if($fileLines < 15000){ - return FALSE; + return false; } $fp = fopen($file, "r+"); assert($n > 0); - $pos = $n+1; + $pos = $n + 1; $lines = []; while(count($lines) <= $n){ try{ @@ -72,13 +67,12 @@ class Controller extends BaseController * * @return int */ - public function countLine($file) - { + public function countLine($file) { $fp = fopen($file, "r"); $i = 0; while(!feof($fp)){ //每次读取2M - if($data = fread($fp, 1024*1024*2)){ + if($data = fread($fp, 1024 * 1024 * 2)){ //计算读取到的行数 $num = substr_count($data, "\n"); $i += $num; @@ -91,14 +85,12 @@ class Controller extends BaseController } // 获取敏感词 - public function sensitiveWords($type) - { + public function sensitiveWords($type) { return SensitiveWords::query()->whereType($type)->get()->pluck('words')->toArray(); } // 将Base64图片转换为本地图片并保存 - function base64ImageSaver($base64_image_content) - { + function base64ImageSaver($base64_image_content) { // 匹配出图片的格式 if(preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $result)){ $type = $result[2]; @@ -106,11 +98,12 @@ class Controller extends BaseController $directory = date('Ymd'); $path = '/assets/images/qrcode/'.$directory.'/'; if(!file_exists(public_path($path))){ // 检查是否有该文件夹,如果没有就创建,并给予最高权限 - mkdir(public_path($path), 0755, TRUE); + mkdir(public_path($path), 0755, true); } - $fileName = makeRandStr(18, TRUE).".{$type}"; - if(file_put_contents(public_path($path.$fileName), base64_decode(str_replace($result[1], '', $base64_image_content)))){ + $fileName = makeRandStr(18, true).".{$type}"; + if(file_put_contents(public_path($path.$fileName), + base64_decode(str_replace($result[1], '', $base64_image_content)))){ chmod(public_path($path.$fileName), 0744); return $path.$fileName; @@ -125,24 +118,23 @@ class Controller extends BaseController /** * 节点信息 * - * @param int $uid 用户ID - * @param int $nodeId 节点ID - * @param int $infoType 信息类型:0为链接,1为文字 + * @param int $uid 用户ID + * @param int $nodeId 节点ID + * @param int $infoType 信息类型:0为链接,1为文字 * * @return string */ - function getNodeInfo($uid, $nodeId, $infoType) - { + function getNodeInfo($uid, $nodeId, $infoType) { $user = User::whereId($uid)->first(); $node = SsNode::whereId($nodeId)->first(); - $scheme = NULL; + $scheme = null; // 获取分组名称 $group = SsGroup::query()->whereId($node->group_id)->first(); - $host = $node->server? : $node->ip; + $host = $node->server?: $node->ip; if($node->type == 1){ $group = $group? $group->name : Helpers::systemConfig()['website_name']; - $obfs_param = $user->obfs_param? : $node->obfs_param; + $obfs_param = $user->obfs_param?: $node->obfs_param; if($node->single){ $port = $node->port; $protocol = $node->protocol; @@ -167,35 +159,27 @@ class Controller extends BaseController } }else{ // 生成文本配置信息 - $data = "服务器:".$host.PHP_EOL. - "IPv6:".($node->ipv6? : '').PHP_EOL. - "远程端口:".$port.PHP_EOL. - "密码:".$passwd.PHP_EOL. - "加密方法:".$method.PHP_EOL. - "路由:绕过局域网及中国大陆地址".PHP_EOL. - "协议:".$protocol.PHP_EOL. - "协议参数:".$protocol_param.PHP_EOL. - "混淆方式:".$obfs.PHP_EOL. - "混淆参数:".$obfs_param.PHP_EOL. - "本地端口:1080".PHP_EOL; + $data = "服务器:".$host.PHP_EOL."IPv6:".($node->ipv6?: '').PHP_EOL."远程端口:".$port.PHP_EOL."密码:".$passwd.PHP_EOL."加密方法:".$method.PHP_EOL."路由:绕过局域网及中国大陆地址".PHP_EOL."协议:".$protocol.PHP_EOL."协议参数:".$protocol_param.PHP_EOL."混淆方式:".$obfs.PHP_EOL."混淆参数:".$obfs_param.PHP_EOL."本地端口:1080".PHP_EOL; } }else{ // 生成v2ray scheme if($infoType != 1){ // 生成v2ray scheme - $data = 'vmess://'.base64_encode(json_encode(["v" => "2", "ps" => $node->name, "add" => $host, "port" => $node->v2_port, "id" => $user->vmess_id, "aid" => $node->v2_alter_id, "net" => $node->v2_net, "type" => $node->v2_type, "host" => $node->v2_host, "path" => $node->v2_path, "tls" => $node->v2_tls? "tls" : ""], JSON_PRETTY_PRINT)); + $data = 'vmess://'.base64_encode(json_encode([ + "v" => "2", + "ps" => $node->name, + "add" => $host, + "port" => $node->v2_port, + "id" => $user->vmess_id, + "aid" => $node->v2_alter_id, + "net" => $node->v2_net, + "type" => $node->v2_type, + "host" => $node->v2_host, + "path" => $node->v2_path, + "tls" => $node->v2_tls? "tls" : "" + ], JSON_PRETTY_PRINT)); }else{ - $data = "服务器:".$host.PHP_EOL. - "IPv6:".($node->ipv6? : "").PHP_EOL. - "端口:".$node->v2_port.PHP_EOL. - "加密方式:".$node->v2_method.PHP_EOL. - "用户ID:".$user->vmess_id.PHP_EOL. - "额外ID:".$node->v2_alter_id.PHP_EOL. - "传输协议:".$node->v2_net.PHP_EOL. - "伪装类型:".$node->v2_type.PHP_EOL. - "伪装域名:".($node->v2_host? : "").PHP_EOL. - "路径:".($node->v2_path? : "").PHP_EOL. - "TLS:".($node->v2_tls? "tls" : "").PHP_EOL; + $data = "服务器:".$host.PHP_EOL."IPv6:".($node->ipv6?: "").PHP_EOL."端口:".$node->v2_port.PHP_EOL."加密方式:".$node->v2_method.PHP_EOL."用户ID:".$user->vmess_id.PHP_EOL."额外ID:".$node->v2_alter_id.PHP_EOL."传输协议:".$node->v2_net.PHP_EOL."伪装类型:".$node->v2_type.PHP_EOL."伪装域名:".($node->v2_host?: "").PHP_EOL."路径:".($node->v2_path?: "").PHP_EOL."TLS:".($node->v2_tls? "tls" : "").PHP_EOL; } } @@ -203,8 +187,7 @@ class Controller extends BaseController } // 写入订阅访问日志 - public function log($subscribeId, $ip, $headers) - { + public function log($subscribeId, $ip, $headers) { $log = new UserSubscribeLog(); $log->sid = $subscribeId; $log->request_ip = $ip; diff --git a/app/Http/Controllers/Gateway/AbstractPayment.php b/app/Http/Controllers/Gateway/AbstractPayment.php index f1d78d75..b7fcca26 100644 --- a/app/Http/Controllers/Gateway/AbstractPayment.php +++ b/app/Http/Controllers/Gateway/AbstractPayment.php @@ -13,27 +13,23 @@ use App\Http\Models\UserLabel; use Illuminate\Http\Request; use Log; -abstract class AbstractPayment -{ +abstract class AbstractPayment { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } - public static function generateGuid() - { - mt_srand((double)microtime()*10000); - $charid = strtoupper(md5(uniqid(mt_rand()+time(), TRUE))); + public static function generateGuid() { + mt_srand((double) microtime() * 10000); + $charid = strtoupper(md5(uniqid(mt_rand() + time(), true))); $hyphen = chr(45); - $uuid = chr(123) - .substr($charid, 0, 8).$hyphen - .substr($charid, 8, 4).$hyphen - .substr($charid, 12, 4).$hyphen - .substr($charid, 16, 4).$hyphen - .substr($charid, 20, 12) - .chr(125); + $uuid = chr(123).substr($charid, 0, 8).$hyphen.substr($charid, 8, 4).$hyphen.substr($charid, 12, + 4).$hyphen.substr($charid, + 16, + 4).$hyphen.substr($charid, + 20, + 12).chr(125); $uuid = str_replace(['}', '{', '-'], '', $uuid); $uuid = substr($uuid, 0, 8); @@ -49,8 +45,7 @@ abstract class AbstractPayment abstract public function getPurchaseHTML(); - public function postPayment($data, $method) - { + public function postPayment($data, $method) { // 获取需要的信息 $payment = Payment::whereSn($data)->first(); // 是否为余额购买套餐 @@ -65,9 +60,10 @@ abstract class AbstractPayment //余额充值 if($order->goods_id == -1){ - User::query()->whereId($order->user_id)->increment('balance', $order->amount*100); + User::query()->whereId($order->user_id)->increment('balance', $order->amount * 100); // 余额变动记录日志 - Helpers::addUserBalanceLog($order->user_id, $order->oid, $order->user->balance, $order->user->balance+$order->amount, $order->amount, '用户'.$method.'充值余额'); + Helpers::addUserBalanceLog($order->user_id, $order->oid, $order->user->balance, + $order->user->balance + $order->amount, $order->amount, '用户'.$method.'充值余额'); return 0; } @@ -77,11 +73,21 @@ abstract class AbstractPayment case 1: $order->status = 2; $order->save(); - User::query()->whereId($order->user_id)->increment('transfer_enable', $goods->traffic*1048576); - Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, $user->transfer_enable+$goods->traffic*1048576, '['.$method.']加上用户购买的套餐流量'); + User::query()->whereId($order->user_id)->increment('transfer_enable', $goods->traffic * 1048576); + Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, + $user->transfer_enable + $goods->traffic * 1048576, + '['.$method.']加上用户购买的套餐流量'); break; case 2: - $activePlan = Order::query()->whereUserId($user->id)->with(['goods'])->whereIsExpire(0)->whereStatus(2)->whereHas('goods', function($q){ $q->whereType(2); })->exists(); + $activePlan = Order::query() + ->whereUserId($user->id) + ->with(['goods']) + ->whereIsExpire(0) + ->whereStatus(2) + ->whereHas('goods', function($q) { + $q->whereType(2); + }) + ->exists(); // 2为开始生效,3为预支付 $order->status = $activePlan? 3 : 2; @@ -89,30 +95,31 @@ abstract class AbstractPayment if($activePlan){ // 预支付订单, 刷新账号有效时间用于流量重置判断 - User::query()->whereId($order->user_id)->update(['expire_time' => date('Y-m-d', strtotime("+".$goods->days." days", strtotime($user->expire_time)))]); + User::query()->whereId($order->user_id)->update([ + 'expire_time' => date('Y-m-d', + strtotime("+".$goods->days." days", + strtotime($user->expire_time))) + ]); }else{ // 如果买的是套餐,则先将之前购买的套餐都无效化,重置用户已用、可用流量为0 - Order::query() - ->whereUserId($user->id) - ->with(['goods']) - ->whereHas('goods', function($q){ - $q->where('type', '<=', 2); - }) - ->whereIsExpire(0) - ->whereStatus(2) - ->where('oid', '<>', $order->oid) - ->update(['expire_at' => date('Y-m-d H:i:s'), 'is_expire' => 1]); + Order::query()->whereUserId($user->id)->with(['goods'])->whereHas('goods', function($q) { + $q->where('type', '<=', 2); + })->whereIsExpire(0)->whereStatus(2)->where('oid', '<>', $order->oid)->update([ + 'expire_at' => date('Y-m-d H:i:s'), + 'is_expire' => 1 + ]); User::query()->whereId($order->user_id)->update(['u' => 0, 'd' => 0, 'transfer_enable' => 0]); - Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, 0, '['.$method.']用户购买新套餐,先清空流量'); + Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, 0, + '['.$method.']用户购买新套餐,先清空流量'); - $userTraffic = $goods->traffic*1048576; + $userTraffic = $goods->traffic * 1048576; // 添加账号有效期 $expireTime = date('Y-m-d', strtotime("+".$goods->days." days")); //账号下一个重置时间 $nextResetTime = date('Y-m-d', strtotime("+".$goods->period." days")); if($nextResetTime >= $expireTime){ - $nextResetTime = NULL; + $nextResetTime = null; } // 写入用户标签 @@ -121,7 +128,12 @@ abstract class AbstractPayment UserLabel::query()->whereUserId($order->user_id)->delete(); //取出 商品默认标签 & 系统默认标签 去重 - $newUserLabels = array_values(array_unique(array_merge(GoodsLabel::query()->whereGoodsId($order->goods_id)->pluck('label_id')->toArray(), self::$systemConfig['initial_labels_for_user']? explode(',', self::$systemConfig['initial_labels_for_user']) : []))); + $newUserLabels = array_values(array_unique(array_merge(GoodsLabel::query() + ->whereGoodsId($order->goods_id) + ->pluck('label_id') + ->toArray(), + self::$systemConfig['initial_labels_for_user']? explode(',', + self::$systemConfig['initial_labels_for_user']) : []))); // 生成标签 foreach($newUserLabels as $Label){ @@ -132,8 +144,14 @@ abstract class AbstractPayment } } - User::query()->whereId($order->user_id)->increment('invite_num', $goods->invite_num? : 0, ['transfer_enable' => $userTraffic, 'reset_time' => $nextResetTime, 'expire_time' => $expireTime, 'enable' => 1]); - Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, $userTraffic, '['.$method.']加上用户购买的套餐流量'); + User::query()->whereId($order->user_id)->increment('invite_num', $goods->invite_num?: 0, [ + 'transfer_enable' => $userTraffic, + 'reset_time' => $nextResetTime, + 'expire_time' => $expireTime, + 'enable' => 1 + ]); + Helpers::addUserTrafficModifyLog($order->user_id, $order->oid, $user->transfer_enable, $userTraffic, + '['.$method.']加上用户购买的套餐流量'); } // 是否返利 @@ -146,8 +164,11 @@ abstract class AbstractPayment User::query()->whereId($order->user->referral_uid)->increment('invite_num', 1); } //按照返利模式进行返利判断 - if(self::$systemConfig['referral_type'] == 2 || (self::$systemConfig['referral_type'] == 1 && !$referral)){ - $this->addReferralLog($order->user_id, $order->user->referral_uid, $order->oid, $order->amount, $order->amount*self::$systemConfig['referral_percent']); + if(self::$systemConfig['referral_type'] == 2 + || (self::$systemConfig['referral_type'] == 1 + && !$referral)){ + $this->addReferralLog($order->user_id, $order->user->referral_uid, $order->oid, $order->amount, + $order->amount * self::$systemConfig['referral_percent']); } } @@ -162,16 +183,15 @@ abstract class AbstractPayment /** * 添加返利日志 * - * @param int $userId 用户ID - * @param int $refUserId 返利用户ID - * @param int $oid 订单ID - * @param int $amount 发生金额 - * @param int $refAmount 返利金额 + * @param int $userId 用户ID + * @param int $refUserId 返利用户ID + * @param int $oid 订单ID + * @param int $amount 发生金额 + * @param int $refAmount 返利金额 * * @return int */ - private function addReferralLog($userId, $refUserId, $oid, $amount, $refAmount) - { + private function addReferralLog($userId, $refUserId, $oid, $amount, $refAmount) { $log = new ReferralLog(); $log->user_id = $userId; $log->ref_user_id = $refUserId; @@ -182,4 +202,4 @@ abstract class AbstractPayment return $log->save(); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Gateway/BitpayX.php b/app/Http/Controllers/Gateway/BitpayX.php index 0ab2384e..fe8c475f 100644 --- a/app/Http/Controllers/Gateway/BitpayX.php +++ b/app/Http/Controllers/Gateway/BitpayX.php @@ -9,17 +9,15 @@ use Auth; use Illuminate\Http\Request; use Response; -class BitpayX extends AbstractPayment -{ +class BitpayX extends AbstractPayment { private $bitpayGatewayUri = 'https://api.mugglepay.com/v1/'; /** - * @param Request $request + * @param Request $request * * @return mixed */ - public function purchase(Request $request) - { + public function purchase(Request $request) { $payment = new Payment(); $payment->sn = self::generateGuid(); $payment->user_id = Auth::user()->id; @@ -29,38 +27,40 @@ class BitpayX extends AbstractPayment $data = [ 'merchant_order_id' => $payment->sn, - 'price_amount' => (float)$request->input('amount'), + 'price_amount' => (float) $request->input('amount'), 'price_currency' => 'CNY', 'pay_currency' => $request->input('type') == 1? 'ALIPAY' : 'WECHAT', 'title' => '支付单号:'.$payment->sn, - 'description' => parent::$systemConfig['subject_name']? : parent::$systemConfig['website_name'], - 'callback_url' => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=bitpayx', + 'description' => parent::$systemConfig['subject_name']?: parent::$systemConfig['website_name'], + 'callback_url' => (parent::$systemConfig['website_callback_url']?: parent::$systemConfig['website_url']).'/callback/notify?method=bitpayx', 'success_url' => parent::$systemConfig['website_url'].'/invoices', 'cancel_url' => parent::$systemConfig['website_url'], 'token' => $this->sign($this->prepareSignId($payment->sn)), ]; - $result = json_decode($this->mprequest($data), TRUE); + $result = json_decode($this->mprequest($data), true); if($result['status'] === 200 || $result['status'] === 201){ $result['payment_url'] .= '&lang=zh'; Payment::whereId($payment->id)->update(['url' => $result['payment_url']]); - return Response::json(['status' => 'success', 'url' => $result['payment_url'] .= '&lang=zh', 'message' => '创建订单成功!']); + return Response::json([ + 'status' => 'success', + 'url' => $result['payment_url'] .= '&lang=zh', + 'message' => '创建订单成功!' + ]); } return Response::json(['status' => 'fail', 'data' => $result, 'message' => '创建订单失败!']); } - public function sign($data) - { + public function sign($data) { return strtolower(md5(md5($data).parent::$systemConfig['bitpay_secret'])); } - public function prepareSignId($tradeno) - { + public function prepareSignId($tradeno) { $data_sign = [ 'merchant_order_id' => $tradeno, 'secret' => parent::$systemConfig['bitpay_secret'], @@ -71,8 +71,7 @@ class BitpayX extends AbstractPayment return http_build_query($data_sign); } - public function mprequest($data, $type = 'pay') - { + public function mprequest($data, $type = 'pay') { $headers = ['content-type: application/json', 'token: '.parent::$systemConfig['bitpay_secret']]; $curl = curl_init(); if($type === 'pay'){ @@ -88,21 +87,20 @@ class BitpayX extends AbstractPayment } curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $data = curl_exec($curl); curl_close($curl); return $data; } - public function notify(Request $request) - { + public function notify(Request $request) { $inputString = file_get_contents('php://input', 'r'); $inputStripped = str_replace(["\r", "\n", "\t", "\v"], '', $inputString); - $inputJSON = json_decode($inputStripped, TRUE); //convert JSON into array + $inputJSON = json_decode($inputStripped, true); //convert JSON into array $data = []; - if($inputJSON !== NULL){ + if($inputJSON !== null){ $data = [ 'status' => $inputJSON['status'], 'order_id' => $inputJSON['order_id'], @@ -115,7 +113,7 @@ class BitpayX extends AbstractPayment // 准备待签名数据 $str_to_sign = $this->prepareSignId($inputJSON['merchant_order_id']); $resultVerify = $this->verify($str_to_sign, $inputJSON['token']); - $isPaid = $data !== NULL && $data['status'] !== NULL && $data['status'] === 'PAID'; + $isPaid = $data !== null && $data['status'] !== null && $data['status'] === 'PAID'; if($resultVerify && $isPaid){ $this->postPayment($inputJSON['merchant_order_id'], 'BitPayX'); @@ -130,20 +128,17 @@ class BitpayX extends AbstractPayment exit(); } - public function verify($data, $signature) - { + public function verify($data, $signature) { $mySign = $this->sign($data); return $mySign === $signature; } - public function getReturnHTML(Request $request) - { + public function getReturnHTML(Request $request) { // TODO: Implement getReturnHTML() method. } - public function getPurchaseHTML() - { + public function getPurchaseHTML() { // TODO: Implement getPurchaseHTML() method. } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Gateway/CodePay.php b/app/Http/Controllers/Gateway/CodePay.php index 90f04904..2fbf9b96 100644 --- a/app/Http/Controllers/Gateway/CodePay.php +++ b/app/Http/Controllers/Gateway/CodePay.php @@ -6,10 +6,8 @@ use App\Http\Models\Payment; use Auth; use Response; -class CodePay extends AbstractPayment -{ - public function purchase($request) - { +class CodePay extends AbstractPayment { + public function purchase($request) { $payment = new Payment(); $payment->sn = self::generateGuid(); $payment->user_id = Auth::user()->id; @@ -20,12 +18,12 @@ class CodePay extends AbstractPayment $data = [ 'id' => parent::$systemConfig['codepay_id'], 'pay_id' => $payment->sn, - 'type' => $request->input('type'),//1支付宝支付 2QQ钱包 3微信支付 + 'type' => $request->input('type'), //1支付宝支付 2QQ钱包 3微信支付 'price' => $payment->amount, 'page' => 1, 'outTime' => 900, 'param' => '', - 'notify_url' => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=codepay', + 'notify_url' => (parent::$systemConfig['website_callback_url']?: parent::$systemConfig['website_url']).'/callback/notify?method=codepay', 'return_url' => parent::$systemConfig['website_url'].'/invoices', ]; @@ -53,8 +51,7 @@ class CodePay extends AbstractPayment return Response::json(['status' => 'success', 'url' => $url, 'message' => '创建订单成功!']); } - public function notify($request) - { + public function notify($request) { ksort($_POST); reset($_POST); $sign = ''; @@ -81,13 +78,11 @@ class CodePay extends AbstractPayment exit('fail'); } - public function getReturnHTML($request) - { + public function getReturnHTML($request) { // TODO: Implement getReturnHTML() method. } - public function getPurchaseHTML() - { + public function getPurchaseHTML() { // TODO: Implement getReturnHTML() method. } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Gateway/F2Fpay.php b/app/Http/Controllers/Gateway/F2Fpay.php index 044d0372..164038c5 100644 --- a/app/Http/Controllers/Gateway/F2Fpay.php +++ b/app/Http/Controllers/Gateway/F2Fpay.php @@ -12,28 +12,25 @@ use Payment\Exceptions\ClassNotFoundException; use Payment\Exceptions\GatewayException; use Response; -class F2Fpay extends AbstractPayment -{ +class F2Fpay extends AbstractPayment { private static $aliConfig; - function __construct() - { + function __construct() { parent::__construct(); self::$aliConfig = [ - 'use_sandbox' => FALSE, + 'use_sandbox' => false, 'app_id' => self::$systemConfig['f2fpay_app_id'], 'sign_type' => 'RSA2', 'ali_public_key' => self::$systemConfig['f2fpay_public_key'], 'rsa_private_key' => self::$systemConfig['f2fpay_private_key'], 'limit_pay' => [], - 'notify_url' => (self::$systemConfig['website_callback_url']? : self::$systemConfig['website_url']).'/callback/notify?method=f2fpay', + 'notify_url' => (self::$systemConfig['website_callback_url']?: self::$systemConfig['website_url']).'/callback/notify?method=f2fpay', 'return_url' => self::$systemConfig['website_url'].'/invoices', 'fee_type' => 'CNY', ]; } - public function purchase($request) - { + public function purchase($request) { $payment = new Payment(); $payment->sn = self::generateGuid(); $payment->user_id = Auth::user()->id; @@ -43,9 +40,9 @@ class F2Fpay extends AbstractPayment $data = [ 'body' => '', - 'subject' => self::$systemConfig['subject_name']? : self::$systemConfig['website_name'], + 'subject' => self::$systemConfig['subject_name']?: self::$systemConfig['website_name'], 'trade_no' => $payment->sn, - 'time_expire' => time()+900, // 必须 15分钟 内付款 + 'time_expire' => time() + 900, // 必须 15分钟 内付款 'amount' => $payment->amount, ]; @@ -67,13 +64,14 @@ class F2Fpay extends AbstractPayment exit; } - Payment::whereId($payment->id)->update(['qr_code' => 'http://qr.topscan.com/api.php?text='.$result['qr_code'].'&bg=ffffff&fg=000000&pt=1c73bd&m=10&w=400&el=1&inpt=1eabfc&logo=https://t.alipayobjects.com/tfscom/T1Z5XfXdxmXXXXXXXX.png']);//后备:https://cli.im/api/qrcode/code?text=".$result['qr_code']."&mhid=5EfGCwztyckhMHcmI9ZcOKs + Payment::whereId($payment->id)->update([ + 'qr_code' => 'http://qr.topscan.com/api.php?text='.$result['qr_code'].'&bg=ffffff&fg=000000&pt=1c73bd&m=10&w=400&el=1&inpt=1eabfc&logo=https://t.alipayobjects.com/tfscom/T1Z5XfXdxmXXXXXXXX.png' + ]);//后备:https://cli.im/api/qrcode/code?text=".$result['qr_code']."&mhid=5EfGCwztyckhMHcmI9ZcOKs return Response::json(['status' => 'success', 'data' => $payment->sn, 'message' => '创建订单成功!']); } - public function notify($request) - { + public function notify($request) { $data = [ 'trade_no' => $request->input('out_trade_no'), 'transaction_id' => $request->input('trade_no'), @@ -82,7 +80,7 @@ class F2Fpay extends AbstractPayment try{ $client = new Client(Client::ALIPAY, self::$aliConfig); $result = $client->tradeQuery($data); - Log::info("【支付宝当面付】回调验证查询:".var_export($result, TRUE)); + Log::info("【支付宝当面付】回调验证查询:".var_export($result, true)); }catch(InvalidArgumentException $e){ Log::error("【支付宝当面付】回调信息错误: ".$e->getMessage()); exit; @@ -113,13 +111,11 @@ class F2Fpay extends AbstractPayment exit($ret); } - public function getReturnHTML($request) - { + public function getReturnHTML($request) { // TODO: Implement getReturnHTML() method. } - public function getPurchaseHTML() - { + public function getPurchaseHTML() { // TODO: Implement getReturnHTML() method. } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Gateway/Local.php b/app/Http/Controllers/Gateway/Local.php index 8bae6922..7dd44ba6 100644 --- a/app/Http/Controllers/Gateway/Local.php +++ b/app/Http/Controllers/Gateway/Local.php @@ -11,18 +11,17 @@ use Auth; use Illuminate\Http\Request; use Response; -class Local extends AbstractPayment -{ - public function purchase(Request $request) - { +class Local extends AbstractPayment { + public function purchase(Request $request) { $amount = $request->input('amount'); $order = Order::whereOid($request->input('oid'))->first(); $goods = Goods::query()->whereStatus(1)->whereId($request->input('goods_id'))->first(); if($goods){ - User::query()->whereId(Auth::user()->id)->decrement('balance', $amount*100); + User::query()->whereId(Auth::user()->id)->decrement('balance', $amount * 100); // 记录余额操作日志 - Helpers::addUserBalanceLog(Auth::user()->id, $order->oid, Auth::user()->balance, Auth::user()->balance-$amount, -1*$amount, '购买商品:'.$goods->name); + Helpers::addUserBalanceLog(Auth::user()->id, $order->oid, Auth::user()->balance, + Auth::user()->balance - $amount, -1 * $amount, '购买商品:'.$goods->name); } self::postPayment($order->oid, '余额'); @@ -30,18 +29,15 @@ class Local extends AbstractPayment return Response::json(['status' => 'success', 'message' => '购买完成!']); } - public function notify(Request $request) - { + public function notify(Request $request) { // TODO: Implement notify() method. } - public function getReturnHTML(Request $request) - { + public function getReturnHTML(Request $request) { // TODO: Implement getReturnHTML() method. } - public function getPurchaseHTML() - { + public function getPurchaseHTML() { // TODO: Implement getPurchaseHTML() method. } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Gateway/PayJs.php b/app/Http/Controllers/Gateway/PayJs.php index 2b371b44..24727deb 100644 --- a/app/Http/Controllers/Gateway/PayJs.php +++ b/app/Http/Controllers/Gateway/PayJs.php @@ -8,12 +8,10 @@ use Log; use Response; use Xhat\Payjs\Payjs as Pay; -class PayJs extends AbstractPayment -{ +class PayJs extends AbstractPayment { private static $config; - function __construct() - { + function __construct() { parent::__construct(); self::$config = [ 'mchid' => self::$systemConfig['payjs_mch_id'], // 配置商户号 @@ -21,8 +19,7 @@ class PayJs extends AbstractPayment ]; } - public function purchase($request) - { + public function purchase($request) { $payment = new Payment(); $payment->sn = self::generateGuid(); $payment->user_id = Auth::user()->id; @@ -31,12 +28,12 @@ class PayJs extends AbstractPayment $payment->save(); $result = (new Pay($this::$config))->native([ - 'body' => parent::$systemConfig['subject_name']? : parent::$systemConfig['website_name'], - 'total_fee' => $payment->amount*100, - 'out_trade_no' => $payment->sn, - 'attach' => '', - 'notify_url' => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=payjs', - ]); + 'body' => parent::$systemConfig['subject_name']?: parent::$systemConfig['website_name'], + 'total_fee' => $payment->amount * 100, + 'out_trade_no' => $payment->sn, + 'attach' => '', + 'notify_url' => (parent::$systemConfig['website_callback_url']?: parent::$systemConfig['website_url']).'/callback/notify?method=payjs', + ]); if(!$result->return_code){ Log::error('PayJs '.$result->return_msg); @@ -47,8 +44,7 @@ class PayJs extends AbstractPayment return Response::json(['status' => 'success', 'data' => $payment->sn, 'message' => '创建订单成功!']); } - public function notify($request) - { + public function notify($request) { $data = (new Pay($this::$config))->notify(); if($data['return_code'] == 1){ @@ -58,13 +54,11 @@ class PayJs extends AbstractPayment exit("fail"); } - public function getReturnHTML($request) - { + public function getReturnHTML($request) { // TODO: Implement getReturnHTML() method. } - public function getPurchaseHTML() - { + public function getPurchaseHTML() { // TODO: Implement getReturnHTML() method. } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Gateway/PayPal.php b/app/Http/Controllers/Gateway/PayPal.php index 21bd2c82..9dcc35fa 100644 --- a/app/Http/Controllers/Gateway/PayPal.php +++ b/app/Http/Controllers/Gateway/PayPal.php @@ -13,13 +13,11 @@ use Log; use Response; use Srmklive\PayPal\Services\ExpressCheckout; -class PayPal extends AbstractPayment -{ +class PayPal extends AbstractPayment { protected $provider; protected $exChange; - public function __construct() - { + public function __construct() { parent::__construct(); $this->provider = new ExpressCheckout(); $config = [ @@ -35,13 +33,14 @@ class PayPal extends AbstractPayment 'payment_action' => 'Sale', 'currency' => 'USD', 'billing_type' => 'MerchantInitiatedBilling', - 'notify_url' => (self::$systemConfig['website_callback_url']? : self::$systemConfig['website_url']).'/callback/notify?method=paypal', + 'notify_url' => (self::$systemConfig['website_callback_url']?: self::$systemConfig['website_url']).'/callback/notify?method=paypal', 'locale' => 'zh_CN', - 'validate_ssl' => TRUE, + 'validate_ssl' => true, ]; $this->provider->setApiCredentials($config); $this->exChange = 7; - $exChangeRate = json_decode(Curl::send('http://api.k780.com/?app=finance.rate&scur=USD&tcur=CNY&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4'), TRUE); + $exChangeRate = json_decode(Curl::send('http://api.k780.com/?app=finance.rate&scur=USD&tcur=CNY&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4'), + true); if($exChangeRate){ if($exChangeRate['success']){ $this->exChange = $exChangeRate['result']['rate']; @@ -49,8 +48,7 @@ class PayPal extends AbstractPayment } } - public function purchase(Request $request) - { + public function purchase(Request $request) { $payment = new Payment(); $payment->sn = self::generateGuid(); $payment->user_id = Auth::user()->id; @@ -63,7 +61,7 @@ class PayPal extends AbstractPayment try{ $response = $this->provider->setExpressCheckout($data); if(!$response['paypal_link']){ - Log::error(var_export($response, TRUE)); + Log::error(var_export($response, true)); return Response::json(['status' => 'fail', 'message' => '创建订单失败,请使用其他方式或通知管理员!']); } @@ -76,17 +74,16 @@ class PayPal extends AbstractPayment } } - protected function getCheckoutData($sn, $amount) - { - $amount = 0.3+ceil($amount/$this->exChange*100)/100; + protected function getCheckoutData($sn, $amount) { + $amount = 0.3 + ceil($amount / $this->exChange * 100) / 100; return [ 'invoice_id' => $sn, 'items' => [ [ - 'name' => self::$systemConfig['subject_name']? : self::$systemConfig['website_name'], + 'name' => self::$systemConfig['subject_name']?: self::$systemConfig['website_name'], 'price' => $amount, - 'desc' => 'Description for'.(self::$systemConfig['subject_name']? : self::$systemConfig['website_name']), + 'desc' => 'Description for'.(self::$systemConfig['subject_name']?: self::$systemConfig['website_name']), 'qty' => 1 ] ], @@ -97,8 +94,7 @@ class PayPal extends AbstractPayment ]; } - public function getCheckout(Request $request) - { + public function getCheckout(Request $request) { $token = $request->get('token'); $PayerID = $request->get('PayerID'); @@ -123,12 +119,11 @@ class PayPal extends AbstractPayment return redirect('/invoices'); } - public function notify(Request $request) - { + public function notify(Request $request) { $request->merge(['cmd' => '_notify-validate']); $post = $request->all(); - $response = (string)$this->provider->verifyIPN($post); + $response = (string) $this->provider->verifyIPN($post); if($response === 'VERIFIED' && $request['mp_desc']){ if(Payment::whereSn($request['mp_desc'])->first()->status == 0){ @@ -139,13 +134,11 @@ class PayPal extends AbstractPayment exit("fail"); } - public function getReturnHTML(Request $request) - { + public function getReturnHTML(Request $request) { // TODO: Implement getReturnHTML() method. } - public function getPurchaseHTML() - { + public function getPurchaseHTML() { // TODO: Implement getPurchaseHTML() method. } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index ebb368fc..87d2fc56 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -26,22 +26,19 @@ use Response; * * @package App\Http\Controllers */ -class PaymentController extends Controller -{ +class PaymentController extends Controller { private static $method; - public static function notify(Request $request) - { + public static function notify(Request $request) { self::$method = $request->input('method'); - Log::info(self::$method."回调接口[POST]:".self::$method.var_export($request->all(), TRUE)); + Log::info(self::$method."回调接口[POST]:".self::$method.var_export($request->all(), true)); self::getClient()->notify($request); return 0; } - public static function getClient() - { + public static function getClient() { switch(self::$method){ case 'balance': return new Local(); @@ -58,22 +55,19 @@ class PaymentController extends Controller default: Log::error("未知支付:".self::$method); - return NULL; + return null; } } - public static function returnHTML(Request $request) - { + public static function returnHTML(Request $request) { return self::getClient()->getReturnHTML($request); } - public static function purchaseHTML() - { + public static function purchaseHTML() { return Response::view('user.components.purchase'); } - public static function getStatus(Request $request) - { + public static function getStatus(Request $request) { $payment = Payment::whereSn($request->input('sn'))->first(); if($payment){ if($payment->status == 1){ @@ -89,8 +83,7 @@ class PaymentController extends Controller } // 创建支付订单 - public function purchase(Request $request) - { + public function purchase(Request $request) { $goods_id = $request->input('goods_id'); $coupon_sn = $request->input('coupon_sn'); self::$method = $request->input('method'); @@ -110,7 +103,9 @@ class PaymentController extends Controller } // 是否有生效的套餐 - $activePlan = Order::uid()->with(['goods'])->whereHas('goods', function($q){ $q->whereType(2); })->whereStatus(2)->whereIsExpire(0)->doesntExist(); + $activePlan = Order::uid()->with(['goods'])->whereHas('goods', function($q) { + $q->whereType(2); + })->whereStatus(2)->whereIsExpire(0)->doesntExist(); //无生效套餐,禁止购买加油包 if($goods->type == 1 && $activePlan){ @@ -135,7 +130,11 @@ class PaymentController extends Controller if($goods->limit_num){ $count = Order::uid()->where('status', '>=', 0)->whereGoodsId($goods_id)->count(); if($count >= $goods->limit_num){ - return Response::json(['status' => 'fail', 'data' => '', 'message' => '此商品/服务限购'.$goods->limit_num.'次,您已购买'.$count.'次']); + return Response::json([ + 'status' => 'fail', + 'data' => '', + 'message' => '此商品/服务限购'.$goods->limit_num.'次,您已购买'.$count.'次' + ]); } } @@ -147,7 +146,7 @@ class PaymentController extends Controller } // 计算实际应支付总价 - $amount = $coupon->type == 2? $goods->price*$coupon->discount/10 : $goods->price-$coupon->amount; + $amount = $coupon->type == 2? $goods->price * $coupon->discount / 10 : $goods->price - $coupon->amount; $amount = $amount > 0? round($amount, 2) : 0; // 四舍五入保留2位小数,避免无法正常创建订单 }else{ $amount = $goods->price; @@ -174,9 +173,9 @@ class PaymentController extends Controller $order->user_id = Auth::user()->id; $order->goods_id = $balance? -1 : $goods_id; $order->coupon_id = !empty($coupon)? $coupon->id : 0; - $order->origin_amount = $balance? : $goods->price; + $order->origin_amount = $balance?: $goods->price; $order->amount = $amount; - $order->expire_at = $balance? NULL : date("Y-m-d H:i:s", strtotime("+".$goods->days." days")); + $order->expire_at = $balance? null : date("Y-m-d H:i:s", strtotime("+".$goods->days." days")); $order->is_expire = 0; $order->pay_way = self::$method; $order->status = 0; @@ -199,8 +198,7 @@ class PaymentController extends Controller } // 支付单详情 - public function detail($sn) - { + public function detail($sn) { $payment = Payment::uid()->with(['order', 'order.goods'])->whereSn($sn)->first(); $view['payment'] = $payment; $view['name'] = $payment->order->goods? $payment->order->goods->name : '余额充值'; @@ -210,8 +208,7 @@ class PaymentController extends Controller } // 回调日志 - public function callbackList(Request $request) - { + public function callbackList(Request $request) { $status = $request->input('status', 0); $query = PaymentCallback::query(); @@ -224,4 +221,4 @@ class PaymentController extends Controller return Response::view('admin.logs.callbackList', $view); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index 118b2520..c9bf4a8e 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -10,22 +10,27 @@ use App\Http\Models\Order; use App\Http\Models\User; use App\Http\Models\UserLabel; -class ServiceController extends Controller -{ - public function activePrepaidOrder($oid) - { +class ServiceController extends Controller { + public function activePrepaidOrder($oid) { // 取出预支付订单 $prepaidOrder = Order::find($oid); //去除使用中的套餐和 流量包 - Order::query()->whereUserId($prepaidOrder->user_id)->whereStatus(2)->whereIsExpire(0)->update(['expire_at' => date('Y-m-d H:i:s'), 'is_expire' => 1]); + Order::query()->whereUserId($prepaidOrder->user_id)->whereStatus(2)->whereIsExpire(0)->update([ + 'expire_at' => date('Y-m-d H:i:s'), + 'is_expire' => 1 + ]); //取出对应套餐信息 $prepaidGood = Goods::query()->whereId($prepaidOrder->goods_id)->first(); //激活预支付套餐 - Order::query()->whereOid($prepaidOrder->oid)->update(['expire_at' => date("Y-m-d H:i:s", strtotime("+".$prepaidGood->days." days")), 'status' => 2]); + Order::query()->whereOid($prepaidOrder->oid)->update([ + 'expire_at' => date("Y-m-d H:i:s", + strtotime("+".$prepaidGood->days." days")), + 'status' => 2 + ]); //取出用户信息 $user = User::query()->whereId($prepaidOrder->user_id)->first(); - $userTraffic = $prepaidGood->traffic*1048576; + $userTraffic = $prepaidGood->traffic * 1048576; //拿出可能存在的其余套餐, 推算 最新的到期时间 $expire_time = date('Y-m-d', strtotime("+".$prepaidGood->days." days")); $prepaidOrders = Order::query()->whereUserId($prepaidOrder->user_id)->whereStatus(3)->get(); @@ -37,13 +42,17 @@ class ServiceController extends Controller //计算账号下一个重置时间 $nextResetTime = date('Y-m-d', strtotime("+".$prepaidGood->period." days")); if($nextResetTime >= $expire_time){ - $nextResetTime = NULL; + $nextResetTime = null; } // 用户默认标签 - $defaultLabels = Helpers::systemConfig()['initial_labels_for_user']? explode(',', Helpers::systemConfig()['initial_labels_for_user']) : []; + $defaultLabels = Helpers::systemConfig()['initial_labels_for_user']? explode(',', + Helpers::systemConfig()['initial_labels_for_user']) : []; //取出 商品默认标签 & 系统默认标签 去重 - $newUserLabels = array_values(array_unique(array_merge(GoodsLabel::query()->whereGoodsId($prepaidOrder->goods_id)->pluck('label_id')->toArray(), $defaultLabels))); + $newUserLabels = array_values(array_unique(array_merge(GoodsLabel::query() + ->whereGoodsId($prepaidOrder->goods_id) + ->pluck('label_id') + ->toArray(), $defaultLabels))); // 生成标签 foreach($newUserLabels as $vo){ @@ -52,8 +61,15 @@ class ServiceController extends Controller $obj->label_id = $vo; $obj->save(); } - Helpers::addUserTrafficModifyLog($prepaidOrder->user_id, $prepaidOrder->oid, $user->transfer_enable, $userTraffic, '[预支付订单激活]加上用户购买的套餐流量'); - User::query()->whereId($prepaidOrder->user_id)->increment('invite_num', $prepaidOrder->invite_num? : 0, ['u' => 0, 'd' => 0, 'transfer_enable' => $userTraffic, 'expire_time' => $expire_time, 'reset_time' => $nextResetTime]); + Helpers::addUserTrafficModifyLog($prepaidOrder->user_id, $prepaidOrder->oid, $user->transfer_enable, + $userTraffic, '[预支付订单激活]加上用户购买的套餐流量'); + User::query()->whereId($prepaidOrder->user_id)->increment('invite_num', $prepaidOrder->invite_num?: 0, [ + 'u' => 0, + 'd' => 0, + 'transfer_enable' => $userTraffic, + 'expire_time' => $expire_time, + 'reset_time' => $nextResetTime + ]); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/User/AffiliateController.php b/app/Http/Controllers/User/AffiliateController.php index d2d304a8..90c074c5 100644 --- a/app/Http/Controllers/User/AffiliateController.php +++ b/app/Http/Controllers/User/AffiliateController.php @@ -11,37 +11,44 @@ use App\Http\Models\User; use Auth; use Response; -class AffiliateController extends Controller -{ +class AffiliateController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 推广返利 - public function referral() - { + public function referral() { if(Order::uid()->whereStatus(2)->doesntExist() && ReferralLog::uid()->doesntExist()){ - return Response::view('auth.error', ['message' => '本功能对非付费用户禁用!请 返 回']); + return Response::view('auth.error', + ['message' => '本功能对非付费用户禁用!请 返 回']); } - $view['referral_traffic'] = flowAutoShow(self::$systemConfig['referral_traffic']*1048576); + $view['referral_traffic'] = flowAutoShow(self::$systemConfig['referral_traffic'] * 1048576); $view['referral_percent'] = self::$systemConfig['referral_percent']; $view['referral_money'] = self::$systemConfig['referral_money']; - $view['totalAmount'] = ReferralLog::uid()->sum('ref_amount')/100; - $view['canAmount'] = ReferralLog::uid()->whereStatus(0)->sum('ref_amount')/100; + $view['totalAmount'] = ReferralLog::uid()->sum('ref_amount') / 100; + $view['canAmount'] = ReferralLog::uid()->whereStatus(0)->sum('ref_amount') / 100; $view['link'] = self::$systemConfig['website_url'].'/register?aff='.Auth::user()->id; - $view['referralLogList'] = ReferralLog::uid()->with('user')->orderBy('id', 'desc')->paginate(10, ['*'], 'log_page'); - $view['referralApplyList'] = ReferralApply::uid()->with('user')->orderBy('id', 'desc')->paginate(10, ['*'], 'apply_page'); - $view['referralUserList'] = User::query()->select(['email', 'created_at'])->whereReferralUid(Auth::user()->id)->orderBy('id', 'desc')->paginate(10, ['*'], 'user_page'); + $view['referralLogList'] = ReferralLog::uid() + ->with('user') + ->orderBy('id', 'desc') + ->paginate(10, ['*'], 'log_page'); + $view['referralApplyList'] = ReferralApply::uid() + ->with('user') + ->orderBy('id', 'desc') + ->paginate(10, ['*'], 'apply_page'); + $view['referralUserList'] = User::query() + ->select(['email', 'created_at']) + ->whereReferralUid(Auth::user()->id) + ->orderBy('id', 'desc') + ->paginate(10, ['*'], 'user_page'); return Response::view('user.referral', $view); } // 申请提现 - public function extractMoney() - { + public function extractMoney() { // 判断账户是否过期 if(Auth::user()->expire_time < date('Y-m-d')){ return Response::json(['status' => 'fail', 'message' => '申请失败:账号已过期,请先购买服务吧']); @@ -57,7 +64,10 @@ class AffiliateController extends Controller $ref_amount = ReferralLog::uid()->whereStatus(0)->sum('ref_amount'); $ref_amount /= 100; if($ref_amount < self::$systemConfig['referral_money']){ - return Response::json(['status' => 'fail', 'message' => '申请失败:满'.self::$systemConfig['referral_money'].'元才可以提现,继续努力吧']); + return Response::json([ + 'status' => 'fail', + 'message' => '申请失败:满'.self::$systemConfig['referral_money'].'元才可以提现,继续努力吧' + ]); } // 取出本次申请关联返利日志ID diff --git a/app/Http/Controllers/User/SubscribeController.php b/app/Http/Controllers/User/SubscribeController.php index 8c997396..3d4764ca 100644 --- a/app/Http/Controllers/User/SubscribeController.php +++ b/app/Http/Controllers/User/SubscribeController.php @@ -12,18 +12,15 @@ use Illuminate\Http\Request; use Redirect; use Response; -class SubscribeController extends Controller -{ +class SubscribeController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } // 通过订阅码获取订阅信息 - public function getSubscribeByCode(Request $request, $code) - { + public function getSubscribeByCode(Request $request, $code) { if(empty($code)){ return Redirect::to('login'); } @@ -51,14 +48,23 @@ class SubscribeController extends Controller exit($this->noneNode()); } - $query = SsNode::query()->selectRaw('ss_node.*')->leftjoin("ss_node_label", "ss_node.id", "=", "ss_node_label.node_id"); + $query = SsNode::query() + ->selectRaw('ss_node.*') + ->leftjoin("ss_node_label", "ss_node.id", "=", "ss_node_label.node_id"); // 启用混合订阅时,加入V2Ray节点,未启用时仅下发SSR节点信息 if(!self::$systemConfig['mix_subscribe']){ $query->where('ss_node.type', 1); } - $nodeList = $query->where('ss_node.status', 1)->where('ss_node.is_subscribe', 1)->whereIn('ss_node_label.label_id', $userLabelIds)->groupBy('ss_node.id')->orderBy('ss_node.sort', 'desc')->orderBy('ss_node.id', 'asc')->get()->toArray(); + $nodeList = $query->where('ss_node.status', 1) + ->where('ss_node.is_subscribe', 1) + ->whereIn('ss_node_label.label_id', $userLabelIds) + ->groupBy('ss_node.id') + ->orderBy('ss_node.sort', 'desc') + ->orderBy('ss_node.id', 'asc') + ->get() + ->toArray(); if(empty($nodeList)){ exit($this->noneNode()); } @@ -68,7 +74,7 @@ class SubscribeController extends Controller shuffle($nodeList); } - $scheme = NULL; + $scheme = null; // 展示到期时间和剩余流量 if(self::$systemConfig['is_custom_subscribe']){ @@ -99,20 +105,18 @@ class SubscribeController extends Controller } // 抛出无可用的节点信息,用于兼容防止客户端订阅失败 - private function noneNode() - { + private function noneNode() { return base64url_encode('ssr://'.base64url_encode('0.0.0.0:1:origin:none:plain:'.base64url_encode('0000').'/?obfsparam=&protoparam=&remarks='.base64url_encode('无可用节点或账号被封禁或订阅被封禁').'&group='.base64url_encode('错误').'&udpport=0&uot=0')."\n"); } /** * 过期时间 * - * @param object $user + * @param object $user * * @return string */ - private function expireDate($user) - { + private function expireDate($user) { $text = '到期时间: '.$user->expire_time; return 'ssr://'.base64url_encode('0.0.0.1:1:origin:none:plain:'.base64url_encode('0000').'/?obfsparam=&protoparam=&remarks='.base64url_encode($text).'&group='.base64url_encode(self::$systemConfig['website_name']).'&udpport=0&uot=0')."\n"; @@ -121,13 +125,12 @@ class SubscribeController extends Controller /** * 剩余流量 * - * @param object $user + * @param object $user * * @return string */ - private function lastTraffic($user) - { - $text = '剩余流量: '.flowAutoShow($user->transfer_enable-$user->u-$user->d); + private function lastTraffic($user) { + $text = '剩余流量: '.flowAutoShow($user->transfer_enable - $user->u - $user->d); return 'ssr://'.base64url_encode('0.0.0.2:1:origin:none:plain:'.base64url_encode('0000').'/?obfsparam=&protoparam=&remarks='.base64url_encode($text).'&group='.base64url_encode(self::$systemConfig['website_name']).'&udpport=0&uot=0')."\n"; } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 41bdf147..c82d1cf3 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -44,60 +44,80 @@ use Validator; * * @package App\Http\Controllers */ -class UserController extends Controller -{ +class UserController extends Controller { protected static $systemConfig; - function __construct() - { + function __construct() { self::$systemConfig = Helpers::systemConfig(); } - public function index() - { + public function index() { $totalTransfer = Auth::user()->transfer_enable; - $usedTransfer = Auth::user()->u+Auth::user()->d; - $unusedTransfer = $totalTransfer-$usedTransfer > 0? $totalTransfer-$usedTransfer : 0; + $usedTransfer = Auth::user()->u + Auth::user()->d; + $unusedTransfer = $totalTransfer - $usedTransfer > 0? $totalTransfer - $usedTransfer : 0; $expireTime = Auth::user()->expire_time; - $view['remainDays'] = $expireTime < date('Y-m-d')? -1 : (strtotime($expireTime)-strtotime(date('Y-m-d')))/86400; - $view['resetDays'] = Auth::user()->reset_time? round((strtotime(Auth::user()->reset_time)-strtotime(date('Y-m-d')))/86400) : 0; + $view['remainDays'] = $expireTime < date('Y-m-d')? -1 : (strtotime($expireTime) - strtotime(date('Y-m-d'))) / 86400; + $view['resetDays'] = Auth::user()->reset_time? round((strtotime(Auth::user()->reset_time) - strtotime(date('Y-m-d'))) / 86400) : 0; $view['unusedTransfer'] = $unusedTransfer; $view['expireTime'] = $expireTime; $view['banedTime'] = Auth::user()->ban_time? date('Y-m-d H:i:s', Auth::user()->ban_time) : 0; - $view['unusedPercent'] = $totalTransfer > 0? round($unusedTransfer/$totalTransfer, 2) : 0; + $view['unusedPercent'] = $totalTransfer > 0? round($unusedTransfer / $totalTransfer, 2) : 0; $view['noticeList'] = Article::type(2)->orderBy('id', 'desc')->Paginate(1); // 公告 //流量异常判断 - $hourlyTraffic = UserTrafficHourly::query()->whereUserId(Auth::user()->id)->whereNodeId(0)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->sum('total'); - $view['isTrafficWarning'] = $hourlyTraffic >= (self::$systemConfig['traffic_ban_value']*1073741824)? : 0; + $hourlyTraffic = UserTrafficHourly::query() + ->whereUserId(Auth::user()->id) + ->whereNodeId(0) + ->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900)) + ->sum('total'); + $view['isTrafficWarning'] = $hourlyTraffic >= (self::$systemConfig['traffic_ban_value'] * 1073741824)?: 0; //付费用户判断 - $view['not_paying_user'] = Order::uid()->whereStatus(2)->whereIsExpire(0)->where('origin_amount', '>', 0)->doesntExist(); - $view['userLoginLog'] = UserLoginLog::query()->whereUserId(Auth::user()->id)->orderBy('id', 'desc')->first(); // 近期登录日志 + $view['not_paying_user'] = Order::uid() + ->whereStatus(2) + ->whereIsExpire(0) + ->where('origin_amount', '>', 0) + ->doesntExist(); + $view['userLoginLog'] = UserLoginLog::query() + ->whereUserId(Auth::user()->id) + ->orderBy('id', 'desc') + ->first(); // 近期登录日志 $dailyData = []; $hourlyData = []; // 节点一个月内的流量 // TODO:有bug - $userTrafficDaily = UserTrafficDaily::query()->whereUserId(Auth::user()->id)->whereNodeId(0)->where('created_at', '<=', date('Y-m-d', time()))->orderBy('created_at', 'asc')->pluck('total')->toArray(); + $userTrafficDaily = UserTrafficDaily::query() + ->whereUserId(Auth::user()->id) + ->whereNodeId(0) + ->where('created_at', '<=', date('Y-m-d', time())) + ->orderBy('created_at', 'asc') + ->pluck('total') + ->toArray(); - $dailyTotal = date('d', time())-1; // 今天不算,减一 + $dailyTotal = date('d', time()) - 1; // 今天不算,减一 $dailyCount = count($userTrafficDaily); - for($x = 0; $x < $dailyTotal-$dailyCount; $x++){ + for($x = 0; $x < $dailyTotal - $dailyCount; $x++){ $dailyData[$x] = 0; } - for($x = $dailyTotal-$dailyCount; $x < $dailyTotal; $x++){ - $dailyData[$x] = round($userTrafficDaily[$x-($dailyTotal-$dailyCount)]/(1024*1024*1024), 3); + for($x = $dailyTotal - $dailyCount; $x < $dailyTotal; $x++){ + $dailyData[$x] = round($userTrafficDaily[$x - ($dailyTotal - $dailyCount)] / (1024 * 1024 * 1024), 3); } // 节点一天内的流量 - $userTrafficHourly = UserTrafficHourly::query()->whereUserId(Auth::user()->id)->whereNodeId(0)->where('created_at', '>=', date('Y-m-d', time()))->orderBy('created_at', 'asc')->pluck('total')->toArray(); + $userTrafficHourly = UserTrafficHourly::query() + ->whereUserId(Auth::user()->id) + ->whereNodeId(0) + ->where('created_at', '>=', date('Y-m-d', time())) + ->orderBy('created_at', 'asc') + ->pluck('total') + ->toArray(); $hourlyTotal = date('H'); $hourlyCount = count($userTrafficHourly); - for($x = 0; $x < $hourlyTotal-$hourlyCount; $x++){ + for($x = 0; $x < $hourlyTotal - $hourlyCount; $x++){ $hourlyData[$x] = 0; } - for($x = ($hourlyTotal-$hourlyCount); $x < $hourlyTotal; $x++){ - $hourlyData[$x] = round($userTrafficHourly[$x-($hourlyTotal-$hourlyCount)]/(1024*1024*1024), 3); + for($x = ($hourlyTotal - $hourlyCount); $x < $hourlyTotal; $x++){ + $hourlyData[$x] = round($userTrafficHourly[$x - ($hourlyTotal - $hourlyCount)] / (1024 * 1024 * 1024), 3); } // 本月天数数据 @@ -120,8 +140,7 @@ class UserController extends Controller } // 签到 - public function checkIn() - { + public function checkIn() { // 系统开启登录加积分功能才可以签到 if(!self::$systemConfig['is_checkin']){ return Response::json(['status' => 'fail', 'message' => '系统未开启签到功能']); @@ -132,25 +151,26 @@ class UserController extends Controller return Response::json(['status' => 'fail', 'message' => '已经签到过了,明天再来吧']); } - $traffic = mt_rand((int)self::$systemConfig['min_rand_traffic'], (int)self::$systemConfig['max_rand_traffic'])*1048576; + $traffic = mt_rand((int) self::$systemConfig['min_rand_traffic'], + (int) self::$systemConfig['max_rand_traffic']) * 1048576; $ret = User::uid()->increment('transfer_enable', $traffic); if(!$ret){ return Response::json(['status' => 'fail', 'message' => '签到失败,系统异常']); } // 写入用户流量变动记录 - Helpers::addUserTrafficModifyLog(Auth::user()->id, 0, Auth::user()->transfer_enable, Auth::user()->transfer_enable+$traffic, '[签到]'); + Helpers::addUserTrafficModifyLog(Auth::user()->id, 0, Auth::user()->transfer_enable, + Auth::user()->transfer_enable + $traffic, '[签到]'); // 多久后可以再签到 - $ttl = self::$systemConfig['traffic_limit_time']? self::$systemConfig['traffic_limit_time']*60 : 86400; + $ttl = self::$systemConfig['traffic_limit_time']? self::$systemConfig['traffic_limit_time'] * 60 : 86400; Cache::put('userCheckIn_'.Auth::user()->id, '1', $ttl); return Response::json(['status' => 'success', 'message' => '签到成功,系统送您 '.flowAutoShow($traffic).'流量']); } // 节点列表 - public function nodeList(Request $request) - { + public function nodeList(Request $request) { if($request->isMethod('POST')){ $node_id = $request->input('id'); $infoType = $request->input('type'); @@ -165,20 +185,36 @@ class UserController extends Controller // 获取当前用户标签 $userLabelIds = UserLabel::uid()->pluck('label_id'); // 获取当前用户可用节点 - $nodeList = SsNode::query()->selectRaw('ss_node.*')->leftJoin('ss_node_label', 'ss_node.id', '=', 'ss_node_label.node_id')->whereIn('ss_node_label.label_id', $userLabelIds)->where('ss_node.status', 1)->groupBy('ss_node.id')->orderBy('ss_node.sort', 'desc')->orderBy('ss_node.id', 'asc')->get(); + $nodeList = SsNode::query() + ->selectRaw('ss_node.*') + ->leftJoin('ss_node_label', 'ss_node.id', '=', 'ss_node_label.node_id') + ->whereIn('ss_node_label.label_id', $userLabelIds) + ->where('ss_node.status', 1) + ->groupBy('ss_node.id') + ->orderBy('ss_node.sort', 'desc') + ->orderBy('ss_node.id', 'asc') + ->get(); foreach($nodeList as $node){ - $node->ct = number_format(SsNodePing::query()->whereNodeId($node->id)->where('ct', '>', '0')->avg('ct'), 1, '.', ''); - $node->cu = number_format(SsNodePing::query()->whereNodeId($node->id)->where('cu', '>', '0')->avg('cu'), 1, '.', ''); - $node->cm = number_format(SsNodePing::query()->whereNodeId($node->id)->where('cm', '>', '0')->avg('cm'), 1, '.', ''); - $node->hk = number_format(SsNodePing::query()->whereNodeId($node->id)->where('hk', '>', '0')->avg('hk'), 1, '.', ''); + $node->ct = number_format(SsNodePing::query()->whereNodeId($node->id)->where('ct', '>', '0')->avg('ct'), + 1, '.', ''); + $node->cu = number_format(SsNodePing::query()->whereNodeId($node->id)->where('cu', '>', '0')->avg('cu'), + 1, '.', ''); + $node->cm = number_format(SsNodePing::query()->whereNodeId($node->id)->where('cm', '>', '0')->avg('cm'), + 1, '.', ''); + $node->hk = number_format(SsNodePing::query()->whereNodeId($node->id)->where('hk', '>', '0')->avg('hk'), + 1, '.', ''); // 节点在线状态 - $node->offline = SsNodeInfo::query()->whereNodeId($node->id)->where('log_time', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->doesntExist(); + $node->offline = SsNodeInfo::query() + ->whereNodeId($node->id) + ->where('log_time', '>=', strtotime("-10 minutes")) + ->orderBy('id', 'desc') + ->doesntExist(); // 节点标签 $node->labels = SsNodeLabel::query()->whereNodeId($node->id)->first(); } - $view['nodeList'] = $nodeList? : []; + $view['nodeList'] = $nodeList?: []; } @@ -186,16 +222,14 @@ class UserController extends Controller } // 公告详情 - public function article(Request $request) - { + public function article(Request $request) { $view['info'] = Article::query()->findOrFail($request->input('id')); return Response::view('user.article', $view); } // 修改个人资料 - public function profile(Request $request) - { + public function profile(Request $request) { if($request->isMethod('POST')){ $old_password = trim($request->input('old_password')); $new_password = trim($request->input('new_password')); @@ -250,26 +284,45 @@ class UserController extends Controller } // 商品列表 - public function services(Request $request) - { + public function services(Request $request) { // 余额充值商品,只取10个 - $view['chargeGoodsList'] = Goods::type(3)->whereStatus(1)->orderBy('price', 'asc')->orderBy('price', 'asc')->limit(10)->get(); - $view['goodsList'] = Goods::query()->whereStatus(1)->where('type', '<=', '2')->orderBy('type', 'desc')->orderBy('sort', 'desc')->paginate(10)->appends($request->except('page')); - $renewOrder = Order::query()->with(['goods'])->whereUserId(Auth::user()->id)->whereStatus(2)->whereIsExpire(0)->whereHas('goods', function($q){ $q->whereType(2); })->first(); + $view['chargeGoodsList'] = Goods::type(3) + ->whereStatus(1) + ->orderBy('price', 'asc') + ->orderBy('price', 'asc') + ->limit(10) + ->get(); + $view['goodsList'] = Goods::query() + ->whereStatus(1) + ->where('type', '<=', '2') + ->orderBy('type', 'desc') + ->orderBy('sort', 'desc') + ->paginate(10) + ->appends($request->except('page')); + $renewOrder = Order::query() + ->with(['goods']) + ->whereUserId(Auth::user()->id) + ->whereStatus(2) + ->whereIsExpire(0) + ->whereHas('goods', function($q) { + $q->whereType(2); + }) + ->first(); $renewPrice = $renewOrder? Goods::query()->whereId($renewOrder->goods_id)->first() : 0; $view['renewTraffic'] = $renewPrice? $renewPrice->renew : 0; // 有重置日时按照重置日为标准,否者就以过期日为标准 $dataPlusDays = Auth::user()->reset_time? Auth::user()->reset_time : Auth::user()->expire_time; - $view['dataPlusDays'] = $dataPlusDays > date('Y-m-d')? round((strtotime($dataPlusDays)-strtotime(date('Y-m-d')))/86400) : 0; + $view['dataPlusDays'] = $dataPlusDays > date('Y-m-d')? round((strtotime($dataPlusDays) - strtotime(date('Y-m-d'))) / 86400) : 0; $view['purchaseHTML'] = PaymentController::purchaseHTML(); return Response::view('user.services', $view); } //重置流量 - public function resetUserTraffic() - { - $temp = Order::uid()->whereStatus(2)->whereIsExpire(0)->with(['goods'])->whereHas('goods', function($q){ $q->whereType(2); })->first(); + public function resetUserTraffic() { + $temp = Order::uid()->whereStatus(2)->whereIsExpire(0)->with(['goods'])->whereHas('goods', function($q) { + $q->whereType(2); + })->first(); $renewCost = Goods::query()->whereId($temp->goods_id)->first()->renew; if(Auth::user()->balance < $renewCost){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '余额不足,请充值余额']); @@ -277,33 +330,35 @@ class UserController extends Controller User::uid()->update(['u' => 0, 'd' => 0]); // 扣余额 - User::query()->whereId(Auth::user()->id)->decrement('balance', $renewCost*100); + User::query()->whereId(Auth::user()->id)->decrement('balance', $renewCost * 100); // 记录余额操作日志 - Helpers::addUserBalanceLog(Auth::user()->id, '', Auth::user()->balance, Auth::user()->balance-$renewCost, -1*$renewCost, '用户自行重置流量'); + Helpers::addUserBalanceLog(Auth::user()->id, '', Auth::user()->balance, Auth::user()->balance - $renewCost, + -1 * $renewCost, '用户自行重置流量'); return Response::json(['status' => 'success', 'data' => '', 'message' => '重置成功']); } } // 工单 - public function ticketList(Request $request) - { + public function ticketList(Request $request) { $view['ticketList'] = Ticket::uid()->orderBy('id', 'desc')->paginate(10)->appends($request->except('page')); return Response::view('user.ticketList', $view); } // 订单 - public function invoices(Request $request) - { - $view['orderList'] = Order::uid()->with(['user', 'goods', 'coupon', 'payment'])->orderBy('oid', 'desc')->paginate(10)->appends($request->except('page')); + public function invoices(Request $request) { + $view['orderList'] = Order::uid() + ->with(['user', 'goods', 'coupon', 'payment']) + ->orderBy('oid', 'desc') + ->paginate(10) + ->appends($request->except('page')); return Response::view('user.invoices', $view); } - public function activeOrder(Request $request) - { + public function activeOrder(Request $request) { $oid = $request->input('oid'); $prepaidOrder = Order::query()->whereOid($oid)->first(); if(!$prepaidOrder){ @@ -318,16 +373,14 @@ class UserController extends Controller } // 订单明细 - public function invoiceDetail($sn) - { + public function invoiceDetail($sn) { $view['order'] = Order::uid()->with(['goods', 'coupon', 'payment'])->whereOrderSn($sn)->firstOrFail(); return Response::view('user.invoiceDetail', $view); } // 添加工单 - public function addTicket(Request $request) - { + public function addTicket(Request $request) { $title = $request->input('title'); $content = clean($request->input('content')); $content = str_replace("eval", "", str_replace("atob", "", $content)); @@ -362,8 +415,7 @@ class UserController extends Controller } // 回复工单 - public function replyTicket(Request $request) - { + public function replyTicket(Request $request) { $id = $request->input('id'); $ticket = Ticket::uid()->with('user')->whereId($id)->firstOrFail(); @@ -416,8 +468,7 @@ class UserController extends Controller } // 关闭工单 - public function closeTicket(Request $request) - { + public function closeTicket(Request $request) { $id = $request->input('id'); $ret = Ticket::uid()->whereId($id)->update(['status' => 2]); @@ -431,23 +482,22 @@ class UserController extends Controller } // 邀请码 - public function invite() - { + public function invite() { if(Order::uid()->whereStatus(2)->whereIsExpire(0)->where('origin_amount', '>', 0)->doesntExist()){ - return Response::view('auth.error', ['message' => '本功能对非付费用户禁用!请 返 回']); + return Response::view('auth.error', + ['message' => '本功能对非付费用户禁用!请 返 回']); } $view['num'] = Auth::user()->invite_num; // 还可以生成的邀请码数量 $view['inviteList'] = Invite::uid()->with(['generator', 'user'])->paginate(10); // 邀请码列表 - $view['referral_traffic'] = flowAutoShow(self::$systemConfig['referral_traffic']*1048576); + $view['referral_traffic'] = flowAutoShow(self::$systemConfig['referral_traffic'] * 1048576); $view['referral_percent'] = self::$systemConfig['referral_percent']; return Response::view('user.invite', $view); } // 生成邀请码 - public function makeInvite() - { + public function makeInvite() { if(Auth::user()->invite_num <= 0){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '生成失败:已无邀请码生成名额']); } @@ -466,8 +516,7 @@ class UserController extends Controller } // 使用优惠券 - public function redeemCoupon(Request $request) - { + public function redeemCoupon(Request $request) { $coupon_sn = $request->input('coupon_sn'); $good_price = $request->input('price'); @@ -493,22 +542,33 @@ class UserController extends Controller return Response::json(['status' => 'fail', 'title' => '使用条件未满足', 'message' => '请购买价格更高的套餐']); } - $data = ['name' => $coupon->name, 'type' => $coupon->type, 'amount' => $coupon->amount, 'discount' => $coupon->discount]; + $data = [ + 'name' => $coupon->name, + 'type' => $coupon->type, + 'amount' => $coupon->amount, + 'discount' => $coupon->discount + ]; return Response::json(['status' => 'success', 'data' => $data, 'message' => '优惠券有效']); } // 购买服务 - public function buy($goods_id) - { + public function buy($goods_id) { $goods = Goods::query()->whereId($goods_id)->whereStatus(1)->first(); if(empty($goods)){ return Redirect::to('services'); } // 有重置日时按照重置日为标准,否者就以过期日为标准 $dataPlusDays = Auth::user()->reset_time? Auth::user()->reset_time : Auth::user()->expire_time; - $view['dataPlusDays'] = $dataPlusDays > date('Y-m-d')? round((strtotime($dataPlusDays)-strtotime(date('Y-m-d')))/86400) : 0; - $view['activePlan'] = Order::uid()->with(['goods'])->whereIsExpire(0)->whereStatus(2)->whereHas('goods', function($q){ $q->whereType(2); })->exists(); + $view['dataPlusDays'] = $dataPlusDays > date('Y-m-d')? round((strtotime($dataPlusDays) - strtotime(date('Y-m-d'))) / 86400) : 0; + $view['activePlan'] = Order::uid() + ->with(['goods']) + ->whereIsExpire(0) + ->whereStatus(2) + ->whereHas('goods', function($q) { + $q->whereType(2); + }) + ->exists(); $view['purchaseHTML'] = PaymentController::purchaseHTML(); $view['goods'] = $goods; @@ -516,12 +576,15 @@ class UserController extends Controller } // 帮助中心 - public function help() - { + public function help() { $view['articleList'] = Article::type(1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->limit(10)->paginate(5); //付费用户判断 - $view['not_paying_user'] = Order::uid()->whereStatus(2)->whereIsExpire(0)->where('origin_amount', '>', 0)->doesntExist(); + $view['not_paying_user'] = Order::uid() + ->whereStatus(2) + ->whereIsExpire(0) + ->where('origin_amount', '>', 0) + ->doesntExist(); //客户端安装 $view['Shadowrocket_install'] = 'itms-services://?action=download-manifest&url='.self::$systemConfig['website_url'].'/clients/Shadowrocket.plist'; $view['Quantumult_install'] = 'itms-services://?action=download-manifest&url='.self::$systemConfig['website_url'].'/clients/Quantumult.plist'; @@ -540,8 +603,7 @@ class UserController extends Controller } // 更换订阅地址 - public function exchangeSubscribe() - { + public function exchangeSubscribe() { DB::beginTransaction(); try{ // 更换订阅码 @@ -563,8 +625,7 @@ class UserController extends Controller } // 转换成管理员的身份 - public function switchToAdmin() - { + public function switchToAdmin() { if(!Session::has('admin')){ return Response::json(['status' => 'fail', 'data' => '', 'message' => '非法请求']); } @@ -577,14 +638,22 @@ class UserController extends Controller } // 卡券余额充值 - public function charge(Request $request) - { - $validator = Validator::make($request->all(), ['coupon_sn' => ['required', Rule::exists('coupon', 'sn')->where(function($query){ - $query->whereType(3)->whereStatus(0); - }),]], ['coupon_sn.required' => '券码不能为空', 'coupon_sn.exists' => '该券不可用']); + public function charge(Request $request) { + $validator = Validator::make($request->all(), [ + 'coupon_sn' => [ + 'required', + Rule::exists('coupon', 'sn')->where(function($query) { + $query->whereType(3)->whereStatus(0); + }), + ] + ], ['coupon_sn.required' => '券码不能为空', 'coupon_sn.exists' => '该券不可用']); if($validator->fails()){ - return Response::json(['status' => 'fail', 'data' => '', 'message' => $validator->getMessageBag()->first()]); + return Response::json([ + 'status' => 'fail', + 'data' => '', + 'message' => $validator->getMessageBag()->first() + ]); } $coupon = Coupon::query()->whereSn($request->input('coupon_sn'))->first(); @@ -592,10 +661,12 @@ class UserController extends Controller try{ DB::beginTransaction(); // 写入日志 - Helpers::addUserBalanceLog(Auth::user()->id, 0, Auth::user()->balance, Auth::user()->balance+$coupon->amount, $coupon->amount, '用户手动充值 - [充值券:'.$request->input('coupon_sn').']'); + Helpers::addUserBalanceLog(Auth::user()->id, 0, Auth::user()->balance, + Auth::user()->balance + $coupon->amount, $coupon->amount, + '用户手动充值 - [充值券:'.$request->input('coupon_sn').']'); // 余额充值 - User::uid()->increment('balance', $coupon->amount*100); + User::uid()->increment('balance', $coupon->amount * 100); // 更改卡券状态 $coupon->status = 1; diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index e33503c3..ff87d277 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -30,8 +30,7 @@ use Illuminate\Routing\Middleware\ValidateSignature; use Illuminate\Session\Middleware\StartSession; use Illuminate\View\Middleware\ShareErrorsFromSession; -class Kernel extends HttpKernel -{ +class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * diff --git a/app/Http/Middleware/Affiliate.php b/app/Http/Middleware/Affiliate.php index 07351062..d5262d72 100644 --- a/app/Http/Middleware/Affiliate.php +++ b/app/Http/Middleware/Affiliate.php @@ -6,18 +6,16 @@ use Closure; use Cookie; use Illuminate\Http\Request; -class Affiliate -{ +class Affiliate { /** * 返利识别 * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { $aff = trim($request->input('aff', 0)); if($aff){ Cookie::queue('register_aff', $aff, 129600); diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/app/Http/Middleware/CheckForMaintenanceMode.php index 760104ee..c2923a27 100644 --- a/app/Http/Middleware/CheckForMaintenanceMode.php +++ b/app/Http/Middleware/CheckForMaintenanceMode.php @@ -4,14 +4,12 @@ namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; -class CheckForMaintenanceMode extends Middleware -{ +class CheckForMaintenanceMode extends Middleware { /** * The URIs that should be reachable while maintenance mode is enabled. * * @var array */ - protected $except = [ - // + protected $except = [// ]; } diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 98b44a53..ecf698f5 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -4,14 +4,12 @@ namespace App\Http\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; -class EncryptCookies extends Middleware -{ +class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. * * @var array */ - protected $except = [ - // + protected $except = [// ]; } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index a7ca44ed..cb5591b9 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -5,19 +5,17 @@ namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; -class RedirectIfAuthenticated -{ +class RedirectIfAuthenticated { /** * Handle an incoming request. * - * @param Request $request - * @param Closure $next - * @param string|null $guard + * @param Request $request + * @param Closure $next + * @param string|null $guard * * @return mixed */ - public function handle($request, Closure $next, $guard = NULL) - { + public function handle($request, Closure $next, $guard = null) { if(auth()->guard($guard)->check()){ return redirect('/'); } diff --git a/app/Http/Middleware/SetLocale.php b/app/Http/Middleware/SetLocale.php index 873ecf06..97180661 100644 --- a/app/Http/Middleware/SetLocale.php +++ b/app/Http/Middleware/SetLocale.php @@ -6,18 +6,16 @@ use Closure; use Illuminate\Http\Request; use Session; -class SetLocale -{ +class SetLocale { /** * 变更语言 * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { if(Session::has('locale')){ app()->setLocale(Session::get('locale')); } @@ -30,4 +28,4 @@ class SetLocale return $next($request); } -} \ No newline at end of file +} diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php index e2393eb1..b57b8d85 100644 --- a/app/Http/Middleware/TrimStrings.php +++ b/app/Http/Middleware/TrimStrings.php @@ -4,8 +4,7 @@ namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; -class TrimStrings extends Middleware -{ +class TrimStrings extends Middleware { /** * The names of the attributes that should not be trimmed. * diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 15eaa6b2..879a20e2 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -5,8 +5,7 @@ namespace App\Http\Middleware; use Fideloper\Proxy\TrustProxies as Middleware; use Illuminate\Http\Request; -class TrustProxies extends Middleware -{ +class TrustProxies extends Middleware { /** * The trusted proxies for this application. * diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 38e7a7fa..7d54d17e 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -4,8 +4,7 @@ namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; -class VerifyCsrfToken extends Middleware -{ +class VerifyCsrfToken extends Middleware { /** * The URIs that should be excluded from CSRF verification. * diff --git a/app/Http/Middleware/WebApi.php b/app/Http/Middleware/WebApi.php new file mode 100644 index 00000000..3966a499 --- /dev/null +++ b/app/Http/Middleware/WebApi.php @@ -0,0 +1,47 @@ +input('key'); + // 未提供 key + if($key === null){ + return Response::json([ + 'ret' => 0, + 'data' => 'Your key is null' + ]); + } + + if(!in_array($key, env('WEB_API_KEY'))){ + // key 不存在 + return Response::json([ + 'ret' => 0, + 'data' => 'Token is invalid' + ]); + } + + if(env('WEB_API') == false){ + // 主站不提供 Webapi + return Response::json([ + 'ret' => 0, + 'data' => 'We regret this service is temporarily unavailable' + ]); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/isAdmin.php b/app/Http/Middleware/isAdmin.php index d3b1601a..e0b5c73e 100644 --- a/app/Http/Middleware/isAdmin.php +++ b/app/Http/Middleware/isAdmin.php @@ -7,18 +7,16 @@ use Closure; use Illuminate\Http\Request; use Redirect; -class isAdmin -{ +class isAdmin { /** * 校验是否为管理员身份 * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { if(!Auth::user()->is_admin){ return Redirect::to('/'); } diff --git a/app/Http/Middleware/isAdminlogin.php b/app/Http/Middleware/isAdminlogin.php index 716af5e5..75d3bfad 100644 --- a/app/Http/Middleware/isAdminlogin.php +++ b/app/Http/Middleware/isAdminlogin.php @@ -6,18 +6,16 @@ use Closure; use Illuminate\Http\Request; use Redirect; -class isAdminlogin -{ +class isAdminlogin { /** * Handle an incoming request. * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { if(auth()->guest()){ return Redirect::to('admin/login'); } diff --git a/app/Http/Middleware/isForbidden.php b/app/Http/Middleware/isForbidden.php index 4b6fe7b1..705b027c 100644 --- a/app/Http/Middleware/isForbidden.php +++ b/app/Http/Middleware/isForbidden.php @@ -10,18 +10,16 @@ use Closure; use Illuminate\Http\Request; use Log; -class isForbidden -{ +class isForbidden { /** * 限制机器人、指定IP访问 * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { // 拒绝机器人访问 if(Helpers::systemConfig()['is_forbid_robot']){ if(Agent::isRobot()){ @@ -32,7 +30,8 @@ class isForbidden } // 拒绝通过订阅链接域名访问网站,防止网站被探测 - if(TRUE === strpos(Helpers::systemConfig()['subscribe_domain'], $request->getHost()) && FALSE === strpos(Helpers::systemConfig()['subscribe_domain'], Helpers::systemConfig()['website_url'])){ + if(true === strpos(Helpers::systemConfig()['subscribe_domain'], $request->getHost()) + && false === strpos(Helpers::systemConfig()['subscribe_domain'], Helpers::systemConfig()['website_url'])){ Log::info("识别到通过订阅链接访问,强制跳转至百度(".getClientIp().")"); return redirect('https://www.baidu.com'); @@ -41,10 +40,10 @@ class isForbidden $ip = getClientIP(); if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)){ Log::info('识别到IPv6,尝试解析:'.$ip); - $isIPv6 = TRUE; + $isIPv6 = true; $ipInfo = getIPv6($ip); }else{ - $isIPv6 = FALSE; + $isIPv6 = false; $ipInfo = QQWry::ip($ip); // 通过纯真IP库解析IPv4信息 if(isset($ipInfo['error'])){ Log::info('无法识别IPv4,尝试使用IPIP的IP库解析:'.$ip); @@ -73,7 +72,9 @@ class isForbidden if(!in_array($ipInfo['country'], ['本机地址', '局域网'])){ // 拒绝大陆IP访问 if(Helpers::systemConfig()['is_forbid_china']){ - if(($ipInfo['country'] == '中国' && !in_array($ipInfo['province'], ['香港', '澳门', '台湾'])) || ($isIPv6 && $ipInfo['country'] == 'China')){ + if(($ipInfo['country'] == '中国' && !in_array($ipInfo['province'], ['香港', '澳门', '台湾'])) + || ($isIPv6 + && $ipInfo['country'] == 'China')){ Log::info('识别到大陆IP,拒绝访问:'.$ip); return response()->view('auth.error', ['message' => trans('error.ForbiddenChina')], 403); @@ -82,7 +83,9 @@ class isForbidden // 拒绝非大陆IP访问 if(Helpers::systemConfig()['is_forbid_oversea']){ - if($ipInfo['country'] != '中国' || in_array($ipInfo['province'], ['香港', '澳门', '台湾']) || ($isIPv6 && $ipInfo['country'] != 'China')){ + if($ipInfo['country'] != '中国' || in_array($ipInfo['province'], ['香港', '澳门', '台湾']) + || ($isIPv6 + && $ipInfo['country'] != 'China')){ Log::info('识别到海外IP,拒绝访问:'.$ip.' - '.$ipInfo['country']); return response()->view('auth.error', ['message' => trans('error.ForbiddenOversea')], 403); diff --git a/app/Http/Middleware/isLogin.php b/app/Http/Middleware/isLogin.php index b13e93fa..df594bac 100644 --- a/app/Http/Middleware/isLogin.php +++ b/app/Http/Middleware/isLogin.php @@ -6,18 +6,16 @@ use Closure; use Illuminate\Http\Request; use Redirect; -class isLogin -{ +class isLogin { /** * 校验是否已登录 * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { if(auth()->guest()){ return Redirect::to('login'); } diff --git a/app/Http/Middleware/isMaintenance.php b/app/Http/Middleware/isMaintenance.php index b7d8339b..a37d98bc 100644 --- a/app/Http/Middleware/isMaintenance.php +++ b/app/Http/Middleware/isMaintenance.php @@ -6,22 +6,23 @@ use App\Components\Helpers; use Closure; use Illuminate\Http\Request; -class isMaintenance -{ +class isMaintenance { /** * 校验是否开启维护模式 * - * @param Request $request - * @param Closure $next + * @param Request $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { if(Helpers::systemConfig()['maintenance_mode']){ - return response()->view('auth.maintenance', ['message' => Helpers::systemConfig()['maintenance_content'], 'time' => Helpers::systemConfig()['maintenance_time']? : '0']); + return response()->view('auth.maintenance', [ + 'message' => Helpers::systemConfig()['maintenance_content'], + 'time' => Helpers::systemConfig()['maintenance_time']?: '0' + ]); } return $next($request); } -} \ No newline at end of file +} diff --git a/app/Http/Middleware/isSecurity.php b/app/Http/Middleware/isSecurity.php index 8cd65dad..8edd07ed 100644 --- a/app/Http/Middleware/isSecurity.php +++ b/app/Http/Middleware/isSecurity.php @@ -7,18 +7,16 @@ use Cache; use Closure; use Log; -class isSecurity -{ +class isSecurity { /** * 是否需要安全码才访问(仅用于登录页) * - * @param $request - * @param Closure $next + * @param $request + * @param Closure $next * * @return mixed */ - public function handle($request, Closure $next) - { + public function handle($request, Closure $next) { $ip = getClientIP(); $code = $request->securityCode; $cacheKey = 'SecurityLogin_'.ip2long($ip); @@ -28,7 +26,9 @@ class isSecurity if($code != $websiteSecurityCode){ Log::info("拒绝非安全入口访问(".$ip.")"); - return response()->view('auth.error', ['message' => trans('error.SecurityError').', '.trans('error.Visit').''.trans('error.SecurityEnter').'']); + return response()->view('auth.error', [ + 'message' => trans('error.SecurityError').', '.trans('error.Visit').''.trans('error.SecurityEnter').'' + ]); }else{ Cache::put($cacheKey, $ip, 7200); // 2小时之内无需再次输入安全码访问 } diff --git a/app/Http/Models/Article.php b/app/Http/Models/Article.php index 7dbc040d..efc79861 100644 --- a/app/Http/Models/Article.php +++ b/app/Http/Models/Article.php @@ -10,27 +10,22 @@ use Illuminate\Support\Carbon; /** * 文章 - * Class Article * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $title 标题 * @property string|null $author 作者 * @property string|null $summary 简介 * @property string|null $logo LOGO * @property string|null $content 内容 - * @property int|null $type 类型:1-文章、2-公告、3-购买说明、4-使用教程 + * @property int|null $type 类型:1-文章、2-站内公告、3-站外公告 * @property int $sort 排序 * @property Carbon|null $created_at 创建时间 * @property Carbon|null $updated_at 最后更新时间 * @property Carbon|null $deleted_at 删除时间 - * @method static bool|null forceDelete() * @method static \Illuminate\Database\Eloquent\Builder|Article newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Article newQuery() * @method static Builder|Article onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|Article query() - * @method static bool|null restore() * @method static \Illuminate\Database\Eloquent\Builder|Article type($type) * @method static \Illuminate\Database\Eloquent\Builder|Article whereAuthor($value) * @method static \Illuminate\Database\Eloquent\Builder|Article whereContent($value) @@ -45,9 +40,9 @@ use Illuminate\Support\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|Article whereUpdatedAt($value) * @method static Builder|Article withTrashed() * @method static Builder|Article withoutTrashed() + * @mixin Eloquent */ -class Article extends Model -{ +class Article extends Model { use SoftDeletes; protected $table = 'article'; @@ -55,8 +50,7 @@ class Article extends Model protected $dates = ['deleted_at']; // 筛选类型 - function scopeType($query, $type) - { + function scopeType($query, $type) { return $query->whereType($type); } -} \ No newline at end of file +} diff --git a/app/Http/Models/Config.php b/app/Http/Models/Config.php index db3b122b..fbde4122 100644 --- a/app/Http/Models/Config.php +++ b/app/Http/Models/Config.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * 系统配置 - * Class Config * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $name 配置名 * @property string|null $value 配置值 @@ -21,11 +18,11 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|Config whereId($value) * @method static Builder|Config whereName($value) * @method static Builder|Config whereValue($value) + * @mixin Eloquent */ -class Config extends Model -{ - public $timestamps = FALSE; +class Config extends Model { + public $timestamps = false; protected $table = 'config'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/Country.php b/app/Http/Models/Country.php index ac2a1e1b..8461efe5 100644 --- a/app/Http/Models/Country.php +++ b/app/Http/Models/Country.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * 国家/地区 - * Class Country * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $name 名称 * @property string $code 代码 @@ -21,10 +18,10 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|Country whereCode($value) * @method static Builder|Country whereId($value) * @method static Builder|Country whereName($value) + * @mixin Eloquent */ -class Country extends Model -{ - public $timestamps = FALSE; +class Country extends Model { + public $timestamps = false; protected $table = 'country'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/Coupon.php b/app/Http/Models/Coupon.php index 474fef75..1e344bd5 100644 --- a/app/Http/Models/Coupon.php +++ b/app/Http/Models/Coupon.php @@ -10,16 +10,13 @@ use Illuminate\Support\Carbon; /** * 优惠券 - * Class Goods * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $name 优惠券名称 * @property string $logo 优惠券LOGO * @property string $sn 优惠券码 - * @property int $type 类型:1-现金券、2-折扣券、3-充值券 - * @property int $usage 用途:1-仅限一次性使用、2-可重复使用 + * @property int $type 类型:1-抵用券、2-折扣券、3-充值券 + * @property int $usage 用途:0-可重复使用、1-仅限一次性使用 * @property int $amount 金额,单位分 * @property float $discount 折扣 * @property int $rule 使用限制,单位分 @@ -29,12 +26,10 @@ use Illuminate\Support\Carbon; * @property Carbon|null $created_at 创建时间 * @property Carbon|null $updated_at 最后更新时间 * @property Carbon|null $deleted_at 删除时间 - * @method static bool|null forceDelete() * @method static \Illuminate\Database\Eloquent\Builder|Coupon newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Coupon newQuery() * @method static Builder|Coupon onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|Coupon query() - * @method static bool|null restore() * @method static \Illuminate\Database\Eloquent\Builder|Coupon type($type) * @method static \Illuminate\Database\Eloquent\Builder|Coupon whereAmount($value) * @method static \Illuminate\Database\Eloquent\Builder|Coupon whereAvailableEnd($value) @@ -53,9 +48,9 @@ use Illuminate\Support\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|Coupon whereUsage($value) * @method static Builder|Coupon withTrashed() * @method static Builder|Coupon withoutTrashed() + * @mixin Eloquent */ -class Coupon extends Model -{ +class Coupon extends Model { use SoftDeletes; protected $table = 'coupon'; @@ -63,38 +58,31 @@ class Coupon extends Model protected $dates = ['deleted_at']; // 筛选类型 - function scopeType($query, $type) - { + function scopeType($query, $type) { return $query->whereType($type); } - function getAmountAttribute($value) - { - return $value/100; + function getAmountAttribute($value) { + return $value / 100; } - function setAmountAttribute($value) - { - $this->attributes['amount'] = $value*100; + function setAmountAttribute($value) { + $this->attributes['amount'] = $value * 100; } - function getDiscountAttribute($value) - { - return $value*10; + function getDiscountAttribute($value) { + return $value * 10; } - function setDiscountAttribute($value) - { - $this->attributes['discount'] = $value/10; + function setDiscountAttribute($value) { + $this->attributes['discount'] = $value / 10; } - function getRuleAttribute($value) - { - return $value/100; + function getRuleAttribute($value) { + return $value / 100; } - function setRuleAttribute($value) - { - $this->attributes['rule'] = $value*100; + function setRuleAttribute($value) { + $this->attributes['rule'] = $value * 100; } -} \ No newline at end of file +} diff --git a/app/Http/Models/CouponLog.php b/app/Http/Models/CouponLog.php index 32a66074..2156effd 100644 --- a/app/Http/Models/CouponLog.php +++ b/app/Http/Models/CouponLog.php @@ -9,31 +9,28 @@ use Illuminate\Support\Carbon; /** * 优惠券使用日志 - * Class Goods * - * @package App\Http\Models - * @mixin Eloquent * @property int $id - * @property int $coupon_id 优惠券ID - * @property int $goods_id 商品ID - * @property int $order_id 订单ID - * @property string $desc 备注 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 + * @property int $coupon_id 优惠券ID + * @property int $goods_id 商品ID + * @property int $order_id 订单ID + * @property string $description 备注 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 * @method static Builder|CouponLog newModelQuery() * @method static Builder|CouponLog newQuery() * @method static Builder|CouponLog query() * @method static Builder|CouponLog whereCouponId($value) * @method static Builder|CouponLog whereCreatedAt($value) - * @method static Builder|CouponLog whereDesc($value) + * @method static Builder|CouponLog whereDescription($value) * @method static Builder|CouponLog whereGoodsId($value) * @method static Builder|CouponLog whereId($value) * @method static Builder|CouponLog whereOrderId($value) * @method static Builder|CouponLog whereUpdatedAt($value) + * @mixin Eloquent */ -class CouponLog extends Model -{ +class CouponLog extends Model { protected $table = 'coupon_log'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/Device.php b/app/Http/Models/Device.php index d8c798c0..c38e3b47 100644 --- a/app/Http/Models/Device.php +++ b/app/Http/Models/Device.php @@ -8,36 +8,20 @@ use Illuminate\Database\Eloquent\Model; /** * 订阅设备列表 - * Class Device * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $type 类型:0-兼容、1-Shadowsocks(R)、2-V2Ray - * @property int $platform 所属平台:0-其他、1-iOS、2-Android、3-Mac、4-Windows、5-Linux - * @property string $name 设备名称 - * @property int $status 状态:0-禁止订阅、1-允许订阅 - * @property string $header 请求时头部的识别特征码 * @property-read mixed $platform_label * @property-read mixed $type_label * @method static Builder|Device newModelQuery() * @method static Builder|Device newQuery() * @method static Builder|Device query() - * @method static Builder|Device whereHeader($value) - * @method static Builder|Device whereId($value) - * @method static Builder|Device whereName($value) - * @method static Builder|Device wherePlatform($value) - * @method static Builder|Device whereStatus($value) - * @method static Builder|Device whereType($value) + * @mixin Eloquent */ -class Device extends Model -{ - public $timestamps = FALSE; +class Device extends Model { + public $timestamps = false; protected $table = 'device'; protected $primaryKey = 'id'; - function getTypeLabelAttribute() - { + function getTypeLabelAttribute() { switch($this->attributes['type']){ case 1: $type_label = ' Shadowsocks(R) '; @@ -52,8 +36,7 @@ class Device extends Model return $type_label; } - function getPlatformLabelAttribute() - { + function getPlatformLabelAttribute() { switch($this->attributes['platform']){ case 1: $platform_label = ' iOS'; @@ -77,4 +60,4 @@ class Device extends Model return $platform_label; } -} \ No newline at end of file +} diff --git a/app/Http/Models/Goods.php b/app/Http/Models/Goods.php index c6012b1f..22f6fe7e 100644 --- a/app/Http/Models/Goods.php +++ b/app/Http/Models/Goods.php @@ -11,20 +11,17 @@ use Illuminate\Support\Carbon; /** * 商品 - * Class Goods * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $sku 商品服务SKU * @property string $name 商品名称 * @property string $logo 商品图片地址 * @property int $traffic 商品内含多少流量,单位MiB - * @property int $type 商品类型:1-流量包、2-套餐、3-余额充值 + * @property int $type 商品类型:1-流量包、2-套餐 * @property int $price 售价,单位分 * @property int $renew 流量重置价格,单位分 * @property int $period 流量自动重置周期 - * @property string|null $info 商品 + * @property string|null $info 商品信息 * @property string|null $desc 商品描述 * @property int $days 有效期 * @property int $invite_num 赠送邀请码数 @@ -39,12 +36,10 @@ use Illuminate\Support\Carbon; * @property-read mixed $traffic_label * @property-read Collection|GoodsLabel[] $label * @property-read int|null $label_count - * @method static bool|null forceDelete() * @method static \Illuminate\Database\Eloquent\Builder|Goods newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Goods newQuery() * @method static Builder|Goods onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|Goods query() - * @method static bool|null restore() * @method static \Illuminate\Database\Eloquent\Builder|Goods type($type) * @method static \Illuminate\Database\Eloquent\Builder|Goods whereColor($value) * @method static \Illuminate\Database\Eloquent\Builder|Goods whereCreatedAt($value) @@ -69,47 +64,40 @@ use Illuminate\Support\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|Goods whereUpdatedAt($value) * @method static Builder|Goods withTrashed() * @method static Builder|Goods withoutTrashed() + * @mixin Eloquent */ -class Goods extends Model -{ +class Goods extends Model { use SoftDeletes; protected $table = 'goods'; protected $primaryKey = 'id'; protected $dates = ['deleted_at']; - function scopeType($query, $type) - { + function scopeType($query, $type) { return $query->whereType($type)->whereStatus(1)->orderBy('sort', 'desc'); } - function label() - { + function label() { return $this->hasMany(GoodsLabel::class, 'goods_id', 'id'); } - function getPriceAttribute($value) - { - return $value/100; + function getPriceAttribute($value) { + return $value / 100; } - function setPriceAttribute($value) - { - $this->attributes['price'] = $value*100; + function setPriceAttribute($value) { + $this->attributes['price'] = $value * 100; } - function getRenewAttribute($value) - { - return $value/100; + function getRenewAttribute($value) { + return $value / 100; } - function setRenewAttribute($value) - { - return $this->attributes['renew'] = $value*100; + function setRenewAttribute($value) { + return $this->attributes['renew'] = $value * 100; } - function getTrafficLabelAttribute() - { - return flowAutoShow($this->attributes['traffic']*1048576); + function getTrafficLabelAttribute() { + return flowAutoShow($this->attributes['traffic'] * 1048576); } } diff --git a/app/Http/Models/GoodsLabel.php b/app/Http/Models/GoodsLabel.php index 8a0d0feb..03be1d67 100644 --- a/app/Http/Models/GoodsLabel.php +++ b/app/Http/Models/GoodsLabel.php @@ -8,29 +8,19 @@ use Illuminate\Database\Eloquent\Model; /** * 商品标签 - * Class GoodsLabel * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $goods_id 商品ID - * @property int $label_id 标签ID - * @property-read Goods $goods + * @property-read Goods|null $goods * @method static Builder|GoodsLabel newModelQuery() * @method static Builder|GoodsLabel newQuery() * @method static Builder|GoodsLabel query() - * @method static Builder|GoodsLabel whereGoodsId($value) - * @method static Builder|GoodsLabel whereId($value) - * @method static Builder|GoodsLabel whereLabelId($value) + * @mixin Eloquent */ -class GoodsLabel extends Model -{ - public $timestamps = FALSE; +class GoodsLabel extends Model { + public $timestamps = false; protected $table = 'goods_label'; protected $primaryKey = 'id'; - function goods() - { + function goods() { return $this->hasOne(Goods::class, 'id', 'goods_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/Invite.php b/app/Http/Models/Invite.php index 05750179..493e4f29 100644 --- a/app/Http/Models/Invite.php +++ b/app/Http/Models/Invite.php @@ -11,28 +11,23 @@ use Illuminate\Support\Carbon; /** * 邀请码 - * Class Invite * - * @package App\Http\Models - * @mixin Eloquent - * @property-read mixed $status_label - * @property int $id - * @property int $uid 邀请人ID - * @property int $fuid 受邀人ID - * @property string $code 邀请码 - * @property int $status 邀请码状态:0-未使用、1-已使用、2-已过期 - * @property string|null $dateline 有效期至 - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property Carbon|null $deleted_at 删除时间 - * @property-read User $generator - * @property-read User $user - * @method static bool|null forceDelete() + * @property int $id + * @property int $uid 邀请人ID + * @property int $fuid 受邀人ID + * @property string $code 邀请码 + * @property int $status 邀请码状态:0-未使用、1-已使用、2-已过期 + * @property string|null $dateline 有效期至 + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property Carbon|null $deleted_at 删除时间 + * @property-read User|null $generator + * @property-read mixed $status_label + * @property-read User|null $user * @method static \Illuminate\Database\Eloquent\Builder|Invite newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Invite newQuery() * @method static Builder|Invite onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|Invite query() - * @method static bool|null restore() * @method static \Illuminate\Database\Eloquent\Builder|Invite uid() * @method static \Illuminate\Database\Eloquent\Builder|Invite whereCode($value) * @method static \Illuminate\Database\Eloquent\Builder|Invite whereCreatedAt($value) @@ -45,32 +40,28 @@ use Illuminate\Support\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|Invite whereUpdatedAt($value) * @method static Builder|Invite withTrashed() * @method static Builder|Invite withoutTrashed() + * @mixin Eloquent */ -class Invite extends Model -{ +class Invite extends Model { use SoftDeletes; protected $table = 'invite'; protected $primaryKey = 'id'; protected $dates = ['deleted_at']; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUid(Auth::user()->id); } - function generator() - { + function generator() { return $this->hasOne(User::class, 'id', 'uid'); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'fuid'); } - function getStatusLabelAttribute() - { + function getStatusLabelAttribute() { switch($this->attributes['status']){ case 0: $status_label = ''.trans('home.invite_code_table_status_un').''; @@ -88,4 +79,4 @@ class Invite extends Model return $status_label; } -} \ No newline at end of file +} diff --git a/app/Http/Models/Label.php b/app/Http/Models/Label.php index 1bf56fa1..f0e4f484 100644 --- a/app/Http/Models/Label.php +++ b/app/Http/Models/Label.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * 标签 - * Class Label * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $name 名称 * @property int $sort 排序值 @@ -21,10 +18,10 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|Label whereId($value) * @method static Builder|Label whereName($value) * @method static Builder|Label whereSort($value) + * @mixin Eloquent */ -class Label extends Model -{ - public $timestamps = FALSE; +class Label extends Model { + public $timestamps = false; protected $table = 'label'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/Level.php b/app/Http/Models/Level.php index 2feb47fe..ce6b57f2 100644 --- a/app/Http/Models/Level.php +++ b/app/Http/Models/Level.php @@ -8,23 +8,14 @@ use Illuminate\Database\Eloquent\Model; /** * 等级 - * Class Level * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $level 等级 - * @property string $level_name 等级名称 * @method static Builder|Level newModelQuery() * @method static Builder|Level newQuery() * @method static Builder|Level query() - * @method static Builder|Level whereId($value) - * @method static Builder|Level whereLevel($value) - * @method static Builder|Level whereLevelName($value) + * @mixin Eloquent */ -class Level extends Model -{ - public $timestamps = FALSE; +class Level extends Model { + public $timestamps = false; protected $table = 'level'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/Marketing.php b/app/Http/Models/Marketing.php index 553e77aa..62bf6b73 100644 --- a/app/Http/Models/Marketing.php +++ b/app/Http/Models/Marketing.php @@ -9,12 +9,9 @@ use Illuminate\Support\Carbon; /** * 营销 - * Class Marketing * - * @package App\Http\Models - * @mixin Eloquent * @property int $id - * @property int $type 类型:1-邮件群发、2-订阅渠道群发 + * @property int $type 类型:1-邮件群发 * @property string $receiver 接收者 * @property string $title 标题 * @property string $content 内容 @@ -35,15 +32,14 @@ use Illuminate\Support\Carbon; * @method static Builder|Marketing whereTitle($value) * @method static Builder|Marketing whereType($value) * @method static Builder|Marketing whereUpdatedAt($value) + * @mixin Eloquent */ -class Marketing extends Model -{ +class Marketing extends Model { protected $table = 'marketing'; protected $primaryKey = 'id'; protected $appends = ['status_label']; - function getStatusLabelAttribute() - { + function getStatusLabelAttribute() { $status_label = ''; switch($this->attributes['status']){ case -1: @@ -59,4 +55,4 @@ class Marketing extends Model return $status_label; } -} \ No newline at end of file +} diff --git a/app/Http/Models/NotificationLog.php b/app/Http/Models/NotificationLog.php index 1d8ad0de..425e5d4d 100644 --- a/app/Http/Models/NotificationLog.php +++ b/app/Http/Models/NotificationLog.php @@ -9,13 +9,12 @@ use Illuminate\Support\Carbon; /** * 推送通知日志 - * Class NotificationLog * * @property int $id - * @property int $type 类型:1-邮件、2-ServerChan、3-Bark + * @property int $type 类型:1-邮件、2-ServerChan、3-Bark、4-Telegram * @property string $address 收信地址 - * @property string $title 标题 - * @property string $content 内容 + * @property string|null $title 邮件标题 + * @property string|null $content 邮件内容 * @property int $status 状态:-1发送失败、0-等待发送、1-发送成功 * @property string|null $error 发送失败抛出的异常信息 * @property Carbon|null $created_at 创建时间 @@ -34,9 +33,8 @@ use Illuminate\Support\Carbon; * @method static Builder|NotificationLog whereUpdatedAt($value) * @mixin Eloquent */ -class NotificationLog extends Model -{ +class NotificationLog extends Model { protected $table = 'notification_log'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/Order.php b/app/Http/Models/Order.php index e98ecc65..36de820c 100644 --- a/app/Http/Models/Order.php +++ b/app/Http/Models/Order.php @@ -10,30 +10,26 @@ use Illuminate\Support\Carbon; /** * 订单 - * Class Order * - * @package App\Http\Models - * @mixin Eloquent - * @property-read mixed $status_label - * @property int $oid - * @property string $order_sn 订单编号 - * @property int $user_id 操作人 - * @property int $goods_id 商品ID - * @property int $coupon_id 优惠券ID - * @property string|null $email 邮箱 - * @property int $origin_amount 订单原始总价,单位分 - * @property int $amount 订单总价,单位分 - * @property string|null $expire_at 过期时间 - * @property int $is_expire 是否已过期:0-未过期、1-已过期 - * @property int $pay_way 支付方式:1-余额支付、2-有赞云支付 - * @property int $status 订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后一次更新时间 - * @property-read Coupon $coupon - * @property-read Goods $goods - * @property-read Payment $payment - * @property-read User $user - * @property-read mixed $pay_way_label + * @property int $oid + * @property string $order_sn 订单编号 + * @property int $user_id 操作人 + * @property int $goods_id 商品ID + * @property int $coupon_id 优惠券ID + * @property int $origin_amount 订单原始总价,单位分 + * @property int $amount 订单总价,单位分 + * @property string|null $expire_at 过期时间 + * @property int $is_expire 是否已过期:0-未过期、1-已过期 + * @property string $pay_way 支付方式:balance、f2fpay、codepay、payjs、bitpayx等 + * @property int $status 订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后一次更新时间 + * @property-read Coupon|null $coupon + * @property-read mixed $pay_way_label + * @property-read mixed $status_label + * @property-read Goods|null $goods + * @property-read Payment|null $payment + * @property-read User|null $user * @method static Builder|Order newModelQuery() * @method static Builder|Order newQuery() * @method static Builder|Order query() @@ -41,7 +37,6 @@ use Illuminate\Support\Carbon; * @method static Builder|Order whereAmount($value) * @method static Builder|Order whereCouponId($value) * @method static Builder|Order whereCreatedAt($value) - * @method static Builder|Order whereEmail($value) * @method static Builder|Order whereExpireAt($value) * @method static Builder|Order whereGoodsId($value) * @method static Builder|Order whereIsExpire($value) @@ -52,41 +47,35 @@ use Illuminate\Support\Carbon; * @method static Builder|Order whereStatus($value) * @method static Builder|Order whereUpdatedAt($value) * @method static Builder|Order whereUserId($value) + * @mixin Eloquent */ -class Order extends Model -{ +class Order extends Model { protected $table = 'order'; protected $primaryKey = 'oid'; protected $appends = ['status_label']; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUserId(Auth::user()->id); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } - function goods() - { + function goods() { return $this->hasOne(Goods::class, 'id', 'goods_id')->withTrashed(); } - function coupon() - { + function coupon() { return $this->hasOne(Coupon::class, 'id', 'coupon_id')->withTrashed(); } - function payment() - { + function payment() { return $this->hasOne(Payment::class, 'oid', 'oid'); } // 订单状态 - function getStatusLabelAttribute() - { + function getStatusLabelAttribute() { switch($this->attributes['status']){ case -1: $status_label = trans('home.invoice_status_closed'); @@ -108,29 +97,24 @@ class Order extends Model } - function getOriginAmountAttribute($value) - { - return $value/100; + function getOriginAmountAttribute($value) { + return $value / 100; } - function setOriginAmountAttribute($value) - { - return $this->attributes['origin_amount'] = $value*100; + function setOriginAmountAttribute($value) { + return $this->attributes['origin_amount'] = $value * 100; } - function getAmountAttribute($value) - { - return $value/100; + function getAmountAttribute($value) { + return $value / 100; } - function setAmountAttribute($value) - { - return $this->attributes['amount'] = $value*100; + function setAmountAttribute($value) { + return $this->attributes['amount'] = $value * 100; } // 支付方式 - function getPayWayLabelAttribute() - { + function getPayWayLabelAttribute() { switch($this->attributes['pay_way']){ case 'balance': $pay_way_label = '余额'; @@ -156,4 +140,4 @@ class Order extends Model return $pay_way_label; } -} \ No newline at end of file +} diff --git a/app/Http/Models/Payment.php b/app/Http/Models/Payment.php index 8e305595..f1ad6cee 100644 --- a/app/Http/Models/Payment.php +++ b/app/Http/Models/Payment.php @@ -10,16 +10,15 @@ use Illuminate\Support\Carbon; /** * 支付单 - * Class Payment * * @property int $id - * @property string|null $sn - * @property int $user_id 用户ID - * @property int|null $oid 本地订单ID - * @property int $amount 金额,单位分 - * @property string|null $qr_code 支付二维码 - * @property string|null $url 支付链接 - * @property int $status 状态:-1-支付失败、0-等待支付、1-支付成功 + * @property string|null $trade_no 支付单号(本地订单号) + * @property int $user_id 用户ID + * @property int|null $oid 本地订单ID + * @property int $amount 金额,单位分 + * @property string|null $qr_code 支付二维码 + * @property string|null $url 支付链接 + * @property int $status 支付状态:-1-支付失败、0-等待支付、1-支付成功 * @property Carbon $created_at * @property Carbon $updated_at * @property-read mixed $status_label @@ -34,47 +33,40 @@ use Illuminate\Support\Carbon; * @method static Builder|Payment whereId($value) * @method static Builder|Payment whereOid($value) * @method static Builder|Payment whereQrCode($value) - * @method static Builder|Payment whereSn($value) * @method static Builder|Payment whereStatus($value) + * @method static Builder|Payment whereTradeNo($value) * @method static Builder|Payment whereUpdatedAt($value) * @method static Builder|Payment whereUrl($value) * @method static Builder|Payment whereUserId($value) * @mixin Eloquent */ -class Payment extends Model -{ +class Payment extends Model { protected $table = 'payment'; protected $primaryKey = 'id'; protected $appends = ['status_label']; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUserId(Auth::user()->id); } - function user() - { + function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } - function order() - { + function order() { return $this->belongsTo(Order::class, 'oid', 'oid'); } - function getAmountAttribute($value) - { - return $value/100; + function getAmountAttribute($value) { + return $value / 100; } - function setAmountAttribute($value) - { - return $this->attributes['amount'] = $value*100; + function setAmountAttribute($value) { + return $this->attributes['amount'] = $value * 100; } // 订单状态 - function getStatusLabelAttribute() - { + function getStatusLabelAttribute() { switch($this->attributes['status']){ case -1: $status_label = '支付失败'; diff --git a/app/Http/Models/PaymentCallback.php b/app/Http/Models/PaymentCallback.php index 5973d259..35b57d3b 100644 --- a/app/Http/Models/PaymentCallback.php +++ b/app/Http/Models/PaymentCallback.php @@ -8,54 +8,34 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Carbon; /** - * 支付回调(有赞云支付) - * Class PaymentCallback + * 支付回调日志 * - * @package App\Http\Models - * @mixin Eloquent * @property int $id - * @property string|null $client_id - * @property string|null $yz_id - * @property string|null $kdt_id - * @property string|null $kdt_name - * @property int|null $mode - * @property string|null $msg - * @property int|null $sendCount - * @property string|null $sign - * @property string|null $status - * @property int|null $test - * @property string|null $type - * @property string|null $version + * @property string|null $trade_no 本地订单号 + * @property string|null $out_trade_no 外部订单号(支付平台) + * @property int|null $amount 交易金额,单位分 + * @property int|null $status 交易状态:0-失败、1-成功 * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property-read mixed $status_label * @method static Builder|PaymentCallback newModelQuery() * @method static Builder|PaymentCallback newQuery() * @method static Builder|PaymentCallback query() - * @method static Builder|PaymentCallback whereClientId($value) + * @method static Builder|PaymentCallback whereAmount($value) * @method static Builder|PaymentCallback whereCreatedAt($value) * @method static Builder|PaymentCallback whereId($value) - * @method static Builder|PaymentCallback whereKdtId($value) - * @method static Builder|PaymentCallback whereKdtName($value) - * @method static Builder|PaymentCallback whereMode($value) - * @method static Builder|PaymentCallback whereMsg($value) - * @method static Builder|PaymentCallback whereSendCount($value) - * @method static Builder|PaymentCallback whereSign($value) + * @method static Builder|PaymentCallback whereOutTradeNo($value) * @method static Builder|PaymentCallback whereStatus($value) - * @method static Builder|PaymentCallback whereTest($value) - * @method static Builder|PaymentCallback whereType($value) + * @method static Builder|PaymentCallback whereTradeNo($value) * @method static Builder|PaymentCallback whereUpdatedAt($value) - * @method static Builder|PaymentCallback whereVersion($value) - * @method static Builder|PaymentCallback whereYzId($value) + * @mixin Eloquent */ -class PaymentCallback extends Model -{ +class PaymentCallback extends Model { protected $table = 'payment_callback'; protected $primaryKey = 'id'; protected $appends = ['status_label']; - function getStatusLabelAttribute() - { + function getStatusLabelAttribute() { $status_label = ''; switch($this->attributes['status']){ case 'WAIT_BUYER_PAY': @@ -74,4 +54,4 @@ class PaymentCallback extends Model return $status_label; } -} \ No newline at end of file +} diff --git a/app/Http/Models/ReferralApply.php b/app/Http/Models/ReferralApply.php index 64e9d203..654e7559 100644 --- a/app/Http/Models/ReferralApply.php +++ b/app/Http/Models/ReferralApply.php @@ -10,20 +10,17 @@ use Illuminate\Support\Carbon; /** * 返利申请 - * Class ReferralApply * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $before 操作前可提现金额,单位分 - * @property int $after 操作后可提现金额,单位分 - * @property int $amount 本次提现金额,单位分 - * @property string $link_logs 关联返利日志ID,例如:1,3,4 - * @property int $status 状态:-1-驳回、0-待审核、1-审核通过待打款、2-已打款 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read User $User + * @property int $id + * @property int $user_id 用户ID + * @property int $before 操作前可提现金额,单位分 + * @property int $after 操作后可提现金额,单位分 + * @property int $amount 本次提现金额,单位分 + * @property string $link_logs 关联返利日志ID,例如:1,3,4 + * @property int $status 状态:-1-驳回、0-待审核、1-审核通过待打款、2-已打款 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read User|null $User * @method static Builder|ReferralApply newModelQuery() * @method static Builder|ReferralApply newQuery() * @method static Builder|ReferralApply query() @@ -37,49 +34,41 @@ use Illuminate\Support\Carbon; * @method static Builder|ReferralApply whereStatus($value) * @method static Builder|ReferralApply whereUpdatedAt($value) * @method static Builder|ReferralApply whereUserId($value) + * @mixin Eloquent */ -class ReferralApply extends Model -{ +class ReferralApply extends Model { protected $table = 'referral_apply'; protected $primaryKey = 'id'; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUserId(Auth::user()->id); } - function User() - { + function User() { return $this->hasOne(User::class, 'id', 'user_id'); } - function getBeforeAttribute($value) - { - return $value/100; + function getBeforeAttribute($value) { + return $value / 100; } - function setBeforeAttribute($value) - { - $this->attributes['before'] = $value*100; + function setBeforeAttribute($value) { + $this->attributes['before'] = $value * 100; } - function getAfterAttribute($value) - { - return $value/100; + function getAfterAttribute($value) { + return $value / 100; } - function setAfterAttribute($value) - { - $this->attributes['after'] = $value*100; + function setAfterAttribute($value) { + $this->attributes['after'] = $value * 100; } - function getAmountAttribute($value) - { - return $value/100; + function getAmountAttribute($value) { + return $value / 100; } - function setAmountAttribute($value) - { - $this->attributes['amount'] = $value*100; + function setAmountAttribute($value) { + $this->attributes['amount'] = $value * 100; } -} \ No newline at end of file +} diff --git a/app/Http/Models/ReferralLog.php b/app/Http/Models/ReferralLog.php index 8691cd6b..21bce283 100644 --- a/app/Http/Models/ReferralLog.php +++ b/app/Http/Models/ReferralLog.php @@ -10,22 +10,19 @@ use Illuminate\Support\Carbon; /** * 返利日志 - * Class ReferralLog * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $ref_user_id 推广人ID - * @property int $order_id 关联订单ID - * @property int $amount 消费金额,单位分 - * @property int $ref_amount 返利金额 - * @property int $status 状态:0-未提现、1-审核中、2-已提现 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read Order $order - * @property-read User $ref_user - * @property-read User $user + * @property int $id + * @property int $user_id 用户ID + * @property int $ref_user_id 推广人ID + * @property int $order_id 关联订单ID + * @property int $amount 消费金额,单位分 + * @property int $ref_amount 返利金额 + * @property int $status 状态:0-未提现、1-审核中、2-已提现 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read Order|null $order + * @property-read User|null $ref_user + * @property-read User|null $user * @method static Builder|ReferralLog newModelQuery() * @method static Builder|ReferralLog newQuery() * @method static Builder|ReferralLog query() @@ -39,49 +36,41 @@ use Illuminate\Support\Carbon; * @method static Builder|ReferralLog whereStatus($value) * @method static Builder|ReferralLog whereUpdatedAt($value) * @method static Builder|ReferralLog whereUserId($value) + * @mixin Eloquent */ -class ReferralLog extends Model -{ +class ReferralLog extends Model { protected $table = 'referral_log'; protected $primaryKey = 'id'; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereRefUserId(Auth::user()->id); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } - function ref_user() - { + function ref_user() { return $this->hasOne(User::class, 'id', 'ref_user_id'); } - function order() - { + function order() { return $this->hasOne(Order::class, 'oid', 'order_id'); } - function getAmountAttribute($value) - { - return $value/100; + function getAmountAttribute($value) { + return $value / 100; } - function setAmountAttribute($value) - { - $this->attributes['amount'] = $value*100; + function setAmountAttribute($value) { + $this->attributes['amount'] = $value * 100; } - function getRefAmountAttribute($value) - { - return $value/100; + function getRefAmountAttribute($value) { + return $value / 100; } - function setRefAmountAttribute($value) - { - $this->attributes['ref_amount'] = $value*100; + function setRefAmountAttribute($value) { + $this->attributes['ref_amount'] = $value * 100; } -} \ No newline at end of file +} diff --git a/app/Http/Models/SensitiveWords.php b/app/Http/Models/SensitiveWords.php index 76598ebe..9310ba9f 100644 --- a/app/Http/Models/SensitiveWords.php +++ b/app/Http/Models/SensitiveWords.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * 敏感词 - * Class SensitiveWords * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int $type 类型:1-黑名单、2-白名单 * @property string $words 敏感词 @@ -21,10 +18,10 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|SensitiveWords whereId($value) * @method static Builder|SensitiveWords whereType($value) * @method static Builder|SensitiveWords whereWords($value) + * @mixin Eloquent */ -class SensitiveWords extends Model -{ - public $timestamps = FALSE; +class SensitiveWords extends Model { + public $timestamps = false; protected $table = 'sensitive_words'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/SsConfig.php b/app/Http/Models/SsConfig.php index 4b1d06a9..528eec22 100644 --- a/app/Http/Models/SsConfig.php +++ b/app/Http/Models/SsConfig.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * 配置信息 - * Class SsConfig * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $name 配置名 * @property int $type 类型:1-加密方式、2-协议、3-混淆 @@ -27,23 +24,21 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|SsConfig whereName($value) * @method static Builder|SsConfig whereSort($value) * @method static Builder|SsConfig whereType($value) + * @mixin Eloquent */ -class SsConfig extends Model -{ - public $timestamps = FALSE; +class SsConfig extends Model { + public $timestamps = false; protected $table = 'ss_config'; protected $primaryKey = 'id'; // 筛选默认 - function scopeDefault($query) - { + function scopeDefault($query) { $query->whereIsDefault(1); } // 筛选类型 - function scopeType($query, $type) - { + function scopeType($query, $type) { $query->whereType($type); } -} \ No newline at end of file +} diff --git a/app/Http/Models/SsGroup.php b/app/Http/Models/SsGroup.php index 81c87877..e635ce70 100644 --- a/app/Http/Models/SsGroup.php +++ b/app/Http/Models/SsGroup.php @@ -9,13 +9,9 @@ use Illuminate\Support\Carbon; /** * SS节点分组 - * Class SsNodeGroup * - * @package App\Http\Models - * @mixin Eloquent * @property int $id - * @property string $name 分组名称 - * @property int $level 分组级别 + * @property string $name 分组名称 * @property Carbon|null $created_at * @property Carbon|null $updated_at * @method static Builder|SsGroup newModelQuery() @@ -23,13 +19,12 @@ use Illuminate\Support\Carbon; * @method static Builder|SsGroup query() * @method static Builder|SsGroup whereCreatedAt($value) * @method static Builder|SsGroup whereId($value) - * @method static Builder|SsGroup whereLevel($value) * @method static Builder|SsGroup whereName($value) * @method static Builder|SsGroup whereUpdatedAt($value) + * @mixin Eloquent */ -class SsGroup extends Model -{ +class SsGroup extends Model { protected $table = 'ss_group'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/SsGroupNode.php b/app/Http/Models/SsGroupNode.php index e433be03..3940f2fb 100644 --- a/app/Http/Models/SsGroupNode.php +++ b/app/Http/Models/SsGroupNode.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * SS分组和节点关联表 - * Class SsNodeGroup * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int $group_id 分组ID * @property int $node_id 节点ID @@ -21,11 +18,11 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|SsGroupNode whereGroupId($value) * @method static Builder|SsGroupNode whereId($value) * @method static Builder|SsGroupNode whereNodeId($value) + * @mixin Eloquent */ -class SsGroupNode extends Model -{ - public $timestamps = FALSE; +class SsGroupNode extends Model { + public $timestamps = false; protected $table = 'ss_group_node'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNode.php b/app/Http/Models/SsNode.php index 8de569a2..8abc3486 100644 --- a/app/Http/Models/SsNode.php +++ b/app/Http/Models/SsNode.php @@ -10,49 +10,51 @@ use Illuminate\Support\Carbon; /** * SS节点信息 - * Class SsNode * - * @package App\Http\Models - * @mixin Eloquent * @property int $id - * @property int $type 服务类型:1-SS、2-V2ray - * @property string $name 名称 - * @property int $group_id 所属分组 - * @property string $country_code 国家代码 - * @property string|null $server 服务器域名地址 - * @property string|null $ip 服务器IPV4地址 - * @property string|null $ipv6 服务器IPV6地址 - * @property string|null $desc 节点简单描述 - * @property string $method 加密方式 - * @property string $protocol 协议 - * @property string|null $protocol_param 协议参数 - * @property string $obfs 混淆 - * @property string|null $obfs_param 混淆参数 - * @property float $traffic_rate 流量比率 - * @property int $bandwidth 出口带宽,单位M - * @property int $traffic 每月可用流量,单位G - * @property string|null $monitor_url 监控地址 - * @property int|null $is_subscribe 是否允许用户订阅该节点:0-否、1-是 - * @property int $is_ddns 是否使用DDNS:0-否、1-是 - * @property int $is_transit 是否中转节点:0-否、1-是 - * @property int $ssh_port SSH端口 - * @property int $detectionType 节点检测: 0-关闭、1-只检测TCP、2-只检测ICMP、3-检测全部 - * @property int $compatible 兼容SS - * @property int $single 启用单端口功能:0-否、1-是 - * @property string|null $port 单端口的端口号 - * @property string|null $passwd 单端口的连接密码 - * @property int $sort 排序值,值越大越靠前显示 - * @property int $status 状态:0-维护、1-正常 - * @property int $v2_alter_id V2ray额外ID - * @property int $v2_port V2ray端口 - * @property string $v2_method V2ray加密方式 - * @property string $v2_net V2ray传输协议 - * @property string $v2_type V2ray伪装类型 - * @property string $v2_host V2ray伪装的域名 - * @property string $v2_path V2ray WS/H2路径 - * @property int $v2_tls V2ray底层传输安全 0 未开启 1 开启 - * @property int $v2_insider_port V2ray内部端口(内部监听),v2_port为0时有效 - * @property int $v2_outsider_port V2ray外部端口(外部覆盖),v2_port为0时有效 + * @property int $type 服务类型:1-ShadowsocksR、2-V2ray + * @property string $name 名称 + * @property int $group_id 所属分组 + * @property string|null $country_code 国家代码 + * @property string|null $server 服务器域名地址 + * @property string|null $ip 服务器IPV4地址 + * @property string|null $ipv6 服务器IPV6地址 + * @property string|null $relay_server 中转地址 + * @property int|null $relay_port 中转端口 + * @property int $level 等级:0-无等级,全部可见 + * @property int $speed_limit 节点限速,为0表示不限速,单位Byte + * @property int $client_limit 设备数限制 + * @property string|null $description 节点简单描述 + * @property string $method 加密方式 + * @property string $protocol 协议 + * @property string|null $protocol_param 协议参数 + * @property string $obfs 混淆 + * @property string|null $obfs_param 混淆参数 + * @property float $traffic_rate 流量比率 + * @property int $is_subscribe 是否允许用户订阅该节点:0-否、1-是 + * @property int $is_ddns 是否使用DDNS:0-否、1-是 + * @property int $is_relay 是否中转节点:0-否、1-是 + * @property int $is_udp 是否启用UDP:0-不启用、1-启用 + * @property int $ssh_port SSH端口 + * @property int $detectiontype 节点检测: 0-关闭、1-只检测TCP、2-只检测ICMP、3-检测全部 + * @property int $compatible 兼容SS + * @property int $single 启用单端口功能:0-否、1-是 + * @property int|null $port 单端口的端口号 + * @property string|null $passwd 单端口的连接密码 + * @property int $sort 排序值,值越大越靠前显示 + * @property int $status 状态:0-维护、1-正常 + * @property int $v2_alter_id V2Ray额外ID + * @property int $v2_connect_port V2Ray连接端口 + * @property int $v2_port V2Ray服务端口 + * @property string $v2_method V2Ray加密方式 + * @property string $v2_net V2Ray传输协议 + * @property string $v2_type V2Ray伪装类型 + * @property string $v2_host V2Ray伪装的域名 + * @property string $v2_path V2Ray的WS/H2路径 + * @property int $v2_connect_tls V2Ray连接TLS:0-未开启、1-开启 + * @property int $v2_tls V2Ray后端TLS:0-未开启、1-开启 + * @property string|null $tls_provider V2Ray节点的TLS提供商授权信息 + * @property int $trojan_port Trojan连接端口 * @property Carbon $created_at * @property Carbon $updated_at * @property-read Collection|SsNodeLabel[] $label @@ -60,21 +62,22 @@ use Illuminate\Support\Carbon; * @method static Builder|SsNode newModelQuery() * @method static Builder|SsNode newQuery() * @method static Builder|SsNode query() - * @method static Builder|SsNode whereBandwidth($value) + * @method static Builder|SsNode whereClientLimit($value) * @method static Builder|SsNode whereCompatible($value) * @method static Builder|SsNode whereCountryCode($value) * @method static Builder|SsNode whereCreatedAt($value) - * @method static Builder|SsNode whereDesc($value) - * @method static Builder|SsNode whereDetectionType($value) + * @method static Builder|SsNode whereDescription($value) + * @method static Builder|SsNode whereDetectiontype($value) * @method static Builder|SsNode whereGroupId($value) * @method static Builder|SsNode whereId($value) * @method static Builder|SsNode whereIp($value) * @method static Builder|SsNode whereIpv6($value) * @method static Builder|SsNode whereIsDdns($value) + * @method static Builder|SsNode whereIsRelay($value) * @method static Builder|SsNode whereIsSubscribe($value) - * @method static Builder|SsNode whereIsTransit($value) + * @method static Builder|SsNode whereIsUdp($value) + * @method static Builder|SsNode whereLevel($value) * @method static Builder|SsNode whereMethod($value) - * @method static Builder|SsNode whereMonitorUrl($value) * @method static Builder|SsNode whereName($value) * @method static Builder|SsNode whereObfs($value) * @method static Builder|SsNode whereObfsParam($value) @@ -82,33 +85,36 @@ use Illuminate\Support\Carbon; * @method static Builder|SsNode wherePort($value) * @method static Builder|SsNode whereProtocol($value) * @method static Builder|SsNode whereProtocolParam($value) + * @method static Builder|SsNode whereRelayPort($value) + * @method static Builder|SsNode whereRelayServer($value) * @method static Builder|SsNode whereServer($value) * @method static Builder|SsNode whereSingle($value) * @method static Builder|SsNode whereSort($value) + * @method static Builder|SsNode whereSpeedLimit($value) * @method static Builder|SsNode whereSshPort($value) * @method static Builder|SsNode whereStatus($value) - * @method static Builder|SsNode whereTraffic($value) + * @method static Builder|SsNode whereTlsProvider($value) * @method static Builder|SsNode whereTrafficRate($value) + * @method static Builder|SsNode whereTrojanPort($value) * @method static Builder|SsNode whereType($value) * @method static Builder|SsNode whereUpdatedAt($value) * @method static Builder|SsNode whereV2AlterId($value) + * @method static Builder|SsNode whereV2ConnectPort($value) + * @method static Builder|SsNode whereV2ConnectTls($value) * @method static Builder|SsNode whereV2Host($value) - * @method static Builder|SsNode whereV2InsiderPort($value) * @method static Builder|SsNode whereV2Method($value) * @method static Builder|SsNode whereV2Net($value) - * @method static Builder|SsNode whereV2OutsiderPort($value) * @method static Builder|SsNode whereV2Path($value) * @method static Builder|SsNode whereV2Port($value) * @method static Builder|SsNode whereV2Tls($value) * @method static Builder|SsNode whereV2Type($value) + * @mixin Eloquent */ -class SsNode extends Model -{ +class SsNode extends Model { protected $table = 'ss_node'; protected $primaryKey = 'id'; - function label() - { + function label() { return $this->hasMany(SsNodeLabel::class, 'node_id', 'id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNodeInfo.php b/app/Http/Models/SsNodeInfo.php index 8f0f8369..3660ca41 100644 --- a/app/Http/Models/SsNodeInfo.php +++ b/app/Http/Models/SsNodeInfo.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * SS节点负载情况 - * Class SsNodeInfo * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int $node_id 节点ID * @property int $uptime 后端存活时长,单位秒 @@ -25,11 +22,11 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|SsNodeInfo whereLogTime($value) * @method static Builder|SsNodeInfo whereNodeId($value) * @method static Builder|SsNodeInfo whereUptime($value) + * @mixin Eloquent */ -class SsNodeInfo extends Model -{ - public $timestamps = FALSE; +class SsNodeInfo extends Model { + public $timestamps = false; protected $table = 'ss_node_info'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNodeIp.php b/app/Http/Models/SsNodeIp.php index 1cc88f53..2d3e5982 100644 --- a/app/Http/Models/SsNodeIp.php +++ b/app/Http/Models/SsNodeIp.php @@ -9,10 +9,7 @@ use Illuminate\Support\Carbon; /** * SS节点在线IP信息 - * Class SsNodeIp * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int $node_id 节点ID * @property int $user_id 用户ID @@ -32,19 +29,17 @@ use Illuminate\Support\Carbon; * @method static Builder|SsNodeIp wherePort($value) * @method static Builder|SsNodeIp whereType($value) * @method static Builder|SsNodeIp whereUserId($value) + * @mixin Eloquent */ -class SsNodeIp extends Model -{ +class SsNodeIp extends Model { protected $table = 'ss_node_ip'; protected $primaryKey = 'id'; - function node() - { + function node() { return $this->belongsTo(SsNode::class, 'node_id', 'id'); } - function user() - { + function user() { return $this->belongsTo(User::class, 'port', 'port'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNodeLabel.php b/app/Http/Models/SsNodeLabel.php index 12b642ee..925cefec 100644 --- a/app/Http/Models/SsNodeLabel.php +++ b/app/Http/Models/SsNodeLabel.php @@ -8,29 +8,25 @@ use Illuminate\Database\Eloquent\Model; /** * 节点标签 - * Class SsNodeLabel * - * @package App\Http\Models - * @mixin Eloquent - * @property-read Label $labelInfo - * @property int $id - * @property int $node_id 用户ID - * @property int $label_id 标签ID + * @property int $id + * @property int $node_id 用户ID + * @property int $label_id 标签ID + * @property-read Label|null $labelInfo * @method static Builder|SsNodeLabel newModelQuery() * @method static Builder|SsNodeLabel newQuery() * @method static Builder|SsNodeLabel query() * @method static Builder|SsNodeLabel whereId($value) * @method static Builder|SsNodeLabel whereLabelId($value) * @method static Builder|SsNodeLabel whereNodeId($value) + * @mixin Eloquent */ -class SsNodeLabel extends Model -{ - public $timestamps = FALSE; +class SsNodeLabel extends Model { + public $timestamps = false; protected $table = 'ss_node_label'; protected $primaryKey = 'id'; - function labelInfo() - { + function labelInfo() { return $this->hasOne(Label::class, 'id', 'label_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNodeOnlineLog.php b/app/Http/Models/SsNodeOnlineLog.php index 3b0d24e2..c76f12c4 100644 --- a/app/Http/Models/SsNodeOnlineLog.php +++ b/app/Http/Models/SsNodeOnlineLog.php @@ -8,10 +8,7 @@ use Illuminate\Database\Eloquent\Model; /** * SS节点用户在线情况 - * Class SsNodeOnlineLog * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int $node_id 节点ID * @property int $online_user 在线用户数 @@ -23,11 +20,11 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|SsNodeOnlineLog whereLogTime($value) * @method static Builder|SsNodeOnlineLog whereNodeId($value) * @method static Builder|SsNodeOnlineLog whereOnlineUser($value) + * @mixin Eloquent */ -class SsNodeOnlineLog extends Model -{ - public $timestamps = FALSE; +class SsNodeOnlineLog extends Model { + public $timestamps = false; protected $table = 'ss_node_online_log'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNodePing.php b/app/Http/Models/SsNodePing.php index a9caba6e..8b248f2d 100644 --- a/app/Http/Models/SsNodePing.php +++ b/app/Http/Models/SsNodePing.php @@ -9,38 +9,34 @@ use Illuminate\Support\Carbon; /** * 节点定时Ping测速 - * App\Http\Models\SsNodePing * - * @mixin Eloquent - * @property int $id - * @property int $node_id 对应节点id - * @property int $ct 电信 - * @property int $cu 联通 - * @property int $cm 移动 - * @property int $hk 香港 - * @property Carbon $created_at - * @property Carbon $updated_at + * @property int $id + * @property int $node_id 对应节点id + * @property int $ct 电信 + * @property int $cu 联通 + * @property int $cm 移动 + * @property int $hk 香港 + * @property Carbon $created_at + * @property Carbon $updated_at + * @property-read SsNode|null $node * @method static Builder|SsNodePing newModelQuery() * @method static Builder|SsNodePing newQuery() * @method static Builder|SsNodePing query() * @method static Builder|SsNodePing whereCm($value) * @method static Builder|SsNodePing whereCreatedAt($value) + * @method static Builder|SsNodePing whereCt($value) * @method static Builder|SsNodePing whereCu($value) * @method static Builder|SsNodePing whereHk($value) * @method static Builder|SsNodePing whereId($value) * @method static Builder|SsNodePing whereNodeId($value) * @method static Builder|SsNodePing whereUpdatedAt($value) - * @method static Builder|SsNodePing whereUt($value) - * @method static Builder|SsNodePing whereCt($value) - * @property-read SsNode $node + * @mixin Eloquent */ -class SsNodePing extends Model -{ +class SsNodePing extends Model { protected $table = 'ss_node_ping'; protected $primaryKey = 'id'; - public function node() - { + public function node() { return $this->hasOne(SsNode::class, 'id', 'node_id'); } } diff --git a/app/Http/Models/SsNodeTrafficDaily.php b/app/Http/Models/SsNodeTrafficDaily.php index d7f3a037..6a21b032 100644 --- a/app/Http/Models/SsNodeTrafficDaily.php +++ b/app/Http/Models/SsNodeTrafficDaily.php @@ -9,19 +9,16 @@ use Illuminate\Support\Carbon; /** * 节点每日流量统计 - * Class SsUserTrafficDaily * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $node_id 节点ID - * @property int $u 上传流量 - * @property int $d 下载流量 - * @property int $total 总流量 - * @property string|null $traffic 总流量(带单位) - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read SsNode $info + * @property int $id + * @property int $node_id 节点ID + * @property int $u 上传流量 + * @property int $d 下载流量 + * @property int $total 总流量 + * @property string|null $traffic 总流量(带单位) + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read SsNode|null $info * @method static Builder|SsNodeTrafficDaily newModelQuery() * @method static Builder|SsNodeTrafficDaily newQuery() * @method static Builder|SsNodeTrafficDaily query() @@ -33,15 +30,14 @@ use Illuminate\Support\Carbon; * @method static Builder|SsNodeTrafficDaily whereTraffic($value) * @method static Builder|SsNodeTrafficDaily whereU($value) * @method static Builder|SsNodeTrafficDaily whereUpdatedAt($value) + * @mixin Eloquent */ -class SsNodeTrafficDaily extends Model -{ +class SsNodeTrafficDaily extends Model { protected $table = 'ss_node_traffic_daily'; protected $primaryKey = 'id'; - function info() - { + function info() { return $this->hasOne(SsNode::class, 'id', 'node_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/SsNodeTrafficHourly.php b/app/Http/Models/SsNodeTrafficHourly.php index b3e07abd..8934b76f 100644 --- a/app/Http/Models/SsNodeTrafficHourly.php +++ b/app/Http/Models/SsNodeTrafficHourly.php @@ -9,19 +9,16 @@ use Illuminate\Support\Carbon; /** * 节点每日流量统计 - * Class SsUserTrafficHourly * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $node_id 节点ID - * @property int $u 上传流量 - * @property int $d 下载流量 - * @property int $total 总流量 - * @property string|null $traffic 总流量(带单位) - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read SsNode $info + * @property int $id + * @property int $node_id 节点ID + * @property int $u 上传流量 + * @property int $d 下载流量 + * @property int $total 总流量 + * @property string|null $traffic 总流量(带单位) + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read SsNode|null $info * @method static Builder|SsNodeTrafficHourly newModelQuery() * @method static Builder|SsNodeTrafficHourly newQuery() * @method static Builder|SsNodeTrafficHourly query() @@ -33,14 +30,13 @@ use Illuminate\Support\Carbon; * @method static Builder|SsNodeTrafficHourly whereTraffic($value) * @method static Builder|SsNodeTrafficHourly whereU($value) * @method static Builder|SsNodeTrafficHourly whereUpdatedAt($value) + * @mixin Eloquent */ -class SsNodeTrafficHourly extends Model -{ +class SsNodeTrafficHourly extends Model { protected $table = 'ss_node_traffic_hourly'; protected $primaryKey = 'id'; - function info() - { + function info() { return $this->hasOne(SsNode::class, 'id', 'node_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/Ticket.php b/app/Http/Models/Ticket.php index 38211d10..575b9c60 100644 --- a/app/Http/Models/Ticket.php +++ b/app/Http/Models/Ticket.php @@ -10,19 +10,16 @@ use Illuminate\Support\Carbon; /** * 工单 - * Class Ticket * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id - * @property string $title 标题 - * @property string $content 内容 - * @property int $status 状态:0-待处理、1-已处理未关闭、2-已关闭 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read mixed $status_label - * @property-read User $user + * @property int $id + * @property int $user_id 用户ID + * @property string $title 标题 + * @property string $content 内容 + * @property int $status 状态:0-待处理、1-已处理未关闭、2-已关闭 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read mixed $status_label + * @property-read User|null $user * @method static Builder|Ticket newModelQuery() * @method static Builder|Ticket newQuery() * @method static Builder|Ticket query() @@ -34,24 +31,21 @@ use Illuminate\Support\Carbon; * @method static Builder|Ticket whereTitle($value) * @method static Builder|Ticket whereUpdatedAt($value) * @method static Builder|Ticket whereUserId($value) + * @mixin Eloquent */ -class Ticket extends Model -{ +class Ticket extends Model { protected $table = 'ticket'; protected $primaryKey = 'id'; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUserId(Auth::user()->id); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } - function getStatusLabelAttribute() - { + function getStatusLabelAttribute() { switch($this->attributes['status']){ case 0: $status_label = ''.trans('home.ticket_table_status_wait').''; @@ -69,4 +63,4 @@ class Ticket extends Model return $status_label; } -} \ No newline at end of file +} diff --git a/app/Http/Models/TicketReply.php b/app/Http/Models/TicketReply.php index 7929d67a..46909e11 100644 --- a/app/Http/Models/TicketReply.php +++ b/app/Http/Models/TicketReply.php @@ -9,17 +9,14 @@ use Illuminate\Support\Carbon; /** * 工单回复 - * Class TicketReply * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $ticket_id 工单ID - * @property int $user_id 回复人ID - * @property string $content 回复内容 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read User $user + * @property int $id + * @property int $ticket_id 工单ID + * @property int $user_id 回复用户的ID + * @property string $content 回复内容 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read User|null $user * @method static Builder|TicketReply newModelQuery() * @method static Builder|TicketReply newQuery() * @method static Builder|TicketReply query() @@ -29,14 +26,13 @@ use Illuminate\Support\Carbon; * @method static Builder|TicketReply whereTicketId($value) * @method static Builder|TicketReply whereUpdatedAt($value) * @method static Builder|TicketReply whereUserId($value) + * @mixin Eloquent */ -class TicketReply extends Model -{ +class TicketReply extends Model { protected $table = 'ticket_reply'; protected $primaryKey = 'id'; - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/User.php b/app/Http/Models/User.php index f591ce46..985562ba 100644 --- a/app/Http/Models/User.php +++ b/app/Http/Models/User.php @@ -14,71 +14,69 @@ use Illuminate\Support\Carbon; /** * 用户信息 - * Class User * - * @package App\Http\Models - * @mixin Eloquent * @property int $id - * @property string $email 邮箱 - * @property string $username 用户名 - * @property string $password 密码 - * @property int $port 代理端口 - * @property string $passwd 代理密码 - * @property string $vmess_id V2Ray用户ID - * @property int $transfer_enable 可用流量,单位字节,默认1TiB - * @property int $u 已上传流量,单位字节 - * @property int $d 已下载流量,单位字节 - * @property int $t 最后使用时间 - * @property string|null $ip 最后连接IP - * @property int $enable 代理状态 - * @property string $method 加密方式 - * @property string $protocol 协议 - * @property string|null $protocol_param 协议参数 - * @property string $obfs 混淆 - * @property string|null $obfs_param 混淆参数 - * @property int $speed_limit_per_con 单连接限速,默认10G,为0表示不限速,单位Byte - * @property int $speed_limit_per_user 单用户限速,默认10G,为0表示不限速,单位Byte - * @property string|null $wechat 微信 - * @property string|null $qq QQ - * @property string $usage 用途:1-手机、2-电脑、3-路由器、4-其他 - * @property int $pay_way 付费方式:0-免费、1-季付、2-月付、3-半年付、4-年付 - * @property int $balance 余额,单位分 - * @property string|null $enable_time 开通日期 - * @property string $expire_time 过期时间 - * @property int $ban_time 封禁到期时间 - * @property string|null $remark 备注 - * @property int $level 等级:可定义名称 - * @property int $is_admin 是否管理员:0-否、1-是 - * @property string $reg_ip 注册IP - * @property int $last_login 最后登录时间 - * @property int $referral_uid 邀请人 - * @property string|null $reset_time 流量重置日期,NULL表示不重置 - * @property int $invite_num 可生成邀请码数 - * @property int $status 状态:-1-禁用、0-未激活、1-正常 + * @property string $username 昵称 + * @property string $email 邮箱 + * @property string $password 密码 + * @property int $port 代理端口 + * @property string $passwd SS密码 + * @property string $uuid + * @property int $transfer_enable 可用流量,单位字节,默认1TiB + * @property int $u 已上传流量,单位字节 + * @property int $d 已下载流量,单位字节 + * @property int $t 最后使用时间 + * @property string|null $ip 最后连接IP + * @property int $enable SS状态 + * @property string $method 加密方式 + * @property string $protocol 协议 + * @property string $obfs 混淆 + * @property string|null $obfs_param 混淆参数 + * @property int $speed_limit 用户限速,为0表示不限速,单位Byte + * @property string|null $wechat 微信 + * @property string|null $qq QQ + * @property int $usage 用途:1-手机、2-电脑、3-路由器、4-其他 + * @property int $pay_way 付费方式:0-免费、1-季付、2-月付、3-半年付、4-年付 + * @property int $credit 余额,单位分 + * @property string|null $enable_time 开通日期 + * @property string $expire_time 过期时间 + * @property int $ban_time 封禁到期时间 + * @property string|null $remark 备注 + * @property int|null $group_id 所属分组ID + * @property int $level 等级,默认0级,最高9级 + * @property int $is_admin 是否管理员:0-否、1-是 + * @property string $reg_ip 注册IP + * @property int $last_login 最后登录时间 + * @property int $referral_uid 邀请人 + * @property string|null $reset_time 流量重置日期,NULL表示不重置 + * @property int $invite_num 可生成邀请码数 + * @property int $status 状态:-1-禁用、0-未激活、1-正常 * @property string|null $remember_token * @property Carbon|null $created_at * @property Carbon|null $updated_at + * @property mixed $balance * @property-read Collection|UserLabel[] $label * @property-read int|null $label_count - * @property-read Level $levelList + * @property-read Level|null $levelList * @property-read DatabaseNotificationCollection|DatabaseNotification[] $notifications * @property-read int|null $notifications_count * @property-read Collection|Payment[] $payment * @property-read int|null $payment_count - * @property-read User $referral - * @property-read UserSubscribe $subscribe + * @property-read User|null $referral + * @property-read UserSubscribe|null $subscribe * @method static Builder|User newModelQuery() * @method static Builder|User newQuery() * @method static Builder|User query() * @method static Builder|User uid() - * @method static Builder|User whereEmail($value) - * @method static Builder|User whereBalance($value) * @method static Builder|User whereBanTime($value) * @method static Builder|User whereCreatedAt($value) + * @method static Builder|User whereCredit($value) * @method static Builder|User whereD($value) + * @method static Builder|User whereEmail($value) * @method static Builder|User whereEnable($value) * @method static Builder|User whereEnableTime($value) * @method static Builder|User whereExpireTime($value) + * @method static Builder|User whereGroupId($value) * @method static Builder|User whereId($value) * @method static Builder|User whereInviteNum($value) * @method static Builder|User whereIp($value) @@ -93,15 +91,13 @@ use Illuminate\Support\Carbon; * @method static Builder|User wherePayWay($value) * @method static Builder|User wherePort($value) * @method static Builder|User whereProtocol($value) - * @method static Builder|User whereProtocolParam($value) * @method static Builder|User whereQq($value) * @method static Builder|User whereReferralUid($value) * @method static Builder|User whereRegIp($value) * @method static Builder|User whereRemark($value) * @method static Builder|User whereRememberToken($value) * @method static Builder|User whereResetTime($value) - * @method static Builder|User whereSpeedLimitPerCon($value) - * @method static Builder|User whereSpeedLimitPerUser($value) + * @method static Builder|User whereSpeedLimit($value) * @method static Builder|User whereStatus($value) * @method static Builder|User whereT($value) * @method static Builder|User whereTransferEnable($value) @@ -109,53 +105,45 @@ use Illuminate\Support\Carbon; * @method static Builder|User whereUpdatedAt($value) * @method static Builder|User whereUsage($value) * @method static Builder|User whereUsername($value) - * @method static Builder|User whereVmessId($value) + * @method static Builder|User whereUuid($value) * @method static Builder|User whereWechat($value) + * @mixin Eloquent */ -class User extends Authenticatable -{ +class User extends Authenticatable { use Notifiable; protected $table = 'user'; protected $primaryKey = 'id'; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereId(Auth::user()->id); } - function levelList() - { + function levelList() { return $this->hasOne(Level::class, 'level', 'level'); } - function payment() - { + function payment() { return $this->hasMany(Payment::class, 'user_id', 'id'); } - function label() - { + function label() { return $this->hasMany(UserLabel::class, 'user_id', 'id'); } - function subscribe() - { + function subscribe() { return $this->hasOne(UserSubscribe::class, 'user_id', 'id'); } - function referral() - { + function referral() { return $this->hasOne(User::class, 'id', 'referral_uid'); } - function getBalanceAttribute($value) - { - return $value/100; + function getBalanceAttribute($value) { + return $value / 100; } - function setBalanceAttribute($value) - { - return $this->attributes['balance'] = $value*100; + function setBalanceAttribute($value) { + return $this->attributes['balance'] = $value * 100; } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserBalanceLog.php b/app/Http/Models/UserBalanceLog.php index 97bc1f46..f43b94b4 100644 --- a/app/Http/Models/UserBalanceLog.php +++ b/app/Http/Models/UserBalanceLog.php @@ -33,44 +33,36 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|UserBalanceLog whereOrderId($value) * @method static Builder|UserBalanceLog whereUserId($value) */ -class UserBalanceLog extends Model -{ - public $timestamps = FALSE; +class UserBalanceLog extends Model { + public $timestamps = false; protected $table = 'user_balance_log'; protected $primaryKey = 'id'; - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } - function getBeforeAttribute($value) - { - return $value/100; + function getBeforeAttribute($value) { + return $value / 100; } - function setBeforeAttribute($value) - { - return $this->attributes['before'] = $value*100; + function setBeforeAttribute($value) { + return $this->attributes['before'] = $value * 100; } - function getAfterAttribute($value) - { - return $value/100; + function getAfterAttribute($value) { + return $value / 100; } - function setAfterAttribute($value) - { - return $this->attributes['after'] = $value*100; + function setAfterAttribute($value) { + return $this->attributes['after'] = $value * 100; } - function getAmountAttribute($value) - { - return $value/100; + function getAmountAttribute($value) { + return $value / 100; } - function setAmountAttribute($value) - { - return $this->attributes['amount'] = $value*100; + function setAmountAttribute($value) { + return $this->attributes['amount'] = $value * 100; } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserBanLog.php b/app/Http/Models/UserBanLog.php index 46ad425e..d0e6480a 100644 --- a/app/Http/Models/UserBanLog.php +++ b/app/Http/Models/UserBanLog.php @@ -9,36 +9,32 @@ use Illuminate\Support\Carbon; /** * 用户封禁日志 - * Class UserBanLog * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $minutes 封禁账号时长,单位分钟 - * @property string $desc 操作描述 - * @property int $status 状态:0-未处理、1-已处理 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read User $user + * @property int $id + * @property int $user_id 用户ID + * @property int $minutes 封禁账号时长,单位分钟 + * @property string $description 操作描述 + * @property int $status 状态:0-未处理、1-已处理 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read User|null $user * @method static Builder|UserBanLog newModelQuery() * @method static Builder|UserBanLog newQuery() * @method static Builder|UserBanLog query() * @method static Builder|UserBanLog whereCreatedAt($value) - * @method static Builder|UserBanLog whereDesc($value) + * @method static Builder|UserBanLog whereDescription($value) * @method static Builder|UserBanLog whereId($value) * @method static Builder|UserBanLog whereMinutes($value) * @method static Builder|UserBanLog whereStatus($value) * @method static Builder|UserBanLog whereUpdatedAt($value) * @method static Builder|UserBanLog whereUserId($value) + * @mixin Eloquent */ -class UserBanLog extends Model -{ +class UserBanLog extends Model { protected $table = 'user_ban_log'; protected $primaryKey = 'id'; - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserLabel.php b/app/Http/Models/UserLabel.php index 4e93049b..38284307 100644 --- a/app/Http/Models/UserLabel.php +++ b/app/Http/Models/UserLabel.php @@ -9,35 +9,24 @@ use Illuminate\Database\Eloquent\Model; /** * 用户标签 - * Class UserLabel * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $label_id 标签ID - * @property-read User $user + * @property-read User|null $user * @method static Builder|UserLabel newModelQuery() * @method static Builder|UserLabel newQuery() * @method static Builder|UserLabel query() * @method static Builder|UserLabel uid() - * @method static Builder|UserLabel whereId($value) - * @method static Builder|UserLabel whereLabelId($value) - * @method static Builder|UserLabel whereUserId($value) + * @mixin Eloquent */ -class UserLabel extends Model -{ - public $timestamps = FALSE; +class UserLabel extends Model { + public $timestamps = false; protected $table = 'user_label'; protected $primaryKey = 'id'; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUserId(Auth::user()->id); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserLoginLog.php b/app/Http/Models/UserLoginLog.php index 408f81ea..bae8cb07 100644 --- a/app/Http/Models/UserLoginLog.php +++ b/app/Http/Models/UserLoginLog.php @@ -9,22 +9,19 @@ use Illuminate\Support\Carbon; /** * 用户登录日志 - * Class UserLoginLog * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id - * @property string $ip - * @property string $country - * @property string $province - * @property string $city - * @property string $county - * @property string $isp - * @property string $area - * @property Carbon $created_at - * @property Carbon $updated_at - * @property-read User $user + * @property int $id + * @property int $user_id + * @property string $ip + * @property string $country + * @property string $province + * @property string $city + * @property string $county + * @property string $isp + * @property string $area + * @property Carbon $created_at + * @property Carbon $updated_at + * @property-read User|null $user * @method static Builder|UserLoginLog newModelQuery() * @method static Builder|UserLoginLog newQuery() * @method static Builder|UserLoginLog query() @@ -39,14 +36,13 @@ use Illuminate\Support\Carbon; * @method static Builder|UserLoginLog whereProvince($value) * @method static Builder|UserLoginLog whereUpdatedAt($value) * @method static Builder|UserLoginLog whereUserId($value) + * @mixin Eloquent */ -class UserLoginLog extends Model -{ +class UserLoginLog extends Model { protected $table = 'user_login_log'; protected $primaryKey = 'id'; - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserSubscribe.php b/app/Http/Models/UserSubscribe.php index 767ff8e9..8cfe2e2a 100644 --- a/app/Http/Models/UserSubscribe.php +++ b/app/Http/Models/UserSubscribe.php @@ -10,20 +10,17 @@ use Illuminate\Support\Carbon; /** * 用户订阅地址 - * Class UserSubscribe * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property string|null $code 订阅地址唯一识别码 - * @property int $times 地址请求次数 - * @property int $status 状态:0-禁用、1-启用 - * @property int $ban_time 封禁时间 - * @property string $ban_desc 封禁理由 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read User $user + * @property int $id + * @property int $user_id 用户ID + * @property string|null $code 订阅地址唯一识别码 + * @property int $times 地址请求次数 + * @property int $status 状态:0-禁用、1-启用 + * @property int $ban_time 封禁时间 + * @property string $ban_desc 封禁理由 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read User|null $user * @method static Builder|UserSubscribe newModelQuery() * @method static Builder|UserSubscribe newQuery() * @method static Builder|UserSubscribe query() @@ -37,19 +34,17 @@ use Illuminate\Support\Carbon; * @method static Builder|UserSubscribe whereTimes($value) * @method static Builder|UserSubscribe whereUpdatedAt($value) * @method static Builder|UserSubscribe whereUserId($value) + * @mixin Eloquent */ -class UserSubscribe extends Model -{ +class UserSubscribe extends Model { protected $table = 'user_subscribe'; protected $primaryKey = 'id'; - function scopeUid($query) - { + function scopeUid($query) { return $query->whereUserId(Auth::user()->id); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserSubscribeLog.php b/app/Http/Models/UserSubscribeLog.php index b6d6a909..bc2034e0 100644 --- a/app/Http/Models/UserSubscribeLog.php +++ b/app/Http/Models/UserSubscribeLog.php @@ -9,10 +9,7 @@ use Illuminate\Database\Eloquent\Model; /** * 用户订阅地址请求日志 - * Class UserSubscribeLog * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int|null $sid 对应user_subscribe的id * @property string|null $request_ip 请求IP @@ -28,15 +25,14 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|UserSubscribeLog whereRequestIp($value) * @method static Builder|UserSubscribeLog whereRequestTime($value) * @method static Builder|UserSubscribeLog whereSid($value) + * @mixin Eloquent */ -class UserSubscribeLog extends Model -{ - public $timestamps = FALSE; +class UserSubscribeLog extends Model { + public $timestamps = false; protected $table = 'user_subscribe_log'; protected $primaryKey = 'id'; - function user() - { + function user() { return $this->hasManyThrough(User::class, UserSubscribe::class, 'id', 'id', 'sid', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserTrafficDaily.php b/app/Http/Models/UserTrafficDaily.php index dd6661d1..136e26e2 100644 --- a/app/Http/Models/UserTrafficDaily.php +++ b/app/Http/Models/UserTrafficDaily.php @@ -9,20 +9,17 @@ use Illuminate\Support\Carbon; /** * 用户每日流量统计 - * Class UserTrafficDaily * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $node_id 节点ID,0表示统计全部节点 - * @property int $u 上传流量 - * @property int $d 下载流量 - * @property int $total 总流量 - * @property string|null $traffic 总流量(带单位) - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read SsNode $node + * @property int $id + * @property int $user_id 用户ID + * @property int $node_id 节点ID,0表示统计全部节点 + * @property int $u 上传流量 + * @property int $d 下载流量 + * @property int $total 总流量 + * @property string|null $traffic 总流量(带单位) + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read SsNode|null $node * @method static Builder|UserTrafficDaily newModelQuery() * @method static Builder|UserTrafficDaily newQuery() * @method static Builder|UserTrafficDaily query() @@ -35,14 +32,13 @@ use Illuminate\Support\Carbon; * @method static Builder|UserTrafficDaily whereU($value) * @method static Builder|UserTrafficDaily whereUpdatedAt($value) * @method static Builder|UserTrafficDaily whereUserId($value) + * @mixin Eloquent */ -class UserTrafficDaily extends Model -{ +class UserTrafficDaily extends Model { protected $table = 'user_traffic_daily'; protected $primaryKey = 'id'; - function node() - { + function node() { return $this->hasOne(SsNode::class, 'id', 'node_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserTrafficHourly.php b/app/Http/Models/UserTrafficHourly.php index bf5a89f3..29081ad0 100644 --- a/app/Http/Models/UserTrafficHourly.php +++ b/app/Http/Models/UserTrafficHourly.php @@ -9,20 +9,17 @@ use Illuminate\Support\Carbon; /** * 用户流量每小时统计 - * Class Article * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $node_id 节点ID,0表示统计全部节点 - * @property int $u 上传流量 - * @property int $d 下载流量 - * @property int $total 总流量 - * @property string|null $traffic 总流量(带单位) - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read SsNode $node + * @property int $id + * @property int $user_id 用户ID + * @property int $node_id 节点ID,0表示统计全部节点 + * @property int $u 上传流量 + * @property int $d 下载流量 + * @property int $total 总流量 + * @property string|null $traffic 总流量(带单位) + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read SsNode|null $node * @method static Builder|UserTrafficHourly newModelQuery() * @method static Builder|UserTrafficHourly newQuery() * @method static Builder|UserTrafficHourly query() @@ -35,14 +32,13 @@ use Illuminate\Support\Carbon; * @method static Builder|UserTrafficHourly whereU($value) * @method static Builder|UserTrafficHourly whereUpdatedAt($value) * @method static Builder|UserTrafficHourly whereUserId($value) + * @mixin Eloquent */ -class UserTrafficHourly extends Model -{ +class UserTrafficHourly extends Model { protected $table = 'user_traffic_hourly'; protected $primaryKey = 'id'; - function node() - { + function node() { return $this->hasOne(SsNode::class, 'id', 'node_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserTrafficLog.php b/app/Http/Models/UserTrafficLog.php index 7995d949..284a91ff 100644 --- a/app/Http/Models/UserTrafficLog.php +++ b/app/Http/Models/UserTrafficLog.php @@ -8,16 +8,13 @@ use Illuminate\Database\Eloquent\Model; /** * 用户流量记录 - * Class UserTrafficLog * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property int $user_id 用户ID * @property int $u 上传流量 * @property int $d 下载流量 * @property int $node_id 节点ID - * @property float $rate 流量比例 + * @property float $rate 倍率 * @property string $traffic 产生流量 * @property int $log_time 记录时间 * @property-read SsNode $node @@ -33,24 +30,22 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|UserTrafficLog whereTraffic($value) * @method static Builder|UserTrafficLog whereU($value) * @method static Builder|UserTrafficLog whereUserId($value) + * @mixin Eloquent */ -class UserTrafficLog extends Model -{ - public $timestamps = FALSE; +class UserTrafficLog extends Model { + public $timestamps = false; protected $table = 'user_traffic_log'; protected $primaryKey = 'id'; // 关联账号 - function user() - { + function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } // 关联节点 - function node() - { + function node() { return $this->belongsTo(SsNode::class, 'node_id', 'id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/UserTrafficModifyLog.php b/app/Http/Models/UserTrafficModifyLog.php index 19916238..3c755872 100644 --- a/app/Http/Models/UserTrafficModifyLog.php +++ b/app/Http/Models/UserTrafficModifyLog.php @@ -9,57 +9,50 @@ use Illuminate\Support\Carbon; /** * 用户流量变动记录 - * Class UserTrafficModifyLog * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $user_id 用户ID - * @property int $order_id 发生的订单ID - * @property int $before 操作前流量 - * @property int $after 操作后流量 - * @property string $desc 描述 - * @property Carbon $created_at - * @property Carbon $updated_at - * @property-read Order $order - * @property-read User $user + * @property int $id + * @property int $user_id 用户ID + * @property int $order_id 发生的订单ID + * @property int $before 操作前流量 + * @property int $after 操作后流量 + * @property string $description 描述 + * @property Carbon $created_at + * @property Carbon $updated_at + * @property-read Order|null $order + * @property-read User|null $user * @method static Builder|UserTrafficModifyLog newModelQuery() * @method static Builder|UserTrafficModifyLog newQuery() * @method static Builder|UserTrafficModifyLog query() * @method static Builder|UserTrafficModifyLog whereAfter($value) * @method static Builder|UserTrafficModifyLog whereBefore($value) * @method static Builder|UserTrafficModifyLog whereCreatedAt($value) - * @method static Builder|UserTrafficModifyLog whereDesc($value) + * @method static Builder|UserTrafficModifyLog whereDescription($value) * @method static Builder|UserTrafficModifyLog whereId($value) * @method static Builder|UserTrafficModifyLog whereOrderId($value) * @method static Builder|UserTrafficModifyLog whereUpdatedAt($value) * @method static Builder|UserTrafficModifyLog whereUserId($value) + * @mixin Eloquent */ -class UserTrafficModifyLog extends Model -{ +class UserTrafficModifyLog extends Model { protected $table = 'user_traffic_modify_log'; protected $primaryKey = 'id'; // 关联账号 - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } // 关联订单 - function order() - { + function order() { return $this->hasOne(Order::class, 'oid', 'order_id'); } - function getBeforeAttribute($value) - { + function getBeforeAttribute($value) { return $this->attributes['before'] = flowAutoShow($value); } - function getAfterAttribute($value) - { + function getAfterAttribute($value) { return $this->attributes['after'] = flowAutoShow($value); } -} \ No newline at end of file +} diff --git a/app/Http/Models/Verify.php b/app/Http/Models/Verify.php index 9f1e6c60..6a967ea2 100644 --- a/app/Http/Models/Verify.php +++ b/app/Http/Models/Verify.php @@ -9,18 +9,15 @@ use Illuminate\Support\Carbon; /** * 注册时的验证激活地址 - * Class Verify * - * @package App\Http\Models - * @mixin Eloquent - * @property int $id - * @property int $type 激活类型:1-自行激活、2-管理员激活 - * @property int $user_id 用户ID - * @property string $token 校验token - * @property int $status 状态:0-未使用、1-已使用、2-已失效 - * @property Carbon|null $created_at 创建时间 - * @property Carbon|null $updated_at 最后更新时间 - * @property-read User $user + * @property int $id + * @property int $type 激活类型:1-自行激活、2-管理员激活 + * @property int $user_id 用户ID + * @property string $token 校验token + * @property int $status 状态:0-未使用、1-已使用、2-已失效 + * @property Carbon|null $created_at 创建时间 + * @property Carbon|null $updated_at 最后更新时间 + * @property-read User|null $user * @method static Builder|Verify newModelQuery() * @method static Builder|Verify newQuery() * @method static Builder|Verify query() @@ -32,21 +29,19 @@ use Illuminate\Support\Carbon; * @method static Builder|Verify whereType($value) * @method static Builder|Verify whereUpdatedAt($value) * @method static Builder|Verify whereUserId($value) + * @mixin Eloquent */ -class Verify extends Model -{ +class Verify extends Model { protected $table = 'verify'; protected $primaryKey = 'id'; // 筛选类型 - function scopeType($query, $type) - { + function scopeType($query, $type) { return $query->whereType($type); } - function user() - { + function user() { return $this->hasOne(User::class, 'id', 'user_id'); } -} \ No newline at end of file +} diff --git a/app/Http/Models/VerifyCode.php b/app/Http/Models/VerifyCode.php index 4edf5e23..0a354359 100644 --- a/app/Http/Models/VerifyCode.php +++ b/app/Http/Models/VerifyCode.php @@ -9,10 +9,7 @@ use Illuminate\Support\Carbon; /** * 注册时的激活验证码 - * Class VerifyCode * - * @package App\Http\Models - * @mixin Eloquent * @property int $id * @property string $address 用户邮箱 * @property string $code 验证码 @@ -22,17 +19,16 @@ use Illuminate\Support\Carbon; * @method static Builder|VerifyCode newModelQuery() * @method static Builder|VerifyCode newQuery() * @method static Builder|VerifyCode query() + * @method static Builder|VerifyCode whereAddress($value) * @method static Builder|VerifyCode whereCode($value) * @method static Builder|VerifyCode whereCreatedAt($value) * @method static Builder|VerifyCode whereId($value) * @method static Builder|VerifyCode whereStatus($value) * @method static Builder|VerifyCode whereUpdatedAt($value) - * @method static Builder|VerifyCode whereUsername($value) - * @method static Builder|VerifyCode whereAddress($value) + * @mixin Eloquent */ -class VerifyCode extends Model -{ +class VerifyCode extends Model { protected $table = 'verify_code'; protected $primaryKey = 'id'; -} \ No newline at end of file +} diff --git a/app/Listeners/EventListener.php b/app/Listeners/EventListener.php index 6959c341..b2a3b861 100644 --- a/app/Listeners/EventListener.php +++ b/app/Listeners/EventListener.php @@ -4,27 +4,24 @@ namespace App\Listeners; use App\Events\Event; -class EventListener -{ +class EventListener { /** * Create the event listener. * * @return void */ - public function __construct() - { + public function __construct() { // } /** * Handle the event. * - * @param Event $event + * @param Event $event * * @return void */ - public function handle(Event $event) - { + public function handle(Event $event) { // } } diff --git a/app/Listeners/LogSendingMessage.php b/app/Listeners/LogSendingMessage.php index ca607194..228f9e11 100644 --- a/app/Listeners/LogSendingMessage.php +++ b/app/Listeners/LogSendingMessage.php @@ -4,27 +4,24 @@ namespace App\Listeners; use Illuminate\Mail\Events\MessageSending; -class LogSendingMessage -{ +class LogSendingMessage { /** * Create the event listener. * * @return void */ - public function __construct() - { + public function __construct() { // } /** * Handle the event. * - * @param MessageSending $event + * @param MessageSending $event * * @return void */ - public function handle(MessageSending $event) - { + public function handle(MessageSending $event) { //\Log::info('MessageSending:' . var_export($event->data, true)); } } diff --git a/app/Listeners/LogSentMessage.php b/app/Listeners/LogSentMessage.php index 44d44e40..1a153d2a 100644 --- a/app/Listeners/LogSentMessage.php +++ b/app/Listeners/LogSentMessage.php @@ -4,27 +4,24 @@ namespace App\Listeners; use Illuminate\Mail\Events\MessageSent; -class LogSentMessage -{ +class LogSentMessage { /** * Create the event listener. * * @return void */ - public function __construct() - { + public function __construct() { // } /** * Handle the event. * - * @param MessageSent $event + * @param MessageSent $event * * @return void */ - public function handle(MessageSent $event) - { + public function handle(MessageSent $event) { //\Log::info('MessageSent:' . var_export($event, true)); } } diff --git a/app/Mail/activeUser.php b/app/Mail/activeUser.php index b595c288..ca6bbef1 100644 --- a/app/Mail/activeUser.php +++ b/app/Mail/activeUser.php @@ -9,29 +9,25 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class activeUser extends Mailable implements ShouldQueue -{ +class activeUser extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $activeUserUrl; // 激活用户URL - public function __construct($id, $activeUserUrl) - { + public function __construct($id, $activeUserUrl) { $this->id = $id; $this->activeUserUrl = $activeUserUrl; } - public function build() - { + public function build() { return $this->view('emails.activeUser')->subject('激活账号')->with([ - 'activeUserUrl' => $this->activeUserUrl - ]); + 'activeUserUrl' => $this->activeUserUrl + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/closeTicket.php b/app/Mail/closeTicket.php index 7df0988f..f725ffa4 100644 --- a/app/Mail/closeTicket.php +++ b/app/Mail/closeTicket.php @@ -9,32 +9,28 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class closeTicket extends Mailable implements ShouldQueue -{ +class closeTicket extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $title; // 工单标题 protected $content; // 工单内容 - public function __construct($id, $title, $content) - { + public function __construct($id, $title, $content) { $this->id = $id; $this->title = $title; $this->content = $content; } - public function build() - { + public function build() { return $this->view('emails.closeTicket')->subject('工单关闭提醒')->with([ - 'title' => $this->title, - 'content' => $this->content - ]); + 'title' => $this->title, + 'content' => $this->content + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/newTicket.php b/app/Mail/newTicket.php index 68c2c049..d35ba0df 100644 --- a/app/Mail/newTicket.php +++ b/app/Mail/newTicket.php @@ -9,32 +9,28 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class newTicket extends Mailable implements ShouldQueue -{ +class newTicket extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $title; // 工单标题 protected $content; // 工单内容 - public function __construct($id, $title, $content) - { + public function __construct($id, $title, $content) { $this->id = $id; $this->title = $title; $this->content = $content; } - public function build() - { + public function build() { return $this->view('emails.newTicket')->subject('新工单提醒')->with([ - 'title' => $this->title, - 'content' => $this->content - ]); + 'title' => $this->title, + 'content' => $this->content + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/nodeCrashWarning.php b/app/Mail/nodeCrashWarning.php index e099c1b6..723dcc94 100644 --- a/app/Mail/nodeCrashWarning.php +++ b/app/Mail/nodeCrashWarning.php @@ -9,26 +9,26 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class nodeCrashWarning extends Mailable implements ShouldQueue -{ +class nodeCrashWarning extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID - public function __construct($id) - { + public function __construct($id) { $this->id = $id; } - public function build() - { + public function build() { - return $this->view('emails.nodeCrashWarning')->subject('节点阻断警告')->with(['content' => NotificationLog::query()->whereId($this->id)->first()->content]); + return $this->view('emails.nodeCrashWarning')->subject('节点阻断警告')->with([ + 'content' => NotificationLog::query() + ->whereId($this->id) + ->first()->content + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/replyTicket.php b/app/Mail/replyTicket.php index 79dd60c5..68e6f7fe 100644 --- a/app/Mail/replyTicket.php +++ b/app/Mail/replyTicket.php @@ -9,32 +9,28 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class replyTicket extends Mailable implements ShouldQueue -{ +class replyTicket extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $title; // 工单标题 protected $content; // 工单内容 - public function __construct($id, $title, $content) - { + public function __construct($id, $title, $content) { $this->id = $id; $this->title = $title; $this->content = $content; } - public function build() - { + public function build() { return $this->view('emails.replyTicket')->subject('工单回复提醒')->with([ - 'title' => $this->title, - 'content' => $this->content - ]); + 'title' => $this->title, + 'content' => $this->content + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/resetPassword.php b/app/Mail/resetPassword.php index c31be0d7..8d54bb45 100644 --- a/app/Mail/resetPassword.php +++ b/app/Mail/resetPassword.php @@ -9,29 +9,25 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class resetPassword extends Mailable implements ShouldQueue -{ +class resetPassword extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $resetPasswordUrl; // 重置密码URL - public function __construct($id, $resetPasswordUrl) - { + public function __construct($id, $resetPasswordUrl) { $this->id = $id; $this->resetPasswordUrl = $resetPasswordUrl; } - public function build() - { + public function build() { return $this->view('emails.resetPassword')->subject('重置密码')->with([ - 'resetPasswordUrl' => $this->resetPasswordUrl - ]); + 'resetPasswordUrl' => $this->resetPasswordUrl + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/sendUserInfo.php b/app/Mail/sendUserInfo.php index 46622652..0bc6eb28 100644 --- a/app/Mail/sendUserInfo.php +++ b/app/Mail/sendUserInfo.php @@ -9,29 +9,25 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class sendUserInfo extends Mailable implements ShouldQueue -{ +class sendUserInfo extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $content; // 账号信息 - public function __construct($id, $content) - { + public function __construct($id, $content) { $this->id = $id; $this->content = $content; } - public function build() - { + public function build() { return $this->view('emails.sendUserInfo')->subject('发送账号信息')->with([ - 'content' => $this->content - ]); + 'content' => $this->content + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/sendVerifyCode.php b/app/Mail/sendVerifyCode.php index 539a382f..5ac8c06d 100644 --- a/app/Mail/sendVerifyCode.php +++ b/app/Mail/sendVerifyCode.php @@ -9,29 +9,25 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class sendVerifyCode extends Mailable implements ShouldQueue -{ +class sendVerifyCode extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $code; // 要发送的验证码 - public function __construct($id, $code) - { + public function __construct($id, $code) { $this->id = $id; $this->code = $code; } - public function build() - { + public function build() { return $this->view('emails.sendVerifyCode')->subject('发送注册验证码')->with([ - 'code' => $this->code - ]); + 'code' => $this->code + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/userExpireWarning.php b/app/Mail/userExpireWarning.php index 0f71c703..b7be9131 100644 --- a/app/Mail/userExpireWarning.php +++ b/app/Mail/userExpireWarning.php @@ -9,29 +9,25 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class userExpireWarning extends Mailable implements ShouldQueue -{ +class userExpireWarning extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $lastCanUseDays; // 剩余可用天数 - public function __construct($id, $lastCanUseDays) - { + public function __construct($id, $lastCanUseDays) { $this->id = $id; $this->lastCanUseDays = $lastCanUseDays; } - public function build() - { + public function build() { return $this->view('emails.userExpireWarning')->subject('账号过期提醒')->with([ - 'lastCanUseDays' => $this->lastCanUseDays - ]); + 'lastCanUseDays' => $this->lastCanUseDays + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/userExpireWarningToday.php b/app/Mail/userExpireWarningToday.php index ae42a725..94ce1b01 100644 --- a/app/Mail/userExpireWarningToday.php +++ b/app/Mail/userExpireWarningToday.php @@ -9,25 +9,21 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class userExpireWarningToday extends Mailable implements ShouldQueue -{ +class userExpireWarningToday extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID - public function __construct($id) - { + public function __construct($id) { $this->id = $id; } - public function build() - { + public function build() { return $this->view('emails.userExpireWarningToday')->subject('账号过期提醒'); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/userTrafficWarning.php b/app/Mail/userTrafficWarning.php index 3bfb870d..f10441ef 100644 --- a/app/Mail/userTrafficWarning.php +++ b/app/Mail/userTrafficWarning.php @@ -9,29 +9,25 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -class userTrafficWarning extends Mailable implements ShouldQueue -{ +class userTrafficWarning extends Mailable implements ShouldQueue { use Queueable, SerializesModels; protected $id; // 邮件记录ID protected $usedPercent; // 已使用百分比 - public function __construct($id, $usedPercent) - { + public function __construct($id, $usedPercent) { $this->id = $id; $this->usedPercent = $usedPercent; } - public function build() - { + public function build() { return $this->view('emails.userTrafficWarning')->subject('流量警告')->with([ - 'usedPercent' => $this->usedPercent - ]); + 'usedPercent' => $this->usedPercent + ]); } // 发件失败处理 - public function failed(Exception $e) - { + public function failed(Exception $e) { NotificationLog::query()->whereId($this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index cb76a538..ecf758e7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -6,17 +6,15 @@ use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider; use Illuminate\Support\ServiceProvider; use URL; -class AppServiceProvider extends ServiceProvider -{ +class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ - public function boot() - { + public function boot() { // 检测是否强制跳转https - if(env('REDIRECT_HTTPS', FALSE)){ + if(env('REDIRECT_HTTPS', false)){ URL::forceScheme('https'); } @@ -28,8 +26,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function register() - { + public function register() { if($this->app->environment() !== 'production'){ $this->app->register(IdeHelperServiceProvider::class); } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 4649c6c7..e7a8cfc6 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -4,8 +4,7 @@ namespace App\Providers; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -class AuthServiceProvider extends ServiceProvider -{ +class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * @@ -20,8 +19,7 @@ class AuthServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { $this->registerPolicies(); // diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 0546ead6..c6ab6eb2 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -5,15 +5,13 @@ namespace App\Providers; use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\ServiceProvider; -class BroadcastServiceProvider extends ServiceProvider -{ +class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ - public function boot() - { + public function boot() { Broadcast::routes(); require base_path('routes/channels.php'); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 82ba7e79..d485a5e1 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ namespace App\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { /** * The event listener mappings for the application. * @@ -28,8 +27,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); // diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 04e276b1..ca3ede43 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -5,8 +5,7 @@ namespace App\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { /** * This namespace is applied to your controller routes. * @@ -21,8 +20,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { // parent::boot(); @@ -33,8 +31,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function map() - { + public function map() { $this->mapApiRoutes(); $this->mapWebRoutes(); @@ -49,12 +46,8 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapApiRoutes() - { - Route::prefix('api') - ->middleware('api') - ->namespace($this->namespace) - ->group(base_path('routes/api.php')); + protected function mapApiRoutes() { + Route::prefix('api')->middleware('api')->namespace($this->namespace)->group(base_path('routes/api.php')); } /** @@ -64,10 +57,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapWebRoutes() - { - Route::middleware('web') - ->namespace($this->namespace) - ->group(base_path('routes/web.php')); + protected function mapWebRoutes() { + Route::middleware('web')->namespace($this->namespace)->group(base_path('routes/web.php')); } } diff --git a/app/helpers.php b/app/helpers.php index 59c05ff8..220d66ad 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -4,8 +4,7 @@ use App\Components\Curl; // 生成SS密码 if(!function_exists('makeRandStr')){ - function makeRandStr($length = 6, $isNumbers = FALSE) - { + function makeRandStr($length = 6, $isNumbers = false) { // 密码字符集,可任意添加你需要的字符 if(!$isNumbers){ $chars = 'abcdefghijkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789'; @@ -15,7 +14,7 @@ if(!function_exists('makeRandStr')){ $char = ''; for($i = 0; $i < $length; $i++){ - $char .= $chars[mt_rand(0, strlen($chars)-1)]; + $char .= $chars[mt_rand(0, strlen($chars) - 1)]; } return $char; @@ -24,39 +23,36 @@ if(!function_exists('makeRandStr')){ // base64加密(处理URL) if(!function_exists('base64url_encode')){ - function base64url_encode($data) - { + function base64url_encode($data) { return strtr(base64_encode($data), ['+' => '-', '/' => '_', '=' => '']); } } // base64解密(处理URL) if(!function_exists('base64url_decode')){ - function base64url_decode($data) - { + function base64url_decode($data) { return base64_decode(strtr($data, '-_', '+/')); } } // 根据流量值自动转换单位输出 if(!function_exists('flowAutoShow')){ - function flowAutoShow($value = 0) - { + function flowAutoShow($value = 0) { $kb = 1024; $mb = 1048576; $gb = 1073741824; - $tb = $gb*1024; - $pb = $tb*1024; + $tb = $gb * 1024; + $pb = $tb * 1024; if(abs($value) >= $pb){ - return round($value/$pb, 2)."PB"; + return round($value / $pb, 2)."PB"; }elseif(abs($value) >= $tb){ - return round($value/$tb, 2)."TB"; + return round($value / $tb, 2)."TB"; }elseif(abs($value) >= $gb){ - return round($value/$gb, 2)."GB"; + return round($value / $gb, 2)."GB"; }elseif(abs($value) >= $mb){ - return round($value/$mb, 2)."MB"; + return round($value / $mb, 2)."MB"; }elseif(abs($value) >= $kb){ - return round($value/$kb, 2)."KB"; + return round($value / $kb, 2)."KB"; }else{ return round($value, 2)."B"; } @@ -64,40 +60,36 @@ if(!function_exists('flowAutoShow')){ } if(!function_exists('toMB')){ - function toMB($traffic) - { + function toMB($traffic) { $mb = 1048576; - return $traffic*$mb; + return $traffic * $mb; } } if(!function_exists('toGB')){ - function toGB($traffic) - { - $gb = 1048576*1024; + function toGB($traffic) { + $gb = 1048576 * 1024; - return $traffic*$gb; + return $traffic * $gb; } } if(!function_exists('flowToGB')){ - function flowToGB($traffic) - { - $gb = 1048576*1024; + function flowToGB($traffic) { + $gb = 1048576 * 1024; - return $traffic/$gb; + return $traffic / $gb; } } // 文件大小转换 if(!function_exists('formatBytes')){ - function formatBytes($bytes, $precision = 2) - { + function formatBytes($bytes, $precision = 2) { $units = ['B', 'KB', 'MB', 'GB', 'TB']; $bytes = max($bytes, 0); - $pow = floor(($bytes? log($bytes) : 0)/log(1024)); - $pow = min($pow, count($units)-1); + $pow = floor(($bytes? log($bytes) : 0) / log(1024)); + $pow = min($pow, count($units) - 1); $bytes /= pow(1024, $pow); return round($bytes, $precision).' '.$units[$pow]; @@ -106,11 +98,10 @@ if(!function_exists('formatBytes')){ // 秒转时间 if(!function_exists('seconds2time')){ - function seconds2time($seconds) - { - $day = floor($seconds/(3600*24)); - $hour = floor(($seconds%(3600*24))/3600); - $minute = floor((($seconds%(3600*24))%3600)/60); + function seconds2time($seconds) { + $day = floor($seconds / (3600 * 24)); + $hour = floor(($seconds % (3600 * 24)) / 3600); + $minute = floor((($seconds % (3600 * 24)) % 3600) / 60); if($day > 0){ return $day.'天'.$hour.'小时'.$minute.'分'; }else{ @@ -125,8 +116,7 @@ if(!function_exists('seconds2time')){ // 获取访客真实IP if(!function_exists('getClientIP')){ - function getClientIP() - { + function getClientIP() { /* * 访问时用localhost访问的,读出来的是“::1”是正常情况 * ::1说明开启了IPv6支持,这是IPv6下的本地回环地址的表示 @@ -193,12 +183,11 @@ if(!function_exists('getIPv6')){ * "country_code": "CN" * } */ - function getIPv6($ip) - { + function getIPv6($ip) { $url = 'https://api.ip.sb/geoip/'.$ip; try{ - $result = json_decode(Curl::send($url), TRUE); + $result = json_decode(Curl::send($url), true); if(!is_array($result) || isset($result['code'])){ throw new Exception('解析IPv6异常:'.$ip); } @@ -214,16 +203,15 @@ if(!function_exists('getIPv6')){ // 随机UUID if(!function_exists('createGuid')){ - function createGuid() - { - mt_srand((double)microtime()*10000); - $charid = strtoupper(md5(uniqid(rand(), TRUE))); + function createGuid() { + mt_srand((double) microtime() * 10000); + $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45); - $uuid = substr($charid, 0, 8).$hyphen - .substr($charid, 8, 4).$hyphen - .substr($charid, 12, 4).$hyphen - .substr($charid, 16, 4).$hyphen - .substr($charid, 20, 12); + $uuid = substr($charid, 0, 8).$hyphen.substr($charid, 8, 4).$hyphen.substr($charid, 12, + 4).$hyphen.substr($charid, 16, + 4).$hyphen.substr($charid, + 20, + 12); return strtolower($uuid); } @@ -231,13 +219,10 @@ if(!function_exists('createGuid')){ // 过滤emoji表情 if(!function_exists('filterEmoji')){ - function filterEmoji($str) - { - $str = preg_replace_callback('/./u', - function(array $match){ - return strlen($match[0]) >= 4? '' : $match[0]; - }, - $str); + function filterEmoji($str) { + $str = preg_replace_callback('/./u', function(array $match) { + return strlen($match[0]) >= 4? '' : $match[0]; + }, $str); return $str; } @@ -245,12 +230,12 @@ if(!function_exists('filterEmoji')){ // 验证手机号是否正确 if(!function_exists('isMobile')){ - function isMobile($mobile) - { + function isMobile($mobile) { if(!is_numeric($mobile)){ - return FALSE; + return false; } - return preg_match('#^13[\d]{9}$|^14[5,7]{1}\d{8}$|^15[^4]{1}\d{8}$|^17[0,6,7,8]{1}\d{8}$|^18[\d]{9}$#', $mobile)? TRUE : FALSE; + return preg_match('#^13[\d]{9}$|^14[5,7]{1}\d{8}$|^15[^4]{1}\d{8}$|^17[0,6,7,8]{1}\d{8}$|^18[\d]{9}$#', + $mobile)? true : false; } } diff --git a/bootstrap/app.php b/bootstrap/app.php index f2801adf..9c879ffe 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -12,7 +12,7 @@ */ $app = new Illuminate\Foundation\Application( - realpath(__DIR__.'/../') + realpath(__DIR__ . '/../') ); /* diff --git a/config/HCaptcha.php b/config/HCaptcha.php index 0abb5a2a..30ccd3c4 100644 --- a/config/HCaptcha.php +++ b/config/HCaptcha.php @@ -1,10 +1,10 @@ env('HCAPTCHA_SECRET'), - 'sitekey' => env('HCAPTCHA_SITEKEY'), - 'server-get-config' => TRUE, - 'options' => [ - 'timeout' => 30, - ], + 'secret' => env('HCAPTCHA_SECRET'), + 'sitekey' => env('HCAPTCHA_SITEKEY'), + 'server-get-config' => TRUE, + 'options' => [ + 'timeout' => 30, + ], ]; diff --git a/config/NoCaptcha.php b/config/NoCaptcha.php index 9fa4d566..e87d496b 100644 --- a/config/NoCaptcha.php +++ b/config/NoCaptcha.php @@ -1,10 +1,10 @@ env('NOCAPTCHA_SECRET'), - 'sitekey' => env('NOCAPTCHA_SITEKEY'), - 'server-get-config' => TRUE, - 'options' => [ - 'timeout' => 30, - ], + 'secret' => env('NOCAPTCHA_SECRET'), + 'sitekey' => env('NOCAPTCHA_SITEKEY'), + 'server-get-config' => TRUE, + 'options' => [ + 'timeout' => 30, + ], ]; diff --git a/config/app.php b/config/app.php index ba57811f..7407db2e 100644 --- a/config/app.php +++ b/config/app.php @@ -2,228 +2,228 @@ return [ - /* - |-------------------------------------------------------------------------- - | Application Name - |-------------------------------------------------------------------------- - | - | This value is the name of your application. This value is used when the - | framework needs to place the application's name in a notification or - | any other location as required by the application or its packages. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Name + |-------------------------------------------------------------------------- + | + | This value is the name of your application. This value is used when the + | framework needs to place the application's name in a notification or + | any other location as required by the application or its packages. + | + */ - 'name' => env('APP_NAME', 'Laravel'), + 'name' => env('APP_NAME', 'Laravel'), - /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services your application utilizes. Set this in your ".env" file. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services your application utilizes. Set this in your ".env" file. + | + */ - 'env' => env('APP_ENV', 'production'), + 'env' => env('APP_ENV', 'production'), - /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ - 'debug' => env('APP_DEBUG', FALSE), + 'debug' => env('APP_DEBUG', FALSE), - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ - 'url' => env('APP_URL', 'http://localhost'), + 'url' => env('APP_URL', 'http://localhost'), - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ - 'timezone' => env('APP_TIMEZONE', 'UTC'), + 'timezone' => env('APP_TIMEZONE', 'UTC'), - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ - 'locale' => env('APP_LOCALE', 'en'), + 'locale' => env('APP_LOCALE', 'en'), - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ - 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'zh-CN'), + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'zh-CN'), - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ - 'key' => env('APP_KEY'), + 'key' => env('APP_KEY'), - 'cipher' => 'AES-256-CBC', + 'cipher' => 'AES-256-CBC', - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ - 'providers' => [ + 'providers' => [ - /* - * Laravel Framework Service Providers... - */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - // Illuminate\Translation\TranslationServiceProvider::class, // 弃用自带多国语言包功能 - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, + /* + * Laravel Framework Service Providers... + */ + Illuminate\Auth\AuthServiceProvider::class, + Illuminate\Broadcasting\BroadcastServiceProvider::class, + Illuminate\Bus\BusServiceProvider::class, + Illuminate\Cache\CacheServiceProvider::class, + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + Illuminate\Cookie\CookieServiceProvider::class, + Illuminate\Database\DatabaseServiceProvider::class, + Illuminate\Encryption\EncryptionServiceProvider::class, + Illuminate\Filesystem\FilesystemServiceProvider::class, + Illuminate\Foundation\Providers\FoundationServiceProvider::class, + Illuminate\Hashing\HashServiceProvider::class, + Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, + Illuminate\Pagination\PaginationServiceProvider::class, + Illuminate\Pipeline\PipelineServiceProvider::class, + Illuminate\Queue\QueueServiceProvider::class, + Illuminate\Redis\RedisServiceProvider::class, + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + Illuminate\Session\SessionServiceProvider::class, + // Illuminate\Translation\TranslationServiceProvider::class, // 弃用自带多国语言包功能 + Illuminate\Validation\ValidationServiceProvider::class, + Illuminate\View\ViewServiceProvider::class, - /* - * Package Service Providers... - */ - Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, //IDE帮助 - Barryvdh\Debugbar\ServiceProvider::class,//Debug工具 - Jenssegers\Agent\AgentServiceProvider::class, //用户浏览器检测 - Misechow\Geetest\GeetestServiceProvider::class, // Geetest极验 - Misechow\NoCaptcha\NoCaptchaServiceProvider::class, // Google reCAPTCHA - Overtrue\LaravelLang\TranslationServiceProvider::class, // 多国语言包功能 - Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,//日志查看 - Scyllaly\HCaptcha\HCaptchaServiceProvider::class, //HCaptcha - Srmklive\PayPal\Providers\PayPalServiceProvider::class, // PayPal + /* + * Package Service Providers... + */ + Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, //IDE帮助 + Barryvdh\Debugbar\ServiceProvider::class,//Debug工具 + Jenssegers\Agent\AgentServiceProvider::class, //用户浏览器检测 + Misechow\Geetest\GeetestServiceProvider::class, // Geetest极验 + Misechow\NoCaptcha\NoCaptchaServiceProvider::class, // Google reCAPTCHA + Overtrue\LaravelLang\TranslationServiceProvider::class, // 多国语言包功能 + Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,//日志查看 + Scyllaly\HCaptcha\HCaptchaServiceProvider::class, //HCaptcha + Srmklive\PayPal\Providers\PayPalServiceProvider::class, // PayPal - /* - * Application Service Providers... - */ - App\Providers\AppServiceProvider::class, - App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, + /* + * Application Service Providers... + */ + App\Providers\AppServiceProvider::class, + App\Providers\AuthServiceProvider::class, + // App\Providers\BroadcastServiceProvider::class, + App\Providers\EventServiceProvider::class, + App\Providers\RouteServiceProvider::class, - ], + ], - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ - 'aliases' => [ - 'Agent' => Jenssegers\Agent\Facades\Agent::class, - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Captcha' => Mews\Captcha\Facades\Captcha::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Debugbar' => Barryvdh\Debugbar\Facade::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Geetest' => Misechow\Geetest\Geetest::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'HCaptcha' => Scyllaly\HCaptcha\Facades\HCaptcha::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, - 'NoCaptcha' => Misechow\NoCaptcha\Facades\NoCaptcha::class, - 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'PayPal' => Srmklive\PayPal\Facades\PayPal::class, - 'Purifier' => Mews\Purifier\Facades\Purifier::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, - ], + 'aliases' => [ + 'Agent' => Jenssegers\Agent\Facades\Agent::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Captcha' => Mews\Captcha\Facades\Captcha::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Debugbar' => Barryvdh\Debugbar\Facade::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Geetest' => Misechow\Geetest\Geetest::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'HCaptcha' => Scyllaly\HCaptcha\Facades\HCaptcha::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'NoCaptcha' => Misechow\NoCaptcha\Facades\NoCaptcha::class, + 'Notification' => Illuminate\Support\Facades\Notification::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'PayPal' => Srmklive\PayPal\Facades\PayPal::class, + 'Purifier' => Mews\Purifier\Facades\Purifier::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + ], ]; diff --git a/config/auth.php b/config/auth.php index 92d50006..3e60ab0e 100644 --- a/config/auth.php +++ b/config/auth.php @@ -2,101 +2,101 @@ return [ - /* - |-------------------------------------------------------------------------- - | Authentication Defaults - |-------------------------------------------------------------------------- - | - | This option controls the default authentication "guard" and password - | reset options for your application. You may change these defaults - | as required, but they're a perfect start for most applications. - | - */ + /* + |-------------------------------------------------------------------------- + | Authentication Defaults + |-------------------------------------------------------------------------- + | + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. + | + */ - 'defaults' => [ - 'guard' => 'web', - 'passwords' => 'users', - ], + 'defaults' => [ + 'guard' => 'web', + 'passwords' => 'users', + ], - /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session", "token" - | - */ + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ - 'guards' => [ - 'web' => [ - 'driver' => 'session', - 'provider' => 'users', - ], + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], - 'api' => [ - 'driver' => 'token', - 'provider' => 'users', - ], - ], + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + ], + ], - /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ - 'providers' => [ - 'users' => [ - 'driver' => 'eloquent', - 'model' => App\Http\Models\User::class, - ], + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\Http\Models\User::class, + ], - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], - ], + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], - /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ - 'passwords' => [ - 'users' => [ - 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, - ], - ], + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => 'password_resets', + 'expire' => 60, + ], + ], ]; diff --git a/config/broadcasting.php b/config/broadcasting.php index 5740d11d..5b0ae815 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -2,58 +2,58 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Broadcaster - |-------------------------------------------------------------------------- - | - | This option controls the default broadcaster that will be used by the - | framework when an event needs to be broadcast. You may set this to - | any of the connections defined in the "connections" array below. - | - | Supported: "pusher", "redis", "log", "null" - | - */ + /* + |-------------------------------------------------------------------------- + | Default Broadcaster + |-------------------------------------------------------------------------- + | + | This option controls the default broadcaster that will be used by the + | framework when an event needs to be broadcast. You may set this to + | any of the connections defined in the "connections" array below. + | + | Supported: "pusher", "redis", "log", "null" + | + */ - 'default' => env('BROADCAST_DRIVER', 'null'), + 'default' => env('BROADCAST_DRIVER', 'null'), - /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | - */ + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | + */ - 'connections' => [ + 'connections' => [ - 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), - 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), - 'encrypted' => TRUE, - ], - ], + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'encrypted' => TRUE, + ], + ], - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], - 'log' => [ - 'driver' => 'log', - ], + 'log' => [ + 'driver' => 'log', + ], - 'null' => [ - 'driver' => 'null', - ], + 'null' => [ + 'driver' => 'null', + ], - ], + ], ]; diff --git a/config/cache.php b/config/cache.php index e1809ce0..7285bf19 100644 --- a/config/cache.php +++ b/config/cache.php @@ -2,93 +2,93 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Cache Store - |-------------------------------------------------------------------------- - | - | This option controls the default cache connection that gets used while - | using this caching library. This connection is used when another is - | not explicitly specified when executing a given caching function. - | - | Supported: "apc", "array", "database", "file", "memcached", "redis" - | - */ + /* + |-------------------------------------------------------------------------- + | Default Cache Store + |-------------------------------------------------------------------------- + | + | This option controls the default cache connection that gets used while + | using this caching library. This connection is used when another is + | not explicitly specified when executing a given caching function. + | + | Supported: "apc", "array", "database", "file", "memcached", "redis" + | + */ - 'default' => env('CACHE_DRIVER', 'file'), + 'default' => env('CACHE_DRIVER', 'file'), - /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | - */ + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + */ - 'stores' => [ + 'stores' => [ - 'apc' => [ - 'driver' => 'apc', - ], + 'apc' => [ + 'driver' => 'apc', + ], - 'array' => [ - 'driver' => 'array', - ], + 'array' => [ + 'driver' => 'array', + ], - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => NULL, - ], + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', + 'connection' => NULL, + ], - 'file' => [ - 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), - ], + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + ], - 'memcached' => [ - 'driver' => 'memcached', - 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ - env('MEMCACHED_USERNAME'), - env('MEMCACHED_PASSWORD'), - ], - 'options' => [ - // Memcached::OPT_CONNECT_TIMEOUT => 2000, - ], - 'servers' => [ - [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), - 'weight' => 100, - ], - ], - ], + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], - ], + ], - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | - */ + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ - 'prefix' => env( - 'CACHE_PREFIX', - str_slug(env('APP_NAME', 'laravel'), '_').'_cache' - ), + 'prefix' => env( + 'CACHE_PREFIX', + str_slug(env('APP_NAME', 'laravel'), '_') . '_cache' + ), ]; diff --git a/config/captcha.php b/config/captcha.php index 73ec8205..a782a8b1 100644 --- a/config/captcha.php +++ b/config/captcha.php @@ -2,46 +2,46 @@ return [ - 'characters' => '123467890', - //'characters' => '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ', + 'characters' => '123467890', + //'characters' => '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ', - 'default' => [ - 'length' => 4, // ���ÿ�ѧ�����Ҫ��Ϊ 9 - 'width' => 90, - 'height' => 43, - 'quality' => 90, - 'math' => FALSE, // ��Ϊtrue�����ÿ�ѧ���� - ], + 'default' => [ + 'length' => 4, // ���ÿ�ѧ�����Ҫ��Ϊ 9 + 'width' => 90, + 'height' => 43, + 'quality' => 90, + 'math' => FALSE, // ��Ϊtrue�����ÿ�ѧ���� + ], - 'flat' => [ - 'length' => 6, - 'width' => 160, - 'height' => 46, - 'quality' => 90, - 'lines' => 6, - 'bgImage' => FALSE, - 'bgColor' => '#ecf2f4', - 'fontColors' => ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'], - 'contrast' => -5, - ], + 'flat' => [ + 'length' => 6, + 'width' => 160, + 'height' => 46, + 'quality' => 90, + 'lines' => 6, + 'bgImage' => FALSE, + 'bgColor' => '#ecf2f4', + 'fontColors' => ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'], + 'contrast' => -5, + ], - 'mini' => [ - 'length' => 3, - 'width' => 60, - 'height' => 32, - ], + 'mini' => [ + 'length' => 3, + 'width' => 60, + 'height' => 32, + ], - 'inverse' => [ - 'length' => 5, - 'width' => 120, - 'height' => 36, - 'quality' => 90, - 'sensitive' => TRUE, - 'angle' => 12, - 'sharpen' => 10, - 'blur' => 2, - 'invert' => TRUE, - 'contrast' => -5, - ] + 'inverse' => [ + 'length' => 5, + 'width' => 120, + 'height' => 36, + 'quality' => 90, + 'sensitive' => TRUE, + 'angle' => 12, + 'sharpen' => 10, + 'blur' => 2, + 'invert' => TRUE, + 'contrast' => -5, + ] ]; diff --git a/config/database.php b/config/database.php index 3a252717..ba0ff7d8 100644 --- a/config/database.php +++ b/config/database.php @@ -2,119 +2,119 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | - */ + /* + |-------------------------------------------------------------------------- + | Default Database Connection Name + |-------------------------------------------------------------------------- + | + | Here you may specify which of the database connections below you wish + | to use as your default connection for all database work. Of course + | you may use many connections at once using the Database library. + | + */ - 'default' => env('DB_CONNECTION', 'mysql'), + 'default' => env('DB_CONNECTION', 'mysql'), - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ - 'connections' => [ + 'connections' => [ - 'sqlite' => [ - 'driver' => 'sqlite', - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', - ], + 'sqlite' => [ + 'driver' => 'sqlite', + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + ], - 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'strict' => env('DB_STRICT', TRUE), - 'engine' => NULL, - ], + 'mysql' => [ + 'driver' => 'mysql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'strict' => env('DB_STRICT', TRUE), + 'engine' => NULL, + ], - 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - 'sslmode' => 'prefer', - ], + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', + ], - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - ], + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + ], - ], + ], - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | + */ - 'migrations' => 'migrations', + 'migrations' => 'migrations', - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer set of commands than a typical key-value systems - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer set of commands than a typical key-value systems + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ - 'redis' => [ + 'redis' => [ - 'client' => 'predis', + 'client' => 'predis', - 'default' => [ - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', NULL), - 'port' => env('REDIS_PORT', 6379), - 'database' => 0, - ], + 'default' => [ + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', NULL), + 'port' => env('REDIS_PORT', 6379), + 'database' => 0, + ], - ], + ], ]; diff --git a/config/debugbar.php b/config/debugbar.php index f7f116bc..419e82a1 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -2,201 +2,201 @@ return [ - /* - |-------------------------------------------------------------------------- - | Debugbar Settings - |-------------------------------------------------------------------------- - | - | Debugbar is enabled by default, when debug is set to true in app.php. - | You can override the value by setting enable to true or false instead of null. - | - | You can provide an array of URI's that must be ignored (eg. 'api/*') - | - */ + /* + |-------------------------------------------------------------------------- + | Debugbar Settings + |-------------------------------------------------------------------------- + | + | Debugbar is enabled by default, when debug is set to true in app.php. + | You can override the value by setting enable to true or false instead of null. + | + | You can provide an array of URI's that must be ignored (eg. 'api/*') + | + */ - 'enabled' => env('DEBUGBAR_ENABLED', NULL), - 'except' => [ - 'telescope*' - ], + 'enabled' => env('DEBUGBAR_ENABLED', NULL), + 'except' => [ + 'telescope*' + ], - /* - |-------------------------------------------------------------------------- - | Storage settings - |-------------------------------------------------------------------------- - | - | DebugBar stores data for session/ajax requests. - | You can disable this, so the debugbar stores data in headers/session, - | but this can cause problems with large data collectors. - | By default, file storage (in the storage folder) is used. Redis and PDO - | can also be used. For PDO, run the package migrations first. - | - */ - 'storage' => [ - 'enabled' => TRUE, - 'driver' => 'file', // redis, file, pdo, custom - 'path' => storage_path('debugbar'), // For file driver - 'connection' => NULL, // Leave null for default connection (Redis/PDO) - 'provider' => '' // Instance of StorageInterface for custom driver - ], + /* + |-------------------------------------------------------------------------- + | Storage settings + |-------------------------------------------------------------------------- + | + | DebugBar stores data for session/ajax requests. + | You can disable this, so the debugbar stores data in headers/session, + | but this can cause problems with large data collectors. + | By default, file storage (in the storage folder) is used. Redis and PDO + | can also be used. For PDO, run the package migrations first. + | + */ + 'storage' => [ + 'enabled' => TRUE, + 'driver' => 'file', // redis, file, pdo, custom + 'path' => storage_path('debugbar'), // For file driver + 'connection' => NULL, // Leave null for default connection (Redis/PDO) + 'provider' => '' // Instance of StorageInterface for custom driver + ], - /* - |-------------------------------------------------------------------------- - | Vendors - |-------------------------------------------------------------------------- - | - | Vendor files are included by default, but can be set to false. - | This can also be set to 'js' or 'css', to only include javascript or css vendor files. - | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files) - | and for js: jquery and and highlight.js - | So if you want syntax highlighting, set it to true. - | jQuery is set to not conflict with existing jQuery scripts. - | - */ + /* + |-------------------------------------------------------------------------- + | Vendors + |-------------------------------------------------------------------------- + | + | Vendor files are included by default, but can be set to false. + | This can also be set to 'js' or 'css', to only include javascript or css vendor files. + | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files) + | and for js: jquery and and highlight.js + | So if you want syntax highlighting, set it to true. + | jQuery is set to not conflict with existing jQuery scripts. + | + */ - 'include_vendors' => TRUE, + 'include_vendors' => TRUE, - /* - |-------------------------------------------------------------------------- - | Capture Ajax Requests - |-------------------------------------------------------------------------- - | - | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors), - | you can use this option to disable sending the data through the headers. - | - | Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools. - */ + /* + |-------------------------------------------------------------------------- + | Capture Ajax Requests + |-------------------------------------------------------------------------- + | + | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors), + | you can use this option to disable sending the data through the headers. + | + | Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools. + */ - 'capture_ajax' => TRUE, - 'add_ajax_timing' => FALSE, + 'capture_ajax' => TRUE, + 'add_ajax_timing' => FALSE, - /* - |-------------------------------------------------------------------------- - | Custom Error Handler for Deprecated warnings - |-------------------------------------------------------------------------- - | - | When enabled, the Debugbar shows deprecated warnings for Symfony components - | in the Messages tab. - | - */ - 'error_handler' => FALSE, + /* + |-------------------------------------------------------------------------- + | Custom Error Handler for Deprecated warnings + |-------------------------------------------------------------------------- + | + | When enabled, the Debugbar shows deprecated warnings for Symfony components + | in the Messages tab. + | + */ + 'error_handler' => FALSE, - /* - |-------------------------------------------------------------------------- - | Clockwork integration - |-------------------------------------------------------------------------- - | - | The Debugbar can emulate the Clockwork headers, so you can use the Chrome - | Extension, without the server-side code. It uses Debugbar collectors instead. - | - */ - 'clockwork' => FALSE, + /* + |-------------------------------------------------------------------------- + | Clockwork integration + |-------------------------------------------------------------------------- + | + | The Debugbar can emulate the Clockwork headers, so you can use the Chrome + | Extension, without the server-side code. It uses Debugbar collectors instead. + | + */ + 'clockwork' => FALSE, - /* - |-------------------------------------------------------------------------- - | DataCollectors - |-------------------------------------------------------------------------- - | - | Enable/disable DataCollectors - | - */ + /* + |-------------------------------------------------------------------------- + | DataCollectors + |-------------------------------------------------------------------------- + | + | Enable/disable DataCollectors + | + */ - 'collectors' => [ - 'phpinfo' => TRUE, // Php version - 'messages' => TRUE, // Messages - 'time' => TRUE, // Time Datalogger - 'memory' => TRUE, // Memory usage - 'exceptions' => TRUE, // Exception displayer - 'log' => TRUE, // Logs from Monolog (merged in messages if enabled) - 'db' => TRUE, // Show database (PDO) queries and bindings - 'views' => TRUE, // Views with their data - 'route' => TRUE, // Current route information - 'auth' => FALSE, // Display Laravel authentication status - 'gate' => TRUE, // Display Laravel Gate checks - 'session' => TRUE, // Display session data - 'symfony_request' => TRUE, // Only one can be enabled.. - 'mail' => TRUE, // Catch mail messages - 'laravel' => FALSE, // Laravel version and environment - 'events' => FALSE, // All events fired - 'default_request' => FALSE, // Regular or special Symfony request logger - 'logs' => FALSE, // Add the latest log messages - 'files' => FALSE, // Show the included files - 'config' => FALSE, // Display config settings - 'cache' => FALSE, // Display cache events - 'models' => FALSE, // Display models - ], + 'collectors' => [ + 'phpinfo' => TRUE, // Php version + 'messages' => TRUE, // Messages + 'time' => TRUE, // Time Datalogger + 'memory' => TRUE, // Memory usage + 'exceptions' => TRUE, // Exception displayer + 'log' => TRUE, // Logs from Monolog (merged in messages if enabled) + 'db' => TRUE, // Show database (PDO) queries and bindings + 'views' => TRUE, // Views with their data + 'route' => TRUE, // Current route information + 'auth' => FALSE, // Display Laravel authentication status + 'gate' => TRUE, // Display Laravel Gate checks + 'session' => TRUE, // Display session data + 'symfony_request' => TRUE, // Only one can be enabled.. + 'mail' => TRUE, // Catch mail messages + 'laravel' => FALSE, // Laravel version and environment + 'events' => FALSE, // All events fired + 'default_request' => FALSE, // Regular or special Symfony request logger + 'logs' => FALSE, // Add the latest log messages + 'files' => FALSE, // Show the included files + 'config' => FALSE, // Display config settings + 'cache' => FALSE, // Display cache events + 'models' => FALSE, // Display models + ], - /* - |-------------------------------------------------------------------------- - | Extra options - |-------------------------------------------------------------------------- - | - | Configure some DataCollectors - | - */ + /* + |-------------------------------------------------------------------------- + | Extra options + |-------------------------------------------------------------------------- + | + | Configure some DataCollectors + | + */ - 'options' => [ - 'auth' => [ - 'show_name' => TRUE, // Also show the users name/email in the debugbar - ], - 'db' => [ - 'with_params' => TRUE, // Render SQL with the parameters substituted - 'backtrace' => TRUE, // Use a backtrace to find the origin of the query in your files. - 'timeline' => FALSE, // Add the queries to the timeline - 'explain' => [ // Show EXPLAIN output on queries - 'enabled' => FALSE, - 'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+ - ], - 'hints' => TRUE, // Show hints for common mistakes - ], - 'mail' => [ - 'full_log' => FALSE - ], - 'views' => [ - 'data' => FALSE, //Note: Can slow down the application, because the data can be quite large.. - ], - 'route' => [ - 'label' => TRUE // show complete route on bar - ], - 'logs' => [ - 'file' => NULL - ], - 'cache' => [ - 'values' => TRUE // collect cache values - ], - ], + 'options' => [ + 'auth' => [ + 'show_name' => TRUE, // Also show the users name/email in the debugbar + ], + 'db' => [ + 'with_params' => TRUE, // Render SQL with the parameters substituted + 'backtrace' => TRUE, // Use a backtrace to find the origin of the query in your files. + 'timeline' => FALSE, // Add the queries to the timeline + 'explain' => [ // Show EXPLAIN output on queries + 'enabled' => FALSE, + 'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+ + ], + 'hints' => TRUE, // Show hints for common mistakes + ], + 'mail' => [ + 'full_log' => FALSE + ], + 'views' => [ + 'data' => FALSE, //Note: Can slow down the application, because the data can be quite large.. + ], + 'route' => [ + 'label' => TRUE // show complete route on bar + ], + 'logs' => [ + 'file' => NULL + ], + 'cache' => [ + 'values' => TRUE // collect cache values + ], + ], - /* - |-------------------------------------------------------------------------- - | Inject Debugbar in Response - |-------------------------------------------------------------------------- - | - | Usually, the debugbar is added just before , by listening to the - | Response after the App is done. If you disable this, you have to add them - | in your template yourself. See http://phpdebugbar.com/docs/rendering.html - | - */ + /* + |-------------------------------------------------------------------------- + | Inject Debugbar in Response + |-------------------------------------------------------------------------- + | + | Usually, the debugbar is added just before , by listening to the + | Response after the App is done. If you disable this, you have to add them + | in your template yourself. See http://phpdebugbar.com/docs/rendering.html + | + */ - 'inject' => TRUE, + 'inject' => TRUE, - /* - |-------------------------------------------------------------------------- - | DebugBar route prefix - |-------------------------------------------------------------------------- - | - | Sometimes you want to set route prefix to be used by DebugBar to load - | its resources from. Usually the need comes from misconfigured web server or - | from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97 - | - */ - 'route_prefix' => '_debugbar', + /* + |-------------------------------------------------------------------------- + | DebugBar route prefix + |-------------------------------------------------------------------------- + | + | Sometimes you want to set route prefix to be used by DebugBar to load + | its resources from. Usually the need comes from misconfigured web server or + | from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97 + | + */ + 'route_prefix' => '_debugbar', - /* - |-------------------------------------------------------------------------- - | DebugBar route domain - |-------------------------------------------------------------------------- - | - | By default DebugBar route served from the same domain that request served. - | To override default domain, specify it as a non-empty value. - */ - 'route_domain' => NULL, + /* + |-------------------------------------------------------------------------- + | DebugBar route domain + |-------------------------------------------------------------------------- + | + | By default DebugBar route served from the same domain that request served. + | To override default domain, specify it as a non-empty value. + */ + 'route_domain' => NULL, ]; diff --git a/config/domains.php b/config/domains.php index 6f7fbc82..6806415b 100644 --- a/config/domains.php +++ b/config/domains.php @@ -2,52 +2,52 @@ // 常见域名后缀 return [ - 'com', 'net', 'org', 'couk', 'io', 'computer', 'ac', 'academy', 'actor', 'ae', 'aero', 'af', 'ag', 'agency', - 'ai', 'am', 'archi', 'arpa', 'as', 'asia', 'associates', 'at', 'au', 'aw', 'ax', 'az', 'bar', 'bargains', 'ltd', - 'bayern', 'be', 'berlin', 'bg', 'bi', 'bike', 'biz', 'bj', 'blackfriday', 'bn', 'boutique', 'build', 'builders', - 'bw', 'by', 'ca', 'cab', 'camera', 'camp', 'capital', 'cards', 'careers', 'cat', 'catering', 'cc', 'center', 'style', - 'ceo', 'cf', 'ch', 'cheap', 'christmas', 'ci', 'cl', 'cleaning', 'clothing', 'club', 'cn', 'co', 'codes', 'store', - 'coffee', 'college', 'cologne', 'community', 'company', 'construction', 'contractors', 'cooking', 'cool', 'online', - 'coop', 'country', 'cruises', 'cx', 'cz', 'dating', 'de', 'democrat', 'desi', 'diamonds', 'directory', 'dk', 'vip', - 'dm', 'domains', 'dz', 'ec', 'edu', 'education', 'ee', 'email', 'engineering', 'enterprises', 'equipment', 'top', - 'es', 'estate', 'eu', 'eus', 'events', 'expert', 'exposed', 'farm', 'feedback', 'fi', 'fish', 'fishing', 'dog', - 'flights', 'florist', 'fo', 'foo', 'foundation', 'fr', 'frogans', 'futbol', 'ga', 'gal', 'gd', 'gg', 'gi', 'fun', - 'gift', 'gl', 'glass', 'gop', 'gov', 'graphics', 'gripe', 'gs', 'guitars', 'guru', 'gy', 'haus', 'hk', 'hn', 'loans', - 'holiday', 'horse', 'house', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'immobilien', 'in', 'industries', 'holdings', - 'institute', 'int', 'international', 'iq', 'ir', 'is', 'it', 'je', 'jobs', 'jp', 'kaufen', 'ke', 'kg', 'ki', 'care', - 'kitchen', 'kiwi', 'koeln', 'kr', 'kz', 'la', 'land', 'lease', 'li', 'lighting', 'limo', 'link', 'london', 'football', - 'lt', 'lu', 'luxury', 'lv', 'ly', 'ma', 'management', 'mango', 'marketing', 'md', 'me', 'media', 'menu', 'mg', 'tours', - 'miami', 'mk', 'ml', 'mn', 'mo', 'mobi', 'moda', 'monash', 'mp', 'ms', 'mu', 'museum', 'mx', 'my', 'na', 'name', 'tube', - 'nc', 'nf', 'ng', 'ninja', 'nl', 'no', 'nu', 'nz', 'om', 'onl', 'paris', 'partners', 'parts', 'pe', 'pf', 'financial', - 'photo', 'photography', 'photos', 'pics', 'pictures', 'pl', 'plumbing', 'pm', 'post', 'pr', 'pro', 'productions', - 'properties', 'pt', 'pub', 'pw', 'qa', 'quebec', 're', 'recipes', 'reisen', 'rentals', 'repair', 'report', 'app', - 'rest', 'reviews', 'rich', 'ro', 'rocks', 'rodeo', 'rs', 'ru', 'ruhr', 'sa', 'saarland', 'sb', 'sc', 'se', 'icu', - 'services', 'sexy', 'sg', 'sh', 'shoes', 'si', 'singles', 'sk', 'sm', 'sn', 'so', 'social', 'solar', 'solutions', - 'soy', 'st', 'su', 'supplies', 'supply', 'support', 'sx', 'sy', 'systems', 'tattoo', 'tc', 'technology', 'tel', - 'tf', 'th', 'tienda', 'tips', 'tk', 'tl', 'tm', 'tn', 'to', 'today', 'tools', 'town', 'toys', 'tr', 'training', - 'travel', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'university', 'us', 'uy', 'black', 'blue', 'info', 'kim', 'pink', - 'red', 'shiksha', 'uz', 'vacations', 'vc', 've', 'vegas', 'ventures', 'vg', 'viajes', 'villas', 'vision', 'vodka', - 'voting', 'voyage', 'vu', 'wang', 'watch', 'wed', 'wf', 'wien', 'wiki', 'works', 'ws', 'xxx', 'xyz', 'yt', 'za', - 'zm', 'zone', 'dj', 'do', 'eg', 'eh', 'er', 'et', 'fj', 'fk', 'fm', 'gallery', 'gb', 'ge', 'gf', 'gh', 'gm', 'xin', - 'gn', 'gp', 'gq', 'gr', 'gt', 'gu', 'gw', 'hm', 'jetzt', 'jm', 'jo', 'kh', 'km', 'kn', 'kp', 'kred', 'kw', 'ky', - 'lb', 'lk', 'lr', 'ls', 'mc', 'mf', 'mh', 'mil', 'mm', 'moe', 'mq', 'mr', 'mt', 'mv', 'mw', 'mz', 'nagoya', 'ne', - 'neustar', 'ni', 'np', 'nr', 'nyc', 'okinawa', 'pa', 'pg', 'ph', 'pk', 'pn', 'ps', 'py', 'qpon', 'ren', 'rw', 'krd', - 'sd', 'sj', 'sl', 'sohu', 'sr', 'ss', 'sv', 'sz', 'td', 'tg', 'tj', 'tokyo', 'tp', 'trade', 'tt', 'um', 'uno', 'llc', - 'va', 'vi', 'vi', 'vn', 'webcam', 'ye', 'yokohoma', 'ryukyu', 'meet', 'vote', 'lc', 'voto', 'wed', 'zw', 'ooo', 'ltda', - 'stream', 'wtf', 'observer', 'site', 'tech', 'world', 'vet', 'video', 'vin', 'website', 'wedding', 'whoswho', 'win', - 'wine', 'work', 'yoga', 'tires', 'tickets', 'theatre', 'theater', 'tennis', 'team', 'taxi', 'tax', 'surgery', 'surf', - 'sucks', 'study', 'style', 'storage', 'studio', 'space', 'software', 'soccer', 'ski', 'show', 'shopping', 'shop', - 'security', 'science', 'schule', 'school', 'sarl', 'salon', 'sale', 'run', 'rip', 'review', 'restaurant', 'republican', - 'rent', 'reise', 'rehab', 'realty', 'racing', 'protection', 'property', 'promo', 'press', 'plus', 'place', 'pizza', - 'pet', 'party', 'organic', 'one', 'news', 'network', 'navy', 'movie', 'mortgage', 'money', 'mom', 'men', 'memorial', - 'mba', 'market', 'maison', 'love', 'lol', 'loan', 'live', 'limited', 'life', 'lgbt', 'legal', 'lawyer', 'juegos', - 'jewelry', 'irish', 'investments', 'insure', 'ink', 'hosting', 'host', 'hospital', 'hockey', 'hiv', 'hiphop', 'help', - 'healthcare', 'guide', 'group', 'green', 'gratis', 'golf', 'gold', 'gmbh', 'global', 'gives', 'gifts', 'garden', 'games', - 'game', 'fyi', 'furniture', 'fund', 'forsale', 'flowers', 'fitness', 'fit', 'finance', 'film', 'fashion', 'fans', 'family', - 'faith', 'fail', 'express', 'exchange', 'engineer', 'energy', 'earth', 'download', 'doctor', 'discount', 'direct', - 'digital', 'diet', 'design', 'dentist', 'dental', 'delivery', 'degree', 'deals', 'date', 'dance', 'cricket', 'creditcard', - 'credit', 'courses', 'coupons', 'condos', 'consulting', 'coach', 'cloud', 'clinic', 'click', 'claims', 'city', 'church', - 'chat', 'charity', 'casino', 'cafe', 'buzz', 'business', 'boston', 'blog', 'bio', 'bingo', 'bid', 'beer', 'band', 'audio', - 'auction', 'attorney', 'art', 'army', 'apartments', 'airforce', 'accountants', 'accountant', 'monster', 'dev', 'sydney', 'baby', - 'melbourne', 'bible', 'yachts', 'motorcycles', 'autos', 'boats', 'homes' -]; \ No newline at end of file + 'com', 'net', 'org', 'couk', 'io', 'computer', 'ac', 'academy', 'actor', 'ae', 'aero', 'af', 'ag', 'agency', + 'ai', 'am', 'archi', 'arpa', 'as', 'asia', 'associates', 'at', 'au', 'aw', 'ax', 'az', 'bar', 'bargains', 'ltd', + 'bayern', 'be', 'berlin', 'bg', 'bi', 'bike', 'biz', 'bj', 'blackfriday', 'bn', 'boutique', 'build', 'builders', + 'bw', 'by', 'ca', 'cab', 'camera', 'camp', 'capital', 'cards', 'careers', 'cat', 'catering', 'cc', 'center', 'style', + 'ceo', 'cf', 'ch', 'cheap', 'christmas', 'ci', 'cl', 'cleaning', 'clothing', 'club', 'cn', 'co', 'codes', 'store', + 'coffee', 'college', 'cologne', 'community', 'company', 'construction', 'contractors', 'cooking', 'cool', 'online', + 'coop', 'country', 'cruises', 'cx', 'cz', 'dating', 'de', 'democrat', 'desi', 'diamonds', 'directory', 'dk', 'vip', + 'dm', 'domains', 'dz', 'ec', 'edu', 'education', 'ee', 'email', 'engineering', 'enterprises', 'equipment', 'top', + 'es', 'estate', 'eu', 'eus', 'events', 'expert', 'exposed', 'farm', 'feedback', 'fi', 'fish', 'fishing', 'dog', + 'flights', 'florist', 'fo', 'foo', 'foundation', 'fr', 'frogans', 'futbol', 'ga', 'gal', 'gd', 'gg', 'gi', 'fun', + 'gift', 'gl', 'glass', 'gop', 'gov', 'graphics', 'gripe', 'gs', 'guitars', 'guru', 'gy', 'haus', 'hk', 'hn', 'loans', + 'holiday', 'horse', 'house', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'immobilien', 'in', 'industries', 'holdings', + 'institute', 'int', 'international', 'iq', 'ir', 'is', 'it', 'je', 'jobs', 'jp', 'kaufen', 'ke', 'kg', 'ki', 'care', + 'kitchen', 'kiwi', 'koeln', 'kr', 'kz', 'la', 'land', 'lease', 'li', 'lighting', 'limo', 'link', 'london', 'football', + 'lt', 'lu', 'luxury', 'lv', 'ly', 'ma', 'management', 'mango', 'marketing', 'md', 'me', 'media', 'menu', 'mg', 'tours', + 'miami', 'mk', 'ml', 'mn', 'mo', 'mobi', 'moda', 'monash', 'mp', 'ms', 'mu', 'museum', 'mx', 'my', 'na', 'name', 'tube', + 'nc', 'nf', 'ng', 'ninja', 'nl', 'no', 'nu', 'nz', 'om', 'onl', 'paris', 'partners', 'parts', 'pe', 'pf', 'financial', + 'photo', 'photography', 'photos', 'pics', 'pictures', 'pl', 'plumbing', 'pm', 'post', 'pr', 'pro', 'productions', + 'properties', 'pt', 'pub', 'pw', 'qa', 'quebec', 're', 'recipes', 'reisen', 'rentals', 'repair', 'report', 'app', + 'rest', 'reviews', 'rich', 'ro', 'rocks', 'rodeo', 'rs', 'ru', 'ruhr', 'sa', 'saarland', 'sb', 'sc', 'se', 'icu', + 'services', 'sexy', 'sg', 'sh', 'shoes', 'si', 'singles', 'sk', 'sm', 'sn', 'so', 'social', 'solar', 'solutions', + 'soy', 'st', 'su', 'supplies', 'supply', 'support', 'sx', 'sy', 'systems', 'tattoo', 'tc', 'technology', 'tel', + 'tf', 'th', 'tienda', 'tips', 'tk', 'tl', 'tm', 'tn', 'to', 'today', 'tools', 'town', 'toys', 'tr', 'training', + 'travel', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'university', 'us', 'uy', 'black', 'blue', 'info', 'kim', 'pink', + 'red', 'shiksha', 'uz', 'vacations', 'vc', 've', 'vegas', 'ventures', 'vg', 'viajes', 'villas', 'vision', 'vodka', + 'voting', 'voyage', 'vu', 'wang', 'watch', 'wed', 'wf', 'wien', 'wiki', 'works', 'ws', 'xxx', 'xyz', 'yt', 'za', + 'zm', 'zone', 'dj', 'do', 'eg', 'eh', 'er', 'et', 'fj', 'fk', 'fm', 'gallery', 'gb', 'ge', 'gf', 'gh', 'gm', 'xin', + 'gn', 'gp', 'gq', 'gr', 'gt', 'gu', 'gw', 'hm', 'jetzt', 'jm', 'jo', 'kh', 'km', 'kn', 'kp', 'kred', 'kw', 'ky', + 'lb', 'lk', 'lr', 'ls', 'mc', 'mf', 'mh', 'mil', 'mm', 'moe', 'mq', 'mr', 'mt', 'mv', 'mw', 'mz', 'nagoya', 'ne', + 'neustar', 'ni', 'np', 'nr', 'nyc', 'okinawa', 'pa', 'pg', 'ph', 'pk', 'pn', 'ps', 'py', 'qpon', 'ren', 'rw', 'krd', + 'sd', 'sj', 'sl', 'sohu', 'sr', 'ss', 'sv', 'sz', 'td', 'tg', 'tj', 'tokyo', 'tp', 'trade', 'tt', 'um', 'uno', 'llc', + 'va', 'vi', 'vi', 'vn', 'webcam', 'ye', 'yokohoma', 'ryukyu', 'meet', 'vote', 'lc', 'voto', 'wed', 'zw', 'ooo', 'ltda', + 'stream', 'wtf', 'observer', 'site', 'tech', 'world', 'vet', 'video', 'vin', 'website', 'wedding', 'whoswho', 'win', + 'wine', 'work', 'yoga', 'tires', 'tickets', 'theatre', 'theater', 'tennis', 'team', 'taxi', 'tax', 'surgery', 'surf', + 'sucks', 'study', 'style', 'storage', 'studio', 'space', 'software', 'soccer', 'ski', 'show', 'shopping', 'shop', + 'security', 'science', 'schule', 'school', 'sarl', 'salon', 'sale', 'run', 'rip', 'review', 'restaurant', 'republican', + 'rent', 'reise', 'rehab', 'realty', 'racing', 'protection', 'property', 'promo', 'press', 'plus', 'place', 'pizza', + 'pet', 'party', 'organic', 'one', 'news', 'network', 'navy', 'movie', 'mortgage', 'money', 'mom', 'men', 'memorial', + 'mba', 'market', 'maison', 'love', 'lol', 'loan', 'live', 'limited', 'life', 'lgbt', 'legal', 'lawyer', 'juegos', + 'jewelry', 'irish', 'investments', 'insure', 'ink', 'hosting', 'host', 'hospital', 'hockey', 'hiv', 'hiphop', 'help', + 'healthcare', 'guide', 'group', 'green', 'gratis', 'golf', 'gold', 'gmbh', 'global', 'gives', 'gifts', 'garden', 'games', + 'game', 'fyi', 'furniture', 'fund', 'forsale', 'flowers', 'fitness', 'fit', 'finance', 'film', 'fashion', 'fans', 'family', + 'faith', 'fail', 'express', 'exchange', 'engineer', 'energy', 'earth', 'download', 'doctor', 'discount', 'direct', + 'digital', 'diet', 'design', 'dentist', 'dental', 'delivery', 'degree', 'deals', 'date', 'dance', 'cricket', 'creditcard', + 'credit', 'courses', 'coupons', 'condos', 'consulting', 'coach', 'cloud', 'clinic', 'click', 'claims', 'city', 'church', + 'chat', 'charity', 'casino', 'cafe', 'buzz', 'business', 'boston', 'blog', 'bio', 'bingo', 'bid', 'beer', 'band', 'audio', + 'auction', 'attorney', 'art', 'army', 'apartments', 'airforce', 'accountants', 'accountant', 'monster', 'dev', 'sydney', 'baby', + 'melbourne', 'bible', 'yachts', 'motorcycles', 'autos', 'boats', 'homes' +]; diff --git a/config/filesystems.php b/config/filesystems.php index e870748d..443f2934 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -2,68 +2,68 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Filesystem Disk - |-------------------------------------------------------------------------- - | - | Here you may specify the default filesystem disk that should be used - | by the framework. The "local" disk, as well as a variety of cloud - | based disks are available to your application. Just store away! - | - */ + /* + |-------------------------------------------------------------------------- + | Default Filesystem Disk + |-------------------------------------------------------------------------- + | + | Here you may specify the default filesystem disk that should be used + | by the framework. The "local" disk, as well as a variety of cloud + | based disks are available to your application. Just store away! + | + */ - 'default' => env('FILESYSTEM_DRIVER', 'local'), + 'default' => env('FILESYSTEM_DRIVER', 'local'), - /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | - */ + /* + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | + */ - 'cloud' => env('FILESYSTEM_CLOUD', 's3'), + 'cloud' => env('FILESYSTEM_CLOUD', 's3'), - /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been setup for each driver as an example of the required options. - | - | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" - | - */ + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" + | + */ - 'disks' => [ + 'disks' => [ - 'local' => [ - 'driver' => 'local', - 'root' => storage_path('app'), - ], + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], - 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', - 'visibility' => 'public', - ], + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL') . '/storage', + 'visibility' => 'public', + ], - 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), - ], + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + ], - ], + ], ]; diff --git a/config/geetest.php b/config/geetest.php index fa2770d8..56794166 100644 --- a/config/geetest.php +++ b/config/geetest.php @@ -1,101 +1,101 @@ 'zh-cn', + /* + |-------------------------------------------------------------------------- + | Config Language + |-------------------------------------------------------------------------- + | + | Here you can config your yunpian api key from yunpian provided. + | + | Options: ['zh-cn', 'zh-tw', 'en', 'ja', 'ko'] + | + */ + 'lang' => 'zh-cn', - /* - |-------------------------------------------------------------------------- - | Config ServerGetKey - |-------------------------------------------------------------------------- - | - | Here you can decision whether to get the geetest key from database or not. - | - */ - 'server-get-config' => TRUE, + /* + |-------------------------------------------------------------------------- + | Config ServerGetKey + |-------------------------------------------------------------------------- + | + | Here you can decision whether to get the geetest key from database or not. + | + */ + 'server-get-config' => TRUE, - /* - |-------------------------------------------------------------------------- - | Config Geetest Id - |-------------------------------------------------------------------------- - | - | Here you can config your yunpian api key from yunpian provided. - | - */ - 'id' => env('GEETEST_ID'), + /* + |-------------------------------------------------------------------------- + | Config Geetest Id + |-------------------------------------------------------------------------- + | + | Here you can config your yunpian api key from yunpian provided. + | + */ + 'id' => env('GEETEST_ID'), - /* - |-------------------------------------------------------------------------- - | Config Geetest Key - |-------------------------------------------------------------------------- - | - | Here you can config your yunpian api key from yunpian provided. - | - */ - 'key' => env('GEETEST_KEY'), + /* + |-------------------------------------------------------------------------- + | Config Geetest Key + |-------------------------------------------------------------------------- + | + | Here you can config your yunpian api key from yunpian provided. + | + */ + 'key' => env('GEETEST_KEY'), - /* - |-------------------------------------------------------------------------- - | Config Geetest URL - |-------------------------------------------------------------------------- - | - | Here you can config your geetest url for ajax validation. - | - */ - 'url' => '/geetest', + /* + |-------------------------------------------------------------------------- + | Config Geetest URL + |-------------------------------------------------------------------------- + | + | Here you can config your geetest url for ajax validation. + | + */ + 'url' => '/geetest', - /* - |-------------------------------------------------------------------------- - | Config Geetest Protocol - |-------------------------------------------------------------------------- - | - | Here you can config your geetest url for ajax validation. - | - | Options: http or https - | - */ - 'protocol' => 'http', + /* + |-------------------------------------------------------------------------- + | Config Geetest Protocol + |-------------------------------------------------------------------------- + | + | Here you can config your geetest url for ajax validation. + | + | Options: http or https + | + */ + 'protocol' => 'http', - /* - |-------------------------------------------------------------------------- - | Config Geetest Product - |-------------------------------------------------------------------------- - | - | Here you can config your geetest url for ajax validation. - | - | Options: float, popup, custom, bind - | - */ - 'product' => 'float', + /* + |-------------------------------------------------------------------------- + | Config Geetest Product + |-------------------------------------------------------------------------- + | + | Here you can config your geetest url for ajax validation. + | + | Options: float, popup, custom, bind + | + */ + 'product' => 'float', - /* - |-------------------------------------------------------------------------- - | Config Client Fail Alert Text - |-------------------------------------------------------------------------- - | - | Here you can config the alert text when it failed in client. - | - */ - 'client_fail_alert' => '请正确完成验证码操作', + /* + |-------------------------------------------------------------------------- + | Config Client Fail Alert Text + |-------------------------------------------------------------------------- + | + | Here you can config the alert text when it failed in client. + | + */ + 'client_fail_alert' => '请正确完成验证码操作', - /* - |-------------------------------------------------------------------------- - | Config Server Fail Alert - |-------------------------------------------------------------------------- - | - | Here you can config the alert text when it failed in server (two factor validation). - | - */ - 'server_fail_alert' => '验证码校验失败,请重新尝试', + /* + |-------------------------------------------------------------------------- + | Config Server Fail Alert + |-------------------------------------------------------------------------- + | + | Here you can config the alert text when it failed in server (two factor validation). + | + */ + 'server_fail_alert' => '验证码校验失败,请重新尝试', -]; \ No newline at end of file +]; diff --git a/config/hashing.php b/config/hashing.php index e069d6ff..d3c8e2fb 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -2,51 +2,51 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Hash Driver - |-------------------------------------------------------------------------- - | - | This option controls the default hash driver that will be used to hash - | passwords for your application. By default, the bcrypt algorithm is - | used; however, you remain free to modify this option if you wish. - | - | Supported: "bcrypt", "argon" - | - */ + /* + |-------------------------------------------------------------------------- + | Default Hash Driver + |-------------------------------------------------------------------------- + | + | This option controls the default hash driver that will be used to hash + | passwords for your application. By default, the bcrypt algorithm is + | used; however, you remain free to modify this option if you wish. + | + | Supported: "bcrypt", "argon" + | + */ - 'driver' => 'bcrypt', + 'driver' => 'bcrypt', - /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | - */ + /* + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | + */ - 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), - ], + 'bcrypt' => [ + 'rounds' => env('BCRYPT_ROUNDS', 10), + ], - /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | - */ + /* + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ - 'argon' => [ - 'memory' => 1024, - 'threads' => 2, - 'time' => 2, - ], + 'argon' => [ + 'memory' => 1024, + 'threads' => 2, + 'time' => 2, + ], ]; diff --git a/config/ide-helper.php b/config/ide-helper.php index 9c241c03..b44a32bb 100644 --- a/config/ide-helper.php +++ b/config/ide-helper.php @@ -2,195 +2,197 @@ return [ - /* - |-------------------------------------------------------------------------- - | Filename & Format - |-------------------------------------------------------------------------- - | - | The default filename (without extension) and the format (php or json) - | - */ + /* + |-------------------------------------------------------------------------- + | Filename & Format + |-------------------------------------------------------------------------- + | + | The default filename (without extension) and the format (php or json) + | + */ - 'filename' => '_ide_helper', - 'format' => 'php', + 'filename' => '_ide_helper', + 'format' => 'php', - 'meta_filename' => '.phpstorm.meta.php', + 'meta_filename' => '.phpstorm.meta.php', - /* - |-------------------------------------------------------------------------- - | Fluent helpers - |-------------------------------------------------------------------------- - | - | Set to true to generate commonly used Fluent methods - | - */ + /* + |-------------------------------------------------------------------------- + | Fluent helpers + |-------------------------------------------------------------------------- + | + | Set to true to generate commonly used Fluent methods + | + */ - 'include_fluent' => FALSE, + 'include_fluent' => FALSE, - /* - |-------------------------------------------------------------------------- - | Write Model Magic methods - |-------------------------------------------------------------------------- - | - | Set to false to disable write magic methods of model - | - */ + /* + |-------------------------------------------------------------------------- + | Write Model Magic methods + |-------------------------------------------------------------------------- + | + | Set to false to disable write magic methods of model + | + */ - 'write_model_magic_where' => TRUE, + 'write_model_magic_where' => TRUE, - /* - |-------------------------------------------------------------------------- - | Write Eloquent Model Mixins - |-------------------------------------------------------------------------- - | - | This will add the necessary DocBlock mixins to the model class - | contained in the Laravel Framework. This helps the IDE with - | auto-completion. - | - | Please be aware that this setting changes a file within the /vendor directory. - | - */ + /* + |-------------------------------------------------------------------------- + | Write Eloquent Model Mixins + |-------------------------------------------------------------------------- + | + | This will add the necessary DocBlock mixins to the model class + | contained in the Laravel Framework. This helps the IDE with + | auto-completion. + | + | Please be aware that this setting changes a file within the /vendor directory. + | + */ - 'write_eloquent_model_mixins' => FALSE, + 'write_eloquent_model_mixins' => FALSE, - /* - |-------------------------------------------------------------------------- - | Helper files to include - |-------------------------------------------------------------------------- - | - | Include helper files. By default not included, but can be toggled with the - | -- helpers (-H) option. Extra helper files can be included. - | - */ + /* + |-------------------------------------------------------------------------- + | Helper files to include + |-------------------------------------------------------------------------- + | + | Include helper files. By default not included, but can be toggled with the + | -- helpers (-H) option. Extra helper files can be included. + | + */ - 'include_helpers' => FALSE, + 'include_helpers' => FALSE, - 'helper_files' => [ - base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php', - ], + 'helper_files' => [ + base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php', + ], - /* - |-------------------------------------------------------------------------- - | Model locations to include - |-------------------------------------------------------------------------- - | - | Define in which directories the ide-helper:models command should look - | for models. - | - */ + /* + |-------------------------------------------------------------------------- + | Model locations to include + |-------------------------------------------------------------------------- + | + | Define in which directories the ide-helper:models command should look + | for models. + | + */ - 'model_locations' => [ - 'app', - ], + 'model_locations' => [ + 'app', + ], - /* - |-------------------------------------------------------------------------- - | Extra classes - |-------------------------------------------------------------------------- - | - | These implementations are not really extended, but called with magic functions - | - */ + /* + |-------------------------------------------------------------------------- + | Extra classes + |-------------------------------------------------------------------------- + | + | These implementations are not really extended, but called with magic functions + | + */ - 'extra' => [ - 'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'], - 'Session' => ['Illuminate\Session\Store'], - ], + 'extra' => [ + 'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'], + 'Session' => ['Illuminate\Session\Store'], + ], - 'magic' => [ - 'Log' => [ - 'debug' => 'Monolog\Logger::addDebug', - 'info' => 'Monolog\Logger::addInfo', - 'notice' => 'Monolog\Logger::addNotice', - 'warning' => 'Monolog\Logger::addWarning', - 'error' => 'Monolog\Logger::addError', - 'critical' => 'Monolog\Logger::addCritical', - 'alert' => 'Monolog\Logger::addAlert', - 'emergency' => 'Monolog\Logger::addEmergency', - ] - ], + 'magic' => [ + 'Log' => [ + 'debug' => 'Monolog\Logger::addDebug', + 'info' => 'Monolog\Logger::addInfo', + 'notice' => 'Monolog\Logger::addNotice', + 'warning' => 'Monolog\Logger::addWarning', + 'error' => 'Monolog\Logger::addError', + 'critical' => 'Monolog\Logger::addCritical', + 'alert' => 'Monolog\Logger::addAlert', + 'emergency' => 'Monolog\Logger::addEmergency', + ] + ], - /* - |-------------------------------------------------------------------------- - | Interface implementations - |-------------------------------------------------------------------------- - | - | These interfaces will be replaced with the implementing class. Some interfaces - | are detected by the helpers, others can be listed below. - | - */ + /* + |-------------------------------------------------------------------------- + | Interface implementations + |-------------------------------------------------------------------------- + | + | These interfaces will be replaced with the implementing class. Some interfaces + | are detected by the helpers, others can be listed below. + | + */ - 'interfaces' => [ + 'interfaces' => [ - ], + ], - /* - |-------------------------------------------------------------------------- - | Support for custom DB types - |-------------------------------------------------------------------------- - | - | This setting allow you to map any custom database type (that you may have - | created using CREATE TYPE statement or imported using database plugin - | / extension to a Doctrine type. - | - | Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are: - | 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql' - | - | This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant - | - | The value of the array is an array of type mappings. Key is the name of the custom type, - | (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in - | our case it is 'json_array'. Doctrine types are listed here: - | http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html - | - | So to support jsonb in your models when working with Postgres, just add the following entry to the array below: - | - | "postgresql" => array( - | "jsonb" => "json_array", - | ), - | - */ - 'custom_db_types' => [ + /* + |-------------------------------------------------------------------------- + | Support for custom DB types + |-------------------------------------------------------------------------- + | + | This setting allow you to map any custom database type (that you may have + | created using CREATE TYPE statement or imported using database plugin + | / extension to a Doctrine type. + | + | Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are: + | 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql' + | + | This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant + | + | The value of the array is an array of type mappings. Key is the name of the custom type, + | (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in + | our case it is 'json_array'. Doctrine types are listed here: + | http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html + | + | So to support jsonb in your models when working with Postgres, just add the following entry to the array below: + | + | "postgresql" => array( + | "jsonb" => "json_array", + | ), + | + */ + 'custom_db_types' => [ + 'mysql' => [ + 'bit' => 'boolean' + ] + ], - ], + /* + |-------------------------------------------------------------------------- + | Support for camel cased models + |-------------------------------------------------------------------------- + | + | There are some Laravel packages (such as Eloquence) that allow for accessing + | Eloquent model properties via camel case, instead of snake case. + | + | Enabling this option will support these packages by saving all model + | properties as camel case, instead of snake case. + | + | For example, normally you would see this: + | + | * @property \Illuminate\Support\Carbon $created_at + | * @property \Illuminate\Support\Carbon $updated_at + | + | With this enabled, the properties will be this: + | + | * @property \Illuminate\Support\Carbon $createdAt + | * @property \Illuminate\Support\Carbon $updatedAt + | + | Note, it is currently an all-or-nothing option. + | + */ + 'model_camel_case_properties' => FALSE, - /* - |-------------------------------------------------------------------------- - | Support for camel cased models - |-------------------------------------------------------------------------- - | - | There are some Laravel packages (such as Eloquence) that allow for accessing - | Eloquent model properties via camel case, instead of snake case. - | - | Enabling this option will support these packages by saving all model - | properties as camel case, instead of snake case. - | - | For example, normally you would see this: - | - | * @property \Illuminate\Support\Carbon $created_at - | * @property \Illuminate\Support\Carbon $updated_at - | - | With this enabled, the properties will be this: - | - | * @property \Illuminate\Support\Carbon $createdAt - | * @property \Illuminate\Support\Carbon $updatedAt - | - | Note, it is currently an all-or-nothing option. - | - */ - 'model_camel_case_properties' => FALSE, - - /* - |-------------------------------------------------------------------------- - | Property Casts - |-------------------------------------------------------------------------- - | - | Cast the given "real type" to the given "type". - | - */ - 'type_overrides' => [ - 'integer' => 'int', - 'boolean' => 'bool', - ], + /* + |-------------------------------------------------------------------------- + | Property Casts + |-------------------------------------------------------------------------- + | + | Cast the given "real type" to the given "type". + | + */ + 'type_overrides' => [ + 'integer' => 'int', + 'boolean' => 'bool', + ], ]; diff --git a/config/image.php b/config/image.php index ae10acb5..2b1d2c3e 100644 --- a/config/image.php +++ b/config/image.php @@ -2,19 +2,19 @@ return [ - /* - |-------------------------------------------------------------------------- - | Image Driver - |-------------------------------------------------------------------------- - | - | Intervention Image supports "GD Library" and "Imagick" to process images - | internally. You may choose one of them according to your PHP - | configuration. By default PHP's "GD Library" implementation is used. - | - | Supported: "gd", "imagick" - | - */ + /* + |-------------------------------------------------------------------------- + | Image Driver + |-------------------------------------------------------------------------- + | + | Intervention Image supports "GD Library" and "Imagick" to process images + | internally. You may choose one of them according to your PHP + | configuration. By default PHP's "GD Library" implementation is used. + | + | Supported: "gd", "imagick" + | + */ - 'driver' => 'gd' + 'driver' => 'gd' ]; diff --git a/config/logging.php b/config/logging.php index 1a2ec04d..400bc7f4 100644 --- a/config/logging.php +++ b/config/logging.php @@ -4,78 +4,78 @@ use Monolog\Handler\StreamHandler; return [ - /* - |-------------------------------------------------------------------------- - | Default Log Channel - |-------------------------------------------------------------------------- - | - | This option defines the default log channel that gets used when writing - | messages to the logs. The name specified in this option should match - | one of the channels defined in the "channels" configuration array. - | - */ + /* + |-------------------------------------------------------------------------- + | Default Log Channel + |-------------------------------------------------------------------------- + | + | This option defines the default log channel that gets used when writing + | messages to the logs. The name specified in this option should match + | one of the channels defined in the "channels" configuration array. + | + */ - 'default' => env('LOG_CHANNEL', 'stack'), + 'default' => env('LOG_CHANNEL', 'stack'), - /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | - */ + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | + */ - 'channels' => [ - 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], - ], + 'channels' => [ + 'stack' => [ + 'driver' => 'stack', + 'channels' => ['single'], + ], - 'single' => [ - 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', - ], + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + ], - 'daily' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', - 'days' => 7, - ], + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 7, + ], - 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => 'critical', - ], + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => 'Laravel Log', + 'emoji' => ':boom:', + 'level' => 'critical', + ], - 'stderr' => [ - 'driver' => 'monolog', - 'handler' => StreamHandler::class, - 'with' => [ - 'stream' => 'php://stderr', - ], - ], + 'stderr' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'with' => [ + 'stream' => 'php://stderr', + ], + ], - 'syslog' => [ - 'driver' => 'syslog', - 'level' => 'debug', - ], + 'syslog' => [ + 'driver' => 'syslog', + 'level' => 'debug', + ], - 'errorlog' => [ - 'driver' => 'errorlog', - 'level' => 'debug', - ], - ], + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => 'debug', + ], + ], ]; diff --git a/config/mail.php b/config/mail.php index 05a511b3..2a364f47 100644 --- a/config/mail.php +++ b/config/mail.php @@ -2,135 +2,135 @@ return [ - /* - |-------------------------------------------------------------------------- - | Mail Driver - |-------------------------------------------------------------------------- - | - | Laravel supports both SMTP and PHP's "mail" function as drivers for the - | sending of e-mail. You may specify which one you're using throughout - | your application here. By default, Laravel is setup for SMTP mail. - | - | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses", - | "sparkpost", "log", "array" - | - */ + /* + |-------------------------------------------------------------------------- + | Mail Driver + |-------------------------------------------------------------------------- + | + | Laravel supports both SMTP and PHP's "mail" function as drivers for the + | sending of e-mail. You may specify which one you're using throughout + | your application here. By default, Laravel is setup for SMTP mail. + | + | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses", + | "sparkpost", "log", "array" + | + */ - 'driver' => env('MAIL_DRIVER', 'smtp'), + 'driver' => env('MAIL_DRIVER', 'smtp'), - /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Mailgun mail service which will provide reliable deliveries. + | + */ - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to deliver e-mails to + | users of the application. Like the host we have set this value to + | stay compatible with the Mailgun e-mail application by default. + | + */ - 'port' => env('MAIL_PORT', 587), + 'port' => env('MAIL_PORT', 587), - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ - 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), - ], + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ - 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ - 'username' => env('MAIL_USERNAME'), + 'username' => env('MAIL_USERNAME'), - 'password' => env('MAIL_PASSWORD'), + 'password' => env('MAIL_PASSWORD'), - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ - 'sendmail' => '/usr/sbin/sendmail -bs', + 'sendmail' => '/usr/sbin/sendmail -bs', - /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | - */ + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ - 'markdown' => [ - 'theme' => 'default', + 'markdown' => [ + 'theme' => 'default', - 'paths' => [ - resource_path('views/vendor/mail'), - ], - ], + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], - /* - |-------------------------------------------------------------------------- - | 注意:仅在自建邮局且PHP5.6+时使用 - |-------------------------------------------------------------------------- - */ -// 'stream' => [ -// 'ssl' => [ -// 'verify_peer' => false, -// 'verify_peer_name' => false, -// 'allow_self_signed' => false, -// ], -// ], + /* + |-------------------------------------------------------------------------- + | 注意:仅在自建邮局且PHP5.6+时使用 + |-------------------------------------------------------------------------- + */ + // 'stream' => [ + // 'ssl' => [ + // 'verify_peer' => false, + // 'verify_peer_name' => false, + // 'allow_self_signed' => false, + // ], + // ], ]; diff --git a/config/paypal.php b/config/paypal.php index 8c3d7e92..12c56164 100644 --- a/config/paypal.php +++ b/config/paypal.php @@ -5,26 +5,26 @@ */ return [ - 'mode' => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used. + 'mode' => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used. 'sandbox' => [ - 'username' => env('PAYPAL_SANDBOX_API_USERNAME', ''), - 'password' => env('PAYPAL_SANDBOX_API_PASSWORD', ''), - 'secret' => env('PAYPAL_SANDBOX_API_SECRET', ''), + 'username' => env('PAYPAL_SANDBOX_API_USERNAME', ''), + 'password' => env('PAYPAL_SANDBOX_API_PASSWORD', ''), + 'secret' => env('PAYPAL_SANDBOX_API_SECRET', ''), 'certificate' => env('PAYPAL_SANDBOX_API_CERTIFICATE', ''), - 'app_id' => 'APP-80W284485P519543T', // Used for testing Adaptive Payments API in sandbox mode + 'app_id' => 'APP-80W284485P519543T', // Used for testing Adaptive Payments API in sandbox mode ], 'live' => [ - 'username' => env('PAYPAL_LIVE_API_USERNAME', ''), - 'password' => env('PAYPAL_LIVE_API_PASSWORD', ''), - 'secret' => env('PAYPAL_LIVE_API_SECRET', ''), + 'username' => env('PAYPAL_LIVE_API_USERNAME', ''), + 'password' => env('PAYPAL_LIVE_API_PASSWORD', ''), + 'secret' => env('PAYPAL_LIVE_API_SECRET', ''), 'certificate' => env('PAYPAL_LIVE_API_CERTIFICATE', ''), - 'app_id' => '', // Used for Adaptive Payments API + 'app_id' => '', // Used for Adaptive Payments API ], 'payment_action' => 'Sale', // Can only be 'Sale', 'Authorization' or 'Order' - 'currency' => env('PAYPAL_CURRENCY', 'USD'), - 'billing_type' => 'MerchantInitiatedBilling', - 'notify_url' => '', // Change this accordingly for your application. - 'locale' => 'zh-CN', // force gateway language i.e. it_IT, es_ES, en_US ... (for express checkout only) - 'validate_ssl' => true, // Validate SSL when creating api client. + 'currency' => env('PAYPAL_CURRENCY', 'USD'), + 'billing_type' => 'MerchantInitiatedBilling', + 'notify_url' => '', // Change this accordingly for your application. + 'locale' => 'zh-CN', // force gateway language i.e. it_IT, es_ES, en_US ... (for express checkout only) + 'validate_ssl' => TRUE, // Validate SSL when creating api client. ]; diff --git a/config/permission.php b/config/permission.php index e93790cb..4c2ebab3 100644 --- a/config/permission.php +++ b/config/permission.php @@ -2,126 +2,126 @@ return [ - 'models' => [ + 'models' => [ - /* - * When using the "HasPermissions" trait from this package, we need to know which - * Eloquent model should be used to retrieve your permissions. Of course, it - * is often just the "Permission" model but you may use whatever you like. - * - * The model you want to use as a Permission model needs to implement the - * `Spatie\Permission\Contracts\Permission` contract. - */ + /* + * When using the "HasPermissions" trait from this package, we need to know which + * Eloquent model should be used to retrieve your permissions. Of course, it + * is often just the "Permission" model but you may use whatever you like. + * + * The model you want to use as a Permission model needs to implement the + * `Spatie\Permission\Contracts\Permission` contract. + */ - 'permission' => Spatie\Permission\Models\Permission::class, + 'permission' => Spatie\Permission\Models\Permission::class, - /* - * When using the "HasRoles" trait from this package, we need to know which - * Eloquent model should be used to retrieve your roles. Of course, it - * is often just the "Role" model but you may use whatever you like. - * - * The model you want to use as a Role model needs to implement the - * `Spatie\Permission\Contracts\Role` contract. - */ + /* + * When using the "HasRoles" trait from this package, we need to know which + * Eloquent model should be used to retrieve your roles. Of course, it + * is often just the "Role" model but you may use whatever you like. + * + * The model you want to use as a Role model needs to implement the + * `Spatie\Permission\Contracts\Role` contract. + */ - 'role' => Spatie\Permission\Models\Role::class, + 'role' => Spatie\Permission\Models\Role::class, - ], + ], - 'table_names' => [ + 'table_names' => [ - /* - * When using the "HasRoles" trait from this package, we need to know which - * table should be used to retrieve your roles. We have chosen a basic - * default value but you may easily change it to any table you like. - */ + /* + * When using the "HasRoles" trait from this package, we need to know which + * table should be used to retrieve your roles. We have chosen a basic + * default value but you may easily change it to any table you like. + */ - 'roles' => 'roles', + 'roles' => 'roles', - /* - * When using the "HasPermissions" trait from this package, we need to know which - * table should be used to retrieve your permissions. We have chosen a basic - * default value but you may easily change it to any table you like. - */ + /* + * When using the "HasPermissions" trait from this package, we need to know which + * table should be used to retrieve your permissions. We have chosen a basic + * default value but you may easily change it to any table you like. + */ - 'permissions' => 'permissions', + 'permissions' => 'permissions', - /* - * When using the "HasPermissions" trait from this package, we need to know which - * table should be used to retrieve your models permissions. We have chosen a - * basic default value but you may easily change it to any table you like. - */ + /* + * When using the "HasPermissions" trait from this package, we need to know which + * table should be used to retrieve your models permissions. We have chosen a + * basic default value but you may easily change it to any table you like. + */ - 'model_has_permissions' => 'model_has_permissions', + 'model_has_permissions' => 'model_has_permissions', - /* - * When using the "HasRoles" trait from this package, we need to know which - * table should be used to retrieve your models roles. We have chosen a - * basic default value but you may easily change it to any table you like. - */ + /* + * When using the "HasRoles" trait from this package, we need to know which + * table should be used to retrieve your models roles. We have chosen a + * basic default value but you may easily change it to any table you like. + */ - 'model_has_roles' => 'model_has_roles', + 'model_has_roles' => 'model_has_roles', - /* - * When using the "HasRoles" trait from this package, we need to know which - * table should be used to retrieve your roles permissions. We have chosen a - * basic default value but you may easily change it to any table you like. - */ + /* + * When using the "HasRoles" trait from this package, we need to know which + * table should be used to retrieve your roles permissions. We have chosen a + * basic default value but you may easily change it to any table you like. + */ - 'role_has_permissions' => 'role_has_permissions', - ], + 'role_has_permissions' => 'role_has_permissions', + ], - 'column_names' => [ + 'column_names' => [ - /* - * Change this if you want to name the related model primary key other than - * `model_id`. - * - * For example, this would be nice if your primary keys are all UUIDs. In - * that case, name this `model_uuid`. - */ - 'model_morph_key' => 'model_id', - ], + /* + * Change this if you want to name the related model primary key other than + * `model_id`. + * + * For example, this would be nice if your primary keys are all UUIDs. In + * that case, name this `model_uuid`. + */ + 'model_morph_key' => 'model_id', + ], - /* - * When set to true, the required permission/role names are added to the exception - * message. This could be considered an information leak in some contexts, so - * the default setting is false here for optimum safety. - */ + /* + * When set to true, the required permission/role names are added to the exception + * message. This could be considered an information leak in some contexts, so + * the default setting is false here for optimum safety. + */ - 'display_permission_in_exception' => FALSE, + 'display_permission_in_exception' => FALSE, - 'cache' => [ + 'cache' => [ - /* - * By default all permissions will be cached for 24 hours unless a permission or - * role is updated. Then the cache will be flushed immediately. - */ + /* + * By default all permissions will be cached for 24 hours unless a permission or + * role is updated. Then the cache will be flushed immediately. + */ - 'expiration_time' => 60*24, + 'expiration_time' => 60 * 24, - /* - * The key to use when tagging and prefixing entries in the cache. - */ + /* + * The key to use when tagging and prefixing entries in the cache. + */ - 'key' => 'spatie.permission.cache', + 'key' => 'spatie.permission.cache', - /* - * When checking for a permission against a model by passing a Permission - * instance to the check, this key determines what attribute on the - * Permissions model is used to cache against. - * - * Ideally, this should match your preferred way of checking permissions, eg: - * `$user->can('view-posts')` would be 'name'. - */ + /* + * When checking for a permission against a model by passing a Permission + * instance to the check, this key determines what attribute on the + * Permissions model is used to cache against. + * + * Ideally, this should match your preferred way of checking permissions, eg: + * `$user->can('view-posts')` would be 'name'. + */ - 'model_key' => 'name', + 'model_key' => 'name', - /* - * You may optionally indicate a specific cache driver to use for permission and - * role caching using any of the `store` drivers listed in the cache.php config - * file. Using 'default' here means to use the `default` set in cache.php. - */ - 'store' => 'default', - ], + /* + * You may optionally indicate a specific cache driver to use for permission and + * role caching using any of the `store` drivers listed in the cache.php config + * file. Using 'default' here means to use the `default` set in cache.php. + */ + 'store' => 'default', + ], ]; diff --git a/config/purifier.php b/config/purifier.php index 46755e0b..928950e6 100644 --- a/config/purifier.php +++ b/config/purifier.php @@ -17,89 +17,89 @@ */ return [ - 'encoding' => 'UTF-8', - 'finalize' => TRUE, - 'cachePath' => storage_path('app/purifier'), - 'cacheFileMode' => 0755, - 'settings' => [ - 'default' => [ - 'HTML.Doctype' => 'HTML 4.01 Transitional', - 'HTML.Allowed' => 'div,b,strong,i,em,u,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]', - 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align', - 'AutoFormat.AutoParagraph' => TRUE, - 'AutoFormat.RemoveEmpty' => TRUE, - ], - 'test' => [ - 'Attr.EnableID' => 'true', - ], - "youtube" => [ - "HTML.SafeIframe" => 'true', - "URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%", - ], - 'custom_definition' => [ - 'id' => 'html5-definitions', - 'rev' => 1, - 'debug' => FALSE, - 'elements' => [ - // http://developers.whatwg.org/sections.html - ['section', 'Block', 'Flow', 'Common'], - ['nav', 'Block', 'Flow', 'Common'], - ['article', 'Block', 'Flow', 'Common'], - ['aside', 'Block', 'Flow', 'Common'], - ['header', 'Block', 'Flow', 'Common'], - ['footer', 'Block', 'Flow', 'Common'], + 'encoding' => 'UTF-8', + 'finalize' => TRUE, + 'cachePath' => storage_path('app/purifier'), + 'cacheFileMode' => 0755, + 'settings' => [ + 'default' => [ + 'HTML.Doctype' => 'HTML 4.01 Transitional', + 'HTML.Allowed' => 'div,b,strong,i,em,u,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]', + 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align', + 'AutoFormat.AutoParagraph' => TRUE, + 'AutoFormat.RemoveEmpty' => TRUE, + ], + 'test' => [ + 'Attr.EnableID' => 'true', + ], + "youtube" => [ + "HTML.SafeIframe" => 'true', + "URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%", + ], + 'custom_definition' => [ + 'id' => 'html5-definitions', + 'rev' => 1, + 'debug' => FALSE, + 'elements' => [ + // http://developers.whatwg.org/sections.html + ['section', 'Block', 'Flow', 'Common'], + ['nav', 'Block', 'Flow', 'Common'], + ['article', 'Block', 'Flow', 'Common'], + ['aside', 'Block', 'Flow', 'Common'], + ['header', 'Block', 'Flow', 'Common'], + ['footer', 'Block', 'Flow', 'Common'], - // Content model actually excludes several tags, not modelled here - ['address', 'Block', 'Flow', 'Common'], - ['hgroup', 'Block', 'Required: h1 | h2 | h3 | h4 | h5 | h6', 'Common'], + // Content model actually excludes several tags, not modelled here + ['address', 'Block', 'Flow', 'Common'], + ['hgroup', 'Block', 'Required: h1 | h2 | h3 | h4 | h5 | h6', 'Common'], - // http://developers.whatwg.org/grouping-content.html - ['figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common'], - ['figcaption', 'Inline', 'Flow', 'Common'], + // http://developers.whatwg.org/grouping-content.html + ['figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common'], + ['figcaption', 'Inline', 'Flow', 'Common'], - // http://developers.whatwg.org/the-video-element.html#the-video-element - ['video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [ - 'src' => 'URI', - 'type' => 'Text', - 'width' => 'Length', - 'height' => 'Length', - 'poster' => 'URI', - 'preload' => 'Enum#auto,metadata,none', - 'controls' => 'Bool', - ]], - ['source', 'Block', 'Flow', 'Common', [ - 'src' => 'URI', - 'type' => 'Text', - ]], + // http://developers.whatwg.org/the-video-element.html#the-video-element + ['video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [ + 'src' => 'URI', + 'type' => 'Text', + 'width' => 'Length', + 'height' => 'Length', + 'poster' => 'URI', + 'preload' => 'Enum#auto,metadata,none', + 'controls' => 'Bool', + ]], + ['source', 'Block', 'Flow', 'Common', [ + 'src' => 'URI', + 'type' => 'Text', + ]], - // http://developers.whatwg.org/text-level-semantics.html - ['s', 'Inline', 'Inline', 'Common'], - ['var', 'Inline', 'Inline', 'Common'], - ['sub', 'Inline', 'Inline', 'Common'], - ['sup', 'Inline', 'Inline', 'Common'], - ['mark', 'Inline', 'Inline', 'Common'], - ['wbr', 'Inline', 'Empty', 'Core'], + // http://developers.whatwg.org/text-level-semantics.html + ['s', 'Inline', 'Inline', 'Common'], + ['var', 'Inline', 'Inline', 'Common'], + ['sub', 'Inline', 'Inline', 'Common'], + ['sup', 'Inline', 'Inline', 'Common'], + ['mark', 'Inline', 'Inline', 'Common'], + ['wbr', 'Inline', 'Empty', 'Core'], - // http://developers.whatwg.org/edits.html - ['ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], - ['del', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], - ], - 'attributes' => [ - ['iframe', 'allowfullscreen', 'Bool'], - ['table', 'height', 'Text'], - ['td', 'border', 'Text'], - ['th', 'border', 'Text'], - ['tr', 'width', 'Text'], - ['tr', 'height', 'Text'], - ['tr', 'border', 'Text'], - ], - ], - 'custom_attributes' => [ - ['a', 'target', 'Enum#_blank,_self,_target,_top'], - ], - 'custom_elements' => [ - ['u', 'Inline', 'Inline', 'Common'], - ], - ], + // http://developers.whatwg.org/edits.html + ['ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], + ['del', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']], + ], + 'attributes' => [ + ['iframe', 'allowfullscreen', 'Bool'], + ['table', 'height', 'Text'], + ['td', 'border', 'Text'], + ['th', 'border', 'Text'], + ['tr', 'width', 'Text'], + ['tr', 'height', 'Text'], + ['tr', 'border', 'Text'], + ], + ], + 'custom_attributes' => [ + ['a', 'target', 'Enum#_blank,_self,_target,_top'], + ], + 'custom_elements' => [ + ['u', 'Inline', 'Inline', 'Common'], + ], + ], ]; diff --git a/config/queue.php b/config/queue.php index 65030b39..2f41a66d 100644 --- a/config/queue.php +++ b/config/queue.php @@ -2,85 +2,85 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Queue Connection Name - |-------------------------------------------------------------------------- - | - | Laravel's queue API supports an assortment of back-ends via a single - | API, giving you convenient access to each back-end using the same - | syntax for every one. Here you may define a default connection. - | - */ + /* + |-------------------------------------------------------------------------- + | Default Queue Connection Name + |-------------------------------------------------------------------------- + | + | Laravel's queue API supports an assortment of back-ends via a single + | API, giving you convenient access to each back-end using the same + | syntax for every one. Here you may define a default connection. + | + */ - 'default' => env('QUEUE_DRIVER', 'sync'), + 'default' => env('QUEUE_DRIVER', 'sync'), - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | - */ + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | + */ - 'connections' => [ + 'connections' => [ - 'sync' => [ - 'driver' => 'sync', - ], + 'sync' => [ + 'driver' => 'sync', + ], - 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, - ], + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + ], - 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, - ], + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + ], - 'sqs' => [ - 'driver' => 'sqs', - 'key' => env('SQS_KEY', 'your-public-key'), - 'secret' => env('SQS_SECRET', 'your-secret-key'), - 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'your-queue-name'), - 'region' => env('SQS_REGION', 'us-east-1'), - ], + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('SQS_KEY', 'your-public-key'), + 'secret' => env('SQS_SECRET', 'your-secret-key'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'region' => env('SQS_REGION', 'us-east-1'), + ], - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => 'default', - 'retry_after' => 90, - 'block_for' => NULL, - ], + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => NULL, + ], - ], + ], - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ - 'failed' => [ - 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', - ], + 'failed' => [ + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', + ], ]; diff --git a/config/services.php b/config/services.php index 004c8f2d..aa1f7f82 100644 --- a/config/services.php +++ b/config/services.php @@ -2,37 +2,37 @@ return [ - /* - |-------------------------------------------------------------------------- - | Third Party Services - |-------------------------------------------------------------------------- - | - | This file is for storing the credentials for third party services such - | as Stripe, Mailgun, SparkPost and others. This file provides a sane - | default location for this type of information, allowing packages - | to have a conventional place to find your various credentials. - | - */ + /* + |-------------------------------------------------------------------------- + | Third Party Services + |-------------------------------------------------------------------------- + | + | This file is for storing the credentials for third party services such + | as Stripe, Mailgun, SparkPost and others. This file provides a sane + | default location for this type of information, allowing packages + | to have a conventional place to find your various credentials. + | + */ - 'mailgun' => [ - 'domain' => env('MAILGUN_DOMAIN'), - 'secret' => env('MAILGUN_SECRET'), - ], + 'mailgun' => [ + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), + ], - 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => env('SES_REGION', 'us-east-1'), - ], + 'ses' => [ + 'key' => env('SES_KEY'), + 'secret' => env('SES_SECRET'), + 'region' => env('SES_REGION', 'us-east-1'), + ], - 'sparkpost' => [ - 'secret' => env('SPARKPOST_SECRET'), - ], + 'sparkpost' => [ + 'secret' => env('SPARKPOST_SECRET'), + ], - 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), - 'secret' => env('STRIPE_SECRET'), - ], + 'stripe' => [ + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), + 'secret' => env('STRIPE_SECRET'), + ], ]; diff --git a/config/session.php b/config/session.php index 1036e496..d8ffcccf 100644 --- a/config/session.php +++ b/config/session.php @@ -2,196 +2,196 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Session Driver - |-------------------------------------------------------------------------- - | - | This option controls the default session "driver" that will be used on - | requests. By default, we will use the lightweight native driver but - | you may specify any of the other wonderful drivers provided here. - | - | Supported: "file", "cookie", "database", "apc", - | "memcached", "redis", "array" - | - */ + /* + |-------------------------------------------------------------------------- + | Default Session Driver + |-------------------------------------------------------------------------- + | + | This option controls the default session "driver" that will be used on + | requests. By default, we will use the lightweight native driver but + | you may specify any of the other wonderful drivers provided here. + | + | Supported: "file", "cookie", "database", "apc", + | "memcached", "redis", "array" + | + */ - 'driver' => env('SESSION_DRIVER', 'file'), + 'driver' => env('SESSION_DRIVER', 'file'), - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | + */ - 'lifetime' => env('SESSION_LIFETIME', 120), + 'lifetime' => env('SESSION_LIFETIME', 120), - 'expire_on_close' => FALSE, + 'expire_on_close' => FALSE, - /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | + */ - 'encrypt' => FALSE, + 'encrypt' => FALSE, - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | + */ - 'files' => storage_path('framework/sessions'), + 'files' => storage_path('framework/sessions'), - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ - 'connection' => NULL, + 'connection' => NULL, - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | + */ - 'table' => 'sessions', + 'table' => 'sessions', - /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | When using the "apc" or "memcached" session drivers, you may specify a - | cache store that should be used for these sessions. This value must - | correspond with one of the application's configured cache stores. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using the "apc" or "memcached" session drivers, you may specify a + | cache store that should be used for these sessions. This value must + | correspond with one of the application's configured cache stores. + | + */ - 'store' => NULL, + 'store' => NULL, - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ - 'lottery' => [2, 100], + 'lottery' => [2, 100], - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | + */ - 'cookie' => env( - 'SESSION_COOKIE', - str_slug(env('APP_NAME', 'laravel'), '_').'_session' - ), + 'cookie' => env( + 'SESSION_COOKIE', + str_slug(env('APP_NAME', 'laravel'), '_') . '_session' + ), - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | + */ - 'path' => '/', + 'path' => '/', - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | + */ - 'domain' => env('SESSION_DOMAIN', NULL), + 'domain' => env('SESSION_DOMAIN', NULL), - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | - */ + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | + */ - 'secure' => env('SESSION_SECURE_COOKIE', FALSE), + 'secure' => env('SESSION_SECURE_COOKIE', FALSE), - /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | - */ + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | + */ - 'http_only' => TRUE, + 'http_only' => TRUE, - /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | do not enable this as other CSRF protection services are in place. - | - | Supported: "lax", "strict" - | - */ + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | do not enable this as other CSRF protection services are in place. + | + | Supported: "lax", "strict" + | + */ - 'same_site' => NULL, + 'same_site' => NULL, ]; diff --git a/config/tinker.php b/config/tinker.php index 7a26fe65..181f0fdb 100644 --- a/config/tinker.php +++ b/config/tinker.php @@ -2,32 +2,32 @@ return [ - /* - |-------------------------------------------------------------------------- - | Console Commands - |-------------------------------------------------------------------------- - | - | This option allows you to add additional Artisan commands that should - | be available within the Tinker environment. Once the command is in - | this array you may execute the command in Tinker using its name. - | - */ + /* + |-------------------------------------------------------------------------- + | Console Commands + |-------------------------------------------------------------------------- + | + | This option allows you to add additional Artisan commands that should + | be available within the Tinker environment. Once the command is in + | this array you may execute the command in Tinker using its name. + | + */ - 'commands' => [ - // App\Console\Commands\ExampleCommand::class, - ], + 'commands' => [ + // App\Console\Commands\ExampleCommand::class, + ], - /* - |-------------------------------------------------------------------------- - | Alias Blacklist - |-------------------------------------------------------------------------- - | - | Typically, Tinker automatically aliases classes as you require them in - | Tinker. However, you may wish to never alias certain classes, which - | you may accomplish by listing the classes in the following array. - | - */ + /* + |-------------------------------------------------------------------------- + | Alias Blacklist + |-------------------------------------------------------------------------- + | + | Typically, Tinker automatically aliases classes as you require them in + | Tinker. However, you may wish to never alias certain classes, which + | you may accomplish by listing the classes in the following array. + | + */ - 'dont_alias' => [], + 'dont_alias' => [], ]; diff --git a/config/trustedproxy.php b/config/trustedproxy.php index f2001210..1e10103f 100644 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -2,49 +2,49 @@ return [ - /* - * Set trusted proxy IP addresses. - * - * Both IPv4 and IPv6 addresses are - * supported, along with CIDR notation. - * - * The "*" character is syntactic sugar - * within TrustedProxy to trust any proxy - * that connects directly to your server, - * a requirement when you cannot know the address - * of your proxy (e.g. if using ELB or similar). - * - */ - 'proxies' => NULL, // [,], '*', ',' + /* + * Set trusted proxy IP addresses. + * + * Both IPv4 and IPv6 addresses are + * supported, along with CIDR notation. + * + * The "*" character is syntactic sugar + * within TrustedProxy to trust any proxy + * that connects directly to your server, + * a requirement when you cannot know the address + * of your proxy (e.g. if using ELB or similar). + * + */ + 'proxies' => NULL, // [,], '*', ',' - /* - * To trust one or more specific proxies that connect - * directly to your server, use an array or a string separated by comma of IP addresses: - */ - // 'proxies' => ['192.168.1.1'], - // 'proxies' => '192.168.1.1, 192.168.1.2', + /* + * To trust one or more specific proxies that connect + * directly to your server, use an array or a string separated by comma of IP addresses: + */ + // 'proxies' => ['192.168.1.1'], + // 'proxies' => '192.168.1.1, 192.168.1.2', - /* - * Or, to trust all proxies that connect - * directly to your server, use a "*" - */ - // 'proxies' => '*', + /* + * Or, to trust all proxies that connect + * directly to your server, use a "*" + */ + // 'proxies' => '*', - /* - * Which headers to use to detect proxy related data (For, Host, Proto, Port) - * - * Options include: - * - * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust) - * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust) - * - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer) - * - * - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust) - * - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust) - * - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer) - * - * @link https://symfony.com/doc/current/deployment/proxies.html - */ - 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, + /* + * Which headers to use to detect proxy related data (For, Host, Proto, Port) + * + * Options include: + * + * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust) + * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust) + * - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer) + * + * - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust) + * - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust) + * - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer) + * + * @link https://symfony.com/doc/current/deployment/proxies.html + */ + 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, ]; diff --git a/config/version.php b/config/version.php index 828ca926..990e6934 100644 --- a/config/version.php +++ b/config/version.php @@ -1,6 +1,6 @@ '235', - 'name' => 'OtakuPanel' -]; \ No newline at end of file + 'number' => '210', + 'name' => 'SSRPanel_OtakuMod' +]; diff --git a/config/view.php b/config/view.php index 70e0b64f..2acfd9cc 100644 --- a/config/view.php +++ b/config/view.php @@ -2,32 +2,32 @@ return [ - /* - |-------------------------------------------------------------------------- - | View Storage Paths - |-------------------------------------------------------------------------- - | - | Most templating systems load templates from disk. Here you may specify - | an array of paths that should be checked for your views. Of course - | the usual Laravel view path has already been registered for you. - | - */ + /* + |-------------------------------------------------------------------------- + | View Storage Paths + |-------------------------------------------------------------------------- + | + | Most templating systems load templates from disk. Here you may specify + | an array of paths that should be checked for your views. Of course + | the usual Laravel view path has already been registered for you. + | + */ - 'paths' => [ - resource_path('views'), - ], + 'paths' => [ + resource_path('views'), + ], - /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | - */ + /* + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | + */ - 'compiled' => realpath(storage_path('framework/views')), + 'compiled' => realpath(storage_path('framework/views')), ]; diff --git a/resources/views/admin/affiliate/affiliateDetail.blade.php b/resources/views/admin/affiliate/affiliateDetail.blade.php index d4b9c96d..3c26dd44 100644 --- a/resources/views/admin/affiliate/affiliateDetail.blade.php +++ b/resources/views/admin/affiliate/affiliateDetail.blade.php @@ -1,70 +1,73 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

提现申请详情

-
- @if($info->status == -1) - 已驳回 - @elseif($info->status == 2) - 已打款 - @endif - 返 回 -
-
-
-
- - - - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - @endforeach - -
申请单ID:{{$info->id}} | 申请人:{{$info->user->email}} | 申请提现金额:¥{{$info->amount}} | 申请时间:{{$info->created_at}}
# 关联人 关联订单 订单金额 佣金 下单时间
{{$vo->id}} {{empty($vo->user) ? '【账号已删除】' : $vo->user->email}} - {{$vo->order->goods->name}} - ¥{{$vo->amount}} ¥{{$vo->ref_amount}} {{$vo->created_at}}
-
-
- -
-
+
+
+
+

提现申请详情

+
+ @if($info->status == -1) + 已驳回 + @elseif($info->status == 2) + 已打款 + @endif + 返 回 +
+
+
+
+ + + + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + @endforeach + +
申请单ID:{{$info->id}} | 申请人:{{$info->user->email}} | 申请提现金额:¥{{$info->amount}} + | 申请时间:{{$info->created_at}}
# 关联人 关联订单 订单金额 佣金 下单时间
{{$vo->id}} {{empty($vo->user) ? '【账号已删除】' : $vo->user->email}} + {{$vo->order->goods->name}} + ¥{{$vo->amount}} ¥{{$vo->ref_amount}} {{$vo->created_at}}
+
+
+ +
+
@endsection @section('script') - - -@endsection \ No newline at end of file + + +@endsection diff --git a/resources/views/admin/affiliate/affiliateList.blade.php b/resources/views/admin/affiliate/affiliateList.blade.php index 15d9a30f..a756ca37 100644 --- a/resources/views/admin/affiliate/affiliateList.blade.php +++ b/resources/views/admin/affiliate/affiliateList.blade.php @@ -1,132 +1,142 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

提现申请列表

-
-
-
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - @foreach($applyList as $apply) - - - - - - - - - - @endforeach - -
# 申请时间 申请账号 申请提现金额 状态 处理时间 操作
{{$apply->id}} {{$apply->created_at}} - @if(empty($apply->user)) - 【账号已删除】 - @else - {{$apply->user->email}} - @endif - ¥{{$apply->amount}} - @if($apply->status == -1) - 驳 回 - @elseif($apply->status == 0) - 待审核 - @elseif($apply->status == 2) - 已打款 - @else - 待打款 - @endif - {{$apply->created_at == $apply->updated_at ? '' : $apply->updated_at}} -
- @if($apply->status == 0) - 通过 - 驳回 - @elseif($apply->status == 1) - 已打款 - @endif - -
-
-
- -
-
+
+
+
+

提现申请列表

+
+
+
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + @foreach($applyList as $apply) + + + + + + + + + + @endforeach + +
# 申请时间 申请账号 申请提现金额 状态 处理时间 操作
{{$apply->id}} {{$apply->created_at}} + @if(empty($apply->user)) + 【账号已删除】 + @else + {{$apply->user->email}} + @endif + ¥{{$apply->amount}} + @if($apply->status == -1) + 驳 回 + @elseif($apply->status == 0) + 待审核 + @elseif($apply->status == 2) + 已打款 + @else + 待打款 + @endif + {{$apply->created_at == $apply->updated_at ? '' : $apply->updated_at}} +
+ @if($apply->status == 0) + 通过 + 驳回 + @elseif($apply->status == 1) + 已打款 + @endif + +
+
+
+ +
+
@endsection @section('script') - - - + + + // 更改状态 + function setStatus(id, status) { + $.post("/admin/setAffStatus", {_token: '{{csrf_token()}}', id: id, status: status}, function (ret) { + if (ret.status === 'success') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => window.location.reload()) + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + }); + } + @endsection diff --git a/resources/views/admin/affiliate/userRebateList.blade.php b/resources/views/admin/affiliate/userRebateList.blade.php index d34373d7..d5a027c8 100644 --- a/resources/views/admin/affiliate/userRebateList.blade.php +++ b/resources/views/admin/affiliate/userRebateList.blade.php @@ -1,120 +1,123 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

返利流水记录

-
-
-
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - - - @endforeach - -
# 消费者 邀请者 订单号 消费金额 返利金额 生成时间 处理时间 状态
{{$vo->id}} - @if(empty($vo->user)) - 【账号已删除】 - @else - {{$vo->user->email}} - @endif - - @if(empty($vo->ref_user)) - 【账号已删除】 - @else - {{$vo->ref_user->email}} - @endif - {{$vo->order_id}} {{$vo->amount}} {{$vo->ref_amount}} {{$vo->created_at}} {{$vo->updated_at}} - @if ($vo->status == 1) - 申请中 - @elseif($vo->status == 2) - 已提现 - @else - 未提现 - @endif -
-
- -
-
+
+
+
+

返利流水记录

+
+
+
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + + + @endforeach + +
# 消费者 邀请者 订单号 消费金额 返利金额 生成时间 处理时间 状态
{{$vo->id}} + @if(empty($vo->user)) + 【账号已删除】 + @else + {{$vo->user->email}} + @endif + + @if(empty($vo->ref_user)) + 【账号已删除】 + @else + {{$vo->ref_user->email}} + @endif + {{$vo->order_id}} {{$vo->amount}} {{$vo->ref_amount}} {{$vo->created_at}} {{$vo->updated_at}} + @if ($vo->status == 1) + 申请中 + @elseif($vo->status == 2) + 已提现 + @else + 未提现 + @endif +
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/admin/userRebateList' + '?email=' + $("#email").val() + '&ref_email=' + $("#ref_email").val() + '&status=' + $("#status option:selected").val(); + } + @endsection diff --git a/resources/views/admin/analysis.blade.php b/resources/views/admin/analysis.blade.php index abbfd67a..871f40e5 100644 --- a/resources/views/admin/analysis.blade.php +++ b/resources/views/admin/analysis.blade.php @@ -1,100 +1,103 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

日志分析 - 仅适用于单机单节点 -

-
- @if (Session::has('analysisErrorMsg')) - - @endif -
- - - - - - - - @if(empty($urlList)) - - - - @else - @foreach($urlList as $url) - - - - @endforeach - @endif - -
近期请求地址
访问记录不足15000条,无法分析数据
{{$url}}
-
-
-
+
+
+
+

日志分析 + 仅适用于单机单节点 +

+
+ @if (Session::has('analysisErrorMsg')) + + @endif +
+ + + + + + + + @if(empty($urlList)) + + + + @else + @foreach($urlList as $url) + + + + @endforeach + @endif + +
近期请求地址
访问记录不足15000条,无法分析数据
{{$url}}
+
+
+
@endsection @section('script') - - + + - -@endsection \ No newline at end of file + $('#is_rand_port').on({ + 'switchChange.bootstrapSwitch': function (event, state) { + $.post("/admin/enableRandPort", {_token: '{{csrf_token()}}', value: state ? 1 : 0}, function (ret) { + console.log(ret); + }); + } + }); + +@endsection diff --git a/resources/views/admin/article/addArticle.blade.php b/resources/views/admin/article/addArticle.blade.php index e3a595b6..2000fdf4 100644 --- a/resources/views/admin/article/addArticle.blade.php +++ b/resources/views/admin/article/addArticle.blade.php @@ -1,128 +1,132 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

添加文章

-
- @if($errors->any()) -
- - {{$errors->first()}} -
- @endif -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- -
- - {{csrf_field()}} -
-
-
- -
- -
-
-
- -
- -
- 值越高显示时越靠前 -
-
+
+ +
+ +
+
+
+
+ 返 回 + +
+
+ +
+
+
@endsection @section('script') - - - - - + + + + + @endsection diff --git a/resources/views/admin/article/articleList.blade.php b/resources/views/admin/article/articleList.blade.php index 3f0377dc..60be1043 100644 --- a/resources/views/admin/article/articleList.blade.php +++ b/resources/views/admin/article/articleList.blade.php @@ -1,98 +1,102 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

文章列表

- -
-
- - - - - - - - - - - - - @foreach($list as $vo) - - - @if ($vo->type == '1') - - @elseif ($vo->type == '2') - - @elseif ($vo->type == '3') - - @elseif ($vo->type == '4') - - @else - - @endif - - - - - - @endforeach - -
# 类型 标题 排序 发布日期 操作
{{$vo->id}} 文章 公告 购买说明 使用教程 未知 - {{\Illuminate\Support\Str::limit($vo->title, 80)}} - {{$vo->sort}} {{$vo->created_at}} -
- - -
-
-
- -
-
+
+
+
+

文章列表

+ +
+
+ + + + + + + + + + + + + @foreach($list as $vo) + + + @if ($vo->type == '1') + + @elseif ($vo->type == '2') + + @elseif ($vo->type == '3') + + @elseif ($vo->type == '4') + + @else + + @endif + + + + + + @endforeach + +
# 类型 标题 排序 发布日期 操作
{{$vo->id}} 文章 公告 购买说明 使用教程 未知 + {{\Illuminate\Support\Str::limit($vo->title, 80)}} + {{$vo->sort}} {{$vo->created_at}} +
+ + +
+
+
+ +
+
@endsection @section('script') - - - + + + @endsection diff --git a/resources/views/admin/article/editArticle.blade.php b/resources/views/admin/article/editArticle.blade.php index 78d87a55..e44ca437 100644 --- a/resources/views/admin/article/editArticle.blade.php +++ b/resources/views/admin/article/editArticle.blade.php @@ -1,118 +1,132 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

编辑文章

-
- @if (Session::has('successMsg')) -
- - {{Session::get('successMsg')}} -
- @endif - @if (Session::has('errorMsg')) -
- - 错误: {{Session::get('errorMsg')}} -
- @endif - -
-
-
- -
-
- type == '1' ? 'checked' : ''}} disabled/> - -
-
- type == '2' ? 'checked' : ''}} disabled/> - -
-
- type == '3' ? 'checked' : ''}} disabled/> - -
-
- type == '4' ? 'checked' : ''}} disabled/> - -
-
- -
-
- -
- - - {{csrf_field()}} -
-
- @if($article->type == 1) -
- -
- -
-
- @endif - @if($article->type == 1 || $article->type == 3) -
- -
- -
- 值越高显示时越靠前 -
- @endif - @if($article->type != 2) -
- - @if($article->type == 1) -
- logo?:'/assets/images/default.png'}} /> - 推荐尺寸:100x75 -
- @else -
- @if($article->logo) -
- -
- @endif - -
- 图标列表 | 格式: fa-windows - @endif -
- @endif -
- -
- -
-
-
-
- 返 回 - -
-
-
-
-
-
+
+
+
+

编辑文章

+
+ @if (Session::has('successMsg')) +
+ + {{Session::get('successMsg')}} +
+ @endif + @if (Session::has('errorMsg')) +
+ + 错误: {{Session::get('errorMsg')}} +
+ @endif + +
+
+
+ +
+
+ type == '1' ? 'checked' : ''}} disabled/> + +
+
+ type == '2' ? 'checked' : ''}} disabled/> + +
+
+ type == '3' ? 'checked' : ''}} disabled/> + +
+
+ type == '4' ? 'checked' : ''}} disabled/> + +
+
+ +
+
+ +
+ + + {{csrf_field()}} +
+
+ @if($article->type == 1) +
+ +
+ +
+
+ @endif + @if($article->type == 1 || $article->type == 3) +
+ +
+ +
+ 值越高显示时越靠前 +
+ @endif + @if($article->type != 2) +
+ + @if($article->type == 1) +
+ logo?:'/assets/images/default.png'}} /> + 推荐尺寸:100x75 +
+ @else +
+ @if($article->logo) +
+ +
+ @endif + +
+ 图标列表 | 格式: fa-windows + @endif +
+ @endif +
+ +
+ +
+
+
+
+ 返 回 + +
+
+
+
+
+
@endsection @section('script') - - - - + + + + @endsection diff --git a/resources/views/admin/config.blade.php b/resources/views/admin/config.blade.php index a064fd8a..d634b8a3 100644 --- a/resources/views/admin/config.blade.php +++ b/resources/views/admin/config.blade.php @@ -1,538 +1,594 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

通用配置

-
-
- -
-
-
+
+
+
+

通用配置

+
+
+ +
+
+
- - - + + + @endsection @section('script') - - - - + + + + - + // 置为默认 + function setDefault(id) { + $.ajax({ + type: "POST", + url: "/admin/setDefaultConfig", + async: false, + data: {_token: '{{csrf_token()}}', id: id}, + dataType: 'json', + success: function (ret) { + if (ret.status === 'success') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => window.location.href = '/admin/config') + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + } + }); + } + @endsection diff --git a/resources/views/admin/convert.blade.php b/resources/views/admin/convert.blade.php index ea4029d2..178e4c0b 100644 --- a/resources/views/admin/convert.blade.php +++ b/resources/views/admin/convert.blade.php @@ -1,117 +1,124 @@ @extends('admin.layouts') @section('content') -
-
-
-

格式转换 - Shadowsocks 转 ShadowsocksR -

-
-
-
-
- - -
-
- -
- - GB -
-
-
- - +
+
+
+

格式转换 + Shadowsocks 转 ShadowsocksR +

+
+
+
+
+ + +
+
+ +
+ + GB +
+
+
+ + -
-
- - -
-
- - -
-
- - -
-
- -
-
- -
-
- -
-
- 下 载 -
-
-
-
-
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ 下 载 +
+
+
+
+
@endsection @section('script') - + if (content.trim() === '') { + swal.fire({title: '请填入要转换的配置信息', type: 'warning', timer: 1000, showConfirmButton: false}); + return; + } + swal.fire({ + title: '确定继续转换吗?', + type: 'question', + allowEnterKey: false, + showCancelButton: true, + cancelButtonText: '{{trans('home.ticket_close')}}', + confirmButtonText: '{{trans('home.ticket_confirm')}}', + }).then((result) => { + if (result.value) { + $.ajax({ + type: "POST", + url: "/admin/convert", + async: false, + data: { + _token: '{{csrf_token()}}', + method: $('#method').val(), + transfer_enable: $('#transfer_enable').val(), + protocol: $('#protocol').val(), + protocol_param: $('#protocol_param').val(), + obfs: $('#obfs').val(), + obfs_param: $('#obfs_param').val(), + content: content + }, + dataType: 'json', + success: function (ret) { + if (ret.status === 'success') { + $("#result").val(ret.data); + } else { + $("#result").val(ret.message); + } + } + }) + } + }); + return false; + } + @endsection diff --git a/resources/views/admin/coupon/addCoupon.blade.php b/resources/views/admin/coupon/addCoupon.blade.php index f09b5969..9c3faf53 100644 --- a/resources/views/admin/coupon/addCoupon.blade.php +++ b/resources/views/admin/coupon/addCoupon.blade.php @@ -1,174 +1,190 @@ @extends('admin.layouts') @section('css') - - - + + + @endsection @section('content') -
-
-
-

生成卡券

-
- 返 回 -
-
- @if (Session::has('successMsg')) -
- - {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- - {{$errors->first()}} -
- @endif -
-
-
- -
- - {{csrf_field()}} -
- 会用于前端显示 -
-
- -
- -
- 提供给用户使用卡券的卡券,留空则默认为8位随机码 -
-
- -
- -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- 抵用:抵扣商品金额,折扣:商品百分比打折,充值:充值用户账号余额 -
-
- -
-
- - -
-
- - -
-
- 一次性:任一用户使用后,卡券即可失效;重复使用:任何用户都可无限次使用直到有效期为止 -
- -
- -
- - -
-
-
- -
- - -
- 当套餐超过N值时,才能使用本优惠劵;0即使用无限制 -
-
- -
- - -
-
-
- -
-
- -
- -
- -
- -
-
-
- -
-
-
-
-
+
+
+
+

生成卡券

+
+ 返 回 +
+
+ @if (Session::has('successMsg')) +
+ + {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ + {{$errors->first()}} +
+ @endif +
+
+
+ +
+ + {{csrf_field()}} +
+ 会用于前端显示 +
+
+ +
+ +
+ 提供给用户使用卡券的卡券,留空则默认为8位随机码 +
+
+ +
+ +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ 抵用:抵扣商品金额,折扣:商品百分比打折,充值:充值用户账号余额 +
+
+ +
+
+ + +
+
+ + +
+
+ 一次性:任一用户使用后,卡券即可失效;重复使用:任何用户都可无限次使用直到有效期为止 +
+ +
+ +
+ + +
+
+
+ +
+ + +
+ 当套餐超过N值时,才能使用本优惠劵;0即使用无限制 +
+
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+
+
@endsection @section('script') - - - - + + + + - -@endsection \ No newline at end of file + $("input[name='type']").change(function () { + if ($(this).val() === '2') { + $("#discount").attr("required", true); + $("#amount").attr("required", false); + $("#rule").attr("required", true); + $(".discount").show(); + $(".usage").show(); + $(".amount").hide(); + } else if ($(this).val() === '3') { + $("#discount").attr("required", false); + $("#amount").attr("required", true); + $("#rule").attr("required", false); + $(".discount").hide(); + $(".usage").hide(); + $(".amount").show(); + } else { + $("#discount").attr("required", false); + $("#amount").attr("required", true); + $("#rule").attr("required", true); + $(".discount").hide(); + $(".usage").show(); + $(".amount").show(); + } + }); + +@endsection diff --git a/resources/views/admin/coupon/couponList.blade.php b/resources/views/admin/coupon/couponList.blade.php index 5b34d1d1..5ef734ef 100644 --- a/resources/views/admin/coupon/couponList.blade.php +++ b/resources/views/admin/coupon/couponList.blade.php @@ -1,184 +1,189 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

卡券列表

-
- - 生成 -
-
-
-
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - - - @foreach($couponList as $coupon) - - - - - - - - - - - - - @endforeach - -
# 名称 券码 图片 类型 用途 优惠 有效期 状态 操作
{{$coupon->id}} {{$coupon->name}} {{$coupon->sn}} @if($coupon->logo) 优惠码logo @endif - @if($coupon->type == '1') - 抵用券 - @elseif($coupon->type == '2') - 折扣券 - @else - 充值券 - @endif - {{$coupon->usage == '1' ? '一次性' : '重复使用'}} - @if($coupon->type == 2) - {{$coupon->discount}}折 - @else - {{$coupon->amount}}元 - @endif - {{date('Y-m-d', $coupon->available_start)}} ~ {{date('Y-m-d', $coupon->available_end)}} - @if($coupon->usage == 1) - @if($coupon->status == '1') - 已使用 - @elseif ($coupon->status == '2') - 已失效 - @else - 未使用 - @endif - @elseif ($coupon->usage == 2) - @if ($coupon->status == '2') - 已失效 - @else - 生效中 - @endif - @endif - - @if($coupon->status != '1') - - @endif -
-
- -
-
+
+
+
+

卡券列表

+
+ + 生成 +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + + + @foreach($couponList as $coupon) + + + + + + + + + + + + + @endforeach + +
# 名称 券码 图片 类型 用途 优惠 有效期 状态 操作
{{$coupon->id}} {{$coupon->name}} {{$coupon->sn}} @if($coupon->logo) 优惠码logo @endif + @if($coupon->type == '1') + 抵用券 + @elseif($coupon->type == '2') + 折扣券 + @else + 充值券 + @endif + {{$coupon->usage == '1' ? '一次性' : '重复使用'}} + @if($coupon->type == 2) + {{$coupon->discount}}折 + @else + {{$coupon->amount}}元 + @endif + {{date('Y-m-d', $coupon->available_start)}} + ~ {{date('Y-m-d', $coupon->available_end)}} + @if($coupon->usage == 1) + @if($coupon->status == '1') + 已使用 + @elseif ($coupon->status == '2') + 已失效 + @else + 未使用 + @endif + @elseif ($coupon->usage == 2) + @if ($coupon->status == '2') + 已失效 + @else + 生效中 + @endif + @endif + + @if($coupon->status != '1') + + @endif +
+
+ +
+
@endsection @section('script') - - - + + + // 删除卡券 + function delCoupon(id, name) { + swal.fire({ + title: '确定删除卡券 【' + name + '】 吗?', + type: 'question', + allowEnterKey: false, + showCancelButton: true, + cancelButtonText: '{{trans('home.ticket_close')}}', + confirmButtonText: '{{trans('home.ticket_confirm')}}', + }).then((result) => { + if (result.value) { + $.post("/coupon/delCoupon", {id: id, _token: '{{csrf_token()}}'}, function (ret) { + if (ret.status === 'success') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => window.location.reload()) + } else { + swal.fire({title: ret.message, type: "error"}) + } + }); + } + }) + } + @endsection diff --git a/resources/views/admin/decompile.blade.php b/resources/views/admin/decompile.blade.php index 7d5d08d4..2190d173 100644 --- a/resources/views/admin/decompile.blade.php +++ b/resources/views/admin/decompile.blade.php @@ -1,65 +1,67 @@ @extends('admin.layouts') @section('content') -
-
-
-

反解析

-
-
-
-
- -
-
- -
-
- -
-
- 下 载 -
-
-
-
-
+
+
+
+

反解析

+
+
+
+
+ +
+
+ +
+
+ +
+
+ 下 载 +
+
+
+
+
@endsection @section('script') - + if (content.trim() === '') { + swal.fire({title: '请填入要反解析的链接信息', type: 'warning', timer: 1000, showConfirmButton: false}); + return; + } + swal.fire({ + title: '确定继续反解析吗?', + type: 'question', + allowEnterKey: false, + showCancelButton: true, + cancelButtonText: '{{trans('home.ticket_close')}}', + confirmButtonText: '{{trans('home.ticket_confirm')}}', + }).then((result) => { + if (result.value) { + $.ajax({ + type: "POST", + url: "/admin/decompile", + async: false, + data: {_token: '{{csrf_token()}}', content: content}, + dataType: 'json', + success: function (ret) { + if (ret.status === 'success') { + $("#result").val(ret.data); + } else { + $("#result").val(ret.message); + } + } + }) + } + }); + return false; + } + @endsection diff --git a/resources/views/admin/export.blade.php b/resources/views/admin/export.blade.php index ff3bdc7b..eb2f50ee 100644 --- a/resources/views/admin/export.blade.php +++ b/resources/views/admin/export.blade.php @@ -1,106 +1,113 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

【{{$user->email}}】连接配置信息

-
-
- - - - - - - - - - - - - @foreach($nodeList as $node) - - - - - - - - - @endforeach - -
#节点扩展域名IPv4配置信息
{{$loop->iteration}} - {{$node->name}} - - @if($node->compatible) @endif - @if($node->single) @endif - @if($node->ipv6) IPv6 @endif - {{$node->server}}{{$node->ip}} -
- - - -
-
-
- +
+
> @endsection @section('script') - - - - + + + + - + @endsection diff --git a/resources/views/admin/group/addGroup.blade.php b/resources/views/admin/group/addGroup.blade.php index 20dd86a5..c19af118 100644 --- a/resources/views/admin/group/addGroup.blade.php +++ b/resources/views/admin/group/addGroup.blade.php @@ -1,61 +1,65 @@ @extends('admin.layouts') @section('content') -
-
-
-

添加节点分组

-
- @if (Session::has('errorMsg')) -
- - 错误: {{Session::get('errorMsg')}} -
- @endif -
-
-
- - -
-
- - - 暂时无用                                                                         -
-
- -
-
-
-
-
+
+
+
+

添加节点分组

+
+ @if (Session::has('errorMsg')) +
+ + 错误: {{Session::get('errorMsg')}} +
+ @endif +
+
+
+ + +
+
+ + + 暂时无用                                                                         +
+
+ +
+
+
+
+
@endsection @section('script') - + @endsection diff --git a/resources/views/admin/group/editGroup.blade.php b/resources/views/admin/group/editGroup.blade.php index 82af6f2b..ec2c5d8a 100644 --- a/resources/views/admin/group/editGroup.blade.php +++ b/resources/views/admin/group/editGroup.blade.php @@ -1,61 +1,67 @@ @extends('admin.layouts') @section('content') -
-
-
-

编辑节点分组

-
- @if (Session::has('errorMsg')) -
- - 错误: {{Session::get('errorMsg')}} -
- @endif -
-
-
- - -
-
- - - 暂时无用                                                                         -
-
- -
-
-
-
-
+
+
+
+

编辑节点分组

+
+ @if (Session::has('errorMsg')) +
+ + 错误: {{Session::get('errorMsg')}} +
+ @endif +
+
+
+ + +
+
+ + + 暂时无用                                                                         +
+
+ +
+
+
+
+
@endsection @section('script') - + @endsection diff --git a/resources/views/admin/group/groupList.blade.php b/resources/views/admin/group/groupList.blade.php index 69b47587..08b36a8d 100644 --- a/resources/views/admin/group/groupList.blade.php +++ b/resources/views/admin/group/groupList.blade.php @@ -1,83 +1,87 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

节点分组

- -
-
- - - - - - - - - - - @foreach($groupList as $group) - - - - - - - @endforeach - -
# 分组名称 分组级别 操作
{{$group->id}} {{$group->name}} {{$levelMap[$group->level]}} -
- - -
-
-
- -
-
+
+
+
+

节点分组

+ +
+
+ + + + + + + + + + + @foreach($groupList as $group) + + + + + + + @endforeach + +
# 分组名称 分组级别 操作
{{$group->id}} {{$group->name}} {{$levelMap[$group->level]}} +
+ + +
+
+
+ +
+
@endsection @section('script') - - - + + + @endsection diff --git a/resources/views/admin/import.blade.php b/resources/views/admin/import.blade.php index 5378c7c5..ba58af6e 100644 --- a/resources/views/admin/import.blade.php +++ b/resources/views/admin/import.blade.php @@ -1,35 +1,38 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

数据导入

-
- @if (Session::has('successMsg')) - - @endif - @if($errors->any()) - - @endif -
-
- - {{csrf_field()}} - -
-
-
-
+
+
+
+

数据导入

+
+ @if (Session::has('successMsg')) + + @endif + @if($errors->any()) + + @endif +
+
+ + {{csrf_field()}} + +
+
+
+
@endsection @section('script') - -@endsection \ No newline at end of file + +@endsection diff --git a/resources/views/admin/index.blade.php b/resources/views/admin/index.blade.php index 01b9220c..7037145b 100644 --- a/resources/views/admin/index.blade.php +++ b/resources/views/admin/index.blade.php @@ -1,266 +1,267 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') - + @endsection @section('script') - - - + + + @endsection diff --git a/resources/views/admin/inviteList.blade.php b/resources/views/admin/inviteList.blade.php index 1e91d5ae..4027aa5e 100644 --- a/resources/views/admin/inviteList.blade.php +++ b/resources/views/admin/inviteList.blade.php @@ -1,143 +1,148 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-
-
-

{{trans('home.invite_code_make')}} -

-

- {{trans('home.invite_code_tips1')}} - 10 {{trans('home.invite_code_tips2', ['days' => \App\Components\Helpers::systemConfig()['user_invite_days']])}} -

- -
-
-
-
-
-
-

{{trans('home.invite_code_my_codes')}} -

-
- -
-
-
- - - - - - - - - - - - - @foreach($inviteList as $invite) - - - - - - - - - @endforeach - -
# {{trans('home.invite_code_table_name')}} {{trans('home.invite_code_table_date')}} 生成者 {{trans('home.invite_code_table_status')}} {{trans('home.invite_code_table_user')}}
{{$invite->id}} - {{$invite->code}} - {{$invite->dateline}} - {{$invite->uid == 0 ? '系统生成' : (empty($invite->generator) ? '【账号已删除】' : $invite->generator->email)}} - - {!!$invite->status_label!!} - - {{$invite->status == 1 ? (empty($invite->user) ? '【账号已删除】' : $invite->user->email) : ''}} -
-
- -
-
-
-
+
+
+
+
+
+

{{trans('home.invite_code_make')}} +

+

+ {{trans('home.invite_code_tips1')}} + + 10 {{trans('home.invite_code_tips2', ['days' => \App\Components\Helpers::systemConfig()['user_invite_days']])}} +

+ +
+
+
+
+
+
+

{{trans('home.invite_code_my_codes')}} +

+
+ +
+
+
+ + + + + + + + + + + + + @foreach($inviteList as $invite) + + + + + + + + + @endforeach + +
# {{trans('home.invite_code_table_name')}} {{trans('home.invite_code_table_date')}} 生成者 {{trans('home.invite_code_table_status')}} {{trans('home.invite_code_table_user')}}
{{$invite->id}} + {{$invite->code}} + {{$invite->dateline}} + {{$invite->uid == 0 ? '系统生成' : (empty($invite->generator) ? '【账号已删除】' : $invite->generator->email)}} + + {!!$invite->status_label!!} + + {{$invite->status == 1 ? (empty($invite->user) ? '【账号已删除】' : $invite->user->email) : ''}} +
+
+ +
+
+
+
@endsection @section('script') - - - - + + + + const clipboard = new ClipboardJS('.mt-clipboard'); + clipboard.on('success', function () { + swal.fire({ + title: '复制成功', + type: 'success', + timer: 1300, + showConfirmButton: false + }); + }); + clipboard.on('error', function () { + swal.fire({ + title: '复制失败,请手动复制', + type: 'error', + timer: 1500, + showConfirmButton: false + }); + }); + @endsection diff --git a/resources/views/admin/label/addLabel.blade.php b/resources/views/admin/label/addLabel.blade.php index bab50961..6371b06e 100644 --- a/resources/views/admin/label/addLabel.blade.php +++ b/resources/views/admin/label/addLabel.blade.php @@ -1,55 +1,58 @@ @extends('admin.layouts') @section('content') -
-
-
-

添加标签

-
- @if (Session::has('errorMsg')) -
- - 错误: {{Session::get('errorMsg')}} -
- @endif -
-
-
- - -
-
- - - 排序值越高显示时越靠前                                          -
-
- -
-
-
-
-
+
+
+
+

添加标签

+
+ @if (Session::has('errorMsg')) +
+ + 错误: {{Session::get('errorMsg')}} +
+ @endif +
+
+
+ + +
+
+ + + 排序值越高显示时越靠前                                          +
+
+ +
+
+
+
+
@endsection @section('script') - + @endsection diff --git a/resources/views/admin/label/editLabel.blade.php b/resources/views/admin/label/editLabel.blade.php index f466d10e..4e8b19a7 100644 --- a/resources/views/admin/label/editLabel.blade.php +++ b/resources/views/admin/label/editLabel.blade.php @@ -1,55 +1,65 @@ @extends('admin.layouts') @section('content') -
-
-
-

编辑标签

-
- @if (Session::has('errorMsg')) -
- - 错误: {{Session::get('errorMsg')}} -
- @endif -
-
-
- - -
-
- - - 排序值越高显示时越靠前                                          -
-
- -
-
-
-
-
+
+
+
+

编辑标签

+
+ @if (Session::has('errorMsg')) +
+ + 错误: {{Session::get('errorMsg')}} +
+ @endif +
+
+
+ + +
+
+ + + 排序值越高显示时越靠前                                          +
+
+ +
+
+
+
+
@endsection @section('script') - + @endsection diff --git a/resources/views/admin/label/labelList.blade.php b/resources/views/admin/label/labelList.blade.php index 6776baf3..7c9c1e78 100644 --- a/resources/views/admin/label/labelList.blade.php +++ b/resources/views/admin/label/labelList.blade.php @@ -1,89 +1,93 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

标签列表 - 标签影响用户查看/订阅节点信息(用户和节点通过标签进行关联) -

- -
-
- - - - - - - - - - - - - @foreach($labelList as $label) - - - - - - - - - @endforeach - -
# 名称 关联用户数 关联节点数 排序 操作
{{$label->id}} {{$label->name}} {{$label->userCount}} {{$label->nodeCount}} {{$label->sort}} -
- - -
-
-
- -
-
+
+
+
+

标签列表 + 标签影响用户查看/订阅节点信息(用户和节点通过标签进行关联) +

+ +
+
+ + + + + + + + + + + + + @foreach($labelList as $label) + + + + + + + + + @endforeach + +
# 名称 关联用户数 关联节点数 排序 操作
{{$label->id}} {{$label->name}} {{$label->userCount}} {{$label->nodeCount}} {{$label->sort}} +
+ + +
+
+
+ +
+
@endsection @section('script') - - - + + + @endsection diff --git a/resources/views/admin/layouts.blade.php b/resources/views/admin/layouts.blade.php index 6ecef7f3..bc708b04 100644 --- a/resources/views/admin/layouts.blade.php +++ b/resources/views/admin/layouts.blade.php @@ -7,370 +7,382 @@ - - {{\App\Components\Helpers::systemConfig()['website_name']}} - - - - - - - - - - - - - - - - - @yield('css') - - - - - - - - - + + {{\App\Components\Helpers::systemConfig()['website_name']}} + + + + + + + + + + + + + + + + + @yield('css') + + + + + + + + + -
- - @yield('content') + + @yield('content')
@@ -401,7 +413,7 @@ @@ -409,13 +421,13 @@ @yield('script') diff --git a/resources/views/admin/logs/callbackList.blade.php b/resources/views/admin/logs/callbackList.blade.php index 27484ae5..dea69f4a 100644 --- a/resources/views/admin/logs/callbackList.blade.php +++ b/resources/views/admin/logs/callbackList.blade.php @@ -1,108 +1,112 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

回调日志 - (在线支付) -

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - @endforeach - -
# 支付方式 平台订单号 本地订单号 交易金额 状态
{{$vo->id}} {{$vo->type_label}} {{$vo->trade_no}} - {{$vo->out_trade_no}} - {{$vo->amount}}元 {!! $vo->trade_status_label !!} {{$vo->created_at}}
-
- -
-
+
+
+
+

回调日志 + (在线支付) +

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + @endforeach + +
# 支付方式 平台订单号 本地订单号 交易金额 状态
{{$vo->id}} {{$vo->type_label}} {{$vo->trade_no}} + {{$vo->out_trade_no}} + {{$vo->amount}}元 {!! $vo->trade_status_label !!} {{$vo->created_at}}
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/payment/callbackList?out_trade_no=' + $("#trade_no").val() + '&trade_no=' + $("#out_trade_no").val() + '&type=' + $("#type option:selected").val() + '&trade_status=' + $("#trade_status option:selected").val(); + } + @endsection diff --git a/resources/views/admin/logs/nodePingLog.blade.php b/resources/views/admin/logs/nodePingLog.blade.php index fa42a896..f9a0e27b 100644 --- a/resources/views/admin/logs/nodePingLog.blade.php +++ b/resources/views/admin/logs/nodePingLog.blade.php @@ -1,78 +1,80 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

线路Ping测速日志

-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - - @foreach($pingLogs as $log) - - - - - - - - - @endforeach - -
# 节点 速度
电信联通移动香港
{{$log->id}} {{$log->node->name}} {{$log->ct? $log->ct.' ms': '无'}} {{$log->cu? $log->cu.' ms': '无'}} {{$log->cm? $log->cm.' ms': '无'}} {{$log->hk? $log->hk.' ms': '无'}}
-
- -
-
+
+
+
+

线路Ping测速日志

+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + + @foreach($pingLogs as $log) + + + + + + + + + @endforeach + +
# 节点 速度
电信联通移动香港
{{$log->id}} {{$log->node->name}} {{$log->ct? $log->ct.' ms': '无'}} {{$log->cu? $log->cu.' ms': '无'}} {{$log->cm? $log->cm.' ms': '无'}} {{$log->hk? $log->hk.' ms': '无'}}
+
+ +
+
@endsection @section('script') - - - + + + @endsection diff --git a/resources/views/admin/logs/notificationLog.blade.php b/resources/views/admin/logs/notificationLog.blade.php index be3e8ef9..fb892f33 100644 --- a/resources/views/admin/logs/notificationLog.blade.php +++ b/resources/views/admin/logs/notificationLog.blade.php @@ -1,96 +1,99 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

邮件投递记录

-
-
-
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - - @endforeach - -
# 类型 识别码 收信地址 标题 内容 投递时间 投递状态
{{$vo->id}} {{$vo->type == 1 ? 'Email' : ($vo->type == 2? 'ServerChan': 'Bark')}} @if($vo->type == 3) - {{$vo->code}} @endif {{$vo->address}} {{$vo->title}} {{$vo->content}} {{$vo->created_at}} - @if($vo->status < 0) - {{\Illuminate\Support\Str::limit($vo->error)}} - @elseif($vo->status > 0) - 投递成功 - @else - 等待投递 - @endif -
-
- -
-
+
+
+
+

邮件投递记录

+
+
+
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + + @endforeach + +
# 类型 识别码 收信地址 标题 内容 投递时间 投递状态
{{$vo->id}} {{$vo->type == 1 ? 'Email' : ($vo->type == 2? 'ServerChan': 'Bark')}} @if($vo->type == 3) + {{$vo->code}} @endif {{$vo->address}} {{$vo->title}} {{$vo->content}} {{$vo->created_at}} + @if($vo->status < 0) + {{\Illuminate\Support\Str::limit($vo->error)}} + @elseif($vo->status > 0) + 投递成功 + @else + 等待投递 + @endif +
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/admin/notificationLog?email=' + $("#email").val() + '&type=' + $("#type option:selected").val(); + } + @endsection diff --git a/resources/views/admin/logs/onlineIPMonitor.blade.php b/resources/views/admin/logs/onlineIPMonitor.blade.php index 8eb2f706..0ded0629 100644 --- a/resources/views/admin/logs/onlineIPMonitor.blade.php +++ b/resources/views/admin/logs/onlineIPMonitor.blade.php @@ -1,110 +1,116 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

在线IP监控 - 实时 -

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - - @endforeach - -
# 时间 类型 节点 用户 地址 IP 归属地
{{$vo->id}}{{$vo->created_at}}{{$vo->type}}{{$vo->node ? $vo->node->name : '【节点已删除】'}}{{$vo->user ? $vo->user->email : '【用户已删除】'}}{{$vo->user ? $vo->user->address : '【用户已删除】'}} - @if (strpos($vo->ip, ',') == TRUE) - @foreach (explode(',', $vo->ip) as $ip) - {{$ip}} - @endforeach - @else - {{$vo->ip}} - @endif - {{strpos($vo->ip, ',') == TRUE? '':$vo->ipInfo}}
-
- -
-
+
+
+
+

在线IP监控 + 实时 +

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + + @endforeach + +
# 时间 类型 节点 用户 地址 IP 归属地
{{$vo->id}}{{$vo->created_at}}{{$vo->type}}{{$vo->node ? $vo->node->name : '【节点已删除】'}}{{$vo->user ? $vo->user->email : '【用户已删除】'}}{{$vo->user ? $vo->user->address : '【用户已删除】'}} + @if (strpos($vo->ip, ',') == TRUE) + @foreach (explode(',', $vo->ip) as $ip) + {{$ip}} + @endforeach + @else + {{$vo->ip}} + @endif + {{strpos($vo->ip, ',') == TRUE? '':$vo->ipInfo}}
+
+ +
+
@endsection @section('script') - - - - + + + + // 搜索 + function Search() { + window.location.href = '/admin/onlineIPMonitor?id=' + $("#id").val() + '&ip=' + $("#ip").val() + '&email=' + $("#email").val() + '&port=' + $("#port").val() + '&nodeId=' + $("#nodeId option:selected").val(); + } + @endsection diff --git a/resources/views/admin/logs/orderList.blade.php b/resources/views/admin/logs/orderList.blade.php index 0a87cafe..78bdd949 100644 --- a/resources/views/admin/logs/orderList.blade.php +++ b/resources/views/admin/logs/orderList.blade.php @@ -1,182 +1,192 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

订单列表

-
-
-
-
- -
-
- -
-
-
-
- -
- -
- -
- -
-
-
- -
-
- -
-
- -
-
- -
-
-
-
- - -
-
- - -
-
-
-
- - 重 置 -
-
- - - - - - - - - - - - - - - - - - @foreach($orderList as $order) - - - - - - - - - - - - - - @endforeach - -
# 用户名 订单号 商品 过期时间 优惠券 原价 实价 支付方式 订单状态 创建时间
{{$order->oid}} - @if(empty($order->user) ) - 【账号不存在】 - @else - {{$order->user->email}} - @endif - {{$order->order_sn}} {{$order->goods_id == -1? "余额充值" :$order->goods->name}} {{$order->is_expire ? '已过期' : $order->expire_at}} {{$order->coupon ? $order->coupon->name . ' - ' . $order->coupon->sn : ''}} ¥{{$order->origin_amount}} ¥{{$order->amount}} - {{$order->pay_way_label}} - - @if($order->status == '-1') - 已关闭 - @elseif ($order->status == '0') - 待支付 - @elseif ($order->status == '1') - 已支付待确认 - @else - 已完成 - @endif - {{$order->created_at}}
-
- -
-
+
+
+
+

订单列表

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + +
+
+ + +
+
+
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + + + + @foreach($orderList as $order) + + + + + + + + + + + + + + @endforeach + +
# 用户名 订单号 商品 过期时间 优惠券 原价 实价 支付方式 订单状态 创建时间
{{$order->oid}} + @if(empty($order->user) ) + 【账号不存在】 + @else + {{$order->user->email}} + @endif + {{$order->order_sn}} {{$order->goods_id == -1? "余额充值" :$order->goods->name}} {{$order->is_expire ? '已过期' : $order->expire_at}} {{$order->coupon ? $order->coupon->name . ' - ' . $order->coupon->sn : ''}} ¥{{$order->origin_amount}} ¥{{$order->amount}} + {{$order->pay_way_label}} + + @if($order->status == '-1') + 已关闭 + @elseif ($order->status == '0') + 待支付 + @elseif ($order->status == '1') + 已支付待确认 + @else + 已完成 + @endif + {{$order->created_at}}
+
+ +
+
@endsection @section('script') - - - - - + + + + + // 搜索 + function Search() { + window.location.href = '/admin/orderList?email=' + $("#email").val() + '&order_sn=' + $("#order_sn").val() + '&is_expire=' + $("#is_expire").val() + '&is_coupon=' + $("#is_coupon").val() + '&pay_way=' + $("#pay_way").val() + '&status=' + $("#status").val() + '&sort=' + $("input:radio[name='sort']:checked").val() + '&range_time=' + [$("#start").val(), $("#end").val()]; + } + @endsection diff --git a/resources/views/admin/logs/trafficLog.blade.php b/resources/views/admin/logs/trafficLog.blade.php index a1bfe2de..2c1e9d48 100644 --- a/resources/views/admin/logs/trafficLog.blade.php +++ b/resources/views/admin/logs/trafficLog.blade.php @@ -1,121 +1,133 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

流量日志

-
-
-
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
- -
- -
- -
-
-
- - 重 置 -
-
- - - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - - @endforeach - -
# 用户 节点 流量比例 上传流量 下载流量 总流量 记录时间
{{$vo->id}} - @if(empty($vo->user)) - 【账号已删除】 - @else - {{$vo->user->email}} - @endif - {{$vo->node ? $vo->node->name : '【节点已删除】'}} {{$vo->rate}} {{$vo->u}} {{$vo->d}} {{$vo->traffic}} {{$vo->log_time}}
-
- -
-
+
+
+
+

流量日志

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + + @endforeach + +
# 用户 节点 流量比例 上传流量 下载流量 总流量 记录时间
{{$vo->id}} + @if(empty($vo->user)) + 【账号已删除】 + @else + {{$vo->user->email}} + @endif + {{$vo->node ? $vo->node->name : '【节点已删除】'}} {{$vo->rate}} {{$vo->u}} {{$vo->d}} {{$vo->traffic}} {{$vo->log_time}}
+
+ +
+
@endsection @section('script') - - - - - + + + + + // 搜索 + function Search() { + window.location.href = '/admin/trafficLog' + '?port=' + $("#port").val() + '&user_id=' + $("#user_id").val() + '&email=' + $("#email").val() + '&nodeId=' + $("#nodeId option:selected").val() + '&startTime=' + $("#start").val() + '&endTime=' + $("#end").val(); + } + @endsection diff --git a/resources/views/admin/logs/userBalanceLogList.blade.php b/resources/views/admin/logs/userBalanceLogList.blade.php index 60d3c4cf..33f148af 100644 --- a/resources/views/admin/logs/userBalanceLogList.blade.php +++ b/resources/views/admin/logs/userBalanceLogList.blade.php @@ -1,88 +1,90 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

余额变动记录

-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - - @endforeach - -
# 用户名 订单ID 操作前余额 发生金额 操作后金额 描述 发生时间
{{$vo->id}} - @if(empty($vo->user)) - 【账号已删除】 - @else - {{$vo->user->email}} - @endif - {{$vo->order_id}} {{$vo->before}} {{$vo->amount}} {{$vo->after}} {{$vo->desc}} {{$vo->created_at}}
-
- -
-
+
+
+
+

余额变动记录

+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + + @endforeach + +
# 用户名 订单ID 操作前余额 发生金额 操作后金额 描述 发生时间
{{$vo->id}} + @if(empty($vo->user)) + 【账号已删除】 + @else + {{$vo->user->email}} + @endif + {{$vo->order_id}} {{$vo->before}} {{$vo->amount}} {{$vo->after}} {{$vo->desc}} {{$vo->created_at}}
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/admin/userBalanceLogList?email=' + $("#email").val(); + } + @endsection diff --git a/resources/views/admin/logs/userBanLogList.blade.php b/resources/views/admin/logs/userBanLogList.blade.php index 4426642b..f5e223e9 100644 --- a/resources/views/admin/logs/userBanLogList.blade.php +++ b/resources/views/admin/logs/userBanLogList.blade.php @@ -1,80 +1,83 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

用户封禁记录

-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - @endforeach - -
# 用户名 时长 理由 封禁时间 最后连接时间
- {{$vo->id}} - {{empty($vo->user) ? '【账号已删除】' : $vo->user->email}} {{$vo->minutes}}分钟 {{$vo->desc}} {{$vo->created_at}} {{date("Y-m-d H:i:s", $vo->user->t)}}
-
- -
-
+
+
+
+

用户封禁记录

+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + @endforeach + +
# 用户名 时长 理由 封禁时间 最后连接时间
+ {{$vo->id}} + {{empty($vo->user) ? '【账号已删除】' : $vo->user->email}} {{$vo->minutes}}分钟 {{$vo->desc}} {{$vo->created_at}} {{date("Y-m-d H:i:s", $vo->user->t)}}
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/admin/userBanLogList?email=' + $("#email").val(); + } + @endsection diff --git a/resources/views/admin/logs/userMonitor.blade.php b/resources/views/admin/logs/userMonitor.blade.php index af12b65b..113ce019 100644 --- a/resources/views/admin/logs/userMonitor.blade.php +++ b/resources/views/admin/logs/userMonitor.blade.php @@ -1,124 +1,126 @@ @extends('admin.layouts') @section('content') -
-
-
-

用户流量

-
-
- -

{{$email}}

- 提示: 月流量统计不会统计当天,日流量统计不会统计当前小时;如果无统计数据,请检查定时任务是否正常。(每月1日和每日0时因为没有统计流量,不显示流量) -
-
-
-
- -
-
- -
-
-
-
-
+
+
+
+

用户流量

+
+
+ +

{{$email}}

+ 提示: 月流量统计不会统计当天,日流量统计不会统计当前小时;如果无统计数据,请检查定时任务是否正常。(每月1日和每日0时因为没有统计流量,不显示流量) +
+
+
+
+ +
+
+ +
+
+
+
+
@endsection @section('script') - + - -@endsection \ No newline at end of file + const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), { + type: 'line', + data: { + labels: [{!! $monthDays !!}], + datasets: [{ + fill: true, + backgroundColor: "rgba(98, 168, 234, .1)", + borderColor: Config.colors("primary", 600), + pointRadius: 4, + borderDashOffset: 2, + pointBorderColor: "#fff", + pointBackgroundColor: Config.colors("primary", 600), + pointHoverBackgroundColor: "#fff", + pointHoverBorderColor: Config.colors("primary", 600), + data: [{!! $trafficDaily !!}], + }] + }, + options: { + legend: { + display: false + }, + responsive: true, + scales: { + xAxes: [{ + display: true, + scaleLabel: { + display: true, + labelString: '天' + } + }], + yAxes: [{ + display: true, + ticks: { + beginAtZero: true, + userCallback: function (tick) { + return tick.toString() + ' GB'; + } + }, + scaleLabel: { + display: true, + labelString: '{{trans('home.traffic_log_30days')}}' + } + }] + } + } + }); + +@endsection diff --git a/resources/views/admin/logs/userOnlineIPList.blade.php b/resources/views/admin/logs/userOnlineIPList.blade.php index 207d3afc..8295d78a 100644 --- a/resources/views/admin/logs/userOnlineIPList.blade.php +++ b/resources/views/admin/logs/userOnlineIPList.blade.php @@ -1,131 +1,138 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

用户在线IP列表 - 最近10分钟 -

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - @foreach ($userList as $user) - - - - - - - - - @endforeach - -
# 用户名 端口 状态 代理 连接IP
{{$user->id}} {{$user->email}} {{$user->port}} - @if ($user->status > 0) - 正常 - @elseif ($user->status < 0) - 禁用 - @else - 未激活 - @endif - - @if ($user->enable) - 启用 - @else - 禁用 - @endif - - @if(!$user->onlineIPList->isEmpty()) - - - - - - - - - - - @foreach($user->onlineIPList as $vo) - - - - - - - @endforeach - -
时间 节点 类型 IP
{{$vo->created_at}}{{$vo->node ? $vo->node->name : '【节点已删除】'}}{{$vo->type}} - {{$vo->ip}} -
- @endif -
-
- -
-
+
+
+
+

用户在线IP列表 + 最近10分钟 +

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + @foreach ($userList as $user) + + + + + + + + + @endforeach + +
# 用户名 端口 状态 代理 连接IP
{{$user->id}} {{$user->email}} {{$user->port}} + @if ($user->status > 0) + 正常 + @elseif ($user->status < 0) + 禁用 + @else + 未激活 + @endif + + @if ($user->enable) + 启用 + @else + 禁用 + @endif + + @if(!$user->onlineIPList->isEmpty()) + + + + + + + + + + + @foreach($user->onlineIPList as $vo) + + + + + + + @endforeach + +
时间 节点 类型 IP
{{$vo->created_at}}{{$vo->node ? $vo->node->name : '【节点已删除】'}}{{$vo->type}} + {{$vo->ip}} +
+ @endif +
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/admin/userOnlineIPList' + '?id' + $("#id").val() + '&email=' + $("#email").val() + '&wechat=' + $("#wechat").val() + '&qq=' + $("#qq").val() + '&port=' + $("#port").val(); + } + @endsection diff --git a/resources/views/admin/logs/userTrafficLogList.blade.php b/resources/views/admin/logs/userTrafficLogList.blade.php index a4808934..25fee235 100644 --- a/resources/views/admin/logs/userTrafficLogList.blade.php +++ b/resources/views/admin/logs/userTrafficLogList.blade.php @@ -1,94 +1,96 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

流量变动记录

-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - - @endforeach - -
# 用户名 订单 变动前流量 变动后流量 描述 发生时间
{{$vo->id}} - @if(empty($vo->user)) - 【账号已删除】 - @else - {{$vo->user->email}} - @endif - - @if ($vo->order_id) - @if($vo->order) - {{$vo->order->goods->name}} - @else - 【订单已删除】 - @endif - @endif - {{$vo->before}} {{$vo->after}} {{$vo->desc}} {{$vo->created_at}}
-
- -
-
+
+
+
+

流量变动记录

+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + + @endforeach + +
# 用户名 订单 变动前流量 变动后流量 描述 发生时间
{{$vo->id}} + @if(empty($vo->user)) + 【账号已删除】 + @else + {{$vo->user->email}} + @endif + + @if ($vo->order_id) + @if($vo->order) + {{$vo->order->goods->name}} + @else + 【订单已删除】 + @endif + @endif + {{$vo->before}} {{$vo->after}} {{$vo->desc}} {{$vo->created_at}}
+
+ +
+
@endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/admin/userTrafficLogList' + '?email=' + $("#email").val(); + } + @endsection diff --git a/resources/views/admin/marketing/emailList.blade.php b/resources/views/admin/marketing/emailList.blade.php index 1f7c6118..64a67ece 100644 --- a/resources/views/admin/marketing/emailList.blade.php +++ b/resources/views/admin/marketing/emailList.blade.php @@ -1,86 +1,87 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

邮件群发列表

-
- -
-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - @endforeach - -
# 消息标题 消息内容 发送状态 发送时间 错误信息
{{$vo->id}} {{$vo->title}} {{$vo->content}} {{$vo->status_label}} {{$vo->created_at}} {{$vo->error}}
-
- -
-
+
+
+
+

邮件群发列表

+
+ +
+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + @endforeach + +
# 消息标题 消息内容 发送状态 发送时间 错误信息
{{$vo->id}} {{$vo->title}} {{$vo->content}} {{$vo->status_label}} {{$vo->created_at}} {{$vo->error}}
+
+ +
+
@endsection @section('script') - - - + + + function Search() { + window.location.href = "/marketing/emailList?status=" + $("#status option:selected").val(); + } + @endsection diff --git a/resources/views/admin/marketing/pushList.blade.php b/resources/views/admin/marketing/pushList.blade.php index 7194985d..478f8c5b 100644 --- a/resources/views/admin/marketing/pushList.blade.php +++ b/resources/views/admin/marketing/pushList.blade.php @@ -1,170 +1,176 @@ @extends('admin.layouts') @section('css') - - - + + + @endsection @section('content') -
-
-
-

推送消息列表

-
- -
-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - @foreach($list as $vo) - - - - - - - - - @endforeach - -
# 消息标题 消息内容 推送状态 推送时间 错误信息
{{$vo->id}} {{$vo->title}} {{$vo->content}} {{$vo->status_label}} {{$vo->created_at}} {{$vo->error}}
-
- -
-
+
+
+
+

推送消息列表

+
+ +
+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + @foreach($list as $vo) + + + + + + + + + @endforeach + +
# 消息标题 消息内容 推送状态 推送时间 错误信息
{{$vo->id}} {{$vo->title}} {{$vo->content}} {{$vo->status_label}} {{$vo->created_at}} {{$vo->error}}
+
+ +
+
- - + + @endsection @section('script') - - - - - - + + + + + + function Search() { + window.location.href = "/marketing/pushList?status=" + $("#status").val(); + } + @endsection diff --git a/resources/views/admin/node/addNode.blade.php b/resources/views/admin/node/addNode.blade.php index 3455edc4..d61d7b92 100644 --- a/resources/views/admin/node/addNode.blade.php +++ b/resources/views/admin/node/addNode.blade.php @@ -1,551 +1,593 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

节点添加

-
- -
-
-
-
-
-

基础信息

-
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
- 动态IP节点需要配置DDNS,对此类型节点,节点阻断功能会通过域名进行检测 -
-
- - -
-
- - - 如果开启Namesilo且域名是Namesilo上购买的,则会强制更新域名的DNS记录为本节点IP,如果其他节点绑定了该域名则会清空其域名信息 -
-
- - -
-
- - -
-
- - - 请务必正确填写此值,否则TCP阻断检测可能误报 -
-
- - - 举例:0.1用100M结算10M,5用100M结算500M -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - 排序值越大排越前        -
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
- -
-
-
-
-
-

扩展信息

-
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-

如果兼容请在服务端配置协议和混淆时加上_compatible -

-
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
- 每30~60分钟随机进行节点阻断检测 -
-
-
- -
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
- 如果启用请配置服务端的 additional_ports 信息 -
- -
- - +
+
+
+ +
+
+
+ +
+
+
@endsection @section('script') - - + + - + swal.fire({ + title: '[节点 user-config.json 配置示例]', + html: '
' + content + '
', + type: 'info' + }); + } + @endsection diff --git a/resources/views/admin/node/editNode.blade.php b/resources/views/admin/node/editNode.blade.php index fba5695c..aab3efe3 100644 --- a/resources/views/admin/node/editNode.blade.php +++ b/resources/views/admin/node/editNode.blade.php @@ -1,149 +1,176 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

节点添加

-
- -
-
-
-
-
-

基础信息

-
-
- -
    -
  • -
    - is_transit ? 'checked' : ''}}> - -
    -
  • -
  • -
    - is_transit ? '' : 'checked'}}> - -
    -
  • -
-
-
- -
    -
  • -
    - is_ddns ? 'checked' : ''}}> - -
    -
  • -
  • -
    - is_ddns ? '' : 'checked'}}> - -
    -
  • -
- 动态IP节点需要配置DDNS,对此类型节点,节点阻断功能会通过域名进行检测 -
-
- - - -
-
- - - 如果开启Namesilo且域名是Namesilo上购买的,则会强制更新域名的DNS记录为本节点IP,如果其他节点绑定了该域名则会清空其域名信息 -
-
- - is_ddns ? 'readonly=readonly' : ''}} required> -
-
- - -
-
- - - 请务必正确填写此值,否则TCP阻断检测可能误报 -
-
- - - 举例:0.1用100M结算10M,5用100M结算500M -
-
- - -
-
- - - 订阅时分组展示 -
-
- - -
-
- - -
-
- - - 排序值越大排越前        -
-
- -
    -
  • -
    - status ? 'checked' : ''}}> - -
    -
  • -
  • -
    - status ? '' : 'checked'}}> - -
    -
  • -
-
- -
-
-
-
-
-

扩展信息

-
-
- -
    -
  • -
    - type == 1) checked @endif> - -
    -
  • -
  • -
    - type == 2) checked @endif> - -
    -
  • -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
    -
  • -
    - compatible ? 'checked' : ''}}> - -
    -
  • -
  • -
    - compatible ? '' : 'checked'}}> - -
    -
  • -
-

如果兼容请在服务端配置协议和混淆时加上_compatible -

-
-
- -
    -
  • -
    - is_subscribe ? 'checked' : ''}}> - -
    -
  • -
  • -
    - is_subscribe ? '' : 'checked'}}> - -
    -
  • -
-
-
- -
    -
  • -
    - detectionType == 0) checked @endif/> - -
    -
  • -
  • -
    - detectionType == 1) checked @endif/> - -
    -
  • -
  • -
    - detectionType == 2) checked @endif/> - -
    -
  • -
  • -
    - detectionType == 3) checked @endif/> - -
    -
  • -
- 每30~60分钟随机进行节点阻断检测 -
-
-
- -
    -
  • -
    - single? 'checked' : ''}}> - -
    -
  • -
  • -
    - single? '' : 'checked'}}> - -
    -
  • -
- 如果启用请配置服务端的 additional_ports 信息 -
-
-
- - - 推荐80或443,服务端需要配置 - 严格模式:用户的端口无法连接,只能通过以下指定的端口进行连接(如何配置 -
-
- - -
-
-
- -
-
- - -
-
- - -
-
- - - 使用WebSocket传输协议时不要使用none -
-
- - - 使用WebSocket传输协议时请启用TLS -
-
- - -
-
- - - 伪装类型为http时多个伪装域名逗号隔开,使用WebSocket传输协议时只允许单个 -
-
- - -
-
- -
    -
  • -
    - v2_tls? 'checked' : ''}}> - -
    -
  • -
  • -
    - v2_tls? '' : 'checked'}}> - -
    -
  • -
-
-
- - - 内部监听,当端口为0时启用,仅支持rico93版 -
-
- - - 外部覆盖,当端口为0时启用,仅支持rico93版 -
-
-
-
-
- -
-
-
-
-
-
-
+ + + +
+
+

扩展信息

+
+
+ +
    +
  • +
    + type == 1) checked @endif> + +
    +
  • +
  • +
    + type == 2) checked @endif> + +
    +
  • +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
    +
  • +
    + compatible ? 'checked' : ''}}> + +
    +
  • +
  • +
    + compatible ? '' : 'checked'}}> + +
    +
  • +
+

如果兼容请在服务端配置协议和混淆时加上_compatible +

+
+
+ +
    +
  • +
    + is_subscribe ? 'checked' : ''}}> + +
    +
  • +
  • +
    + is_subscribe ? '' : 'checked'}}> + +
    +
  • +
+
+
+ +
    +
  • +
    + detectionType == 0) checked @endif/> + +
    +
  • +
  • +
    + detectionType == 1) checked @endif/> + +
    +
  • +
  • +
    + detectionType == 2) checked @endif/> + +
    +
  • +
  • +
    + detectionType == 3) checked @endif/> + +
    +
  • +
+ 每30~60分钟随机进行节点阻断检测 +
+
+
+ +
    +
  • +
    + single? 'checked' : ''}}> + +
    +
  • +
  • +
    + single? '' : 'checked'}}> + +
    +
  • +
+ 如果启用请配置服务端的 additional_ports 信息 +
+
+
+ + + 推荐80或443,服务端需要配置 + 严格模式:用户的端口无法连接,只能通过以下指定的端口进行连接(如何配置 +
+
+ + +
+
+
+ +
+
+ + +
+
+ + +
+
+ + + 使用WebSocket传输协议时不要使用none +
+
+ + + 使用WebSocket传输协议时请启用TLS +
+
+ + +
+
+ + + 伪装类型为http时多个伪装域名逗号隔开,使用WebSocket传输协议时只允许单个 +
+
+ + +
+
+ +
    +
  • +
    + v2_tls? 'checked' : ''}}> + +
    +
  • +
  • +
    + v2_tls? '' : 'checked'}}> + +
    +
  • +
+
+
+ + + 内部监听,当端口为0时启用,仅支持rico93版 +
+
+ + + 外部覆盖,当端口为0时启用,仅支持rico93版 +
+
+
+
+
+ +
+
+ + + + + @endsection @section('script') - - + + - + swal.fire({ + title: '[节点 user-config.json 配置示例]', + html: '
' + content + '
', + type: 'info' + }); + } + @endsection diff --git a/resources/views/admin/node/nodeList.blade.php b/resources/views/admin/node/nodeList.blade.php index 48b174b8..c9e854d4 100644 --- a/resources/views/admin/node/nodeList.blade.php +++ b/resources/views/admin/node/nodeList.blade.php @@ -1,173 +1,189 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

节点列表

- -
-
- - - - - - - - - - - - - - - - - - - @foreach($nodeList as $node) - - - - - - - - - - - - - - - @endforeach - -
ID 类型 名称 IP 域名 存活 状态 在线产生流量 流量比例 扩展 操作
- {{$node->id}} - - @if($node->is_transit) - 中转 - @else - {{$node->type == 2 ? 'V2' : 'SSR'}} - @endif - {{$node->name}} {{$node->is_ddns ? 'DDNS' : $node->ip}} {{$node->server}} {{$node->uptime}} {{$node->status? $node->load : '维护'}} {{$node->online_users}} {{$node->transfer}} {{$node->traffic_rate}} - @if($node->compatible) @endif - @if($node->single) @endif - @if(!$node->is_subscribe) @endif - -
- - - - - -
-
-
- -
-
+
+
+
+

节点列表

+ +
+
+ + + + + + + + + + + + + + + + + + + @foreach($nodeList as $node) + + + + + + + + + + + + + + + @endforeach + +
ID 类型 名称 IP 域名 存活 状态 在线产生流量 流量比例 扩展 操作
+ {{$node->id}} + + @if($node->is_transit) + 中转 + @else + {{$node->type == 2 ? 'V2' : 'SSR'}} + @endif + {{$node->name}} {{$node->is_ddns ? 'DDNS' : $node->ip}} {{$node->server}} {{$node->uptime}} {{$node->status? $node->load : '维护'}} {{$node->online_users}} {{$node->transfer}} {{$node->traffic_rate}} + @if($node->compatible) @endif + @if($node->single) @endif + @if(!$node->is_subscribe) @endif + +
+ + + + + +
+
+
+ +
+
@endsection @section('script') - - - + + + // 显示提示 + function showIdTips() { + swal.fire({ + title: '复制成功', + type: 'success', + timer: 1300, + showConfirmButton: false, + }); + } + @endsection diff --git a/resources/views/admin/node/nodeMonitor.blade.php b/resources/views/admin/node/nodeMonitor.blade.php index 54a9eb9f..dd8f5525 100644 --- a/resources/views/admin/node/nodeMonitor.blade.php +++ b/resources/views/admin/node/nodeMonitor.blade.php @@ -1,120 +1,122 @@ @extends('admin.layouts') @section('content') -
-
-
-

节点流量

-
-
- -

{{$nodeName}} - {{$nodeServer}} -

- 提示: 月流量统计不会统计当天,日流量统计不会统计当前小时;如果无统计数据,请检查定时任务是否正常。 -
-
-
-
- -
-
- -
-
-
-
-
+
+
+
+

节点流量

+
+
+ +

{{$nodeName}} + {{$nodeServer}} +

+ 提示: 月流量统计不会统计当天,日流量统计不会统计当前小时;如果无统计数据,请检查定时任务是否正常。 +
+
+
+
+ +
+
+ +
+
+
+
+
@endsection @section('script') - + - -@endsection \ No newline at end of file + const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), { + type: 'line', + data: { + labels: [{!! $monthDays !!}], + datasets: [{ + fill: true, + backgroundColor: "rgba(98, 168, 234, .1)", + borderColor: Config.colors("primary", 600), + pointRadius: 4, + borderDashOffset: 2, + pointBorderColor: "#fff", + pointBackgroundColor: Config.colors("primary", 600), + pointHoverBackgroundColor: "#fff", + pointHoverBorderColor: Config.colors("primary", 600), + data: [{!! $trafficDaily['dailyData'] !!}], + }] + }, + options: { + legend: { + display: false + }, + responsive: true, + scales: { + xAxes: [{ + display: true, + scaleLabel: { + display: true, + labelString: '天' + } + }], + yAxes: [{ + display: true, + ticks: { + beginAtZero: true, + }, + scaleLabel: { + display: true, + labelString: '{{trans('home.traffic_log_30days')}}' + } + }] + } + } + }); + +@endsection diff --git a/resources/views/admin/profile.blade.php b/resources/views/admin/profile.blade.php index 91ba7cea..b2b16131 100644 --- a/resources/views/admin/profile.blade.php +++ b/resources/views/admin/profile.blade.php @@ -1,38 +1,42 @@ @extends('admin.layouts') @section('content') -
-
-
-

{{trans('home.profile')}}

-
- @if (Session::has('successMsg')) -
- - {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- - {{trans('home.error')}}: {{$errors->first()}} -
- @endif -
-
- {{csrf_field()}} -
- - -
-
- - -
-
- -
-
-
-
-
-@endsection \ No newline at end of file +
+
+
+

{{trans('home.profile')}}

+
+ @if (Session::has('successMsg')) +
+ + {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ + {{trans('home.error')}}: {{$errors->first()}} +
+ @endif +
+
+ {{csrf_field()}} +
+ + +
+
+ + +
+
+ +
+
+
+
+
+@endsection diff --git a/resources/views/admin/sensitiveWords/addSensitiveWords.blade.php b/resources/views/admin/sensitiveWords/addSensitiveWords.blade.php index 912946d8..98cd54e1 100644 --- a/resources/views/admin/sensitiveWords/addSensitiveWords.blade.php +++ b/resources/views/admin/sensitiveWords/addSensitiveWords.blade.php @@ -1,69 +1,78 @@ @extends('admin.layouts') @section('content') -
-
-
-

添加敏感词

-
- @if (Session::has('errorMsg')) -
- - 错误: {{Session::get('errorMsg')}} -
- @endif -
-
-
- -
- -
-
-
- -
-
-
-
-
+
+
+
+

添加敏感词

+
+ @if (Session::has('errorMsg')) +
+ + 错误: {{Session::get('errorMsg')}} +
+ @endif +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
- + @endsection @section('script') - + @endsection diff --git a/resources/views/admin/sensitiveWords/sensitiveWordsList.blade.php b/resources/views/admin/sensitiveWords/sensitiveWordsList.blade.php index b4e529d1..46ba88fc 100644 --- a/resources/views/admin/sensitiveWords/sensitiveWordsList.blade.php +++ b/resources/views/admin/sensitiveWords/sensitiveWordsList.blade.php @@ -1,142 +1,148 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

敏感词列表 - (用于屏蔽注册邮箱后缀) -

-
- -
-
-
- - - - - - - - - - - @foreach($list as $vo) - - - - - - - @endforeach - -
# 类型 敏感词 操作
{{$vo->id}} {{$vo->type==1? '黑':'白'}} {{$vo->words}} - -
-
- -
-
+
+
+
+

敏感词列表 + (用于屏蔽注册邮箱后缀) +

+
+ +
+
+
+ + + + + + + + + + + @foreach($list as $vo) + + + + + + + @endforeach + +
# 类型 敏感词 操作
{{$vo->id}} {{$vo->type==1? '黑':'白'}} {{$vo->words}} + +
+
+ +
+
- + @endsection @section('script') - - - + + + // 删除敏感词 + function delWord(id, name) { + swal.fire({ + title: '警告', + text: '确定删除敏感词 【' + name + '】 ?', + type: 'warning', + showCancelButton: true, + cancelButtonText: '取消', + confirmButtonText: '确定', + }).then((result) => { + if (result.value) { + $.post("/sensitiveWords/del", {id: id, _token: '{{csrf_token()}}'}, function (ret) { + if (ret.status === 'success') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => window.location.reload()) + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + }) + } + }) + } + @endsection diff --git a/resources/views/admin/shop/addGoods.blade.php b/resources/views/admin/shop/addGoods.blade.php index 59baa89a..4cc9272e 100644 --- a/resources/views/admin/shop/addGoods.blade.php +++ b/resources/views/admin/shop/addGoods.blade.php @@ -1,214 +1,232 @@ @extends('admin.layouts') @section('css') - - - - + + + + @endsection @section('content') -
-
-
-

添加商品

-
- @if (Session::has('successMsg')) -
- - {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- - {{$errors->first()}} -
- @endif -
-
- {{csrf_field()}} -
-
-
- -
-
- - -
-
- - -
-
- 套餐与账号有效期有关,流量包只扣可用流量,不影响有效期 -
-
- -
- -
-
-
- -
- - MB -
- *提交后不可修改 -
-
- -
- - -
-
-
- -
- - -
- 用户自行重置流量价格, 0 时代表改该商品不提供重置功能 -
-
- -
- - -
- 套餐流量会每N天重置 -
-
- -
- - -
- 每个用户可以购买该商品次数,为 0 时代表不限购 -
-
- -
- -
- 自动给购买此商品的用户打上相应的标签 -
-
- -
- - -
- *提交后不可修改 -
-
- -
-
- - -
-
- - -
-
-
-
- -
-
- - -
-
- - -
-
-
-
-
-
- -
- -
- 排序值越大排越前 -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- 每行内容请以<li> 开头 </li> 结尾 -
-
-
- 返 回 - -
-
-
-
-
-
+
+
+
+

添加商品

+
+ @if (Session::has('successMsg')) +
+ + {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ + {{$errors->first()}} +
+ @endif +
+
+ {{csrf_field()}} +
+
+
+ +
+
+ + +
+
+ + +
+
+ 套餐与账号有效期有关,流量包只扣可用流量,不影响有效期 +
+
+ +
+ +
+
+
+ +
+ + MB +
+ *提交后不可修改 +
+
+ +
+ + +
+
+
+ +
+ + +
+ 用户自行重置流量价格, 0 时代表改该商品不提供重置功能 +
+
+ +
+ + +
+ 套餐流量会每N天重置 +
+
+ +
+ + +
+ 每个用户可以购买该商品次数,为 0 时代表不限购 +
+
+ +
+ +
+ 自动给购买此商品的用户打上相应的标签 +
+
+ +
+ + +
+ *提交后不可修改 +
+
+ +
+
+ + +
+
+ + +
+
+
+
+ +
+
+ + +
+
+ + +
+
+
+
+
+
+ +
+ +
+ 排序值越大排越前 +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ 每行内容请以<li> 开头 </li> 结尾 +
+
+
+ 返 回 + +
+
+
+
+
+
@endsection @section('script') - - - - - - - - + + + + + + + + - -@endsection \ No newline at end of file + +@endsection diff --git a/resources/views/admin/shop/editGoods.blade.php b/resources/views/admin/shop/editGoods.blade.php index 9932f8f0..3229aca0 100644 --- a/resources/views/admin/shop/editGoods.blade.php +++ b/resources/views/admin/shop/editGoods.blade.php @@ -1,190 +1,208 @@ @extends('admin.layouts') @section('css') - - - - + + + + @endsection @section('content') -
-
-
-

编辑商品

-
- 返 回 -
-
- @if (Session::has('successMsg')) - - @endif - @if($errors->any()) - - @endif -
-
-
- -
-
- type == 1) checked @endif disabled/> - -
-
- type == 2) checked @endif disabled/> - -
-
- 套餐与账号有效期有关,流量包只扣可用流量,不影响有效期 -
-
- -
- - {{csrf_field()}} - -
-
-
- -
- - -
-
-
- -
-
- status == 1) checked @endif/> - -
-
- status == 0) checked @endif/> - -
-
-
- @if ($goods->type == 2) -
- -
- - -
-
-
- -
- - -
- 套餐流量会每N天重置 -
- @endif -
- -
- - MB -
-
-
- -
- - -
- 每个用户可以购买该商品次数,为 0 时代表不限购 -
-
- -
- -
- 自动给购买此商品的用户打上相应的标签 -
-
- -
- - -
- 到期后会自动从总流量扣减对应的流量 -
-
- -
- -
- 排序值越大排越前 -
-
- -
- -
-
-
- -
-
- is_hot == 1) checked @endif/> - -
-
- is_hot == 0) checked @endif/> - -
-
-
-
- -
- logo?:'/assets/images/default.png'}} /> -
-
-
- -
- -
-
-
- -
- -
- 每行内容请以<li> 开头 </li> 结尾 -
-
- -
-
-
-
-
+
+
+
+

编辑商品

+
+ 返 回 +
+
+ @if (Session::has('successMsg')) + + @endif + @if($errors->any()) + + @endif +
+
+
+ +
+
+ type == 1) checked + @endif disabled/> + +
+
+ type == 2) checked + @endif disabled/> + +
+
+ 套餐与账号有效期有关,流量包只扣可用流量,不影响有效期 +
+
+ +
+ + {{csrf_field()}} + +
+
+
+ +
+ + +
+
+
+ +
+
+ status == 1) checked @endif/> + +
+
+ status == 0) checked @endif/> + +
+
+
+ @if ($goods->type == 2) +
+ +
+ + +
+
+
+ +
+ + +
+ 套餐流量会每N天重置 +
+ @endif +
+ +
+ + MB +
+
+
+ +
+ + +
+ 每个用户可以购买该商品次数,为 0 时代表不限购 +
+
+ +
+ +
+ 自动给购买此商品的用户打上相应的标签 +
+
+ +
+ + +
+ 到期后会自动从总流量扣减对应的流量 +
+
+ +
+ +
+ 排序值越大排越前 +
+
+ +
+ +
+
+
+ +
+
+ is_hot == 1) checked @endif/> + +
+
+ is_hot == 0) checked @endif/> + +
+
+
+
+ +
+ logo?:'/assets/images/default.png'}} /> +
+
+
+ +
+ +
+
+
+ +
+ +
+ 每行内容请以<li> 开头 </li> 结尾 +
+
+ +
+
+
+
+
@endsection @section('script') - - - - - - - - -@endsection \ No newline at end of file + + + + + + + + +@endsection diff --git a/resources/views/admin/shop/goodsList.blade.php b/resources/views/admin/shop/goodsList.blade.php index bc6563e1..80da852b 100644 --- a/resources/views/admin/shop/goodsList.blade.php +++ b/resources/views/admin/shop/goodsList.blade.php @@ -1,151 +1,156 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

商品列表

- -
-
-
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - - - - @foreach($goodsList as $goods) - - - - - - - - - - - - - - @endforeach - -
# 名称 类型 图片 内含流量 售价 排序 热销 限购数 状态 操作
{{$goods->id}} {{$goods->name}} - @if($goods->type == 1) - 流量包 - @elseif($goods->type == 2) - 套餐 - @else - 充值 - @endif - - @if($goods->logo) - logo - @endif - {{$goods->traffic_label}} {{$goods->price}}元 {{$goods->sort}} - @if($goods->is_hot) - - @else - - @endif - - {{$goods->limit_num}} - - @if($goods->status) - 上架 - @else - 下架 - @endif - -
- - -
-
-
- -
-
+
+
+
+

商品列表

+ +
+
+
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + + + + @foreach($goodsList as $goods) + + + + + + + + + + + + + + @endforeach + +
# 名称 类型 图片 内含流量 售价 排序 热销 限购数 状态 操作
{{$goods->id}} {{$goods->name}} + @if($goods->type == 1) + 流量包 + @elseif($goods->type == 2) + 套餐 + @else + 充值 + @endif + + @if($goods->logo) + logo + @endif + {{$goods->traffic_label}} {{$goods->price}}元 {{$goods->sort}} + @if($goods->is_hot) + + @else + + @endif + + {{$goods->limit_num}} + + @if($goods->status) + 上架 + @else + 下架 + @endif + +
+ + +
+
+
+ +
+
@endsection @section('script') - - - + + + // 删除商品 + function delGoods(id, name) { + swal.fire({ + title: '警告', + text: '确定删除商品 【' + name + '】 ?', + type: 'warning', + showCancelButton: true, + cancelButtonText: '取消', + confirmButtonText: '确定', + }).then((result) => { + if (result.value) { + $.post("/shop/delGoods", {id: id, _token: '{{csrf_token()}}'}, function (ret) { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false,}) + .then(() => { + window.location.reload(); + }) + }); + } + }); + } + @endsection diff --git a/resources/views/admin/subscribe/deviceList.blade.php b/resources/views/admin/subscribe/deviceList.blade.php index 3eb9b439..6f0e9718 100644 --- a/resources/views/admin/subscribe/deviceList.blade.php +++ b/resources/views/admin/subscribe/deviceList.blade.php @@ -1,100 +1,105 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

订阅设备列表

-
-
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - @foreach($deviceList as $vo) - - - - - - - - - @endforeach - -
# 名称 类型 平台 请求头 操作
{{$vo->id}} {{$vo->name}} {!! $vo->type_label !!} {!! $vo->platform_label !!} {{$vo->header}} - @if($vo->status == 0) - - @endif - @if($vo->status == 1) - - @endif -
-
- -
-
+
+
+
+

订阅设备列表

+
+
+
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + @foreach($deviceList as $vo) + + + + + + + + + @endforeach + +
# 名称 类型 平台 请求头 操作
{{$vo->id}} {{$vo->name}} {!! $vo->type_label !!} {!! $vo->platform_label !!} {{$vo->header}} + @if($vo->status == 0) + + @endif + @if($vo->status == 1) + + @endif +
+
+ +
+
@endsection @section('script') - - - + + + // 启用禁用订阅设备 + function setDeviceStatus(id, status) { + $.post("/subscribe/setDeviceStatus", { + _token: '{{csrf_token()}}', + id: id, + status: status + }, function (ret) { + swal.fire({text: ret.message, timer: 1000, showConfirmButton: false,}) + .then(() => { + window.location.reload(); + }) + }); + } + @endsection diff --git a/resources/views/admin/subscribe/subscribeList.blade.php b/resources/views/admin/subscribe/subscribeList.blade.php index 7998ecfa..e423ed06 100644 --- a/resources/views/admin/subscribe/subscribeList.blade.php +++ b/resources/views/admin/subscribe/subscribeList.blade.php @@ -1,126 +1,135 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

订阅列表

-
-
-
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - @foreach($subscribeList as $subscribe) - - - - - - - - - - - @endforeach - -
# 用户 订阅码 请求次数 最后请求时间 封禁时间 封禁理由 操作
{{$subscribe->id}} - @if(empty($subscribe->user)) - 【账号已删除】 - @else - {{$subscribe->user->email}} - @endif - {{$subscribe->code}} - {{$subscribe->times}} - {{$subscribe->updated_at}} {{$subscribe->ban_time > 0 ? date('Y-m-d H:i', $subscribe->ban_time): ''}} {{$subscribe->ban_desc}} - @if($subscribe->status == 0) - - @endif - @if($subscribe->status == 1) - - @endif -
-
- -
-
+
+
+
+

订阅列表

+
+
+
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+ + + + + + + + + + + + + + + @foreach($subscribeList as $subscribe) + + + + + + + + + + + @endforeach + +
# 用户 订阅码 请求次数 最后请求时间 封禁时间 封禁理由 操作
{{$subscribe->id}} + @if(empty($subscribe->user)) + 【账号已删除】 + @else + {{$subscribe->user->email}} + @endif + {{$subscribe->code}} + {{$subscribe->times}} + {{$subscribe->updated_at}} {{$subscribe->ban_time > 0 ? date('Y-m-d H:i', $subscribe->ban_time): ''}} {{$subscribe->ban_desc}} + @if($subscribe->status == 0) + + @endif + @if($subscribe->status == 1) + + @endif +
+
+ +
+
@endsection @section('script') - - - + + -@endsection \ No newline at end of file + }); + } + +@endsection diff --git a/resources/views/admin/subscribe/subscribeLog.blade.php b/resources/views/admin/subscribe/subscribeLog.blade.php index cdbc3388..aa19125e 100644 --- a/resources/views/admin/subscribe/subscribeLog.blade.php +++ b/resources/views/admin/subscribe/subscribeLog.blade.php @@ -1,53 +1,54 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

订阅列表

-
-
- - - - - - - - - - - - @foreach($subscribeLog as $subscribe) - - - - - - - - @endforeach - -
# 用户 请求IP 请求时间 访问
{{$subscribe->id}}{{empty($subscribe->user) ? '用户已删除' : $subscribe->user[0]->email}}{{$subscribe->request_ip}}{{$subscribe->request_time}}{{$subscribe->request_header}}
-
- -
-
+
+
+
+

订阅列表

+
+
+ + + + + + + + + + + + @foreach($subscribeLog as $subscribe) + + + + + + + + @endforeach + +
# 用户 请求IP 请求时间 访问
{{$subscribe->id}}{{empty($subscribe->user) ? '用户已删除' : $subscribe->user[0]->email}}{{$subscribe->request_ip}}{{$subscribe->request_time}}{{$subscribe->request_header}}
+
+ +
+
@endsection @section('script') - - + + @endsection diff --git a/resources/views/admin/system.blade.php b/resources/views/admin/system.blade.php index 6979e697..70a42961 100644 --- a/resources/views/admin/system.blade.php +++ b/resources/views/admin/system.blade.php @@ -1,1366 +1,1718 @@ @extends('admin.layouts') @section('css') - - - - + + + + @endsection @section('content') -
-
-
-

通用配置

-
-
- +
+
+
@endsection @section('script') - - - - - - - - - - + + + + + + + + + + - + // 生成网站安全码 + function makeWebsiteSecurityCode() { + $.get("/makeSecurityCode", function (ret) { + $("#website_security_code").val(ret); + }); + } + @endsection diff --git a/resources/views/admin/ticket/addTicket.blade.php b/resources/views/admin/ticket/addTicket.blade.php index 148993a7..837e604b 100644 --- a/resources/views/admin/ticket/addTicket.blade.php +++ b/resources/views/admin/ticket/addTicket.blade.php @@ -1,66 +1,77 @@ @extends('admin.layouts') @section('content') -
- @if($errors->any()) - - @endif -
-
-

发起工单

-
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
- -
-
-
-
-
-
-
+
+ @if($errors->any()) + + @endif +
+
+

发起工单

+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
@endsection @section('script') - + @endsection diff --git a/resources/views/admin/ticket/replyTicket.blade.php b/resources/views/admin/ticket/replyTicket.blade.php index b2429d8e..8cf191a6 100644 --- a/resources/views/admin/ticket/replyTicket.blade.php +++ b/resources/views/admin/ticket/replyTicket.blade.php @@ -1,163 +1,173 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
-
-

{{$ticket->title}}

- @if($ticket->status != 2) -
- 返 回 - -
- @endif -
-
-
-
-
-
-

- @if($ticket->user->qq) - 客户 - @elseif(strpos(strtolower($ticket->user->email),"@qq.com") !== FALSE) - 客户 - @else - 客户 - @endif -

-
-
-
-

- {!! $ticket->content !!} -

- -
-
-
- @foreach ($replyList as $reply) -
-
- @if ($reply->user->is_admin) -

- {{trans('home.ticket_reply_master')}} -

- @else -

- @if($ticket->user->qq) - 客户 - @elseif(strpos(strtolower($ticket->user->email),"@qq.com") !== FALSE) - 客户 - @else - 客户 - @endif -

- @endif -
-
-
-

- {!! $reply->content!!} -

- -
-
-
- @endforeach -
-
-
- @if($ticket->status != 2) - + @endif +
+
@endsection @section('script') - + if (content.trim() === '') { + swal.fire({title: '您未填写工单内容!', type: 'warning', timer: 1500}); + return false; + } + swal.fire({ + title: '确定回复工单?', + type: 'question', + allowEnterKey: false, + showCancelButton: true, + cancelButtonText: '{{trans('home.ticket_close')}}', + confirmButtonText: '{{trans('home.ticket_confirm')}}', + }).then((result) => { + if (result.value) { + $.post("/ticket/replyTicket", { + _token: '{{csrf_token()}}', + id: '{{$ticket->id}}', + content: content + }, function (ret) { + if (ret.status === 'success') { + swal.fire({ + title: ret.message, + type: 'success', + timer: 1000, + showConfirmButton: false + }).then(() => window.location.reload()) + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + }); + } + }) + } + @endsection diff --git a/resources/views/admin/ticket/ticketList.blade.php b/resources/views/admin/ticket/ticketList.blade.php index 0dc1d366..08bb4a8a 100644 --- a/resources/views/admin/ticket/ticketList.blade.php +++ b/resources/views/admin/ticket/ticketList.blade.php @@ -1,90 +1,93 @@ @extends('admin.layouts') @section('css') - + @endsection @section('content') -
-
- -
-
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - @foreach($ticketList as $ticket) - - - +
+
+ +
+
+
+ +
+
+ + 重 置 +
+
+
# 用户名 标题 状态
{{$ticket->id}} - @if(!$ticket->user) - 【账号已删除】 - @else - {{$ticket->user->email}} - @endif -
+ + + + + + + + + + @foreach($ticketList as $ticket) + + + - - - - @endforeach - -
# 用户名 标题 状态
{{$ticket->id}} + @if(!$ticket->user) + 【账号已删除】 + @else + {{$ticket->user->email}} + @endif + - {{$ticket->title}} - - {!!$ticket->status_label!!} -
-
- -
-
+ + {{$ticket->title}} + + + {!!$ticket->status_label!!} + + + @endforeach + + + + + + @endsection @section('script') - - - + + + // 搜索 + function Search() { + window.location.href = '/ticket/ticketList?email=' + $("#email").val(); + } + @endsection diff --git a/resources/views/admin/user/addUser.blade.php b/resources/views/admin/user/addUser.blade.php index 6e7e70a4..3025bdbe 100644 --- a/resources/views/admin/user/addUser.blade.php +++ b/resources/views/admin/user/addUser.blade.php @@ -1,415 +1,444 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

用户添加

-
-
-
-
-
-

账号信息

-
- -
- -
-
-
- -
- -
-
-
- -
-
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
-
- -
-
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
-
- -
- -
-
-
- -
-
-
- -
- -
- 账号流量重置日期 -
-
-
- -
-
-
- -
- -
- -
- -
- 留空默认为一年 -
-
-
- -
-
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-

代理信息

-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
- -
-
-
- -
-
- - GB -
-
-
-
- -
-
    -
  • -
    - - -
    -
  • -
  • -
    - - -
    -
  • -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
- - Byte -
- 为 0 时不限速 -
-
-
- -
-
- - Byte -
- 为 0 时不限速 -
-
-
-
- -
-
- - -
- V2Ray的账户ID -
-
-
+
+
+
+

用户添加

+
+
+ +
+
+

账号信息

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
    +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
+
+
+
+ +
+
    +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
+
+
+
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ 账号流量重置日期 +
+
+
+ +
+
+
+ +
+ +
+ +
+ +
+ 留空默认为一年 +
+
+
+ +
+
    +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

代理信息

+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+
+ + GB +
+
+
+
+ +
+
    +
  • +
    + + +
    +
  • +
  • +
    + + +
    +
  • +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ + Byte +
+ 为 0 时不限速 +
+
+
+ +
+
+ + Byte +
+ 为 0 时不限速 +
+
+
+
+ +
+
+ + +
+ V2Ray的账户ID +
+
+
-
- -
-
- -
-
-
+
+ +
+
+ +
+
+
@endsection @section('script') - - - - + + + + - + // 生成随机密码 + function makePasswd() { + $.get("/makePasswd", function (ret) { + $("#passwd").val(ret); + }); + } + @endsection diff --git a/resources/views/admin/user/editUser.blade.php b/resources/views/admin/user/editUser.blade.php index d1b48339..e0bc05e8 100644 --- a/resources/views/admin/user/editUser.blade.php +++ b/resources/views/admin/user/editUser.blade.php @@ -1,563 +1,621 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

用户信息编辑

-
- -
-
-
-
-
-
-

账号信息

-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
    -
  • -
    - usage) ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - usage) ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - usage) ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - usage) ? 'checked' : ''}} /> - -
    -
  • -
-
-
-
- -
-
    -
  • -
    - pay_way == 0 ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - pay_way == 1 ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - pay_way == 2 ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - pay_way == 3 ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - pay_way == 4 ? 'checked' : ''}} /> - -
    -
  • -
-
-
-
- -
- -
-
-
- -
-
-

{{$user->balance}}

- -
-
-
-
- -
-
-
- -
- reset_time) value="{{$user->reset_time}} @endif"/> -
- 账号流量重置日期 -
-
-
- -
-
-
- -
- -
- -
- -
- 留空默认为一年 -
-
-
- -
-
    -
  • -
    - status == '1' ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - status == '0' ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - status == '-1' ? 'checked' : ''}} /> - -
    -
  • -
-
-
-
- -
-
    -
  • -
    - is_admin == '1' ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - is_admin == '0' ? 'checked' : ''}} /> - -
    -
  • -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-

{{empty($user->referral) ? '无邀请人' : $user->referral->email}}

-
-
-
-
-

代理信息

-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
- -
-
-
- -
-
- - GB -
-
-
-
- -
-
    -
  • -
    - enable == '1' ? 'checked' : ''}} /> - -
    -
  • -
  • -
    - enable == '0' ? 'checked' : ''}} /> - -
    -
  • -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
- - Byte -
- 为 0 时不限速 -
-
-
- -
-
- - Byte -
- 为 0 时不限速 -
-
-
-
- -
-
- - -
- V2Ray的账户ID -
-
-
+
+
+
+

用户信息编辑

+
+ +
+
+
+ +
+
+

账号信息

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
    +
  • +
    + usage) ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + usage) ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + usage) ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + usage) ? 'checked' : ''}} /> + +
    +
  • +
+
+
+
+ +
+
    +
  • +
    + pay_way == 0 ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + pay_way == 1 ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + pay_way == 2 ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + pay_way == 3 ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + pay_way == 4 ? 'checked' : ''}} /> + +
    +
  • +
+
+
+
+ +
+ +
+
+
+ +
+
+

{{$user->balance}}

+ +
+
+
+
+ +
+
+
+ +
+ reset_time) value="{{$user->reset_time}} @endif"/> +
+ 账号流量重置日期 +
+
+
+ +
+
+
+ +
+ +
+ +
+ +
+ 留空默认为一年 +
+
+
+ +
+
    +
  • +
    + status == '1' ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + status == '0' ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + status == '-1' ? 'checked' : ''}} /> + +
    +
  • +
+
+
+
+ +
+
    +
  • +
    + is_admin == '1' ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + is_admin == '0' ? 'checked' : ''}} /> + +
    +
  • +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+

{{empty($user->referral) ? '无邀请人' : $user->referral->email}}

+
+
+
+
+

代理信息

+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+
+ + GB +
+
+
+
+ +
+
    +
  • +
    + enable == '1' ? 'checked' : ''}} /> + +
    +
  • +
  • +
    + enable == '0' ? 'checked' : ''}} /> + +
    +
  • +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ + Byte +
+ 为 0 时不限速 +
+
+
+ +
+
+ + Byte +
+ 为 0 时不限速 +
+
+
+
+ +
+
+ + +
+ V2Ray的账户ID +
+
+
-
- -
-
- -
-
-
+
+ +
+
+ +
+
+
- - + + @endsection @section('script') - - - - + + + + - + $.ajax({ + url: '/admin/handleUserBalance', + type: "POST", + data: {_token: '{{csrf_token()}}', user_id: '{{$user->id}}', amount: amount}, + beforeSend: function () { + $("#msg").show().html("充值中..."); + }, + success: function (ret) { + if (ret.status === 'fail') { + $("#msg").show().html(ret.message); + return false; + } else { + if (ret.status === 'success') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => { + $("#handle_user_balance").modal("hide"); + window.location.reload(); + }) + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + } + }, + error: function () { + $("#msg").show().html("请求错误,请重试"); + }, + complete: function () { + } + }); + } + @endsection diff --git a/resources/views/admin/user/userList.blade.php b/resources/views/admin/user/userList.blade.php index c0dc05f8..3889941d 100644 --- a/resources/views/admin/user/userList.blade.php +++ b/resources/views/admin/user/userList.blade.php @@ -1,303 +1,321 @@ @extends('admin.layouts') @section('css') - - + + @endsection @section('content') -
-
-
-

用户列表

-
- - - - 添加用户 - -
-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - 重 置 -
-
- - - - - - - - - - - - - - - - - - @foreach ($userList as $user) - - - - - - - - +
+
+
+

用户列表

+
+ + + + 添加用户 + +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + 重 置 +
+
+
# 用户名 余额 端口 订阅码 流量使用 最后使用 有效期 状态 代理 操作
{{$user->id}} {{$user->email}} {{$user->balance}} - {!!$user->port? : ' 未分配 '!!} - - {{$user->subscribe->code}} - {{$user->used_flow}} / {{$user->transfer_enable}} {{$user->t? date('Y-m-d H:i', $user->t): '未使用'}}
+ + + + + + + + + + + + + + + + + @foreach ($userList as $user) + + + + + + + + - - - - - - @endforeach - -
# 用户名 余额 端口 订阅码 流量使用 最后使用 有效期 状态 代理 操作
{{$user->id}} {{$user->email}} {{$user->balance}} + {!!$user->port? : ' 未分配 '!!} + + {{$user->subscribe->code}} + {{$user->used_flow}} / {{$user->transfer_enable}} {{$user->t? date('Y-m-d H:i', $user->t): '未使用'}} - @if ($user->expireWarning == '-1') - {{$user->expire_time}} - @elseif ($user->expireWarning == '0') - {{$user->expire_time}} - @elseif ($user->expireWarning == '1') - {{$user->expire_time}} - @else - {{$user->expire_time}} - @endif - - @if ($user->status > 0) - - @elseif ($user->status < 0) - - @else - - @endif - - - -
- - - - - - - -
-
-
- -
-
+ + @if ($user->expireWarning == '-1') + {{$user->expire_time}} + @elseif ($user->expireWarning == '0') + {{$user->expire_time}} + @elseif ($user->expireWarning == '1') + {{$user->expire_time}} + @else + {{$user->expire_time}} + @endif + + + @if ($user->status > 0) + + @elseif ($user->status < 0) + + @else + + @endif + + + + + +
+ + + + + + + +
+ + + @endforeach + + + + + + @endsection @section('script') - - - - + + + + const clipboard = new ClipboardJS('.copySubscribeLink'); + clipboard.on('success', function () { + swal.fire({ + title: '复制成功', + type: 'success', + timer: 1000, + showConfirmButton: false + }); + }); + clipboard.on('error', function () { + swal.fire({ + title: '复制失败,请手动复制', + type: 'error', + timer: 1500, + showConfirmButton: false + }); + }); + @endsection diff --git a/resources/views/auth/active.blade.php b/resources/views/auth/active.blade.php index 25970d6d..06225add 100644 --- a/resources/views/auth/active.blade.php +++ b/resources/views/auth/active.blade.php @@ -1,17 +1,17 @@ @extends('auth.layouts') @section('title', trans('auth.active_account')) @section('content') - @if(Session::get('errorMsg')) -
- {{Session::get('errorMsg')}} -
- @endif - @if(Session::get('successMsg')) -
- {{Session::get('successMsg')}} -
- @endif -
- {{trans('auth.login')}} -
+ @if(Session::get('errorMsg')) +
+ {{Session::get('errorMsg')}} +
+ @endif + @if(Session::get('successMsg')) +
+ {{Session::get('successMsg')}} +
+ @endif +
+ {{trans('auth.login')}} +
@endsection diff --git a/resources/views/auth/activeUser.blade.php b/resources/views/auth/activeUser.blade.php index c40430e5..ab058fb3 100644 --- a/resources/views/auth/activeUser.blade.php +++ b/resources/views/auth/activeUser.blade.php @@ -1,36 +1,37 @@ @extends('auth.layouts') @section('title', trans('auth.active_account')) @section('content') - @if (Session::get('successMsg')) -
- - {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- {{$errors->first()}} -
- @endif -
- @if(\App\Components\Helpers::systemConfig()['is_activate_account'] == 2) -
- {{trans('auth.active_account')}} -
-
- - - {{csrf_field()}} -
- @else -
- {{trans('auth.system_maintenance_tip',['email' => \App\Components\Helpers::systemConfig()['webmaster_email']])}} -
- @endif - {{trans('auth.back')}} - @if(\App\Components\Helpers::systemConfig()['is_activate_account']==2) - - @endif -
+ @if (Session::get('successMsg')) +
+ + {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ {{$errors->first()}} +
+ @endif +
+ @if(\App\Components\Helpers::systemConfig()['is_activate_account'] == 2) +
+ {{trans('auth.active_account')}} +
+
+ + + {{csrf_field()}} +
+ @else +
+ {{trans('auth.system_maintenance_tip',['email' => \App\Components\Helpers::systemConfig()['webmaster_email']])}} +
+ @endif + {{trans('auth.back')}} + @if(\App\Components\Helpers::systemConfig()['is_activate_account']==2) + + @endif +
@endsection diff --git a/resources/views/auth/error.blade.php b/resources/views/auth/error.blade.php index 9bb7eafa..5e0d8ed6 100644 --- a/resources/views/auth/error.blade.php +++ b/resources/views/auth/error.blade.php @@ -9,56 +9,57 @@ - - - - - - - {{trans('error.title')}} + + + + + + + {{trans('error.title')}} - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
-
-
-

(。・_・。)ノI’m sorry~

-

{{trans('error.title')}}

-
-

{!! $message !!}

-
+
+
+

(。・_・。)ノI’m sorry~

+

{{trans('error.title')}}

+
+

{!! $message !!}

+
@@ -86,21 +87,21 @@ \ No newline at end of file diff --git a/resources/views/auth/free.blade.php b/resources/views/auth/free.blade.php index 5fe8531a..76f3d8c3 100644 --- a/resources/views/auth/free.blade.php +++ b/resources/views/auth/free.blade.php @@ -1,41 +1,41 @@ @extends('auth.layouts') @section('title',\App\Components\Helpers::systemConfig()['website_name']) @section('content') -

{{trans('home.free_invite_codes_title')}}

-
- - @if(\App\Components\Helpers::systemConfig()['is_invite_register']) - @if(\App\Components\Helpers::systemConfig()['is_free_code']) - - - - - - - - @foreach($inviteList as $invite) - - - - - @endforeach - - @endif - @else - - - - - - @endif -
{{trans('home.invite_code_table_name')}} {{trans('home.invite_code_table_date')}}
{{$invite->code}} {{$invite->dateline}}
{{trans('home.no_need_invite_codes')}}
-
- @if(\App\Components\Helpers::systemConfig()['is_invite_register'] && \App\Components\Helpers::systemConfig()['is_free_code']) -
- {{trans('auth.back')}} - -
- @endif +

{{trans('home.free_invite_codes_title')}}

+
+ + @if(\App\Components\Helpers::systemConfig()['is_invite_register']) + @if(\App\Components\Helpers::systemConfig()['is_free_code']) + + + + + + + + @foreach($inviteList as $invite) + + + + + @endforeach + + @endif + @else + + + + + + @endif +
{{trans('home.invite_code_table_name')}} {{trans('home.invite_code_table_date')}}
{{$invite->code}} {{$invite->dateline}}
{{trans('home.no_need_invite_codes')}}
+
+ @if(\App\Components\Helpers::systemConfig()['is_invite_register'] && \App\Components\Helpers::systemConfig()['is_free_code']) +
+ {{trans('auth.back')}} + +
+ @endif @endsection diff --git a/resources/views/auth/layouts.blade.php b/resources/views/auth/layouts.blade.php index 7877a6bd..edafc0ef 100644 --- a/resources/views/auth/layouts.blade.php +++ b/resources/views/auth/layouts.blade.php @@ -7,101 +7,110 @@ - - - - - - - - @yield('title') - - - - - - - - - - - + + + + + + + + @yield('title') + + + + + + + + + + + @yield('css') - - - - - - - + + + + + + + @if(Agent::isMobile() && Agent::is('iOS') && strpos(Agent::getUserAgent(), 'MicroMessenger') !== FALSE) - -
-
-

点击右上角 ,选择在Safari Safari 中打开 -

-

您就可以正常访问本站了呦~

-
-
+ +
+
+

点击右上角 ,选择在Safari Safari 中打开 +

+

您就可以正常访问本站了呦~

+
+
@endif
-
-
-
-
-
-
- logo -

{{\App\Components\Helpers::systemConfig()['website_name']}}

-
-
- -
-
- @yield('content') -
-
-
- @yield('modal') -
+
+
+
+
+
+
+ logo +

{{\App\Components\Helpers::systemConfig()['website_name']}}

+
+
+ +
+
+ @yield('content') +
+
+
+ @yield('modal') +
@@ -129,7 +138,7 @@ @yield('script') @@ -143,13 +152,13 @@ {!! \App\Components\Helpers::systemConfig()['website_customer_service'] !!} \ No newline at end of file diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 918c4e3b..e9a92423 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,90 +1,95 @@ @extends('auth.layouts') @section('title', trans('auth.login')) @section('content') -
- @if($errors->any()) -
- {!! $errors->first() !!} -
- @endif - @if (Session::get('regSuccessMsg')) -
- - {{Session::get('regSuccessMsg')}} -
- @endif -
- - -
-
- - - {{csrf_field()}} -
- @switch(\App\Components\Helpers::systemConfig()['is_captcha']) - @case(1) -
- - - {{trans('auth.captcha')}} -
- @break - @case(2) -
- {!! Geetest::render() !!} -
- @break - @case(3) -
- {!! NoCaptcha::display() !!} - {!! NoCaptcha::renderJs(session::get('locale')) !!} -
- @break - @case(4) -
- {!! HCaptcha::display() !!} - {!! HCaptcha::renderJs(session::get('locale')) !!} -
- @break - @default - @endswitch -
-
- - -
- {{trans('auth.forget_password')}} -
- -
- @if(\App\Components\Helpers::systemConfig()['is_register']) -

{{trans('auth.register_tip')}} {{trans('auth.register')}}

- @endif +
+ @if($errors->any()) +
+ {!! $errors->first() !!} +
+ @endif + @if (Session::get('regSuccessMsg')) +
+ + {{Session::get('regSuccessMsg')}} +
+ @endif +
+ + +
+
+ + + {{csrf_field()}} +
+ @switch(\App\Components\Helpers::systemConfig()['is_captcha']) + @case(1) +
+ + + {{trans('auth.captcha')}} +
+ @break + @case(2) +
+ {!! Geetest::render() !!} +
+ @break + @case(3) +
+ {!! NoCaptcha::display() !!} + {!! NoCaptcha::renderJs(session::get('locale')) !!} +
+ @break + @case(4) +
+ {!! HCaptcha::display() !!} + {!! HCaptcha::renderJs(session::get('locale')) !!} +
+ @break + @default + @endswitch +
+
+ + +
+ {{trans('auth.forget_password')}} +
+ +
+ @if(\App\Components\Helpers::systemConfig()['is_register']) +

{{trans('auth.register_tip')}} {{trans('auth.register')}}

+ @endif @endsection @section('script') - -@endsection \ No newline at end of file + +@endsection diff --git a/resources/views/auth/maintenance.blade.php b/resources/views/auth/maintenance.blade.php index 2e47aca3..e5fa66dd 100644 --- a/resources/views/auth/maintenance.blade.php +++ b/resources/views/auth/maintenance.blade.php @@ -7,57 +7,60 @@ - - - - - - - - 维护 | Maintenance - - - - - - - - - - - - - - + + + + + + + + 维护 | Maintenance + + + + + + + + + + + + + + - - + + - - - + + +
> -
- -

维护建设中

- {!! $message !!} -
-

-
-
+
+ +

维护建设中

+ {!! $message !!} +
+

+
+
@@ -86,7 +89,7 @@ @@ -94,29 +97,29 @@ diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 37cc3f12..9b6926b1 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,260 +1,281 @@ @extends('auth.layouts') @section('title', trans('auth.register')) @section('css') - - + + @endsection @section('content') -
- @if(\App\Components\Helpers::systemConfig()['is_register']) - @if($errors->any()) -
- {{$errors->first()}} -
- @endif - @csrf - - -
- - -
-
- @if($emailList) -
- - -
- @ -
- - -
- @else - - - @endif -
- @if(\App\Components\Helpers::systemConfig()['is_activate_account'] == 1) -
-
- - - + + @if(\App\Components\Helpers::systemConfig()['is_register']) + @if($errors->any()) +
+ {{$errors->first()}} +
+ @endif + @csrf + + +
+ + +
+
+ @if($emailList) +
+ + +
+ @ +
+ + +
+ @else + + + @endif +
+ @if(\App\Components\Helpers::systemConfig()['is_activate_account'] == 1) +
+
+ + + -
-
- @endif -
- - -
-
- - -
- @if(\App\Components\Helpers::systemConfig()['is_invite_register']) -
- - -
- @if(\App\Components\Helpers::systemConfig()['is_free_code']) -

- {{trans('auth.get_free_code')}} -

- @endif - @endif - @switch(\App\Components\Helpers::systemConfig()['is_captcha']) - @case(1) -
- - - {{trans('auth.captcha')}} -
- @break - @case(2) -
- {!! Geetest::render() !!} -
- @break - @case(3) -
- {!! NoCaptcha::display() !!} - {!! NoCaptcha::renderJs(session::get('locale')) !!} -
- @break - @case(4) -
- {!! HCaptcha::display() !!} - {!! HCaptcha::renderJs(session::get('locale')) !!} -
- @break - @default - @endswitch -
-
- - -
-
- @else -
+
+
+ @endif +
+ + +
+
+ + +
+ @if(\App\Components\Helpers::systemConfig()['is_invite_register']) +
+ + +
+ @if(\App\Components\Helpers::systemConfig()['is_free_code']) +

+ {{trans('auth.get_free_code')}} +

+ @endif + @endif + @switch(\App\Components\Helpers::systemConfig()['is_captcha']) + @case(1) +
+ + + {{trans('auth.captcha')}} +
+ @break + @case(2) +
+ {!! Geetest::render() !!} +
+ @break + @case(3) +
+ {!! NoCaptcha::display() !!} + {!! NoCaptcha::renderJs(session::get('locale')) !!} +
+ @break + @case(4) +
+ {!! HCaptcha::display() !!} + {!! HCaptcha::renderJs(session::get('locale')) !!} +
+ @break + @default + @endswitch +
+
+ + +
+
+ @else +
{{trans('auth.system_maintenance')}} -
- @endif - {{trans('auth.back')}} - @if(\App\Components\Helpers::systemConfig()['is_register']) - - @endif - +
+ @endif + {{trans('auth.back')}} + @if(\App\Components\Helpers::systemConfig()['is_register']) + + @endif + @endsection @section('modal') - - - @endsection + + + @endsection @section('script') - - - - + + + + + + @switch(\App\Components\Helpers::systemConfig()['is_captcha']) + @case(3) + // 先检查Google reCAPTCHA有没有进行验证 + if ($('#g-recaptcha-response').val() === '') { + swal.fire({title: '{{trans('auth.required_captcha')}}', type: 'error'}); + return false; + } + @break + @case(4) + // 先检查Google reCAPTCHA有没有进行验证 + if ($('#h-captcha-response').val() === '') { + swal.fire({title: '{{trans('auth.required_captcha')}}', type: 'error'}); + return false; + } + @break + @default + @endswitch + }); + @endsection diff --git a/resources/views/auth/reset.blade.php b/resources/views/auth/reset.blade.php index 1af4d9b0..2b40ebd9 100644 --- a/resources/views/auth/reset.blade.php +++ b/resources/views/auth/reset.blade.php @@ -1,38 +1,39 @@ @extends('auth.layouts') @section('title', trans('auth.resetPassword')) @section('content') -
- @if(Session::get('successMsg')) -
- {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- {{$errors->first()}} -
- @endif - @if ($verify->status > 0 && count($errors) <= 0 && empty(Session::get('successMsg'))) -
- {{trans('auth.overtime')}} -
- @else -
- {{trans('auth.resetPassword')}} -
-
- - - {{csrf_field()}} -
-
- - -
- @endif - {{trans('auth.back')}} - @if ($verify->status == 0) - - @endif -
-@endsection \ No newline at end of file +
+ @if(Session::get('successMsg')) +
+ {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ {{$errors->first()}} +
+ @endif + @if ($verify->status > 0 && count($errors) <= 0 && empty(Session::get('successMsg'))) +
+ {{trans('auth.overtime')}} +
+ @else +
+ {{trans('auth.resetPassword')}} +
+
+ + + {{csrf_field()}} +
+
+ + +
+ @endif + {{trans('auth.back')}} + @if ($verify->status == 0) + + @endif +
+@endsection diff --git a/resources/views/auth/resetPassword.blade.php b/resources/views/auth/resetPassword.blade.php index ff077233..9e89c6b1 100644 --- a/resources/views/auth/resetPassword.blade.php +++ b/resources/views/auth/resetPassword.blade.php @@ -1,34 +1,36 @@ @extends('auth.layouts') @section('title', trans('auth.resetPassword')) @section('content') - @if (Session::get('successMsg')) -
- {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- {{$errors->first()}} -
- @endif -
- @if(\App\Components\Helpers::systemConfig()['is_reset_password']) -
- {{trans('auth.resetPassword')}} -
-
- - - {{csrf_field()}} -
- @else -
- {{trans('auth.system_maintenance_tip',['email' => \App\Components\Helpers::systemConfig()['webmaster_email']])}} -
- @endif - {{trans('auth.back')}} - @if(\App\Components\Helpers::systemConfig()['is_reset_password']) - - @endif -
+ @if (Session::get('successMsg')) +
+ {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ {{$errors->first()}} +
+ @endif +
+ @if(\App\Components\Helpers::systemConfig()['is_reset_password']) +
+ {{trans('auth.resetPassword')}} +
+
+ + + {{csrf_field()}} +
+ @else +
+ {{trans('auth.system_maintenance_tip',['email' => \App\Components\Helpers::systemConfig()['webmaster_email']])}} +
+ @endif + {{trans('auth.back')}} + @if(\App\Components\Helpers::systemConfig()['is_reset_password']) + + @endif +
@endsection diff --git a/resources/views/emails/activeUser.blade.php b/resources/views/emails/activeUser.blade.php index da4219b7..c8cc98dc 100644 --- a/resources/views/emails/activeUser.blade.php +++ b/resources/views/emails/activeUser.blade.php @@ -1,89 +1,109 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 激活账号 - -
-
-
- - - - - - - - - -
-

-
-
-

点击这里去【激活账号】,或者点击下面的链接(30分钟内有效)。

-

- {{$activeUserUrl}} -

-
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 激活账号 + +
+
+
+ + + + + + + + + +
+

+
+
+

点击这里去【激活账号】,或者点击下面的链接(30分钟内有效)。 +

+

+ {{$activeUserUrl}} +

+
+
+
+ + + + + diff --git a/resources/views/emails/closeTicket.blade.php b/resources/views/emails/closeTicket.blade.php index 0d66f118..5fdc49e4 100644 --- a/resources/views/emails/closeTicket.blade.php +++ b/resources/views/emails/closeTicket.blade.php @@ -1,86 +1,105 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 工单关闭提醒 - -
-
-
- - - - - - - - - -
-

-
-
-

{{$content}}

-
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 工单关闭提醒 + +
+
+
+ + + + + + + + + +
+

+
+
+

{{$content}}

+
+
+
+ + + + + diff --git a/resources/views/emails/newTicket.blade.php b/resources/views/emails/newTicket.blade.php index e1fd0b8b..8158dc28 100644 --- a/resources/views/emails/newTicket.blade.php +++ b/resources/views/emails/newTicket.blade.php @@ -1,86 +1,105 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 新工单提醒 - -
-
-
- - - - - - - - - -
-

-
-
- {!! $content !!} -
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 新工单提醒 + +
+
+
+ + + + + + + + + +
+

+
+
+ {!! $content !!} +
+
+
+ + + + + diff --git a/resources/views/emails/nodeCrashWarning.blade.php b/resources/views/emails/nodeCrashWarning.blade.php index 65f3361f..036a2970 100644 --- a/resources/views/emails/nodeCrashWarning.blade.php +++ b/resources/views/emails/nodeCrashWarning.blade.php @@ -1,86 +1,105 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 节点阻断警告 - -
-
-
- - - - - - - - - -
-

-
-
-

{!! $content !!}

-
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 节点阻断警告 + +
+
+
+ + + + + + + + + +
+

+
+
+

{!! $content !!}

+
+
+
+ + + + + diff --git a/resources/views/emails/replyTicket.blade.php b/resources/views/emails/replyTicket.blade.php index 8406676a..27e3c145 100644 --- a/resources/views/emails/replyTicket.blade.php +++ b/resources/views/emails/replyTicket.blade.php @@ -1,86 +1,105 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 工单回复提醒 - -
-
-
- - - - - - - - - -
-

-
-
- {!! $content !!} -
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 工单回复提醒 + +
+
+
+ + + + + + + + + +
+

+
+
+ {!! $content !!} +
+
+
+ + + + + diff --git a/resources/views/emails/resetPassword.blade.php b/resources/views/emails/resetPassword.blade.php index 646a3aa4..f36cc035 100644 --- a/resources/views/emails/resetPassword.blade.php +++ b/resources/views/emails/resetPassword.blade.php @@ -1,758 +1,760 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + + +
 
+ + + + diff --git a/resources/views/emails/sendUserInfo.blade.php b/resources/views/emails/sendUserInfo.blade.php index ec9af8c5..4a9a7be4 100644 --- a/resources/views/emails/sendUserInfo.blade.php +++ b/resources/views/emails/sendUserInfo.blade.php @@ -1,133 +1,152 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 您的账号信息 - -
-
-
- - - - - - - - - -
-

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @if($content['serverList']) - - - - - - - @foreach($content['serverList'] as $vo) - - - - - @endforeach - @endif -
订单编号{{$content['order_sn']}}
服务{{$content['goods_name']}}
流量{{$content['goods_traffic']}}
端口{{$content['port']}}
密码{{$content['passwd']}}
加密方式{{$content['method']}}
创建时间{{$content['created_at']}}
过期时间{{$content['expire_at']}}
------------------------------------------
节点列表
{{$vo['name']}}{{$vo['server'] ? $vo['server'] : $vo['ip']}}
-
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 您的账号信息 + +
+
+
+ + + + + + + + + +
+

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @if($content['serverList']) + + + + + + + @foreach($content['serverList'] as $vo) + + + + + @endforeach + @endif +
订单编号{{$content['order_sn']}}
服务{{$content['goods_name']}}
流量{{$content['goods_traffic']}}
端口{{$content['port']}}
密码{{$content['passwd']}}
加密方式{{$content['method']}}
创建时间{{$content['created_at']}}
过期时间{{$content['expire_at']}}
------------------------------------------
节点列表
{{$vo['name']}}{{$vo['server'] ? $vo['server'] : $vo['ip']}}
+
+
+
+ + + + + diff --git a/resources/views/emails/sendVerifyCode.blade.php b/resources/views/emails/sendVerifyCode.blade.php index a4817eb9..03c20cc5 100644 --- a/resources/views/emails/sendVerifyCode.blade.php +++ b/resources/views/emails/sendVerifyCode.blade.php @@ -1,86 +1,105 @@ - - - - + + +
-
- - - - + + +
- - - +
+ + + - - -
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 注册账号 - -
-
-
- - - - - - - - - -
-

-
-
-

您的验证码:{{$code}} (10分钟内有效)

-
-
-
-
-
\ No newline at end of file +
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 注册账号 + +
+
+
+ + + + + + + + + +
+

+
+
+

您的验证码:{{$code}} (10分钟内有效)

+
+
+
+ + + + + diff --git a/resources/views/emails/userExpireWarning.blade.php b/resources/views/emails/userExpireWarning.blade.php index cbeaa848..ee0e819b 100644 --- a/resources/views/emails/userExpireWarning.blade.php +++ b/resources/views/emails/userExpireWarning.blade.php @@ -1,86 +1,105 @@ - - - - + +
-
- - - - + + +
- - - +
+ + + - - + + + +
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 账号过期提醒 - -
-
-
- - - - - - - - - -
-

-
-
-

您的账号【{{$lastCanUseDays}}】天后即将过期,为了确保您可以继续正常使用我们的服务,请及时续费。

-
-
-
-
-
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 账号过期提醒 + +
+
+
+ + + + + + + + + +
+

+
+
+

您的账号【{{$lastCanUseDays}}】天后即将过期,为了确保您可以继续正常使用我们的服务,请及时续费。

+
+
+
+
+
diff --git a/resources/views/emails/userExpireWarningToday.blade.php b/resources/views/emails/userExpireWarningToday.blade.php index 1eaf2d51..d53c6528 100644 --- a/resources/views/emails/userExpireWarningToday.blade.php +++ b/resources/views/emails/userExpireWarningToday.blade.php @@ -1,86 +1,105 @@ - - - - + +
-
- - - - + + +
- - - +
+ + + - - + + + +
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 账号过期提醒 - -
-
-
- - - - - - - - - -
-

-
-
-

您的账号将于今天晚上【24:00】过期,为了确保您可以继续正常使用我们的服务,请及时续费。

-
-
-
-
-
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 账号过期提醒 + +
+
+
+ + + + + + + + + +
+

+
+
+

您的账号将于今天晚上【24:00】过期,为了确保您可以继续正常使用我们的服务,请及时续费。

+
+
+
+
+
diff --git a/resources/views/emails/userTrafficWarning.blade.php b/resources/views/emails/userTrafficWarning.blade.php index f1b16088..1d8d2acb 100644 --- a/resources/views/emails/userTrafficWarning.blade.php +++ b/resources/views/emails/userTrafficWarning.blade.php @@ -1,86 +1,105 @@ - - - - + +
-
- - - - + + +
- - - +
+ + + - - + + + +
+
+ + + + - - -
+ + + - - - -
- - - - - - -
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} - -

-
-
-
- - - - - - -
- - - - - - -
- - - - - - - -
-
- - 流量警告 - -
-
-
- - - - - - - - - -
-

-
-
-

您的流量已使用【{{$usedPercent}}%】,为了确保您可以继续正常使用我们的服务,请及时续费或者购买流量包。

-
-
-
-
-
+ + + + + + +
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} + +

+
+
+
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+
+ + 流量警告 + +
+
+
+ + + + + + + + + +
+

+
+
+

您的流量已使用【{{$usedPercent}}%】,为了确保您可以继续正常使用我们的服务,请及时续费或者购买流量包。

+
+
+
+
+
diff --git a/resources/views/user/article.blade.php b/resources/views/user/article.blade.php index 9b497773..692ed409 100644 --- a/resources/views/user/article.blade.php +++ b/resources/views/user/article.blade.php @@ -1,20 +1,20 @@ @extends('user.layouts') @section('content') - -
-
-
- -
-
-

{{$info->title}}{{$info->created_at}}

-
- {!! $info->content !!} -
-
-
-
-
-
- + +
+
+
+ +
+
+

{{$info->title}}{{$info->created_at}}

+
+ {!! $info->content !!} +
+
+
+
+
+
+ @endsection \ No newline at end of file diff --git a/resources/views/user/buy.blade.php b/resources/views/user/buy.blade.php index 4dc2724b..751d6b26 100644 --- a/resources/views/user/buy.blade.php +++ b/resources/views/user/buy.blade.php @@ -1,180 +1,191 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') -
-
-
-
- - - - - - - - - - - - - - - - - -
{{trans('home.service_name')}}{{trans('home.service_desc')}} {{trans('home.service_price')}}{{trans('home.service_quantity')}}
{{$goods->name}} {{trans('home.service_days')}} - {{$goods->type==1? $dataPlusDays:$goods->days}} {{trans('home.day')}} -
- {{$goods->traffic_label}} {{trans('home.bandwidth')}} -
¥{{$goods->price}} x 1
-
- @if($goods->type <= 2) -
-
-
- -
- -
-
-
-
-

{{trans('home.service_subtotal_price')}} - ¥{{$goods->price}} -

-

{{trans('home.service_total_price')}} - ¥{{$goods->price}} -

-
- @endif -
-
-
- @include('user.components.purchase') - @if($goods->type <= 2) - - @endif -
-
-
-
-
-
-
+
+
+
+
+ + + + + + + + + + + + + + + + + +
{{trans('home.service_name')}}{{trans('home.service_desc')}} {{trans('home.service_price')}}{{trans('home.service_quantity')}}
{{$goods->name}} {{trans('home.service_days')}} + {{$goods->type==1? $dataPlusDays:$goods->days}} {{trans('home.day')}} +
+ {{$goods->traffic_label}} {{trans('home.bandwidth')}} +
¥{{$goods->price}} x 1
+
+ @if($goods->type <= 2) +
+
+
+ +
+ +
+
+
+
+

{{trans('home.service_subtotal_price')}} + ¥{{$goods->price}} +

+

{{trans('home.service_total_price')}} + ¥{{$goods->price}} +

+
+ @endif +
+
+
+ @include('user.components.purchase') + @if($goods->type <= 2) + + @endif +
+
+
+
+
+
+
@endsection @section('script') - + function contiousPay(method, pay_type) { + const goods_id = '{{$goods->id}}'; + const coupon_sn = $('#coupon_sn').val(); + $.ajax({ + type: "POST", + url: "/payment/purchase", + async: false, + data: { + _token: '{{csrf_token()}}', + goods_id: goods_id, + coupon_sn: coupon_sn, + method: method, + pay_type: pay_type + }, + dataType: 'json', + success: function (ret) { + if (ret.status === 'success') { + swal.fire({ + title: ret.message, + type: 'success', + timer: 1300, + showConfirmButton: false + }); + if (method === 'balance') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => window.location.href = '/invoices') + } + if (ret.data) { + window.location.href = '/payment/' + ret.data; + } else if (ret.url) { + window.location.href = ret.url; + } + } else if (ret.status === 'info') { + swal.fire({title: ret.title, text: ret.message, type: 'question'}); + } else { + swal.fire({ + title: ret.message, + type: 'error' + }) + } + }, + error: function () { + swal.fire('未知错误', '请开工单通知客服', 'error') + } + }); + } + @endsection diff --git a/resources/views/user/components/avatar.blade.php b/resources/views/user/components/avatar.blade.php index 3e6c0466..d1dc5925 100644 --- a/resources/views/user/components/avatar.blade.php +++ b/resources/views/user/components/avatar.blade.php @@ -1,7 +1,7 @@ @if(Auth::user()->qq) - {{trans('home.ticket_reply_me')}} + {{trans('home.ticket_reply_me')}} @elseif(strpos(strtolower(Auth::user()->email),"@qq.com") !== FALSE) - {{trans('home.ticket_reply_me')}} + {{trans('home.ticket_reply_me')}} @else - {{trans('home.ticket_reply_me')}} -@endif \ No newline at end of file + {{trans('home.ticket_reply_me')}} +@endif diff --git a/resources/views/user/components/help/solution.blade.php b/resources/views/user/components/help/solution.blade.php index ae718bde..5f4a2bdc 100644 --- a/resources/views/user/components/help/solution.blade.php +++ b/resources/views/user/components/help/solution.blade.php @@ -1,53 +1,53 @@ \ No newline at end of file + +
+
+ 暂无 +
+
+

Q: 软件安装后,闪退?

+

A: 闪退的情况大概分以下三种

+
    +
  1. 安装完成后,一打开就秒退。 +
    解决办法:登陆网站上提供的对应ID,先在苹果商店搜索安装最新版,运行一次后,在通过网站直接覆盖安装。 +
  2. +
  3. 打开软件,且弹出ID验证框,输入ID后闪退。 +
    解决办法:同上。 +
  4. +
  5. 打开软件,运行一段时间后闪退。 +
    这类问题,一般是因为软件的适配性引起的,基本无解。 +
  6. +
+

Q: 软件安装失败?

+

A: 出现此类问题,绝大多数是你的网络不好,更换个网络即可,最好使用数据流量进行下载。

+
+
+ {{--

Q: PAC 更新失败

--}} + {{--

A: 这个情况都是PC链接访问网站不稳定造成的!--}} + {{--
--}} + {{-- 解决方案: 手动下载--}} + {{--

--}} + 暂无 +
+
+ 暂无 +
+
+ diff --git a/resources/views/user/components/purchase.blade.php b/resources/views/user/components/purchase.blade.php index 752698e8..0187c721 100644 --- a/resources/views/user/components/purchase.blade.php +++ b/resources/views/user/components/purchase.blade.php @@ -1,14 +1,21 @@ @if(\App\Components\Helpers::systemConfig()['is_AliPay']) - + @endif @if(\App\Components\Helpers::systemConfig()['is_QQPay']) - + @endif @if(\App\Components\Helpers::systemConfig()['is_WeChatPay']) - ' + ' @endif @if(\App\Components\Helpers::systemConfig()['is_otherPay'] == 'bitpayx') - ' + ' @elseif(\App\Components\Helpers::systemConfig()['is_otherPay'] == 'paypal') - ' -@endif \ No newline at end of file + ' +@endif diff --git a/resources/views/user/help.blade.php b/resources/views/user/help.blade.php index 049d3877..01275d24 100644 --- a/resources/views/user/help.blade.php +++ b/resources/views/user/help.blade.php @@ -1,294 +1,345 @@ @extends('user.layouts') @section('css') - - - + + + @endsection @section('content') - -
-
-
- - - -
-
- -
-
-
-
-
-
- -
-
- @if($subscribe_status) - -
- - - + {{trans('home.subscribe_warning')}} +
+
+ + + - -
- @else - - @endif -
-
-
-
- -
-
- @include('user.components.help.tutorial') -
-
-
-
- -
-
- @include('user.components.help.solution') -
-
-
-
-
-
-
- -
- -
-
- -
-
-
- +
+ @else + + @endif +
+
+
+
+ +
+
+ @include('user.components.help.tutorial') +
+
+
+
+ +
+
+ @include('user.components.help.solution') +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ - -
- -
-
-
    -
  1. 在线支付,本支付方式支持支付宝。支付后即开即用。前往【{{trans('home.services')}}】选择想要购买的套餐,在订单界面选择在线支付即可。 -
  2. -
  3. 余额支付,本支付方法支持微信,支付宝。支付后需要等待充值到账,再购买服务。 - ,充值后等待充值到账,一般会在24小时内到账,到账后可以在【{{trans('home.services')}}】 页面查看您的账号余额。 在【{{trans('home.services')}}】选择想要购买的套餐,在订单界面选择余额支付即可。 -
  4. -
-
-
-
- + +
+ +
+
+
    +
  1. 在线支付,本支付方式支持支付宝。支付后即开即用。前往【{{trans('home.services')}}】选择想要购买的套餐,在订单界面选择在线支付即可。 +
  2. +
  3. 余额支付,本支付方法支持微信,支付宝。支付后需要等待充值到账,再购买服务。 + ,充值后等待充值到账,一般会在24小时内到账,到账后可以在【{{trans('home.services')}}】 + 页面查看您的账号余额。 在【{{trans('home.services')}} + 】选择想要购买的套餐,在订单界面选择余额支付即可。 +
  4. +
+
+
+
+ - -
- -
-
-
请选择其一种方式联系客服,请勿重复发送请求!!!
-
    -
  1. 【{{trans('home.tickets')}}】界面,创建新的工单,客服人员在上线后会在第一时刻处理。 -
  2. -
-
-
-
-
-
-
-
- -
- -
-
-
    -
  1. - 电脑有安装任何电脑管家类的软件,都可以使用他们自带的网络修复工具来重置网络。 -
  2. -
  3. -
      -
    1. - 键盘操作Win + X,或右击左下角开始菜单键 (Win键看起来像 这样) -
    2. -
    3. - 按下 A键 或者 手动选择 - 命令提示符(管理员)/ Windows PowerShell(管理员) -
    4. -
    5. - 输入Netsh winsock reset 后回车,再输入 netsh advfirewall reset 后回车; -
    6. -
    -
  4. -
-
-
-
- + +
+ +
+
+
+ 请选择其一种方式联系客服,请勿重复发送请求!!! +
+
    +
  1. 【{{trans('home.tickets')}}】界面,创建新的工单,客服人员在上线后会在第一时刻处理。 +
  2. +
+
+
+
+
+
+
+
+ +
+ +
+
+
    +
  1. + 电脑有安装任何电脑管家类的软件,都可以使用他们自带的网络修复工具来重置网络。 +
  2. +
  3. +
      +
    1. + 键盘操作Win + X,或右击左下角开始菜单键 + (Win键看起来像 这样) +
    2. +
    3. + 按下 A键 或者 手动选择 + 命令提示符(管理员)/ Windows PowerShell(管理员) +
    4. +
    5. + 输入Netsh winsock reset 后回车,再输入 netsh + advfirewall reset 后回车; +
    6. +
    +
  4. +
+
+
+
+ - -
- -
-
- 账号在2种情况下会显示禁用; -
    -
  1. - 套餐过期/流量枯竭;此情况您需要重新【{{trans('home.services')}}】; -
  2. -
  3. - 近期流量使用异常;在1小时内使用流量超过 - {{\App\Components\Helpers::systemConfig()['traffic_ban_value']}}GB ,即会触发本站的流量异常保护;保护时长为{{\App\Components\Helpers::systemConfig()['traffic_ban_time']}}分钟 -
  4. -
- 如您对禁用情况有疑问,可以创建【{{trans('home.tickets')}}】,联系售后人员。 -
-
-
- + +
+ +
+
+ 账号在2种情况下会显示禁用; +
    +
  1. + 套餐过期/流量枯竭;此情况您需要重新【{{trans('home.services')}}】; +
  2. +
  3. + 近期流量使用异常;在1小时内使用流量超过 + {{\App\Components\Helpers::systemConfig()['traffic_ban_value']}} + GB + ,即会触发本站的流量异常保护;保护时长为{{\App\Components\Helpers::systemConfig()['traffic_ban_time']}} + 分钟 +
  4. +
+ 如您对禁用情况有疑问,可以创建【{{trans('home.tickets')}}】,联系售后人员。 +
+
+
+ - -
- -
-
- 订阅地址对于账号来说非常重要。所以本站对此设置了严格的限制措施,以防止用户无意间泄露给他人后,无法挽回。 -

限制为: - 24小时内,订阅地址只允许请求{{\App\Components\Helpers::systemConfig()['subscribe_ban_times']}}次 -

-

解封,请在过一段时间并确定无误后,创建【{{trans('home.tickets')}}】,联系售后人员 -

-

小知识:如果您无意间的截图忘记将订阅地址打码了,您可以 - - 更换链接 -

-
-
-
- -
-
-
-
- - - - - + +
+ +
+
+ 订阅地址对于账号来说非常重要。所以本站对此设置了严格的限制措施,以防止用户无意间泄露给他人后,无法挽回。 +

限制为: + 24小时内,订阅地址只允许请求{{\App\Components\Helpers::systemConfig()['subscribe_ban_times']}} + 次 +

+

解封,请在过一段时间并确定无误后,创建【{{trans('home.tickets')}}】,联系售后人员 +

+

小知识:如果您无意间的截图忘记将订阅地址打码了,您可以 + + 更换链接 +

+
+
+
+ + + + + + + + + + @endsection @section('script') - - - - - + + + + + const clipboard = new ClipboardJS('.mt-clipboard'); + clipboard.on('success', function () { + swal.fire({ + title: '复制成功', + type: 'success', + timer: 1300, + showConfirmButton: false + }); + }); + clipboard.on('error', function () { + swal.fire({ + title: '复制失败,请手动复制', + type: 'error', + timer: 1500, + showConfirmButton: false + }); + }); + @endsection diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php index f28b1ca0..ded066f2 100644 --- a/resources/views/user/index.blade.php +++ b/resources/views/user/index.blade.php @@ -1,365 +1,401 @@ @extends('user.layouts') @section('css') - - + + @endsection @section('content') -
-
- @if (Session::has('successMsg')) - - @endif -
-
-
- - {{trans('home.account_status')}} - @if(\App\Components\Helpers::systemConfig()['is_checkin']) - - {{trans('home.sign_in')}} - - @endif -
- @if($not_paying_user) -

更长使用时间

-

更多流量

-

更多优质线路

- 快 来 购 买 服 务 吧! - @elseif(Auth::user()->enable) - - {{trans('home.enabled')}} -

{{trans('home.normal')}}

- @elseif($remainDays == 0) - - {{trans('home.expired')}} -

{{trans('home.reason_expired')}}

- @elseif($unusedTransfer == 0) - - {{trans('home.disabled')}} -

{{trans('home.reason_traffic_exhausted')}}

- @elseif($isTrafficWarning || $banedTime != 0) - - {{trans('home.limited')}} -

{!!trans('home.reason_overused', ['data'=>\App\Components\Helpers::systemConfig()['traffic_ban_value']])!!}

- @else - - {{trans('home.disabled')}} -

{{trans('home.reason_unknown')}}

- @endif -
-
-
-
-
-
-
- - {{trans('home.account_bandwidth_usage')}} -
- {{flowAutoShow($unusedTransfer)}} -
-
- @if(!$not_paying_user && \App\Components\Helpers::systemConfig()['reset_traffic'] && $resetDays != 0 && $remainDays>$resetDays) - {{trans('home.account_reset_notice', ['reset_day' => $resetDays])}} - @endif -
-
-
-
- {{$unusedPercent * 100}}% -
-
-
-
-
-
-
- - {{trans('home.account_expire')}} -
- @if($remainDays != -1) - {{$remainDays}} {{trans('home.day')}} -

{{$expireTime}}

- @else - {{trans('home.expired')}} -
- {{trans('home.service_buy_button')}} - @endif -
-
-
- @if($userLoginLog) -
-
- - {{trans('home.account_last_login')}} -
    -
  • - 时间:{{date_format($userLoginLog->created_at,'Y/m/d H:i')}} -
  • -
  • IP地址:{{$userLoginLog->ip}} -
  • -
  • 运营商:{{$userLoginLog->isp}} -
  • -
  • 地区:{{$userLoginLog->area}} -
  • -
-
-
- @endif -
-
-
-
-
-
- -

客户端

-

下载 & 教程

- 前往 -
-
-
-
-
-
- @if(\App\Components\Helpers::systemConfig()['is_push_bear'] && \App\Components\Helpers::systemConfig()['push_bear_qrcode']) -

微信公告推送

-

- @endif -
-
-
-
-
-
-
-
-

{{trans('home.announcement')}} -

-
- -
-
-
-
-
- @if(!$noticeList -> isEmpty()) - @foreach($noticeList as $notice) -

{!!$notice->title!!}

- {!! $notice->content !!} - @if ($notice->updated_at) - 更新于 {{$notice->updated_at}} - @endif - @endforeach - @else -

暂无公告

- @endif -
-
-
-
-
-
-
-
-

{{trans('home.traffic_log')}}

-
- -
-
- -
-
-
- -
-
- -
-
-
-
-
-
-
-
-
+
+
+ @if (Session::has('successMsg')) + + @endif +
+
+
+ + {{trans('home.account_status')}} + @if(\App\Components\Helpers::systemConfig()['is_checkin']) + + {{trans('home.sign_in')}} + + @endif +
+ @if($not_paying_user) +

更长使用时间

+

更多流量

+

更多优质线路

+ 快 来 购 买 服 务 吧! + @elseif(Auth::user()->enable) + + {{trans('home.enabled')}} +

{{trans('home.normal')}}

+ @elseif($remainDays == 0) + + {{trans('home.expired')}} +

{{trans('home.reason_expired')}}

+ @elseif($unusedTransfer == 0) + + {{trans('home.disabled')}} +

{{trans('home.reason_traffic_exhausted')}}

+ @elseif($isTrafficWarning || $banedTime != 0) + + {{trans('home.limited')}} +

{!!trans('home.reason_overused', ['data'=>\App\Components\Helpers::systemConfig()['traffic_ban_value']])!!}

+ @else + + {{trans('home.disabled')}} +

{{trans('home.reason_unknown')}}

+ @endif +
+
+
+
+
+
+
+ + {{trans('home.account_bandwidth_usage')}} +
+ {{flowAutoShow($unusedTransfer)}} +
+
+ @if(!$not_paying_user && \App\Components\Helpers::systemConfig()['reset_traffic'] && $resetDays != 0 && $remainDays>$resetDays) + {{trans('home.account_reset_notice', ['reset_day' => $resetDays])}} + @endif +
+
+
+
+ {{$unusedPercent * 100}}% +
+
+
+
+
+
+
+ + {{trans('home.account_expire')}} +
+ @if($remainDays != -1) + {{$remainDays}} {{trans('home.day')}} +

{{$expireTime}}

+ @else + {{trans('home.expired')}} +
+ {{trans('home.service_buy_button')}} + @endif +
+
+
+ @if($userLoginLog) +
+
+ + {{trans('home.account_last_login')}} +
    +
  • + 时间:{{date_format($userLoginLog->created_at,'Y/m/d H:i')}} +
  • +
  • IP地址:{{$userLoginLog->ip}} +
  • +
  • 运营商:{{$userLoginLog->isp}} +
  • +
  • 地区:{{$userLoginLog->area}} +
  • +
+
+
+ @endif +
+
+
+
+
+
+ +

客户端

+

下载 & 教程

+ 前往 +
+
+
+
+
+
+ @if(\App\Components\Helpers::systemConfig()['is_push_bear'] && \App\Components\Helpers::systemConfig()['push_bear_qrcode']) +

微信公告推送

+

+ @else +

交流群

+ @endif + @if($not_paying_user) + + @else + + @endif +
+
+
+ +
+
+
+
+
+

{{trans('home.announcement')}} +

+
+ +
+
+
+
+
+ @if(!$noticeList -> isEmpty()) + @foreach($noticeList as $notice) +

{!!$notice->title!!}

+ {!! $notice->content !!} + @if ($notice->updated_at) + 更新于 {{$notice->updated_at}} + @endif + @endforeach + @else +

暂无公告

+ @endif +
+
+
+
+
+
+
+
+

{{trans('home.traffic_log')}} +

+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
@endsection @section('script') - - - - - - - + + + + + + + @if($banedTime != 0) + // 每秒更新计时器 + const countDownDate = new Date("{{$banedTime}}").getTime(); + const x = setInterval(function () { + const distance = countDownDate - new Date().getTime(); + const hours = Math.floor(distance % 86400000 / 3600000); + const minutes = Math.floor((distance % 3600000) / 60000); + const seconds = Math.floor((distance % 60000) / 1000); + document.getElementById("countdown").innerHTML = hours + "时 " + minutes + "分 " + seconds + "秒"; + if (distance <= 0) { + clearInterval(x); + document.getElementById("countdown").remove(); + } + }, 1000); + @endif + @endsection diff --git a/resources/views/user/invite.blade.php b/resources/views/user/invite.blade.php index a75232be..76d3b241 100644 --- a/resources/views/user/invite.blade.php +++ b/resources/views/user/invite.blade.php @@ -1,120 +1,129 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') - + @endsection @section('script') - - - - + + + + const clipboard = new ClipboardJS('.mt-clipboard'); + clipboard.on('success', function () { + swal.fire({ + title: '复制成功', + type: 'success', + timer: 1300, + showConfirmButton: false + }); + }); + clipboard.on('error', function () { + swal.fire({ + title: '复制失败,请手动复制', + type: 'error', + timer: 1500, + showConfirmButton: false + }); + }); + @endsection diff --git a/resources/views/user/invoiceDetail.blade.php b/resources/views/user/invoiceDetail.blade.php index 3e884108..e93fb91e 100644 --- a/resources/views/user/invoiceDetail.blade.php +++ b/resources/views/user/invoiceDetail.blade.php @@ -1,93 +1,102 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') -
-
-
-
-
-

- - {{\App\Components\Helpers::systemConfig()['website_name']}} -

-
-
-

{{trans('home.invoice_title')}}

-

{{trans('home.invoice_table_id')}}:{{$order->order_sn}} -

-

{{trans('home.invoice_table_pay_way')}}:{{$order->pay_way === 1 ? trans('home.service_pay_button') : trans('home.online_pay')}}

-

{{trans('home.invoice_table_create_date')}}: {{$order->created_at}}

-

{{trans('home.invoice_table_expire_at')}}: {{$order->expire_at}}

-

- @if(!$order->is_expire) - @if($order->status == -1) -

{{trans('home.invoice_table_closed')}}

- @elseif($order->status == 0) -

{{trans('home.invoice_table_wait_payment')}}

- @elseif($order->status == 1) -

{{trans('home.invoice_table_wait_confirm')}}

- @elseif($order->status == 2) -

{{trans('home.invoice_table_wait_active')}}

- @else -

{{trans('home.invoice_table_expired')}}

- @endif - @else -

{{trans('home.invoice_table_expired')}}

- @endif -
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
{{trans('home.service_name')}}{{trans('home.service_desc')}} {{trans('home.service_price')}}{{trans('home.service_quantity')}}{{trans('home.coupon')}}{{trans('home.service_total_price')}}状态
-

{{empty($order->goods) ? ($order->goods_id == -1 ? '余额充值': trans('home.invoice_table_goods_deleted')) : $order->goods->name}}

-
- @if($order->goods) - {{trans('home.service_days')}} {{$order->goods->days}} {{trans('home.day')}} -
- @if($order->goods->type == '2') - {{$order->goods->traffic_label}} {{trans('home.bandwidth')}}/{{trans('home.month')}} - @else - {{$order->goods->traffic_label}} {{trans('home.bandwidth')}}/{{$order->goods->days}} {{trans('home.day')}} - @endif - @else - 余额充值 - @endif -
¥ {{$order->origin_amount}} 1{{$order->coupon ? $order->coupon->name : '无'}} ¥{{$order->amount}} {{$order->status_label}}
-
-
- -
-
-
-
+
+
+
+
+
+

+ + {{\App\Components\Helpers::systemConfig()['website_name']}} +

+
+
+

{{trans('home.invoice_title')}}

+

{{trans('home.invoice_table_id')}}:{{$order->order_sn}} +

+

{{trans('home.invoice_table_pay_way')}} + :{{$order->pay_way === 1 ? trans('home.service_pay_button') : trans('home.online_pay')}}

+

{{trans('home.invoice_table_create_date')}}: {{$order->created_at}}

+

{{trans('home.invoice_table_expire_at')}}: {{$order->expire_at}}

+

+ @if(!$order->is_expire) + @if($order->status == -1) +

{{trans('home.invoice_table_closed')}}

+ @elseif($order->status == 0) +

{{trans('home.invoice_table_wait_payment')}}

+ @elseif($order->status == 1) +

{{trans('home.invoice_table_wait_confirm')}}

+ @elseif($order->status == 2) +

{{trans('home.invoice_table_wait_active')}}

+ @else +

{{trans('home.invoice_table_expired')}}

+ @endif + @else +

{{trans('home.invoice_table_expired')}}

+ @endif +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
{{trans('home.service_name')}}{{trans('home.service_desc')}} {{trans('home.service_price')}}{{trans('home.service_quantity')}}{{trans('home.coupon')}}{{trans('home.service_total_price')}}状态
+

{{empty($order->goods) ? ($order->goods_id == -1 ? '余额充值': trans('home.invoice_table_goods_deleted')) : $order->goods->name}}

+
+ @if($order->goods) + {{trans('home.service_days')}} + {{$order->goods->days}} {{trans('home.day')}} +
+ @if($order->goods->type == '2') + {{$order->goods->traffic_label}} {{trans('home.bandwidth')}} + /{{trans('home.month')}} + @else + {{$order->goods->traffic_label}} {{trans('home.bandwidth')}}/ + {{$order->goods->days}} {{trans('home.day')}} + @endif + @else + 余额充值 + @endif +
¥ {{$order->origin_amount}} 1{{$order->coupon ? $order->coupon->name : '无'}} ¥{{$order->amount}} {{$order->status_label}}
+
+
+ +
+
+
+
@endsection @section('script') - - -@endsection \ No newline at end of file + + +@endsection diff --git a/resources/views/user/invoices.blade.php b/resources/views/user/invoices.blade.php index 6eb02701..da59f704 100644 --- a/resources/views/user/invoices.blade.php +++ b/resources/views/user/invoices.blade.php @@ -1,125 +1,134 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') -
-
-
-

{{trans('home.invoices')}}

-
-
- - - - - - - - - - - - - - - - @foreach($orderList as $order) - - - - - - - - - - - @endforeach - -
# {{trans('home.invoice_table_id')}} {{trans('home.invoice_table_name')}} {{trans('home.invoice_table_pay_way')}} {{trans('home.invoice_table_price')}} {{trans('home.invoice_table_create_date')}} {{trans('home.invoice_table_expire_at')}} {{trans('home.invoice_table_status')}} {{trans('home.invoice_table_actions')}}
{{$loop->iteration}}{{$order->order_sn}}{{empty($order->goods) ? ($order->goods_id == -1 ? '余额充值': trans('home.invoice_table_goods_deleted')) : $order->goods->name}}{{$order->pay_way === 1 ? trans('home.service_pay_button') : trans('home.online_pay')}}¥{{$order->amount}}{{$order->created_at}}{{empty($order->goods) ? '' : $order->goods_id == -1 || $order->status == 3 ? '' : $order->expire_at}} - @switch($order->status) - @case(-1) - {{trans('home.invoice_status_closed')}} - @break - @case(0) - {{trans('home.invoice_status_wait_payment')}} - @break - @case(1) - {{trans('home.invoice_status_wait_confirm')}} - @break - @case(2) - @if ($order->goods_id == -1) - {{trans('home.invoice_status_payment_confirm')}} - @else - @if($order->is_expire) - {{trans('home.invoice_table_expired')}} - @else - {{trans('home.invoice_table_active')}} - @endif - @endif - @break - @case(3) - {{trans('home.invoice_table_prepay')}} - @break - @endswitch - - @if($order->status == 0 && $order->payment) - @if($order->payment->url) - {{trans('home.pay')}} - @elseif($order->payment->sn) - {{trans('home.pay')}} - @endif - @elseif ($order->status == 1) - - @elseif ($order->status == 3) - - @endif -
-
- -
-
+
+
+
+

{{trans('home.invoices')}}

+
+
+ + + + + + + + + + + + + + + + @foreach($orderList as $order) + + + + + + + + + + + @endforeach + +
# {{trans('home.invoice_table_id')}} {{trans('home.invoice_table_name')}} {{trans('home.invoice_table_pay_way')}} {{trans('home.invoice_table_price')}} {{trans('home.invoice_table_create_date')}} {{trans('home.invoice_table_expire_at')}} {{trans('home.invoice_table_status')}} {{trans('home.invoice_table_actions')}}
{{$loop->iteration}}{{$order->order_sn}}{{empty($order->goods) ? ($order->goods_id == -1 ? '余额充值': trans('home.invoice_table_goods_deleted')) : $order->goods->name}}{{$order->pay_way === 1 ? trans('home.service_pay_button') : trans('home.online_pay')}}¥{{$order->amount}}{{$order->created_at}}{{empty($order->goods) ? '' : $order->goods_id == -1 || $order->status == 3 ? '' : $order->expire_at}} + @switch($order->status) + @case(-1) + {{trans('home.invoice_status_closed')}} + @break + @case(0) + {{trans('home.invoice_status_wait_payment')}} + @break + @case(1) + {{trans('home.invoice_status_wait_confirm')}} + @break + @case(2) + @if ($order->goods_id == -1) + {{trans('home.invoice_status_payment_confirm')}} + @else + @if($order->is_expire) + {{trans('home.invoice_table_expired')}} + @else + {{trans('home.invoice_table_active')}} + @endif + @endif + @break + @case(3) + {{trans('home.invoice_table_prepay')}} + @break + @endswitch + + @if($order->status == 0 && $order->payment) + @if($order->payment->url) + {{trans('home.pay')}} + @elseif($order->payment->sn) + {{trans('home.pay')}} + @endif + @elseif ($order->status == 1) + + @elseif ($order->status == 3) + + @endif +
+
+ +
+
@endsection @section('script') - - - + + + @endsection diff --git a/resources/views/user/layouts.blade.php b/resources/views/user/layouts.blade.php index 8c408b91..55026ba7 100644 --- a/resources/views/user/layouts.blade.php +++ b/resources/views/user/layouts.blade.php @@ -7,198 +7,207 @@ - - {{\App\Components\Helpers::systemConfig()['website_name']}} - - - - - - - - - - - + + {{\App\Components\Helpers::systemConfig()['website_name']}} + + + + + + + + + + + - - - - - - @yield('css') - + + + + + + @yield('css') + - - - - - - - - + + + + + + + + -
- - @yield('content') + + @yield('content')
@if(Session::get("admin")) -
-
-
当前身份:{{Auth::user()->email}}
- -
-
+
+
+
当前身份:{{Auth::user()->email}}
+ +
+
@endif @@ -251,7 +260,7 @@ @@ -259,44 +268,44 @@ @yield('script') @if(Session::get("admin")) - + @endif {!! \App\Components\Helpers::systemConfig()['website_analytics'] !!} diff --git a/resources/views/user/nodeList.blade.php b/resources/views/user/nodeList.blade.php index 9b3b03c1..115be59a 100644 --- a/resources/views/user/nodeList.blade.php +++ b/resources/views/user/nodeList.blade.php @@ -1,111 +1,125 @@ @extends('user.layouts') @section('css') - - - + + + @endsection @section('content') - -
-
- @foreach($nodeList as $node) -
-
-
-
- -
-
-

- @if($node->offline) - - @endif - @if($node->traffic_rate != 1) - - @endif - {{$node->name}} - {{$node->labels->labelInfo->name}} -

-
- {{$node->desc}} -
-

- - - -

-

- 电信: {{$node->ct>0 ?$node->ct.' ms' :'无数据'}} - 联通: {{$node->cu>0 ?$node->cu.' ms' :'无数据'}} -
- 移动: {{$node->cm>0 ?$node->cm.' ms' :'无数据'}} - 香港: {{$node->hk>0 ?$node->hk.' ms' :'无数据'}} -

-
-
-
-
- @endforeach -
-
+ +
+
+ @foreach($nodeList as $node) +
+
+
+
+ +
+
+

+ @if($node->offline) + + @endif + @if($node->traffic_rate != 1) + + @endif + {{$node->name}} + {{$node->labels->labelInfo->name}} +

+
+ {{$node->desc}} +
+

+ + + +

+

+ 电信: {{$node->ct>0 ?$node->ct.' ms' :'无数据'}} + 联通: {{$node->cu>0 ?$node->cu.' ms' :'无数据'}} +
+ 移动: {{$node->cm>0 ?$node->cm.' ms' :'无数据'}} + 香港: {{$node->hk>0 ?$node->hk.' ms' :'无数据'}} +

+
+
+
+
+ @endforeach +
+
@endsection @section('script') - - - - + + + + - + function getInfo(id, type) { + const oldClass = $("#" + type + id).attr("class"); + $.ajax({ + type: "POST", + url: '/nodeList', + data: {_token: '{{csrf_token()}}', id: id, type: type}, + beforeSend: function () { + $("#" + type + id).removeAttr("class").addClass("icon wb-loop icon-spin"); + }, + success: function (ret) { + if (ret.status === 'success') { + switch (type) { + case 'code': + swal.fire({ + html: '' + + '打开' + ret.title + '', + showConfirmButton: false + }); + break; + case 'qrcode': + swal.fire({ + title: '{{trans('home.scan_qrcode')}}', + html: '
', + onBeforeOpen: () => { + $("#qrcode").qrcode({text: ret.data}); + }, + showConfirmButton: false + }); + break; + case 'text': + swal.fire({ + title: '{{trans('home.setting_info')}}', + html: '', + showConfirmButton: false + }); + break; + default: + swal.fire({title: ret.title, text: ret.data}); + } + } + }, + complete: function () { + $("#" + type + id).removeAttr("class").addClass(oldClass); + } + }); + } + @endsection diff --git a/resources/views/user/payment.blade.php b/resources/views/user/payment.blade.php index ff431cf7..46fd4569 100644 --- a/resources/views/user/payment.blade.php +++ b/resources/views/user/payment.blade.php @@ -1,75 +1,76 @@ @extends('user.layouts') @section('content') -
-
-
-

{{\App\Components\Helpers::systemConfig()['website_name']}}{{trans('home.online_pay')}} -

-
-
-
-
-
- 请使用 支付宝 扫描二维码进行支付 -
-
-
-
-
-
    -
  • 服务名称:{{$name}}
  • -
  • 支付金额:{{$payment->amount}}元
  • - @if($days != 0) -
  • 有效期:{{$days}} 天
  • - @endif -
  • 请在15分钟内完成支付,否者订单将会自动关闭
  • -
-
-
- 支付二维码 -
-
-
-
-
- 手机用户:长按二维码 -> 保存图片 ->打开支付软件 -> 扫一扫 -> 选择相册 进行付款 -
-
-
-
-
-
+
+
+
+

{{\App\Components\Helpers::systemConfig()['website_name']}}{{trans('home.online_pay')}} +

+
+
+
+
+
+ 请使用 支付宝 扫描二维码进行支付 +
+
+
+
+
+
    +
  • 服务名称:{{$name}}
  • +
  • 支付金额:{{$payment->amount}}元
  • + @if($days != 0) +
  • 有效期:{{$days}} 天
  • + @endif +
  • 请在15分钟内完成支付,否者订单将会自动关闭
  • +
+
+
+ 支付二维码 +
+
+
+
+
+ 手机用户:长按二维码 -> 保存图片 ->打开支付软件 -> 扫一扫 -> 选择相册 进行付款 +
+
+
+
+
+
@endsection @section('script') - -@endsection \ No newline at end of file + // 还原html脚本 < > & " ' + function unescapeHTML(str) { + str = "" + str; + return str.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'"); + } + +@endsection diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 5cf8c420..5d4af8f5 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -1,108 +1,131 @@ @extends('user.layouts') @section('content') -
-
-
-
-
+
+
+
+
+
@include('user.components.avatar') -
-
{{Auth::user()->username}}
-

- 微信: @if(Auth::user()->wechat) {{Auth::user()->wechat}} @else 未添加 @endif -

-

- QQ: @if(Auth::user()->qq) {{Auth::user()->qq}} @else 未添加 @endif -

-
-
-
-
-
-
- @if (Session::has('successMsg')) -
- - {{Session::get('successMsg')}} -
- @endif - @if($errors->any()) -
- - {{trans('home.error')}}: {{$errors->first()}} -
- @endif - -
-
-
-
+
+
{{Auth::user()->username}}
+

+ 微信: @if(Auth::user()->wechat) {{Auth::user()->wechat}} @else + 未添加 @endif +

+

+ QQ: @if(Auth::user()->qq) {{Auth::user()->qq}} @else + 未添加 @endif +

+
+
+
+
+
+
+ @if (Session::has('successMsg')) +
+ + {{Session::get('successMsg')}} +
+ @endif + @if($errors->any()) +
+ + {{trans('home.error')}}: {{$errors->first()}} +
+ @endif + +
+
+
+
@endsection @section('script') - - + + @endsection diff --git a/resources/views/user/referral.blade.php b/resources/views/user/referral.blade.php index 3a420621..b3d12750 100644 --- a/resources/views/user/referral.blade.php +++ b/resources/views/user/referral.blade.php @@ -1,209 +1,214 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') - -
- -
-
- -
-
-

{{trans('home.referral_my_link')}} -

-
-
- - -
-
-
-
- -
-
-

- {{trans('home.invite_user_title')}} -

- - - - - - - - - - @foreach($referralUserList as $vo) - - - - - - @endforeach - -
# {{trans('home.invite_user_email')}} {{trans('home.invite_user_created_at')}}
{{$loop->iteration}} {{str_replace(mb_substr($vo->email, 3, 4), "****", $vo->email)}} {{$vo->created_at}}
-
- -
-
-
- -
-
-

- {{trans('home.referral_title')}} -

-
- -
-
-
- - - - - - - - - - - - - @foreach($referralLogList as $referralLog) - - - - - - - - - @endforeach - -
# {{trans('home.referral_table_date')}} {{trans('home.referral_table_user')}} {{trans('home.referral_table_amount')}} {{trans('home.referral_table_commission')}} {{trans('home.referral_table_status')}}
{{$loop->iteration}} {{$referralLog->created_at}} {{empty($referralLog->user) ? '【账号已删除】' : str_replace(mb_substr($referralLog->user->email, 3, 4), "****", $referralLog->user->email)}} ¥{{$referralLog->amount}} ¥{{$referralLog->ref_amount}} - @if ($referralLog->status == 1) - 申请中 - @elseif($referralLog->status == 2) - 已提现 - @else - 未提现 - @endif -
-
- -
- -
-
-

{{trans('home.referral_apply_title')}}

- - - - - - - - - - - @foreach($referralApplyList as $vo) - - - - - - - @endforeach - -
# {{trans('home.referral_apply_table_date')}} {{trans('home.referral_apply_table_amount')}} {{trans('home.referral_apply_table_status')}}
{{$loop->iteration}} {{$vo->created_at}} ¥{{$vo->amount}} - @if ($vo->status == 0) - 待审核 - @elseif($vo->status == 1) - 审核通过 - 待打款 - @elseif($vo->status == 2) - 已打款 - @else - 驳回 - @endif -
-
- -
-
-
-
+ +
+ +
+
+ +
+
+

{{trans('home.referral_my_link')}} +

+
+
+ + +
+
+
+
+ +
+
+

+ {{trans('home.invite_user_title')}} +

+ + + + + + + + + + @foreach($referralUserList as $vo) + + + + + + @endforeach + +
# {{trans('home.invite_user_email')}} {{trans('home.invite_user_created_at')}}
{{$loop->iteration}} {{str_replace(mb_substr($vo->email, 3, 4), "****", $vo->email)}} {{$vo->created_at}}
+
+ +
+
+
+ +
+
+

+ {{trans('home.referral_title')}} +

+
+ +
+
+
+ + + + + + + + + + + + + @foreach($referralLogList as $referralLog) + + + + + + + + + @endforeach + +
# {{trans('home.referral_table_date')}} {{trans('home.referral_table_user')}} {{trans('home.referral_table_amount')}} {{trans('home.referral_table_commission')}} {{trans('home.referral_table_status')}}
{{$loop->iteration}} {{$referralLog->created_at}} {{empty($referralLog->user) ? '【账号已删除】' : str_replace(mb_substr($referralLog->user->email, 3, 4), "****", $referralLog->user->email)}} ¥{{$referralLog->amount}} ¥{{$referralLog->ref_amount}} + @if ($referralLog->status == 1) + 申请中 + @elseif($referralLog->status == 2) + 已提现 + @else + 未提现 + @endif +
+
+ +
+ +
+
+

{{trans('home.referral_apply_title')}}

+ + + + + + + + + + + @foreach($referralApplyList as $vo) + + + + + + + @endforeach + +
# {{trans('home.referral_apply_table_date')}} {{trans('home.referral_apply_table_amount')}} {{trans('home.referral_apply_table_status')}}
{{$loop->iteration}} {{$vo->created_at}} ¥{{$vo->amount}} + @if ($vo->status == 0) + 待审核 + @elseif($vo->status == 1) + 审核通过 - 待打款 + @elseif($vo->status == 2) + 已打款 + @else + 驳回 + @endif +
+
+ +
+
+
+
@endsection @section('script') - - - - + + + + const clipboard = new ClipboardJS('.mt-clipboard'); + clipboard.on('success', function () { + swal.fire({ + title: '复制成功', + type: 'success', + timer: 1300, + showConfirmButton: false, + }); + }); + clipboard.on('error', function () { + swal.fire({ + title: '复制失败,请手动复制', + type: 'error', + timer: 1500, + showConfirmButton: false, + }); + }); + @endsection diff --git a/resources/views/user/replyTicket.blade.php b/resources/views/user/replyTicket.blade.php index fdeecd90..d64047c7 100644 --- a/resources/views/user/replyTicket.blade.php +++ b/resources/views/user/replyTicket.blade.php @@ -1,149 +1,160 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') -
-
-
-

{{$ticket->title}}

- @if($ticket->status != 2) -
- -
- @endif -
-
-
-
-
-
-

- @include('user.components.avatar') -

-
-
-
-

- {!! $ticket->content !!} -

- -
-
-
- @foreach ($replyList as $reply) -
-
- @if ($reply->user->is_admin) -

- {{trans('home.ticket_reply_master')}} -

- @else -

- @include('user.components.avatar') -

- @endif -
-
-
-

- {!! $reply->content!!} -

- -
-
-
- @endforeach -
-
-
- @if($ticket->status != 2) - + @endif +
+
@endsection @section('script') - + if (content.trim() === '') { + swal.fire({title: '您未填写工单内容!', type: 'warning'}); + return false; + } + swal.fire({ + title: '确定回复工单?', + type: 'question', + allowEnterKey: false, + showCancelButton: true, + cancelButtonText: '{{trans('home.ticket_close')}}', + confirmButtonText: '{{trans('home.ticket_confirm')}}', + }).then((result) => { + if (result.value) { + $.post("/replyTicket", { + _token: '{{csrf_token()}}', + id: '{{$ticket->id}}', + content: content + }, function (ret) { + if (ret.status === 'success') { + swal.fire({ + title: ret.message, + type: 'success', + timer: 800, + showConfirmButton: false + }).then(() => window.location.reload()) + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + }); + } + }) + } + @endsection diff --git a/resources/views/user/services.blade.php b/resources/views/user/services.blade.php index 1148deec..58cb17a4 100644 --- a/resources/views/user/services.blade.php +++ b/resources/views/user/services.blade.php @@ -1,294 +1,314 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') -
-
-
-
-
- - {{trans('home.account_balance')}} -
- {{Auth::user()->balance}} -
- -
-
-
- @if($renewTraffic) -
-
- - 流量重置 -
- 需要 {{$renewTraffic}} -
- -
-
-
- @endif -
-
-
-
-

{{trans('home.services')}} -

-
-
-
- @foreach($goodsList as $goods) -
-
-
-
{{$goods->name}}
- @if($goods->limit_num) -
-
-
- @elseif($goods->is_hot) -
-
-
- @endif -
- ¥ - {{$goods->price}} - @if($goods->type == 2) - / {{$goods->days}}{{trans('home.day')}} - @endif -
- @if($goods->info) -

{{$goods->desc}}

- @endif -
-
    -
  • - {{$goods->traffic_label}} {{trans('home.bandwidth')}}{!!$goods->type == 1? ' '.$dataPlusDays.' '.trans('home.day'):'/'.trans('home.month')!!} -
  • -
  • - {{trans('home.service_unlimited')}} {{trans('home.service_device')}} -
  • - {!!$goods->info!!} -
- -
-
- @endforeach -
-
-
-
-
-
- +
+
+
+
+
+ + {{trans('home.account_balance')}} +
+ {{Auth::user()->balance}} +
+ +
+
+
+ @if($renewTraffic) +
+
+ + 流量重置 +
+ 需要 {{$renewTraffic}} +
+ +
+
+
+ @endif +
+
+
+
+

{{trans('home.services')}} +

+
+
+
+ @foreach($goodsList as $goods) +
+
+
+
{{$goods->name}}
+ @if($goods->limit_num) +
+
+
+ @elseif($goods->is_hot) +
+
+
+ @endif +
+ ¥ + {{$goods->price}} + @if($goods->type == 2) + / {{$goods->days}}{{trans('home.day')}} + @endif +
+ @if($goods->info) +

{{$goods->desc}}

+ @endif +
+
    +
  • + {{$goods->traffic_label}} {{trans('home.bandwidth')}}{!!$goods->type == 1? ' '.$dataPlusDays.' '.trans('home.day'):'/'.trans('home.month')!!} +
  • +
  • + {{trans('home.service_unlimited')}} {{trans('home.service_device')}} +
  • + {!!$goods->info!!} +
+ +
+
+ @endforeach +
+
+
+
+
+
+ @endsection @section('script') - - - + + + @endsection diff --git a/resources/views/user/ticketList.blade.php b/resources/views/user/ticketList.blade.php index 1aa489ff..69718c59 100644 --- a/resources/views/user/ticketList.blade.php +++ b/resources/views/user/ticketList.blade.php @@ -1,169 +1,179 @@ @extends('user.layouts') @section('css') - + @endsection @section('content') -
-
-
-
-
-

{{trans('home.ticket_title')}} -

-
- -
-
-
-
- - - - - - - - - - - @foreach($ticketList as $ticket) - - - - - - - @endforeach - -
# {{trans('home.ticket_table_title')}} {{trans('home.ticket_table_status')}}
{{$ticket->id}}{{$ticket->title}} - {!!$ticket->status_label!!} - - @if($ticket->status == 2) - - {{trans('home.ticket_table_view')}} - @else - - {{trans('home.ticket_open')}} - @endif -
-
-
- -
-
-
-
-
-

客服工作时间

-
-
-
    -
  • -
    -
    - - 在线时间 -
    -
    - 周一至周五 23:00 - 次日 11:00 -
    - 周末 21:00 - 次日 12:00 -
    -
    -
  • -
  • -
    -
    - -
    -
    - 本站有多种联系方式,请使用其中一种联系客服! -
    重复请求,将会自动延迟处理时间 -
    -
    -
  • -
-
-
-
-
-
- +
+
+
+
+
+

{{trans('home.ticket_title')}} +

+
+ +
+
+
+
+ + + + + + + + + + + @foreach($ticketList as $ticket) + + + + + + + @endforeach + +
# {{trans('home.ticket_table_title')}} {{trans('home.ticket_table_status')}}
{{$ticket->id}}{{$ticket->title}} + {!!$ticket->status_label!!} + + @if($ticket->status == 2) + + {{trans('home.ticket_table_view')}} + @else + + {{trans('home.ticket_open')}} + @endif +
+
+
+ +
+
+
+
+
+

客服工作时间

+
+
+
    +
  • +
    +
    + + 在线时间 +
    +
    + 周一至周五 23:00 - 次日 11:00 +
    + 周末 21:00 - 次日 12:00 +
    +
    +
  • +
  • +
    +
    + +
    +
    + 本站有多种联系方式,请使用其中一种联系客服! +
    重复请求,将会自动延迟处理时间 +
    +
    +
  • +
+
+
+
+
+
+ @endsection @section('script') - + swal.fire({ + title: '确定提交工单?', + type: 'question', + showCancelButton: true, + cancelButtonText: '{{trans('home.ticket_close')}}', + confirmButtonText: '{{trans('home.ticket_confirm')}}', + }).then((result) => { + if (result.value) { + $.post("/addTicket", { + _token: '{{csrf_token()}}', + title: title, + content: content + }, function (ret) { + if (ret.status === 'success') { + swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}) + .then(() => window.location.reload()) + } else { + swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload()) + } + }); + } + }) + } + @endsection diff --git a/resources/views/vendor/geetest/geetest.blade.php b/resources/views/vendor/geetest/geetest.blade.php index 5f85dd57..30cca7f6 100644 --- a/resources/views/vendor/geetest/geetest.blade.php +++ b/resources/views/vendor/geetest/geetest.blade.php @@ -4,71 +4,71 @@

{{trans('auth.captcha_loading')}}

@define use Illuminate\Support\Facades\Config diff --git a/resources/views/vendor/laravel-log-viewer/log.blade.php b/resources/views/vendor/laravel-log-viewer/log.blade.php index b1c6b3af..6cff729a 100644 --- a/resources/views/vendor/laravel-log-viewer/log.blade.php +++ b/resources/views/vendor/laravel-log-viewer/log.blade.php @@ -1,175 +1,184 @@ - - - - 系统运行日志 - - - +
-
- -
- @if ($logs === NULL) -
- Log file >50M, please download it. -
- @else - - - - @if ($standardFormat) - - - - @else - - @endif - - - - +
+ +
+ @if ($logs === NULL) +
+ Log file >50M, please download it. +
+ @else +
LevelContextDateLine numberContent
+ + + @if ($standardFormat) + + + + @else + + @endif + + + + - @foreach($logs as $key => $log) - - @if ($standardFormat) - - - @endif - - - - @endforeach + @foreach($logs as $key => $log) + + @if ($standardFormat) + + + @endif + + + + @endforeach - -
LevelContextDateLine numberContent
-   {{$log['level']}} - {{$log['context']}}{{{$log['date']}}} - @if ($log['stack']) - - @endif - {{{$log['text']}}} - @if (isset($log['in_file'])) -
{{{$log['in_file']}}} - @endif - @if ($log['stack']) - - @endif -
+   {{$log['level']}} + {{$log['context']}}{{{$log['date']}}} + @if ($log['stack']) + + @endif + {{{$log['text']}}} + @if (isset($log['in_file'])) +
{{{$log['in_file']}}} + @endif + @if ($log['stack']) + + @endif +
- @endif -
- @if($current_file) - - 下 载 - - - - - 清 空 - - - - - 删 除 - - @if(count($files) > 1) - - - - 删除全部 - - @endif - @endif -
-
-
+ + + @endif +
+ @if($current_file) + + 下 载 + + - + + 清 空 + + - + + 删 除 + + @if(count($files) > 1) + - + + 删除全部 + + @endif + @endif +
+
+ @@ -180,35 +189,35 @@ diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php index 6e082825..815f3b9d 100644 --- a/resources/views/vendor/mail/html/button.blade.php +++ b/resources/views/vendor/mail/html/button.blade.php @@ -1,19 +1,20 @@ - - - + + +
- - - - -
- - - - -
- {{ $slot }} -
-
-
+ + + + +
+ + + + +
+ {{ $slot }} +
+
+
diff --git a/resources/views/vendor/mail/html/footer.blade.php b/resources/views/vendor/mail/html/footer.blade.php index 31a597c8..c3f9360a 100644 --- a/resources/views/vendor/mail/html/footer.blade.php +++ b/resources/views/vendor/mail/html/footer.blade.php @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php index e161153d..2d0527b1 100644 --- a/resources/views/vendor/mail/html/header.blade.php +++ b/resources/views/vendor/mail/html/header.blade.php @@ -1,7 +1,7 @@ - - - {{$slot}} - - + + + {{$slot}} + + diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/vendor/mail/html/layout.blade.php index 605b8960..4284294f 100644 --- a/resources/views/vendor/mail/html/layout.blade.php +++ b/resources/views/vendor/mail/html/layout.blade.php @@ -1,54 +1,55 @@ - + - - + + - - +
- - {{ $header or '' }} + + - + {{ $footer or '' }} +
+ + {{ $header or '' }} - - - + - {{ $footer or '' }} -
- - - - + - + {{ $subcopy or '' }} + + +
- {{ Illuminate\Mail\Markdown::parse($slot) }} + +
+ + + + - -
+ {{ Illuminate\Mail\Markdown::parse($slot) }} - {{ $subcopy or '' }} -
-
+
-
+
diff --git a/resources/views/vendor/mail/html/panel.blade.php b/resources/views/vendor/mail/html/panel.blade.php index 668f6bd0..f3970802 100644 --- a/resources/views/vendor/mail/html/panel.blade.php +++ b/resources/views/vendor/mail/html/panel.blade.php @@ -1,13 +1,13 @@ - - - + + +
- - - - -
- {{ Illuminate\Mail\Markdown::parse($slot) }} -
-
+ + + + +
+ {{ Illuminate\Mail\Markdown::parse($slot) }} +
+
diff --git a/resources/views/vendor/mail/html/promotion.blade.php b/resources/views/vendor/mail/html/promotion.blade.php index 0939ba4c..0debcf8a 100644 --- a/resources/views/vendor/mail/html/promotion.blade.php +++ b/resources/views/vendor/mail/html/promotion.blade.php @@ -1,7 +1,7 @@ - - - + + +
- {{ Illuminate\Mail\Markdown::parse($slot) }} -
+ {{ Illuminate\Mail\Markdown::parse($slot) }} +
diff --git a/resources/views/vendor/mail/html/promotion/button.blade.php b/resources/views/vendor/mail/html/promotion/button.blade.php index 38b73adb..8e79081c 100644 --- a/resources/views/vendor/mail/html/promotion/button.blade.php +++ b/resources/views/vendor/mail/html/promotion/button.blade.php @@ -1,13 +1,13 @@ - - - + + +
- - - - -
- {{ $slot }} -
-
+ + + + +
+ {{ $slot }} +
+
diff --git a/resources/views/vendor/mail/html/subcopy.blade.php b/resources/views/vendor/mail/html/subcopy.blade.php index d2bf7b13..c3df7b4c 100644 --- a/resources/views/vendor/mail/html/subcopy.blade.php +++ b/resources/views/vendor/mail/html/subcopy.blade.php @@ -1,7 +1,7 @@ - - - + + +
- {{ Illuminate\Mail\Markdown::parse($slot) }} -
+ {{ Illuminate\Mail\Markdown::parse($slot) }} +
diff --git a/resources/views/vendor/mail/html/table.blade.php b/resources/views/vendor/mail/html/table.blade.php index 0a050f3a..b3bb3c8e 100644 --- a/resources/views/vendor/mail/html/table.blade.php +++ b/resources/views/vendor/mail/html/table.blade.php @@ -1,3 +1,3 @@
- {{ Illuminate\Mail\Markdown::parse($slot) }} + {{ Illuminate\Mail\Markdown::parse($slot) }}
diff --git a/resources/views/vendor/mail/markdown/layout.blade.php b/resources/views/vendor/mail/markdown/layout.blade.php index 3670fe9f..c59d2d8a 100644 --- a/resources/views/vendor/mail/markdown/layout.blade.php +++ b/resources/views/vendor/mail/markdown/layout.blade.php @@ -3,7 +3,7 @@ {!! strip_tags($slot) !!} @isset($subcopy) - {!! strip_tags($subcopy) !!} + {!! strip_tags($subcopy) !!} @endisset {!! strip_tags($footer) !!} diff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/vendor/mail/markdown/message.blade.php index a2c59c0c..b409c71c 100644 --- a/resources/views/vendor/mail/markdown/message.blade.php +++ b/resources/views/vendor/mail/markdown/message.blade.php @@ -1,27 +1,27 @@ @component('mail::layout') - {{-- Header --}} - @slot('header') - @component('mail::header', ['url' => config('app.url')]) - {{ config('app.name') }} - @endcomponent - @endslot + {{-- Header --}} + @slot('header') + @component('mail::header', ['url' => config('app.url')]) + {{ config('app.name') }} + @endcomponent + @endslot - {{-- Body --}} - {{ $slot }} + {{-- Body --}} + {{ $slot }} - {{-- Subcopy --}} - @isset($subcopy) - @slot('subcopy') - @component('mail::subcopy') - {{ $subcopy }} - @endcomponent - @endslot - @endisset + {{-- Subcopy --}} + @isset($subcopy) + @slot('subcopy') + @component('mail::subcopy') + {{ $subcopy }} + @endcomponent + @endslot + @endisset - {{-- Footer --}} - @slot('footer') - @component('mail::footer') - © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. - @endcomponent - @endslot + {{-- Footer --}} + @slot('footer') + @component('mail::footer') + © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. + @endcomponent + @endslot @endcomponent diff --git a/resources/views/vendor/notifications/email.blade.php b/resources/views/vendor/notifications/email.blade.php index d2b13026..6fe3abd0 100644 --- a/resources/views/vendor/notifications/email.blade.php +++ b/resources/views/vendor/notifications/email.blade.php @@ -1,23 +1,23 @@ @component('mail::message') - {{-- Greeting --}} - @if (! empty($greeting)) - # {{ $greeting }} - @else - @if ($level == 'error') - # Whoops! - @else - # Hello! - @endif - @endif + {{-- Greeting --}} + @if (! empty($greeting)) + # {{ $greeting }} + @else + @if ($level == 'error') + # Whoops! + @else + # Hello! + @endif + @endif - {{-- Intro Lines --}} - @foreach ($introLines as $line) - {{ $line }} + {{-- Intro Lines --}} + @foreach ($introLines as $line) + {{ $line }} - @endforeach + @endforeach - {{-- Action Button --}} - @isset($actionText) + {{-- Action Button --}} + @isset($actionText) - @component('mail::button', ['url' => $actionUrl, 'color' => $color]) - {{ $actionText }} - @endcomponent - @endisset + @component('mail::button', ['url' => $actionUrl, 'color' => $color]) + {{ $actionText }} + @endcomponent + @endisset - {{-- Outro Lines --}} - @foreach ($outroLines as $line) - {{ $line }} + {{-- Outro Lines --}} + @foreach ($outroLines as $line) + {{ $line }} - @endforeach + @endforeach - {{-- Salutation --}} - @if (! empty($salutation)) - {{ $salutation }} - @else - Regards,
{{ config('app.name') }} - @endif + {{-- Salutation --}} + @if (! empty($salutation)) + {{ $salutation }} + @else + Regards,
{{ config('app.name') }} + @endif - {{-- Subcopy --}} - @isset($actionText) - @component('mail::subcopy') - If you’re having trouble clicking the "{{ $actionText }}" button, copy and paste the URL below - into your web browser: [{{ $actionUrl }}]({{ $actionUrl }}) - @endcomponent - @endisset + {{-- Subcopy --}} + @isset($actionText) + @component('mail::subcopy') + If you’re having trouble clicking the "{{ $actionText }}" button, copy and paste the URL below + into your web browser: [{{ $actionUrl }}]({{ $actionUrl }}) + @endcomponent + @endisset @endcomponent diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php index ae8835aa..07d3b548 100644 --- a/resources/views/vendor/pagination/bootstrap-4.blade.php +++ b/resources/views/vendor/pagination/bootstrap-4.blade.php @@ -1,36 +1,38 @@ @if ($paginator->hasPages()) -
    - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) -
  • «
  • - @else -
  • - @endif +
      + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
    • «
    • + @else +
    • +
    • + @endif - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) -
    • {{ $element }}
    • - @endif + {{-- Pagination Elements --}} + @foreach ($elements as $element) + {{-- "Three Dots" Separator --}} + @if (is_string($element)) +
    • {{ $element }}
    • + @endif - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) -
    • {{ $page }}
    • - @else -
    • {{ $page }}
    • - @endif - @endforeach - @endif - @endforeach + {{-- Array Of Links --}} + @if (is_array($element)) + @foreach ($element as $page => $url) + @if ($page == $paginator->currentPage()) +
    • {{ $page }}
    • + @else +
    • {{ $page }}
    • + @endif + @endforeach + @endif + @endforeach - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) -
    • - @else -
    • »
    • - @endif -
    + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • +
  • + @else +
  • »
  • + @endif +
@endif diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php index eb9cb659..49956023 100644 --- a/resources/views/vendor/pagination/default.blade.php +++ b/resources/views/vendor/pagination/default.blade.php @@ -1,36 +1,38 @@ @if ($paginator->hasPages()) -
    - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) -
  • «
  • - @else -
  • - @endif +
      + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
    • «
    • + @else +
    • +
    • + @endif - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) -
    • {{ $element }}
    • - @endif + {{-- Pagination Elements --}} + @foreach ($elements as $element) + {{-- "Three Dots" Separator --}} + @if (is_string($element)) +
    • {{ $element }}
    • + @endif - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) -
    • {{ $page }}
    • - @else -
    • {{ $page }}
    • - @endif - @endforeach - @endif - @endforeach + {{-- Array Of Links --}} + @if (is_array($element)) + @foreach ($element as $page => $url) + @if ($page == $paginator->currentPage()) +
    • {{ $page }}
    • + @else +
    • {{ $page }}
    • + @endif + @endforeach + @endif + @endforeach - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) -
    • - @else -
    • »
    • - @endif -
    + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • +
  • + @else +
  • »
  • + @endif +
@endif diff --git a/resources/views/vendor/pagination/semantic-ui.blade.php b/resources/views/vendor/pagination/semantic-ui.blade.php index b3b3255a..2f7ad934 100644 --- a/resources/views/vendor/pagination/semantic-ui.blade.php +++ b/resources/views/vendor/pagination/semantic-ui.blade.php @@ -1,36 +1,40 @@ @if ($paginator->hasPages()) - @endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php index ca5f68d0..dc90a8f3 100644 --- a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php +++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php @@ -1,17 +1,19 @@ @if ($paginator->hasPages()) -
    - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) -
  • @lang('pagination.previous')
  • - @else -
  • - @endif +
      + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
    • @lang('pagination.previous')
    • + @else +
    • + @endif - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) -
    • - @else -
    • @lang('pagination.next')
    • - @endif -
    + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • + @else +
  • @lang('pagination.next')
  • + @endif +
@endif diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php index 754f507c..18016092 100644 --- a/resources/views/vendor/pagination/simple-default.blade.php +++ b/resources/views/vendor/pagination/simple-default.blade.php @@ -1,17 +1,17 @@ @if ($paginator->hasPages()) -
    - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) -
  • @lang('pagination.previous')
  • - @else -
  • - @endif +
      + {{-- Previous Page Link --}} + @if ($paginator->onFirstPage()) +
    • @lang('pagination.previous')
    • + @else +
    • + @endif - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) -
    • - @else -
    • @lang('pagination.next')
    • - @endif -
    + {{-- Next Page Link --}} + @if ($paginator->hasMorePages()) +
  • + @else +
  • @lang('pagination.next')
  • + @endif +
@endif diff --git a/routes/channels.php b/routes/channels.php index 782f5507..8474a45a 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -11,6 +11,6 @@ | */ -Broadcast::channel('App.User.{id}', function($user, $id){ +Broadcast::channel('App.User.{id}', function($user, $id) { return (int)$user->id === (int)$id; }); diff --git a/routes/console.php b/routes/console.php index 4dd41107..27461e72 100644 --- a/routes/console.php +++ b/routes/console.php @@ -13,6 +13,6 @@ use Illuminate\Foundation\Inspiring; | */ -Artisan::command('inspire', function(){ +Artisan::command('inspire', function() { $this->comment(Inspiring::quote()); })->describe('Display an inspiring quote'); diff --git a/routes/web.php b/routes/web.php index 29e01af0..c725329d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,7 +2,7 @@ Route::get('s/{code}', 'User\SubscribeController@getSubscribeByCode'); // 节点订阅地址 -Route::group(['middleware' => ['isForbidden', 'affiliate', 'isMaintenance']], function(){ +Route::group(['middleware' => ['isForbidden', 'affiliate', 'isMaintenance']], function() { Route::get('lang/{locale}', 'AuthController@switchLang'); // 语言切换 Route::any('login', 'AuthController@login')->middleware('isSecurity'); // 登录 Route::get('logout', 'AuthController@logout'); // 退出 @@ -19,8 +19,8 @@ Route::group(['middleware' => ['isForbidden', 'affiliate', 'isMaintenance']], fu }); Route::any('admin/login', 'AuthController@login')->middleware('isForbidden', 'isSecurity'); // 登录 -Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], function(){ - Route::group(['prefix' => 'admin'], function(){ +Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], function() { + Route::group(['prefix' => 'admin'], function() { Route::get('', 'AdminController@index'); // 后台首页 Route::get('userList', 'AdminController@userList'); // 账号列表 Route::any('addUser', 'AdminController@addUser'); // 添加账号 @@ -86,7 +86,7 @@ Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], funct Route::get('makePort', 'AdminController@makePort'); // 生成端口 //返利相关 - Route::group(['namespace' => 'Admin'], function(){ + Route::group(['namespace' => 'Admin'], function() { Route::get('affList', 'AffiliateController@affiliateList'); // 提现申请列表 Route::get('affDetail', 'AffiliateController@affiliateDetail'); // 提现申请详情 Route::post('setAffStatus', 'AffiliateController@setAffiliateStatus'); // 设置提现申请状态 @@ -94,28 +94,28 @@ Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], funct }); }); - Route::group(['namespace' => 'Admin'], function(){ - Route::group(['prefix' => 'ticket'], function(){ + Route::group(['namespace' => 'Admin'], function() { + Route::group(['prefix' => 'ticket'], function() { Route::get('ticketList', 'TicketController@ticketList'); // 工单列表 Route::any('replyTicket', 'TicketController@replyTicket'); // 回复工单 Route::post('closeTicket', 'TicketController@closeTicket'); // 关闭工单 }); - Route::group(['prefix' => 'coupon'], function(){ + Route::group(['prefix' => 'coupon'], function() { Route::any('couponList', 'CouponController@couponList'); // 优惠券列表 Route::any('addCoupon', 'CouponController@addCoupon'); // 添加优惠券 Route::post('delCoupon', 'CouponController@delCoupon'); // 删除优惠券 Route::get('exportCoupon', 'CouponController@exportCoupon'); // 导出优惠券 }); - Route::group(['prefix' => 'shop'], function(){ + Route::group(['prefix' => 'shop'], function() { Route::any('goodsList', 'ShopController@goodsList'); // 商品列表 Route::any('addGoods', 'ShopController@addGoods'); // 添加商品 Route::any('editGoods/{id}', 'ShopController@editGoods'); // 编辑商品 Route::post('delGoods', 'ShopController@delGoods'); // 删除商品 }); - Route::group(['prefix' => 'subscribe'], function(){ + Route::group(['prefix' => 'subscribe'], function() { Route::get('subscribeList', 'SubscribeController@subscribeList'); // 订阅码列表 Route::get('subscribeLog', 'SubscribeController@subscribeLog'); // 订阅码记录 Route::get('deviceList', 'SubscribeController@deviceList'); // 订阅设备列表 @@ -123,13 +123,13 @@ Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], funct Route::post('setDeviceStatus', 'SubscribeController@setDeviceStatus'); // 是否允许设备订阅 }); - Route::group(['prefix' => 'marketing'], function(){ + Route::group(['prefix' => 'marketing'], function() { Route::get("emailList", "MarketingController@emailList"); // 邮件消息列表 Route::get("pushList", "MarketingController@pushList"); // 推送消息列表 Route::post("addPushMarketing", "MarketingController@addPushMarketing"); // 推送消息 }); - Route::group(['prefix' => 'sensitiveWords'], function(){ + Route::group(['prefix' => 'sensitiveWords'], function() { Route::get("list", "SensitiveWordsController@sensitiveWordslist"); // 敏感词列表 Route::post("add", "SensitiveWordsController@addSensitiveWords"); // 添加敏感词 Route::post("del", "SensitiveWordsController@delSensitiveWords"); // 删除敏感词 @@ -140,7 +140,7 @@ Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], funct Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index'); // 系统运行日志 }); -Route::group(['middleware' => ['isForbidden', 'isMaintenance', 'isLogin']], function(){ +Route::group(['middleware' => ['isForbidden', 'isMaintenance', 'isLogin']], function() { Route::any('/', 'UserController@index'); // 用户首页 Route::any('article', 'UserController@article'); // 文章详情 Route::post('exchangeSubscribe', 'UserController@exchangeSubscribe'); // 更换节点订阅地址 @@ -164,19 +164,19 @@ Route::group(['middleware' => ['isForbidden', 'isMaintenance', 'isLogin']], func Route::post("charge", "UserController@charge"); // 卡券余额充值 Route::get("help", "UserController@help"); // 帮助中心 - Route::group(['namespace' => 'User'], function(){ + Route::group(['namespace' => 'User'], function() { Route::get('referral', 'AffiliateController@referral'); // 推广返利 Route::post('extractMoney', 'AffiliateController@extractMoney'); // 申请提现 }); - Route::group(['prefix' => 'payment'], function(){ + Route::group(['prefix' => 'payment'], function() { Route::post('purchase', 'PaymentController@purchase'); // 创建支付 Route::get('getStatus', 'PaymentController@getStatus'); // 获取支付单状态 Route::get('{sn}', 'PaymentController@detail'); // 支付单详情 }); }); -Route::group(['prefix' => 'callback'], function(){ +Route::group(['prefix' => 'callback'], function() { Route::get('checkout', 'Gateway\PayPal@getCheckout'); Route::post('notify', 'PaymentController@notify'); //支付回调 });