diff --git a/app/Http/Controllers/Payment/PaypalController.php b/app/Http/Controllers/Payment/PaypalController.php index 50802e8b4807e4744dbb5206e9db466bf3b26947..bd66186af7498f4a9c1dacf12710d63d22c44617 100644 --- a/app/Http/Controllers/Payment/PaypalController.php +++ b/app/Http/Controllers/Payment/PaypalController.php @@ -144,8 +144,8 @@ class PaypalController extends Controller if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal check res begin'); - Log::debug('notify data', $data); + Log::channel('paypal')->debug('paypal check res begin'); + Log::channel('paypal')->debug('notify data', $data); } $order_no = $request->post('invoice'); @@ -169,14 +169,14 @@ class PaypalController extends Controller if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal check res url:' . $url); + Log::channel('paypal')->debug('paypal check res url:' . $url); } $verifyReturn = $this->curlGet($url); if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal check res:' . $verifyReturn); + Log::channel('paypal')->debug('paypal check res:' . $verifyReturn); } if ($verifyReturn == 'VERIFIED') diff --git a/app/Http/Controllers/Product/ProductController.php b/app/Http/Controllers/Product/ProductController.php index 4c090ab03f9a33b47fa1ffbaed8884bde61be69f..a6c312d3fe6969f483874289faa633d768259986 100644 --- a/app/Http/Controllers/Product/ProductController.php +++ b/app/Http/Controllers/Product/ProductController.php @@ -97,16 +97,6 @@ class ProductController extends Controller } else { $model->where('title', 'like', "%{$request->keywords}%"); - /* * ********************************************************************************** - ● 搜索语法规则: - + 一定要有(不含有该关键词的数据条均被忽略)。 - - 不可以有(排除指定关键词,含有该关键词的均被忽略)。 - > 提高该条匹配数据的权重值。 - < 降低该条匹配数据的权重值。 - ~ 将其相关性由正转负,表示拥有该字会降低相关性(但不像 - 将之排除),只是排在较后面权重值降低。 - * 万用字,不像其他语法放在前面,这个要接在字符串后面。 - " " 用双引号将一段句子包起来表示要完全相符,不可拆字。 - */ } } $model->select(['id', 'title', 'stock', 'stock_status', 'original_price', 'sale_price', 'img_cover', 'click_num']); diff --git a/app/Http/Controllers/Strongadmin/WebconfigController.php b/app/Http/Controllers/Strongadmin/WebconfigController.php index 2edb0a99b7e201f49b9ec0ffdd4010769c9b002d..73a278bb9a305eac454ea755ac358fc9aae84dea 100644 --- a/app/Http/Controllers/Strongadmin/WebconfigController.php +++ b/app/Http/Controllers/Strongadmin/WebconfigController.php @@ -74,6 +74,12 @@ class WebconfigController extends BaseController public function clearcache(Request $request, Webconfig $webconfig) { Cache::flush(); + + if (!$request->expectsJson()) + { + exit(""); + } + return [ 'code' => 200, 'message' => '清楚缓存成功', diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 033136ad128b7687558bc41b03cc92f39cf69149..c81b043ad52da7bad6a97cadf9094b4336631b16 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -3,15 +3,34 @@ namespace App\Http\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; +use Illuminate\Support\Str; class EncryptCookies extends Middleware { + /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ - // + 'click_num_*' ]; + + public function isDisabled($name) + { + if (in_array($name, $this->except)) + { + return true; + } + foreach ($this->except as $pattern) + { + if (Str::is($pattern, $name)) + { + return true; + } + } + return false; + } + } diff --git a/app/Repositories/AppRepository.php b/app/Repositories/AppRepository.php index 89627df4a4c08b99893897e9f43454087e17f4e3..d0d7d19980280ea1def7ded7d742a15f1edb7663 100644 --- a/app/Repositories/AppRepository.php +++ b/app/Repositories/AppRepository.php @@ -20,7 +20,7 @@ class AppRepository /** * strongshop 系统版本 */ - const VERSION = '1.5.2'; + const VERSION = '1.5.3'; /** * uuid @@ -278,6 +278,10 @@ class AppRepository */ public static function changeConfig() { + if (config('mail.driver') !== 'smtp') + { + return false; + } $MAIL_HOST = self::getShopConfig('MAIL_HOST'); $MAIL_PORT = self::getShopConfig('MAIL_PORT'); $MAIL_USERNAME = self::getShopConfig('MAIL_USERNAME'); diff --git a/app/Repositories/OrderRepository.php b/app/Repositories/OrderRepository.php index 0df38d31da7086e3dcccbc8c99764f66b51c9c8c..5a15da5a179050511f04e4ee03ef79c2177081dd 100644 --- a/app/Repositories/OrderRepository.php +++ b/app/Repositories/OrderRepository.php @@ -43,7 +43,7 @@ class OrderRepository { if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal notify $order_no,$transaction_id,$paid_amount: ', [$order_no, $transaction_id, $paid_amount]); + Log::debug('payment notify $order_no,$transaction_id,$paid_amount: ', [$order_no, $transaction_id, $paid_amount]); } return; } @@ -52,7 +52,7 @@ class OrderRepository { if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal notify $order_no,$transaction_id,$paid_amount:已支付 ', [$order_no, $transaction_id, $paid_amount]); + Log::debug('payment notify $order_no,$transaction_id,$paid_amount:已支付 ', [$order_no, $transaction_id, $paid_amount]); } return; } diff --git a/config/logging.php b/config/logging.php index 088c204e29942a941c9cbfb8dadb44671a5b1814..92f91d591f525acf7c02eb3de3b4b552b3f4cfc1 100644 --- a/config/logging.php +++ b/config/logging.php @@ -99,6 +99,13 @@ return [ 'emergency' => [ 'path' => storage_path('logs/laravel.log'), ], + + 'paypal' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/payment/paypal.log'), + 'level' => 'debug', + 'days' => 14, + ], ], ]; diff --git a/config/mail.php b/config/mail.php index c7b482770c174654d2848ab3dd01c6b189f5cb8a..810c6b28980fe85947019c55f0485a7310373553 100644 --- a/config/mail.php +++ b/config/mail.php @@ -119,37 +119,5 @@ return [ 'reply_to' => [ 'address' => env('MAIL_REPLYTO_ADDRESS'), 'name' => env('MAIL_REPLYTO_NAME'), - ], - //批量发送邮件配置信息 - 'batchMail' => [ - 'driver' => env('MAIL_DRIVER_BATCH', env('MAIL_DRIVER')), - 'host' => env('MAIL_HOST_BATCH', env('MAIL_HOST')), - 'port' => env('MAIL_PORT_BATCH', env('MAIL_PORT')), - 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS_BATCH', env('MAIL_FROM_ADDRESS')), - 'name' => env('MAIL_FROM_NAME_BATCH', env('MAIL_FROM_NAME')), - ], - 'encryption' => env('MAIL_ENCRYPTION_BATCH', env('MAIL_ENCRYPTION')), - 'username' => env('MAIL_USERNAME_BATCH', env('MAIL_USERNAME')), - 'password' => env('MAIL_PASSWORD_BATCH', env('MAIL_PASSWORD')), - 'sendmail' => '/usr/sbin/sendmail -bs', - 'markdown' => [ - 'theme' => 'default', - 'paths' => [ - resource_path('views/vendor/mail'), - ], - ], - 'log_channel' => env('MAIL_LOG_CHANNEL'), - 'reply_to' => [ - 'address' => env('MAIL_REPLYTO_ADDRESS_BATCH', env('MAIL_REPLYTO_ADDRESS')), - 'name' => env('MAIL_REPLYTO_NAME_BATCH', env('MAIL_REPLYTO_NAME')), - ], - /* - * 自定义邮件头 - * 'name' => 'value' - */ - 'headers' => [ - 'Umail-Track' => 'Click', - ], - ], + ] ]; diff --git a/resources/views/strongadmin/index/home.blade.php b/resources/views/strongadmin/index/home.blade.php index 8bfe92a7561a1f46389dfd1ba6e68bf684cf8867..d95d93e1766a5eab3f3157e8ac066d52e08c754d 100644 --- a/resources/views/strongadmin/index/home.blade.php +++ b/resources/views/strongadmin/index/home.blade.php @@ -34,6 +34,7 @@