From 74d4cd494426a94c11c8fa38b4a90377953021b1 Mon Sep 17 00:00:00 2001 From: windy <19060@qq.com> Date: Sat, 12 Sep 2020 15:46:42 +0800 Subject: [PATCH] Snapshot 3.12 --- .version | 2 +- README.md | 2 +- app/Card.php | 2 +- app/Category.php | 2 +- app/Console/Commands/ResetPassword.php | 4 ++-- app/Console/Commands/Update.php | 14 +++++++------- app/Console/Kernel.php | 6 +++--- app/Exceptions/Handler.php | 2 +- app/File.php | 2 +- app/Http/Controllers/Admin/Dashboard.php | 2 +- app/Http/Controllers/Admin/Order.php | 2 +- app/Http/Controllers/Admin/Pay.php | 2 +- app/Http/Controllers/Admin/PayWay.php | 2 +- app/Http/Controllers/Admin/System.php | 2 +- app/Http/Controllers/Auth/LoginController.php | 2 +- .../Auth/ResetPasswordController.php | 2 +- app/Http/Controllers/Controller.php | 2 +- app/Http/Controllers/DevController.php | 2 +- app/Http/Controllers/HomeController.php | 6 +++--- app/Http/Controllers/Merchant/Card.php | 6 +++--- app/Http/Controllers/Merchant/Category.php | 2 +- app/Http/Controllers/Merchant/Coupon.php | 4 ++-- app/Http/Controllers/Merchant/File.php | 2 +- app/Http/Controllers/Merchant/Log.php | 2 +- app/Http/Controllers/Merchant/Order.php | 6 +++--- app/Http/Controllers/Merchant/Product.php | 2 +- app/Http/Controllers/Shop/Coupon.php | 2 +- app/Http/Controllers/Shop/Order.php | 2 +- app/Http/Controllers/Shop/Pay.php | 18 +++++++++--------- app/Http/Controllers/Shop/Product.php | 2 +- app/Http/Middleware/AuthenticateToken.php | 2 +- app/Http/Middleware/CORS.php | 2 +- .../Middleware/RedirectIfAuthenticated.php | 2 +- app/Jobs/OrderSms.php | 2 +- app/Library/CurlRequest.php | 4 ++-- app/Library/FundHelper.php | 2 +- app/Library/Geetest/API.php | 2 +- app/Library/Geetest/Lib.php | 6 +++--- app/Library/Helper.php | 2 +- app/Library/LogHelper.php | 2 +- app/Library/QQWry/QQWry.php | 2 +- app/Library/Response.php | 2 +- app/Library/UrlShorten.php | 2 +- app/Mail/OrderShipped.php | 2 +- app/Mail/ProductCountWarn.php | 2 +- app/Order.php | 2 +- app/PayWay.php | 2 +- app/Policies/UserPolicy.php | 2 +- app/Product.php | 2 +- app/Providers/ConfigServiceProvider.php | 2 +- app/ShopTheme.php | 2 +- app/System.php | 2 +- app/User.php | 2 +- .../2017_12_23_223252_create_cards_table.php | 4 ++-- ..._02_01_174100_create_fund_records_table.php | 6 ++---- routes/channels.php | 2 +- 56 files changed, 85 insertions(+), 87 deletions(-) diff --git a/.version b/.version index 59172f902..55fc321f9 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -{"version":"3.11","md5":"073c62cb66606bd3ab5d7eccc085234d","url":"https:\/\/github.com\/Tai7sy\/card-system\/releases\/download\/3.11\/card_release.tar.gz"} \ No newline at end of file +{"version":"3.12","md5":"3a3ef7e38f07944989dc89f4125ab688","url":"http:\/\/p.qpic.cn\/qqshihua\/0\/dab4215b285c461b13e9498691685625\/0\/card_release.tar.gz"} \ No newline at end of file diff --git a/README.md b/README.md index 1ee719da4..d5f3ce45f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-
+
diff --git a/app/Card.php b/app/Card.php
index 30760ea0c..8e5c0b716 100644
--- a/app/Card.php
+++ b/app/Card.php
@@ -1,2 +1,2 @@
hasMany(Order::class); } function product() { return $this->belongsTo(Product::class); } function getCountAttribute() { return $this->count_all - $this->count_sold; } public static function add_cards($sp699450, $sp517398, $spa0789d, $sp0f5dbe, $sp107491, $sp736e02) { DB::statement('call add_cards(?,?,?,?,?,?)', array($sp699450, $sp517398, $spa0789d, $sp0f5dbe, $sp107491, (int) $sp736e02)); } public static function _trash($spcfdf85) { DB::transaction(function () use($spcfdf85) { $spe137eb = clone $spcfdf85; $spe137eb->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp06abef) { foreach ($sp06abef as $sp66d858) { $sp222f58 = \App\Product::where('id', $sp66d858->product_id)->lockForUpdate()->first(); if ($sp222f58) { $sp222f58->count_all -= $sp66d858->count_left; $sp222f58->saveOrFail(); } } }); $spcfdf85->delete(); return true; }); } public static function _restore($spcfdf85) { DB::transaction(function () use($spcfdf85) { $spe137eb = clone $spcfdf85; $spe137eb->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp06abef) { foreach ($sp06abef as $sp66d858) { $sp222f58 = \App\Product::where('id', $sp66d858->product_id)->lockForUpdate()->first(); if ($sp222f58) { $sp222f58->count_all += $sp66d858->count_left; $sp222f58->saveOrFail(); } } }); $spcfdf85->restore(); return true; }); } }
\ No newline at end of file
+namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Facades\DB; class Card extends Model { protected $guarded = array(); use SoftDeletes; protected $dates = array('deleted_at'); const STATUS_NORMAL = 0; const STATUS_SOLD = 1; const STATUS_USED = 2; const TYPE_ONETIME = 0; const TYPE_REPEAT = 1; function orders() { return $this->hasMany(Order::class); } function product() { return $this->belongsTo(Product::class); } function getCountAttribute() { return $this->count_all - $this->count_sold; } public static function add_cards($spc2138c, $spcaeba2, $sp797c94, $sp6002b5, $sp5aa60c, $sp864dfc) { DB::statement('call add_cards(?,?,?,?,?,?)', array($spc2138c, $spcaeba2, $sp797c94, $sp6002b5, $sp5aa60c, (int) $sp864dfc)); } public static function _trash($sp8e2ceb) { DB::transaction(function () use($sp8e2ceb) { $spb1c766 = clone $sp8e2ceb; $spb1c766->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($spdcf051) { foreach ($spdcf051 as $spf40cf3) { $sp863814 = \App\Product::where('id', $spf40cf3->product_id)->lockForUpdate()->first(); if ($sp863814) { $sp863814->count_all -= $spf40cf3->count_left; $sp863814->saveOrFail(); } } }); $sp8e2ceb->delete(); return true; }); } public static function _restore($sp8e2ceb) { DB::transaction(function () use($sp8e2ceb) { $spb1c766 = clone $sp8e2ceb; $spb1c766->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($spdcf051) { foreach ($spdcf051 as $spf40cf3) { $sp863814 = \App\Product::where('id', $spf40cf3->product_id)->lockForUpdate()->first(); if ($sp863814) { $sp863814->count_all += $spf40cf3->count_left; $sp863814->saveOrFail(); } } }); $sp8e2ceb->restore(); return true; }); } }
\ No newline at end of file
diff --git a/app/Category.php b/app/Category.php
index 6b9eb5c4b..fd34bee84 100644
--- a/app/Category.php
+++ b/app/Category.php
@@ -1,2 +1,2 @@
id, Helper::ID_TYPE_CATEGORY); } function products() { return $this->hasMany(Product::class); } function user() { return $this->belongsTo(User::class); } function getTmpPassword() { return md5('$wGgMd45Jgi@dBDR' . $this->password . '1#DS2%!VLqJolmMD'); } function getProductsForShop() { $sp19cd84 = Product::where('category_id', $this->id)->where('enabled', 1)->orderBy('sort')->get(); foreach ($sp19cd84 as $sp222f58) { $sp222f58->setForShop($this->user); } $this->addVisible(array('products')); $this->setAttribute('products', $sp19cd84); return $sp19cd84; } }
\ No newline at end of file
+namespace App; use App\Library\Helper; use Illuminate\Database\Eloquent\Model; class Category extends Model { protected $guarded = array(); function getUrlAttribute() { return config('app.url') . '/c/' . Helper::id_encode($this->id, Helper::ID_TYPE_CATEGORY); } function products() { return $this->hasMany(Product::class); } function user() { return $this->belongsTo(User::class); } function getTmpPassword() { return md5('$wGgMd45Jgi@dBDR' . $this->password . '1#DS2%!VLqJolmMD'); } function getProductsForShop() { $spa1cb90 = Product::where('category_id', $this->id)->where('enabled', 1)->orderBy('sort')->get(); foreach ($spa1cb90 as $sp863814) { $sp863814->setForShop($this->user); } $this->addVisible(array('products')); $this->setAttribute('products', $spa1cb90); return $spa1cb90; } }
\ No newline at end of file
diff --git a/app/Console/Commands/ResetPassword.php b/app/Console/Commands/ResetPassword.php
index d498f1351..76205aba0 100644
--- a/app/Console/Commands/ResetPassword.php
+++ b/app/Console/Commands/ResetPassword.php
@@ -1,4 +1,4 @@
argument('email'); if (!$sp3d0720) { $this->warn('please input the user\'s email
-'); return false; } $sp590011 = \App\User::where('email', $sp3d0720)->first(); if (!$sp590011) { $this->warn("can't find the user: {$sp3d0720} \nplease input the user's email\n"); return false; } $sp4b3985 = $this->argument('password'); $sp590011->password = bcrypt($sp4b3985); $sp590011->save(); $this->info("the password of '{$sp3d0720}' has been set to {$sp4b3985}\n"); return true; } }
\ No newline at end of file
+Usage: php artisan reset:password user@email.com'; public function __construct() { parent::__construct(); } public function handle() { $sp94f974 = $this->argument('email'); if (!$sp94f974) { $this->warn('please input the user\'s email
+'); return false; } $spc33961 = \App\User::where('email', $sp94f974)->first(); if (!$spc33961) { $this->warn("can't find the user: {$sp94f974} \nplease input the user's email\n"); return false; } $spf35053 = $this->argument('password'); $spc33961->password = bcrypt($spf35053); $spc33961->save(); $this->info("the password of '{$sp94f974}' has been set to {$spf35053}\n"); return true; } }
\ No newline at end of file
diff --git a/app/Console/Commands/Update.php b/app/Console/Commands/Update.php
index 755e04b1a..712300567 100644
--- a/app/Console/Commands/Update.php
+++ b/app/Console/Commands/Update.php
@@ -1,13 +1,13 @@
0) { echo '
download: ' . sprintf('%.2f', $spf30f79 / $sp675c6d * 100) . '%'; } }); curl_setopt($spba6201, CURLOPT_NOPROGRESS, false); curl_setopt($spba6201, CURLOPT_HEADER, 0); curl_setopt($spba6201, CURLOPT_USERAGENT, 'card update'); if (defined('MY_PROXY')) { $spa7dc76 = MY_PROXY; $sp0d4846 = CURLPROXY_HTTP; if (strpos($spa7dc76, 'http://') || strpos($spa7dc76, 'https://')) { $spa7dc76 = str_replace('http://', $spa7dc76, $spa7dc76); $spa7dc76 = str_replace('https://', $spa7dc76, $spa7dc76); $sp0d4846 = CURLPROXY_HTTP; } elseif (strpos($spa7dc76, 'socks4://')) { $spa7dc76 = str_replace('socks4://', $spa7dc76, $spa7dc76); $sp0d4846 = CURLPROXY_SOCKS4; } elseif (strpos($spa7dc76, 'socks4a://')) { $spa7dc76 = str_replace('socks4a://', $spa7dc76, $spa7dc76); $sp0d4846 = CURLPROXY_SOCKS4A; } elseif (strpos($spa7dc76, 'socks5://')) { $spa7dc76 = str_replace('socks5://', $spa7dc76, $spa7dc76); $sp0d4846 = CURLPROXY_SOCKS5_HOSTNAME; } curl_setopt($spba6201, CURLOPT_PROXY, $spa7dc76); curl_setopt($spba6201, CURLOPT_PROXYTYPE, $sp0d4846); if (defined('MY_PROXY_PASS')) { curl_setopt($spba6201, CURLOPT_PROXYUSERPWD, MY_PROXY_PASS); } } curl_exec($spba6201); curl_close($spba6201); echo '
-'; return true; } public function handle() { set_time_limit(0); $spa7dc76 = $this->option('proxy'); if (!empty($spa7dc76)) { define('MY_PROXY', $spa7dc76); } $sp6cf7f1 = $this->option('proxy-auth'); if (!empty($sp6cf7f1)) { define('MY_PROXY_PASS', $sp6cf7f1); } if (!empty(getenv('_'))) { $sp96ffbe = '"' . getenv('_') . '" "' . $_SERVER['PHP_SELF'] . '" '; } else { if (!empty($_SERVER['_'])) { $sp96ffbe = '"' . $_SERVER['_'] . '" "' . $_SERVER['PHP_SELF'] . '" '; } else { if (PHP_OS === 'WINNT') { $spf3292e = dirname(php_ini_loaded_file()) . DIRECTORY_SEPARATOR . 'php.exe'; } else { $spf3292e = dirname(php_ini_loaded_file()); if (ends_with($spf3292e, DIRECTORY_SEPARATOR . 'etc')) { $spf3292e = substr($spf3292e, 0, -4); } $spf3292e .= DIRECTORY_SEPARATOR . 'php'; } if (!file_exists($spf3292e)) { echo '未找到php安装路径!
-'; goto LABEL_EXIT; } $sp96ffbe = '"' . $spf3292e . '" "' . $_SERVER['PHP_SELF'] . '" '; } } exec($sp96ffbe . ' cache:clear'); exec($sp96ffbe . ' config:clear'); echo '
-'; $this->comment('检查更新中...'); $this->info('当前版本: ' . config('app.version')); $spbaaa2b = @json_decode(CurlRequest::get('https://raw.githubusercontent.com/Tai7sy/card-system/master/.version'), true); if (!@$spbaaa2b['version']) { $this->warn('检查更新失败!'); $this->warn('Error: ' . ($spbaaa2b ? json_encode($spbaaa2b) : 'Network error')); goto LABEL_EXIT; } $this->info('最新版本: ' . $spbaaa2b['version']); $this->info('版本说明: ' . (@$spbaaa2b['description'] ?? '无')); if (config('app.version') >= $spbaaa2b['version']) { $this->comment('您的版本已是最新!'); $sp66e739 = strtolower($this->ask('是否再次更新 (yes/no)', 'no')); if ($sp66e739 !== 'yes') { goto LABEL_EXIT; } } else { $sp66e739 = strtolower($this->ask('是否现在更新 (yes/no)', 'no')); if ($sp66e739 !== 'yes') { goto LABEL_EXIT; } } $sp2ad06d = realpath(sys_get_temp_dir()); if (strlen($sp2ad06d) < 3) { $this->warn('获取临时目录失败!'); goto LABEL_EXIT; } $sp2ad06d .= DIRECTORY_SEPARATOR . Str::random(16); if (!mkdir($sp2ad06d) || !is_writable($sp2ad06d) || !is_readable($sp2ad06d)) { $this->warn('临时目录不可读写!'); goto LABEL_EXIT; } if (!function_exists('exec')) { $this->warn('函数 exec 已被禁用, 无法继续更新!'); goto LABEL_EXIT; } if (PHP_OS === 'WINNT') { $sp8421d1 = 'C:\\Program Files\\7-Zip\\7z.exe'; if (!is_file($sp8421d1)) { $sp8421d1 = strtolower($this->ask('未找到7-Zip, 请手动输入7zG.exe路径', $sp8421d1)); } if (!is_file($sp8421d1)) { $this->warn('7-Zip不可用, 请安装7-Zip后重试'); goto LABEL_EXIT; } $sp8421d1 = '"' . $sp8421d1 . '"'; } else { exec('tar --version', $spb3c9e1, $sp231f31); if ($sp231f31) { $this->warn('Error: tar --version
+namespace App\Console\Commands; use App\Library\CurlRequest; use function DeepCopy\deep_copy; use Illuminate\Console\Command; use Illuminate\Support\Str; class Update extends Command { protected $signature = 'update {--proxy=} {--proxy-auth=}'; protected $description = 'check update'; public function __construct() { parent::__construct(); } private function download_progress($sp8042f4, $sp221fe9) { $spb19e8d = fopen($sp221fe9, 'w+'); if (!$spb19e8d) { return false; } $spee7fa4 = curl_init(); curl_setopt($spee7fa4, CURLOPT_URL, $sp8042f4); curl_setopt($spee7fa4, CURLOPT_FOLLOWLOCATION, true); curl_setopt($spee7fa4, CURLOPT_RETURNTRANSFER, true); curl_setopt($spee7fa4, CURLOPT_FILE, $spb19e8d); curl_setopt($spee7fa4, CURLOPT_PROGRESSFUNCTION, function ($sp0670e4, $sp89ea7e, $sp051d43, $sp592cde, $sp349fb0) { if ($sp89ea7e > 0) { echo '
download: ' . sprintf('%.2f', $sp051d43 / $sp89ea7e * 100) . '%'; } }); curl_setopt($spee7fa4, CURLOPT_NOPROGRESS, false); curl_setopt($spee7fa4, CURLOPT_HEADER, 0); curl_setopt($spee7fa4, CURLOPT_USERAGENT, 'card update'); if (defined('MY_PROXY')) { $sp2fa40b = MY_PROXY; $sp80385a = CURLPROXY_HTTP; if (strpos($sp2fa40b, 'http://') || strpos($sp2fa40b, 'https://')) { $sp2fa40b = str_replace('http://', $sp2fa40b, $sp2fa40b); $sp2fa40b = str_replace('https://', $sp2fa40b, $sp2fa40b); $sp80385a = CURLPROXY_HTTP; } elseif (strpos($sp2fa40b, 'socks4://')) { $sp2fa40b = str_replace('socks4://', $sp2fa40b, $sp2fa40b); $sp80385a = CURLPROXY_SOCKS4; } elseif (strpos($sp2fa40b, 'socks4a://')) { $sp2fa40b = str_replace('socks4a://', $sp2fa40b, $sp2fa40b); $sp80385a = CURLPROXY_SOCKS4A; } elseif (strpos($sp2fa40b, 'socks5://')) { $sp2fa40b = str_replace('socks5://', $sp2fa40b, $sp2fa40b); $sp80385a = CURLPROXY_SOCKS5_HOSTNAME; } curl_setopt($spee7fa4, CURLOPT_PROXY, $sp2fa40b); curl_setopt($spee7fa4, CURLOPT_PROXYTYPE, $sp80385a); if (defined('MY_PROXY_PASS')) { curl_setopt($spee7fa4, CURLOPT_PROXYUSERPWD, MY_PROXY_PASS); } } curl_exec($spee7fa4); curl_close($spee7fa4); echo '
+'; return true; } public function handle() { set_time_limit(0); $sp2fa40b = $this->option('proxy'); if (!empty($sp2fa40b)) { define('MY_PROXY', $sp2fa40b); } $sp7052a4 = $this->option('proxy-auth'); if (!empty($sp7052a4)) { define('MY_PROXY_PASS', $sp7052a4); } if (!empty(getenv('_'))) { $sp6c5cda = '"' . getenv('_') . '" "' . $_SERVER['PHP_SELF'] . '" '; } else { if (!empty($_SERVER['_'])) { $sp6c5cda = '"' . $_SERVER['_'] . '" "' . $_SERVER['PHP_SELF'] . '" '; } else { if (PHP_OS === 'WINNT') { $spbfe553 = dirname(php_ini_loaded_file()) . DIRECTORY_SEPARATOR . 'php.exe'; } else { $spbfe553 = dirname(php_ini_loaded_file()); if (ends_with($spbfe553, DIRECTORY_SEPARATOR . 'etc')) { $spbfe553 = substr($spbfe553, 0, -4); } $spbfe553 .= DIRECTORY_SEPARATOR . 'php'; } if (!file_exists($spbfe553)) { if (PHP_OS === 'WINNT') { $spbfe553 = 'php.exe'; } else { $spbfe553 = 'php'; } if ((bool) @exec($spbfe553 . ' --version') === FALSE) { echo '未找到php安装路径!
+'; goto LABEL_EXIT; } } $sp6c5cda = '"' . $spbfe553 . '" "' . $_SERVER['PHP_SELF'] . '" '; } } exec($sp6c5cda . ' cache:clear'); exec($sp6c5cda . ' config:clear'); echo '
+'; $this->comment('检查更新中...'); $this->info('当前版本: ' . config('app.version')); $sp2071a9 = @json_decode(CurlRequest::get('https://raw.githubusercontent.com/Tai7sy/card-system/master/.version'), true); if (!@$sp2071a9['version']) { $this->warn('检查更新失败!'); $this->warn('Error: ' . ($sp2071a9 ? json_encode($sp2071a9) : 'Network error')); goto LABEL_EXIT; } $this->info('最新版本: ' . $sp2071a9['version']); $this->info('版本说明: ' . (@$sp2071a9['description'] ?? '无')); if (config('app.version') >= $sp2071a9['version']) { $this->comment('您的版本已是最新!'); $sp0e6201 = strtolower($this->ask('是否再次更新 (yes/no)', 'no')); if ($sp0e6201 !== 'yes') { goto LABEL_EXIT; } } else { $sp0e6201 = strtolower($this->ask('是否现在更新 (yes/no)', 'no')); if ($sp0e6201 !== 'yes') { goto LABEL_EXIT; } } $sp3fe733 = realpath(sys_get_temp_dir()); if (strlen($sp3fe733) < 3) { $this->warn('获取临时目录失败!'); goto LABEL_EXIT; } $sp3fe733 .= DIRECTORY_SEPARATOR . Str::random(16); if (!mkdir($sp3fe733) || !is_writable($sp3fe733) || !is_readable($sp3fe733)) { $this->warn('临时目录不可读写!'); goto LABEL_EXIT; } if (!function_exists('exec')) { $this->warn('函数 exec 已被禁用, 无法继续更新!'); goto LABEL_EXIT; } if (PHP_OS === 'WINNT') { $spa223a8 = 'C:\\Program Files\\7-Zip\\7z.exe'; if (!is_file($spa223a8)) { $spa223a8 = strtolower($this->ask('未找到7-Zip, 请手动输入7zG.exe路径', $spa223a8)); } if (!is_file($spa223a8)) { $this->warn('7-Zip不可用, 请安装7-Zip后重试'); goto LABEL_EXIT; } $spa223a8 = '"' . $spa223a8 . '"'; } else { exec('tar --version', $sp90dbd5, $spdaf9a6); if ($spdaf9a6) { $this->warn('Error: tar --version
' . join('
-', $spb3c9e1)); goto LABEL_EXIT; } } $this->comment('正在下载新版本...'); $sp37b2ad = $sp2ad06d . DIRECTORY_SEPARATOR . 'ka_update_' . Str::random(16) . '.tmp'; if (!$this->download_progress($spbaaa2b['url'], $sp37b2ad)) { $this->warn('写入临时文件失败!'); goto LABEL_EXIT; } $spaced8e = md5_file($sp37b2ad); if ($spaced8e !== $spbaaa2b['md5']) { $this->warn('更新文件md5校验失败!, file:' . $spaced8e . ', require:' . $spbaaa2b['md5']); goto LABEL_EXIT; } $this->comment('正在解压...'); unset($spb3c9e1); if (PHP_OS === 'WINNT') { exec("{$sp8421d1} x -so {$sp37b2ad} | {$sp8421d1} x -aoa -si -ttar -o{$sp2ad06d}", $spb3c9e1, $sp231f31); } else { exec("tar -zxf {$sp37b2ad} -C {$sp2ad06d}", $spb3c9e1, $sp231f31); } if ($sp231f31) { $this->warn('Error: 解压失败
+', $sp90dbd5)); goto LABEL_EXIT; } } $this->comment('正在下载新版本...'); $sp221fe9 = $sp3fe733 . DIRECTORY_SEPARATOR . 'ka_update_' . Str::random(16) . '.tmp'; if (!$this->download_progress($sp2071a9['url'], $sp221fe9)) { $this->warn('写入临时文件失败!'); goto LABEL_EXIT; } $sp8975a6 = md5_file($sp221fe9); if ($sp8975a6 !== $sp2071a9['md5']) { $this->warn('更新文件md5校验失败!, file:' . $sp8975a6 . ', require:' . $sp2071a9['md5']); goto LABEL_EXIT; } $this->comment('正在解压...'); unset($sp90dbd5); if (PHP_OS === 'WINNT') { exec("{$spa223a8} x -so {$sp221fe9} | {$spa223a8} x -aoa -si -ttar -o{$sp3fe733}", $sp90dbd5, $spdaf9a6); } else { exec("tar -zxf {$sp221fe9} -C {$sp3fe733}", $sp90dbd5, $spdaf9a6); } if ($spdaf9a6) { $this->warn('Error: 解压失败
' . join('
-', $spb3c9e1)); goto LABEL_EXIT; } $this->comment('正在关闭主站...'); exec($sp96ffbe . ' down'); sleep(5); $this->comment(' --> 正在清理旧文件...'); $sp03b565 = base_path(); foreach (array('app', 'bootstrap', 'config', 'public/dist', 'database', 'routes', 'vendor') as $sp618c15) { \File::deleteDirectory($sp03b565 . DIRECTORY_SEPARATOR . $sp618c15); } $this->comment(' --> 正在复制新文件...'); \File::delete($sp2ad06d . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'logo.png'); \File::delete($sp2ad06d . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . '.htaccess'); \File::delete($sp2ad06d . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'web.config'); \File::delete($sp2ad06d . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'nginx.conf'); \File::delete($sp2ad06d . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'robots.txt'); \File::copyDirectory($sp2ad06d . DIRECTORY_SEPARATOR . 'card_system_free_dist', $sp03b565); $this->comment(' --> 正在创建缓存...'); exec($sp96ffbe . ' cache:clear'); exec($sp96ffbe . ' route:cache'); exec($sp96ffbe . ' config:cache'); $this->comment(' --> 正在更新数据库...'); exec($sp96ffbe . ' migrate'); if (PHP_OS === 'WINNT') { echo '
+', $sp90dbd5)); goto LABEL_EXIT; } $this->comment('正在关闭主站...'); exec($sp6c5cda . ' down'); sleep(5); $this->comment(' --> 正在清理旧文件...'); $sp1c63fd = base_path(); foreach (array('app', 'bootstrap', 'config', 'public/dist', 'database', 'routes', 'vendor') as $spe59991) { \File::deleteDirectory($sp1c63fd . DIRECTORY_SEPARATOR . $spe59991); } $this->comment(' --> 正在复制新文件...'); \File::delete($sp3fe733 . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'logo.png'); \File::delete($sp3fe733 . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . '.htaccess'); \File::delete($sp3fe733 . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'web.config'); \File::delete($sp3fe733 . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'nginx.conf'); \File::delete($sp3fe733 . DIRECTORY_SEPARATOR . 'card_dist' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'robots.txt'); \File::copyDirectory($sp3fe733 . DIRECTORY_SEPARATOR . 'card_system_free_dist', $sp1c63fd); $this->comment(' --> 正在创建缓存...'); exec($sp6c5cda . ' cache:clear'); exec($sp6c5cda . ' route:cache'); exec($sp6c5cda . ' config:cache'); $this->comment(' --> 正在更新数据库...'); exec($sp6c5cda . ' migrate'); if (PHP_OS === 'WINNT') { echo '
'; $this->alert('请注意手动设置目录权限'); $this->comment(' storage 可读可写 '); $this->comment(' bootstrap/cache/ 可读可写 '); echo '
-'; } else { $this->comment(' --> 正在设置目录权限...'); exec('rm -rf storage/framework/cache/data/*'); exec('chmod -R 777 storage/'); exec('chmod -R 777 bootstrap/cache/'); } $this->comment('正在启用主站...'); exec($sp96ffbe . ' up'); exec($sp96ffbe . ' queue:restart'); $sp154ac7 = true; LABEL_EXIT: if (isset($sp2ad06d) && strlen($sp2ad06d) > 19) { $this->comment('清理临时目录...'); \File::deleteDirectory($sp2ad06d); } if (isset($sp154ac7) && $sp154ac7) { $this->info('更新成功!'); } if (PHP_OS === 'WINNT') { } else { exec('rm -rf storage/framework/cache/data/*'); exec('chmod -R 777 storage/'); exec('chmod -R 777 bootstrap/cache/'); } echo '
+'; } else { $this->comment(' --> 正在设置目录权限...'); exec('rm -rf storage/framework/cache/data/*'); exec('chmod -R 777 storage/'); exec('chmod -R 777 bootstrap/cache/'); } $this->comment('正在启用主站...'); exec($sp6c5cda . ' up'); exec($sp6c5cda . ' queue:restart'); $sp1c053d = true; LABEL_EXIT: if (isset($sp3fe733) && strlen($sp3fe733) > 19) { $this->comment('清理临时目录...'); \File::deleteDirectory($sp3fe733); } if (isset($sp1c053d) && $sp1c053d) { $this->info('更新成功!'); } if (PHP_OS === 'WINNT') { } else { exec('rm -rf storage/framework/cache/data/*'); exec('chmod -R 777 storage/'); exec('chmod -R 777 bootstrap/cache/'); } echo '
'; die; } }
\ No newline at end of file
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index ac4080656..3a081cd45 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -1,4 +1,4 @@
runningInConsole()) { return; } try { System::_init(); } catch (\Throwable $sp7900a2) { return; } if (System::_getInt('order_clean_unpay_open') === 1) { $spc9ad9e = System::_getInt('order_clean_unpay_day', 7); $spd0d724->call(function () use($spc9ad9e) { echo '[' . date('Y-m-d H:i:s') . "] cleaning unpaid orders({$spc9ad9e} days ago)...\n"; \App\Order::where('status', \App\Order::STATUS_UNPAY)->where('created_at', '<', (new Carbon())->addDays(-$spc9ad9e))->delete(); $spdbd7f3 = '[' . date('Y-m-d H:i:s') . '] unpaid-orders cleaned
-'; echo $spdbd7f3; })->dailyAt('01:00'); } $spd0d724->call(function () { $spc9ad9e = 7; echo '[' . date('Y-m-d H:i:s') . "] cleaning deleted cards({$spc9ad9e} days ago)...\n"; \App\Card::onlyTrashed()->where('deleted_at', '<', (new Carbon())->addDays(-$spc9ad9e))->forceDelete(); $spdbd7f3 = '[' . date('Y-m-d H:i:s') . '] deleted-cards cleaned
-'; echo $spdbd7f3; })->dailyAt('02:00'); } protected function commands() { $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } }
\ No newline at end of file
+namespace App\Console; use App\System; use Carbon\Carbon; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; class Kernel extends ConsoleKernel { protected $commands = array(); protected function schedule(Schedule $sp7f508b) { if (!app()->runningInConsole()) { return; } try { System::_init(); } catch (\Throwable $sp45222f) { return; } if (System::_getInt('order_clean_unpay_open') === 1) { $spe595a6 = System::_getInt('order_clean_unpay_day', 7); $sp7f508b->call(function () use($spe595a6) { echo '[' . date('Y-m-d H:i:s') . "] cleaning unpaid orders({$spe595a6} days ago)...\n"; \App\Order::where('status', \App\Order::STATUS_UNPAY)->where('created_at', '<', (new Carbon())->addDays(-$spe595a6))->delete(); $spcdf61d = '[' . date('Y-m-d H:i:s') . '] unpaid-orders cleaned
+'; echo $spcdf61d; })->dailyAt('01:00'); } $sp7f508b->call(function () { $spe595a6 = 7; echo '[' . date('Y-m-d H:i:s') . "] cleaning deleted cards({$spe595a6} days ago)...\n"; \App\Card::onlyTrashed()->where('deleted_at', '<', (new Carbon())->addDays(-$spe595a6))->forceDelete(); $spcdf61d = '[' . date('Y-m-d H:i:s') . '] deleted-cards cleaned
+'; echo $spcdf61d; })->dailyAt('02:00'); } protected function commands() { $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } }
\ No newline at end of file
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index ba395489b..5739a232f 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -1,2 +1,2 @@
isXmlHttpRequest() ? response()->json(array('message' => $spdbd7f3), $sp0f5dbe) : response()->view('errors._', array('code' => $sp0f5dbe, 'message' => $spdbd7f3), $sp0f5dbe); } public function render($sp26e527, Exception $sp7900a2) { if ($sp7900a2 instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) { return $this->msg($sp26e527, trans('exception.resource_not_found'), 404); } elseif ($sp7900a2 instanceof \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException || $sp7900a2 instanceof \Illuminate\Auth\AuthenticationException) { Log::error('Caught a UnauthorizedHttpException', array('exception' => $sp7900a2)); return $this->msg($sp26e527, trans('exception.please_login'), 401); } elseif ($sp7900a2 instanceof \Illuminate\Auth\Access\AuthorizationException) { return $this->msg($sp26e527, trans('exception.un_authenticated'), 403); } elseif ($sp7900a2 instanceof \Illuminate\Validation\ValidationException) { $sp26e527->headers->set('X-Requested-With', 'XMLHttpRequest'); $sp26e527->headers->set('Accept', 'application/json'); return parent::render($sp26e527, $sp7900a2); } elseif ($sp7900a2 instanceof \Illuminate\Session\TokenMismatchException) { return $this->msg($sp26e527, trans('exception.csrf_token_invalid'), 403); } elseif ($sp7900a2 instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) { return $this->msg($sp26e527, trans('exception.not_found'), 404); } elseif ($sp7900a2 instanceof \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException) { return $this->msg($sp26e527, trans('exception.method_not_allowed'), 405); } elseif ($sp7900a2 instanceof \Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException) { return $this->msg($sp26e527, trans('exception.service_unavailable'), 503); } elseif ($sp7900a2 instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { $sp2cda1d = $sp7900a2->getStatusCode() ?? 500; switch ($sp2cda1d) { case 429: return $this->msg($sp26e527, trans('exception.too_many_requests'), $sp2cda1d); break; default: Log::error('Caught a UnknownHttpException', array('exception' => $sp7900a2)); return $this->msg($sp26e527, trans('exception.service_unavailable'), $sp2cda1d); } } elseif ($sp7900a2 instanceof \Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException) { return $this->msg($sp26e527, trans('exception.method_not_allowed'), 405); } Log::error('Uncaught Exception', array('exception' => $sp7900a2, 'method' => $sp26e527->method(), 'url' => $sp26e527->fullUrl(), 'data' => file_get_contents('php://input'), 'ip' => Helper::getIP() ?? $sp26e527->ip(), 'client_ip' => $sp26e527->getClientIp(), 'headers' => $sp26e527->header())); if (config('app.debug')) { return parent::render($sp26e527, $sp7900a2); } else { return $this->msg($sp26e527, trans('exception.unknown_error'), 500); } } }
\ No newline at end of file
+namespace App\Exceptions; use App\Library\Helper; use App\Library\Response; use Exception; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Support\Facades\Log; class Handler extends ExceptionHandler { protected $dontReport = array(); protected $dontFlash = array('password', 'password_confirmation'); public function report(Exception $spc81dc7) { parent::report($spc81dc7); } private function msg($sp13451b, $spcdf61d, $sp6002b5) { return $sp13451b->isXmlHttpRequest() ? response()->json(array('message' => $spcdf61d), $sp6002b5) : response()->view('errors._', array('code' => $sp6002b5, 'message' => $spcdf61d), $sp6002b5); } public function render($sp13451b, Exception $sp45222f) { if ($sp45222f instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) { return $this->msg($sp13451b, trans('exception.resource_not_found'), 404); } elseif ($sp45222f instanceof \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException || $sp45222f instanceof \Illuminate\Auth\AuthenticationException) { Log::error('Caught a UnauthorizedHttpException', array('exception' => $sp45222f)); return $this->msg($sp13451b, trans('exception.please_login'), 401); } elseif ($sp45222f instanceof \Illuminate\Auth\Access\AuthorizationException) { return $this->msg($sp13451b, trans('exception.un_authenticated'), 403); } elseif ($sp45222f instanceof \Illuminate\Validation\ValidationException) { $sp13451b->headers->set('X-Requested-With', 'XMLHttpRequest'); $sp13451b->headers->set('Accept', 'application/json'); return parent::render($sp13451b, $sp45222f); } elseif ($sp45222f instanceof \Illuminate\Session\TokenMismatchException) { return $this->msg($sp13451b, trans('exception.csrf_token_invalid'), 403); } elseif ($sp45222f instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) { return $this->msg($sp13451b, trans('exception.not_found'), 404); } elseif ($sp45222f instanceof \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException) { return $this->msg($sp13451b, trans('exception.method_not_allowed'), 405); } elseif ($sp45222f instanceof \Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException) { return $this->msg($sp13451b, trans('exception.service_unavailable'), 503); } elseif ($sp45222f instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { $spba16fd = $sp45222f->getStatusCode() ?? 500; switch ($spba16fd) { case 429: return $this->msg($sp13451b, trans('exception.too_many_requests'), $spba16fd); break; default: Log::error('Caught a UnknownHttpException', array('exception' => $sp45222f)); return $this->msg($sp13451b, trans('exception.service_unavailable'), $spba16fd); } } elseif ($sp45222f instanceof \Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException) { return $this->msg($sp13451b, trans('exception.method_not_allowed'), 405); } Log::error('Uncaught Exception', array('exception' => $sp45222f, 'method' => $sp13451b->method(), 'url' => $sp13451b->fullUrl(), 'data' => file_get_contents('php://input'), 'ip' => Helper::getIP() ?? $sp13451b->ip(), 'client_ip' => $sp13451b->getClientIp(), 'headers' => $sp13451b->header())); if (config('app.debug')) { return parent::render($sp13451b, $sp45222f); } else { return $this->msg($sp13451b, trans('exception.unknown_error'), 500); } } }
\ No newline at end of file
diff --git a/app/File.php b/app/File.php
index 732700807..41b3fb343 100644
--- a/app/File.php
+++ b/app/File.php
@@ -1,2 +1,2 @@
driver)->delete($this->path); } catch (\Exception $sp7900a2) { \Log::error('File.deleteFile Error: ' . $sp7900a2->getMessage(), array('exception' => $sp7900a2)); } } public static function getProductFolder() { return 'images/product'; } }
\ No newline at end of file
+namespace App; use Illuminate\Database\Eloquent\Model; class File extends Model { protected $guarded = array(); public $timestamps = false; function deleteFile() { try { Storage::disk($this->driver)->delete($this->path); } catch (\Exception $sp45222f) { \Log::error('File.deleteFile Error: ' . $sp45222f->getMessage(), array('exception' => $sp45222f)); } } public static function getProductFolder() { return 'images/product'; } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/Dashboard.php b/app/Http/Controllers/Admin/Dashboard.php
index d68a7c3d6..63fd45519 100644
--- a/app/Http/Controllers/Admin/Dashboard.php
+++ b/app/Http/Controllers/Admin/Dashboard.php
@@ -1,2 +1,2 @@
array('count' => 0, 'paid' => 0, 'profit' => 0), 'yesterday' => array('count' => 0, 'paid' => 0, 'profit' => 0)); $spe6aa6d = Order::whereUserId(\Auth::Id())->whereDate('paid_at', \Carbon\Carbon::now()->toDateString())->where(function ($spcfdf85) { $spcfdf85->where('status', Order::STATUS_PAID)->orWhere('status', Order::STATUS_SUCCESS); })->selectRaw('COUNT(*) as `count`,SUM(`paid`) as `paid`,SUM(`paid`-`sms_price`-`cost`-`fee`) as `profit`')->get()->toArray(); $sp368eaf = Order::whereUserId(\Auth::Id())->whereDate('paid_at', \Carbon\Carbon::yesterday()->toDateString())->where(function ($spcfdf85) { $spcfdf85->where('status', Order::STATUS_PAID)->orWhere('status', Order::STATUS_SUCCESS); })->selectRaw('COUNT(*) as `count`,SUM(`paid`) as `paid`,SUM(`paid`-`sms_price`-`cost`-`fee`) as `profit`')->get()->toArray(); if (isset($spe6aa6d[0]) && isset($spe6aa6d[0]['count'])) { $sp5aa810['today'] = array('count' => (int) $spe6aa6d[0]['count'], 'paid' => (int) $spe6aa6d[0]['paid'], 'profit' => (int) $spe6aa6d[0]['profit']); } if (isset($sp368eaf[0]) && isset($sp368eaf[0]['count'])) { $sp5aa810['yesterday'] = array('count' => (int) $sp368eaf[0]['count'], 'paid' => (int) $sp368eaf[0]['paid'], 'profit' => (int) $sp368eaf[0]['profit']); } $sp5aa810['need_ship_count'] = Order::whereUserId(\Auth::Id())->where('status', Order::STATUS_PAID)->count(); $sp5aa810['login'] = \App\Log::where('action', \App\Log::ACTION_LOGIN)->latest()->first(); return Response::success($sp5aa810); } function clearCache() { if (function_exists('opcache_reset')) { opcache_reset(); } try { \Artisan::call('cache:clear'); \Artisan::call('route:cache'); \Artisan::call('config:cache'); } catch (\Throwable $sp7900a2) { return Response::fail($sp7900a2->getMessage()); } return Response::success(); } function version() { $sp4bc79d = array(); $sp318ad9 = CurlRequest::get('https://raw.githubusercontent.com/Tai7sy/card-system/master/.version'); $spbaaa2b = @json_decode($sp318ad9, true); if (!@$spbaaa2b['data']['version']) { Log::error('Dashboard.version checkUpdate failed', array('version_raw' => $sp318ad9)); $sp4bc79d['message'] = '检查更新失败'; } else { $sp4bc79d = array('version' => $spbaaa2b['data']['version'], 'description' => $spbaaa2b['data']['description']); } return Response::success(array('version' => config('app.version'), 'update' => $sp4bc79d)); } function logsToken() { $spce7aba = md5(random_bytes(128)); Cache::put($spce7aba, Auth::getUser(), 15); return response(array('token' => $spce7aba)); } function logsView(Request $sp26e527, $spce7aba) { if ($sp590011 = Cache::get($spce7aba)) { Cache::put($spce7aba, $sp590011, 15); return (new \Rap2hpoutre\LaravelLogViewer\LogViewerController())->index(); } else { throw new \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException('logs-token'); } } }
\ No newline at end of file
+namespace App\Http\Controllers\Admin; use App\Library\CurlRequest; use App\Library\Response; use App\Order; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Log; class Dashboard extends Controller { function index(Request $sp13451b) { $spa76e10 = array('today' => array('count' => 0, 'paid' => 0, 'profit' => 0), 'yesterday' => array('count' => 0, 'paid' => 0, 'profit' => 0)); $sp28c542 = Order::whereUserId(\Auth::Id())->whereDate('paid_at', \Carbon\Carbon::now()->toDateString())->where(function ($sp8e2ceb) { $sp8e2ceb->where('status', Order::STATUS_PAID)->orWhere('status', Order::STATUS_SUCCESS); })->selectRaw('COUNT(*) as `count`,SUM(`paid`) as `paid`,SUM(`paid`-`sms_price`-`cost`-`fee`) as `profit`')->get()->toArray(); $sp045229 = Order::whereUserId(\Auth::Id())->whereDate('paid_at', \Carbon\Carbon::yesterday()->toDateString())->where(function ($sp8e2ceb) { $sp8e2ceb->where('status', Order::STATUS_PAID)->orWhere('status', Order::STATUS_SUCCESS); })->selectRaw('COUNT(*) as `count`,SUM(`paid`) as `paid`,SUM(`paid`-`sms_price`-`cost`-`fee`) as `profit`')->get()->toArray(); if (isset($sp28c542[0]) && isset($sp28c542[0]['count'])) { $spa76e10['today'] = array('count' => (int) $sp28c542[0]['count'], 'paid' => (int) $sp28c542[0]['paid'], 'profit' => (int) $sp28c542[0]['profit']); } if (isset($sp045229[0]) && isset($sp045229[0]['count'])) { $spa76e10['yesterday'] = array('count' => (int) $sp045229[0]['count'], 'paid' => (int) $sp045229[0]['paid'], 'profit' => (int) $sp045229[0]['profit']); } $spa76e10['need_ship_count'] = Order::whereUserId(\Auth::Id())->where('status', Order::STATUS_PAID)->count(); $spa76e10['login'] = \App\Log::where('action', \App\Log::ACTION_LOGIN)->latest()->first(); return Response::success($spa76e10); } function clearCache() { if (function_exists('opcache_reset')) { opcache_reset(); } try { \Artisan::call('cache:clear'); \Artisan::call('route:cache'); \Artisan::call('config:cache'); } catch (\Throwable $sp45222f) { return Response::fail($sp45222f->getMessage()); } return Response::success(); } function version() { $sp55dee0 = array(); $sp6076e4 = CurlRequest::get('https://raw.githubusercontent.com/Tai7sy/card-system/master/.version'); $sp2071a9 = @json_decode($sp6076e4, true); if (!@$sp2071a9['data']['version']) { Log::error('Dashboard.version checkUpdate failed', array('version_raw' => $sp6076e4)); $sp55dee0['message'] = '检查更新失败'; } else { $sp55dee0 = array('version' => $sp2071a9['data']['version'], 'description' => $sp2071a9['data']['description']); } return Response::success(array('version' => config('app.version'), 'update' => $sp55dee0)); } function logsToken() { $sp61eea9 = md5(random_bytes(128)); Cache::put($sp61eea9, Auth::getUser(), 15); return response(array('token' => $sp61eea9)); } function logsView(Request $sp13451b, $sp61eea9) { if ($spc33961 = Cache::get($sp61eea9)) { Cache::put($sp61eea9, $spc33961, 15); return (new \Rap2hpoutre\LaravelLogViewer\LogViewerController())->index(); } else { throw new \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException('logs-token'); } } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/Order.php b/app/Http/Controllers/Admin/Order.php
index 1e258d972..171e80cc7 100644
--- a/app/Http/Controllers/Admin/Order.php
+++ b/app/Http/Controllers/Admin/Order.php
@@ -1,2 +1,2 @@
validate($sp26e527, array('ids' => 'required|string', 'income' => 'required|integer', 'balance' => 'required|integer')); $sp892962 = $sp26e527->post('ids'); $sp07c5c5 = (int) $sp26e527->post('income'); $sp1396aa = (int) $sp26e527->post('balance'); \App\Order::whereIn('id', explode(',', $sp892962))->chunk(100, function ($sp002573) use($sp07c5c5, $sp1396aa) { foreach ($sp002573 as $sp8ac6c1) { $sp8ac6c1->cards()->detach(); try { if ($sp07c5c5) { $sp8ac6c1->fundRecord()->delete(); } if ($sp1396aa) { $sp590011 = \App\User::lockForUpdate()->firstOrFail(); $sp590011->m_all -= $sp8ac6c1->income; $sp590011->saveOrFail(); } $sp8ac6c1->delete(); } catch (\Exception $sp7900a2) { } } }); return Response::success(); } function freeze(Request $sp26e527) { $this->validate($sp26e527, array('ids' => 'required|string')); $sp892962 = explode(',', $sp26e527->post('ids')); $sp49115f = $sp26e527->post('reason'); $spe95220 = 0; $sp35c270 = 0; foreach ($sp892962 as $sp27545d) { $spe95220++; if (FundHelper::orderFreeze($sp27545d, $sp49115f)) { $sp35c270++; } } return Response::success(array($spe95220, $sp35c270)); } function unfreeze(Request $sp26e527) { $this->validate($sp26e527, array('ids' => 'required|string')); $sp892962 = explode(',', $sp26e527->post('ids')); $spe95220 = 0; $sp35c270 = 0; $sp8591a5 = \App\Order::STATUS_FROZEN; foreach ($sp892962 as $sp27545d) { $spe95220++; if (FundHelper::orderUnfreeze($sp27545d, '后台操作', null, $sp8591a5)) { $sp35c270++; } } return Response::success(array($spe95220, $sp35c270, $sp8591a5)); } function set_paid(Request $sp26e527) { $this->validate($sp26e527, array('id' => 'required|integer')); $sp138835 = $sp26e527->post('id', ''); $sp6324c8 = $sp26e527->post('trade_no', ''); if (strlen($sp6324c8) < 1) { return Response::forbidden('请输入支付系统内单号'); } $sp8ac6c1 = \App\Order::findOrFail($sp138835); if ($sp8ac6c1->status !== \App\Order::STATUS_UNPAY) { return Response::forbidden('只能操作未支付订单'); } $spb399b9 = 'Admin.SetPaid'; $spf82521 = $sp8ac6c1->order_no; $sp7f4b1f = $sp8ac6c1->paid; try { Log::debug($spb399b9 . " shipOrder start, order_no: {$spf82521}, amount: {$sp7f4b1f}, trade_no: {$sp6324c8}"); (new \App\Http\Controllers\Shop\Pay())->shipOrder($sp26e527, $spf82521, $sp7f4b1f, $sp6324c8); Log::debug($spb399b9 . ' shipOrder end, order_no: ' . $spf82521); $sp35c270 = true; $sp93a168 = '发货成功'; } catch (\Exception $sp7900a2) { $sp35c270 = false; $sp93a168 = $sp7900a2->getMessage(); Log::error($spb399b9 . ' shipOrder Exception: ' . $sp7900a2->getMessage()); } $sp8ac6c1 = \App\Order::with(array('pay' => function (Relation $spcfdf85) { $spcfdf85->select(array('id', 'name')); }, 'card_orders.card' => function (Relation $spcfdf85) { $spcfdf85->select(array('id', 'card')); }))->findOrFail($sp138835); if ($sp8ac6c1->status === \App\Order::STATUS_PAID) { if ($sp8ac6c1->product->delivery === \App\Product::DELIVERY_MANUAL) { $sp35c270 = true; $sp93a168 = '已标记为付款成功
当前商品为手动发货商品, 请手动进行发货。'; } else { $sp35c270 = false; $sp93a168 = '已标记为付款成功,
但是买家库存不足, 发货失败, 请稍后尝试手动发货。'; } } return Response::success(array('code' => $sp35c270 ? 0 : -1, 'msg' => $sp93a168, 'order' => $sp8ac6c1)); } }
\ No newline at end of file
+namespace App\Http\Controllers\Admin; use App\Library\FundHelper; use App\Library\Helper; use Carbon\Carbon; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Library\Response; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; class Order extends Controller { public function delete(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string', 'income' => 'required|integer', 'balance' => 'required|integer')); $sp60bb7e = $sp13451b->post('ids'); $sp6d842b = (int) $sp13451b->post('income'); $sp10d665 = (int) $sp13451b->post('balance'); \App\Order::whereIn('id', explode(',', $sp60bb7e))->chunk(100, function ($spbda254) use($sp6d842b, $sp10d665) { foreach ($spbda254 as $sp322370) { $sp322370->cards()->detach(); try { if ($sp6d842b) { $sp322370->fundRecord()->delete(); } if ($sp10d665) { $spc33961 = \App\User::lockForUpdate()->firstOrFail(); $spc33961->m_all -= $sp322370->income; $spc33961->saveOrFail(); } $sp322370->delete(); } catch (\Exception $sp45222f) { } } }); return Response::success(); } function freeze(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string')); $sp60bb7e = explode(',', $sp13451b->post('ids')); $sp3ed973 = $sp13451b->post('reason'); $sp1ca412 = 0; $speba4f8 = 0; foreach ($sp60bb7e as $sp8030c3) { $sp1ca412++; if (FundHelper::orderFreeze($sp8030c3, $sp3ed973)) { $speba4f8++; } } return Response::success(array($sp1ca412, $speba4f8)); } function unfreeze(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string')); $sp60bb7e = explode(',', $sp13451b->post('ids')); $sp1ca412 = 0; $speba4f8 = 0; $spfb5c06 = \App\Order::STATUS_FROZEN; foreach ($sp60bb7e as $sp8030c3) { $sp1ca412++; if (FundHelper::orderUnfreeze($sp8030c3, '后台操作', null, $spfb5c06)) { $speba4f8++; } } return Response::success(array($sp1ca412, $speba4f8, $spfb5c06)); } function set_paid(Request $sp13451b) { $this->validate($sp13451b, array('id' => 'required|integer')); $sp7df839 = $sp13451b->post('id', ''); $spbe9054 = $sp13451b->post('trade_no', ''); if (strlen($spbe9054) < 1) { return Response::forbidden('请输入支付系统内单号'); } $sp322370 = \App\Order::findOrFail($sp7df839); if ($sp322370->status !== \App\Order::STATUS_UNPAY) { return Response::forbidden('只能操作未支付订单'); } $spf6b1a9 = 'Admin.SetPaid'; $sp6b06ff = $sp322370->order_no; $sp07bb5f = $sp322370->paid; try { Log::debug($spf6b1a9 . " shipOrder start, order_no: {$sp6b06ff}, amount: {$sp07bb5f}, trade_no: {$spbe9054}"); (new \App\Http\Controllers\Shop\Pay())->shipOrder($sp13451b, $sp6b06ff, $sp07bb5f, $spbe9054); Log::debug($spf6b1a9 . ' shipOrder end, order_no: ' . $sp6b06ff); $speba4f8 = true; $spfd1ead = '发货成功'; } catch (\Exception $sp45222f) { $speba4f8 = false; $spfd1ead = $sp45222f->getMessage(); Log::error($spf6b1a9 . ' shipOrder Exception: ' . $sp45222f->getMessage()); } $sp322370 = \App\Order::with(array('pay' => function (Relation $sp8e2ceb) { $sp8e2ceb->select(array('id', 'name')); }, 'card_orders.card' => function (Relation $sp8e2ceb) { $sp8e2ceb->select(array('id', 'card')); }))->findOrFail($sp7df839); if ($sp322370->status === \App\Order::STATUS_PAID) { if ($sp322370->product->delivery === \App\Product::DELIVERY_MANUAL) { $speba4f8 = true; $spfd1ead = '已标记为付款成功
当前商品为手动发货商品, 请手动进行发货。'; } else { $speba4f8 = false; $spfd1ead = '已标记为付款成功,
但是买家库存不足, 发货失败, 请稍后尝试手动发货。'; } } return Response::success(array('code' => $speba4f8 ? 0 : -1, 'msg' => $spfd1ead, 'order' => $sp322370)); } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/Pay.php b/app/Http/Controllers/Admin/Pay.php
index 5ae55a6aa..0c74e86a8 100644
--- a/app/Http/Controllers/Admin/Pay.php
+++ b/app/Http/Controllers/Admin/Pay.php
@@ -1,2 +1,2 @@
input('enabled'); if (strlen($spc9cacd)) { $spcfdf85->whereIn('enabled', explode(',', $spc9cacd)); } $sp78cca0 = $sp26e527->input('search', false); $sp79e569 = $sp26e527->input('val', false); if ($sp78cca0 && $sp79e569) { if ($sp78cca0 == 'simple') { return Response::success($spcfdf85->get(array('id', 'name', 'enabled', 'comment'))); } elseif ($sp78cca0 == 'id') { $spcfdf85->where('id', $sp79e569); } else { $spcfdf85->where($sp78cca0, 'like', '%' . $sp79e569 . '%'); } } $spccc256 = $spcfdf85->get(); return Response::success(array('list' => $spccc256, 'urls' => array('url' => config('app.url'), 'url_api' => config('app.url_api')))); } function stat(Request $sp26e527) { $this->validate($sp26e527, array('day' => 'required|integer|between:1,30')); $spc9ad9e = (int) $sp26e527->input('day'); if ($spc9ad9e === 30) { $sp6bf7ca = Carbon::now()->addMonths(-1)->toDateString() . ' 00:00:00'; } else { $sp6bf7ca = Carbon::now()->addDays(-$spc9ad9e)->toDateString() . ' 00:00:00'; } $spccc256 = $this->authQuery($sp26e527, \App\Order::class)->where(function ($spcfdf85) { $spcfdf85->where('status', \App\Order::STATUS_PAID)->orWhere('status', \App\Order::STATUS_SUCCESS); })->where('paid_at', '>=', $sp6bf7ca)->with(array('pay' => function ($spcfdf85) { $spcfdf85->select(array('id', 'name')); }))->groupBy('pay_id')->selectRaw('`pay_id`,COUNT(*) as "count",SUM(`paid`) as "sum"')->get()->toArray(); $spa87332 = array(); foreach ($spccc256 as $sp9c771b) { if (isset($sp9c771b['pay']) && isset($sp9c771b['pay']['name'])) { $spd74535 = $sp9c771b['pay']['name']; } else { $spd74535 = '未知方式#' . $sp9c771b['pay_id']; } $spa87332[$spd74535] = array((int) $sp9c771b['count'], (int) $sp9c771b['sum']); } return Response::success($spa87332); } function edit(Request $sp26e527) { $this->validate($sp26e527, array('id' => 'sometimes|integer', 'name' => 'required|string', 'driver' => 'required|string', 'way' => 'required|string', 'config' => 'required|string', 'fee_system' => 'required|numeric')); $spade156 = \App\Pay::find((int) $sp26e527->post('id')); if (!$spade156) { $spade156 = new \App\Pay(); } $spade156->name = $sp26e527->post('name'); $spade156->comment = $sp26e527->post('comment'); $spade156->driver = $sp26e527->post('driver'); $spade156->way = $sp26e527->post('way'); $spade156->config = $sp26e527->post('config'); $spade156->enabled = (int) $sp26e527->post('enabled'); $spade156->fee_system = $sp26e527->post('fee_system'); $spade156->saveOrFail(); return Response::success(); } function comment(Request $sp26e527) { $this->validate($sp26e527, array('id' => 'required|integer')); $sp138835 = (int) $sp26e527->post('id'); $spade156 = \App\Pay::findOrFail($sp138835); $spade156->comment = $sp26e527->post('comment'); $spade156->save(); return Response::success(); } function fee_system(Request $sp26e527) { $this->validate($sp26e527, array('id' => 'required|integer')); $sp138835 = (int) $sp26e527->post('id'); $spade156 = \App\Pay::findOrFail($sp138835); $spade156->fee_system = $sp26e527->post('fee_system'); $spade156->saveOrFail(); return Response::success(); } function enable(Request $sp26e527) { $this->validate($sp26e527, array('ids' => 'required|string', 'enabled' => 'required|integer|between:0,3')); $sp892962 = $sp26e527->post('ids'); $spc9cacd = (int) $sp26e527->post('enabled'); \App\Pay::whereIn('id', explode(',', $sp892962))->update(array('enabled' => $spc9cacd)); \App\Pay::flushCache(); return Response::success(); } function delete(Request $sp26e527) { $this->validate($sp26e527, array('ids' => 'required|string')); $sp892962 = $sp26e527->post('ids'); \App\Pay::whereIn('id', explode(',', $sp892962))->delete(); \App\Pay::flushCache(); return Response::success(); } }
\ No newline at end of file
+namespace App\Http\Controllers\Admin; use App\Library\Helper; use Carbon\Carbon; use function foo\func; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Library\Response; class Pay extends Controller { function get(Request $sp13451b) { $sp8e2ceb = \App\Pay::query(); $sp6a3468 = $sp13451b->input('enabled'); if (strlen($sp6a3468)) { $sp8e2ceb->whereIn('enabled', explode(',', $sp6a3468)); } $sp54e0e6 = $sp13451b->input('search', false); $sp59b33b = $sp13451b->input('val', false); if ($sp54e0e6 && $sp59b33b) { if ($sp54e0e6 == 'simple') { return Response::success($sp8e2ceb->get(array('id', 'name', 'enabled', 'comment'))); } elseif ($sp54e0e6 == 'id') { $sp8e2ceb->where('id', $sp59b33b); } else { $sp8e2ceb->where($sp54e0e6, 'like', '%' . $sp59b33b . '%'); } } $spa67529 = $sp8e2ceb->get(); return Response::success(array('list' => $spa67529, 'urls' => array('url' => config('app.url'), 'url_api' => config('app.url_api')))); } function stat(Request $sp13451b) { $this->validate($sp13451b, array('day' => 'required|integer|between:1,30')); $spe595a6 = (int) $sp13451b->input('day'); if ($spe595a6 === 30) { $speeaf8a = Carbon::now()->addMonths(-1)->toDateString() . ' 00:00:00'; } else { $speeaf8a = Carbon::now()->addDays(-$spe595a6)->toDateString() . ' 00:00:00'; } $spa67529 = $this->authQuery($sp13451b, \App\Order::class)->where(function ($sp8e2ceb) { $sp8e2ceb->where('status', \App\Order::STATUS_PAID)->orWhere('status', \App\Order::STATUS_SUCCESS); })->where('paid_at', '>=', $speeaf8a)->with(array('pay' => function ($sp8e2ceb) { $sp8e2ceb->select(array('id', 'name')); }))->groupBy('pay_id')->selectRaw('`pay_id`,COUNT(*) as "count",SUM(`paid`) as "sum"')->get()->toArray(); $sp00ac62 = array(); foreach ($spa67529 as $sp3f5c2c) { if (isset($sp3f5c2c['pay']) && isset($sp3f5c2c['pay']['name'])) { $sp07acf6 = $sp3f5c2c['pay']['name']; } else { $sp07acf6 = '未知方式#' . $sp3f5c2c['pay_id']; } $sp00ac62[$sp07acf6] = array((int) $sp3f5c2c['count'], (int) $sp3f5c2c['sum']); } return Response::success($sp00ac62); } function edit(Request $sp13451b) { $this->validate($sp13451b, array('id' => 'sometimes|integer', 'name' => 'required|string', 'driver' => 'required|string', 'way' => 'required|string', 'config' => 'required|string', 'fee_system' => 'required|numeric')); $sp2e6adb = \App\Pay::find((int) $sp13451b->post('id')); if (!$sp2e6adb) { $sp2e6adb = new \App\Pay(); } $sp2e6adb->name = $sp13451b->post('name'); $sp2e6adb->comment = $sp13451b->post('comment'); $sp2e6adb->driver = $sp13451b->post('driver'); $sp2e6adb->way = $sp13451b->post('way'); $sp2e6adb->config = $sp13451b->post('config'); $sp2e6adb->enabled = (int) $sp13451b->post('enabled'); $sp2e6adb->fee_system = $sp13451b->post('fee_system'); $sp2e6adb->saveOrFail(); return Response::success(); } function comment(Request $sp13451b) { $this->validate($sp13451b, array('id' => 'required|integer')); $sp7df839 = (int) $sp13451b->post('id'); $sp2e6adb = \App\Pay::findOrFail($sp7df839); $sp2e6adb->comment = $sp13451b->post('comment'); $sp2e6adb->save(); return Response::success(); } function fee_system(Request $sp13451b) { $this->validate($sp13451b, array('id' => 'required|integer')); $sp7df839 = (int) $sp13451b->post('id'); $sp2e6adb = \App\Pay::findOrFail($sp7df839); $sp2e6adb->fee_system = $sp13451b->post('fee_system'); $sp2e6adb->saveOrFail(); return Response::success(); } function enable(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string', 'enabled' => 'required|integer|between:0,3')); $sp60bb7e = $sp13451b->post('ids'); $sp6a3468 = (int) $sp13451b->post('enabled'); \App\Pay::whereIn('id', explode(',', $sp60bb7e))->update(array('enabled' => $sp6a3468)); \App\Pay::flushCache(); return Response::success(); } function delete(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string')); $sp60bb7e = $sp13451b->post('ids'); \App\Pay::whereIn('id', explode(',', $sp60bb7e))->delete(); \App\Pay::flushCache(); return Response::success(); } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/PayWay.php b/app/Http/Controllers/Admin/PayWay.php
index 6e669c0fb..6c6ae92b8 100644
--- a/app/Http/Controllers/Admin/PayWay.php
+++ b/app/Http/Controllers/Admin/PayWay.php
@@ -1,2 +1,2 @@
input('current_page', 1); $sp8de1f1 = (int) $sp26e527->input('per_page', 20); $spcfdf85 = \App\PayWay::orderBy('sort')->where('type', $sp26e527->input('type')); $sp78cca0 = $sp26e527->input('search', false); $sp79e569 = $sp26e527->input('val', false); if ($sp78cca0 && $sp79e569) { if ($sp78cca0 == 'simple') { return Response::success($spcfdf85->get(array('id', 'name'))); } elseif ($sp78cca0 == 'id') { $spcfdf85->where('id', $sp79e569); } else { $spcfdf85->where($sp78cca0, 'like', '%' . $sp79e569 . '%'); } } $spc9cacd = $sp26e527->input('enabled'); if (strlen($spc9cacd)) { $spcfdf85->whereIn('enabled', explode(',', $spc9cacd)); } $spccc256 = $spcfdf85->paginate($sp8de1f1, array('*'), 'page', $sp81cf40); return Response::success($spccc256); } function edit(Request $sp26e527) { $this->validate($sp26e527, array('id' => 'required|integer', 'type' => 'required|integer|between:1,2', 'name' => 'required|string', 'sort' => 'required|integer', 'channels' => 'required|string', 'enabled' => 'required|integer|between:0,3')); $sp138835 = (int) $sp26e527->post('id'); $spe11c68 = \App\PayWay::find($sp138835); if (!$spe11c68) { if (\App\PayWay::where('name', $sp26e527->post('name'))->exists()) { return Response::fail('名称已经存在'); } $spe11c68 = new \App\PayWay(); } else { if (\App\PayWay::where('name', $sp26e527->post('name'))->where('id', '!=', $spe11c68->id)->exists()) { return Response::fail('名称已经存在'); } } $spe11c68->type = (int) $sp26e527->post('type'); $spe11c68->name = $sp26e527->post('name'); $spe11c68->sort = (int) $sp26e527->post('sort'); $spe11c68->img = $sp26e527->post('img'); $spe11c68->channels = @json_decode($sp26e527->post('channels')) ?? array(); $spe11c68->comment = $sp26e527->post('comment'); $spe11c68->enabled = (int) $sp26e527->post('enabled'); $spe11c68->saveOrFail(); return Response::success(); } function enable(Request $sp26e527) { $this->validate($sp26e527, array('ids' => 'required|string', 'enabled' => 'required|integer|between:0,3')); $sp892962 = $sp26e527->post('ids'); $spc9cacd = (int) $sp26e527->post('enabled'); \App\PayWay::whereIn('id', explode(',', $sp892962))->update(array('enabled' => $spc9cacd)); return Response::success(); } function sort(Request $sp26e527) { $this->validate($sp26e527, array('id' => 'required|integer')); $sp138835 = (int) $sp26e527->post('id'); $spe11c68 = \App\PayWay::findOrFail($sp138835); $spe11c68->sort = (int) $sp26e527->post('sort'); $spe11c68->save(); return Response::success(); } function delete(Request $sp26e527) { $this->validate($sp26e527, array('ids' => 'required|string')); $sp892962 = $sp26e527->post('ids'); \App\PayWay::whereIn('id', explode(',', $sp892962))->delete(); return Response::success(); } }
\ No newline at end of file
+namespace App\Http\Controllers\Admin; use App\Library\Response; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class PayWay extends Controller { function get(Request $sp13451b) { $sp26dcb6 = (int) $sp13451b->input('current_page', 1); $sp769c3e = (int) $sp13451b->input('per_page', 20); $sp8e2ceb = \App\PayWay::orderBy('sort')->where('type', $sp13451b->input('type')); $sp54e0e6 = $sp13451b->input('search', false); $sp59b33b = $sp13451b->input('val', false); if ($sp54e0e6 && $sp59b33b) { if ($sp54e0e6 == 'simple') { return Response::success($sp8e2ceb->get(array('id', 'name'))); } elseif ($sp54e0e6 == 'id') { $sp8e2ceb->where('id', $sp59b33b); } else { $sp8e2ceb->where($sp54e0e6, 'like', '%' . $sp59b33b . '%'); } } $sp6a3468 = $sp13451b->input('enabled'); if (strlen($sp6a3468)) { $sp8e2ceb->whereIn('enabled', explode(',', $sp6a3468)); } $spa67529 = $sp8e2ceb->paginate($sp769c3e, array('*'), 'page', $sp26dcb6); return Response::success($spa67529); } function edit(Request $sp13451b) { $this->validate($sp13451b, array('id' => 'required|integer', 'type' => 'required|integer|between:1,2', 'name' => 'required|string', 'sort' => 'required|integer', 'channels' => 'required|string', 'enabled' => 'required|integer|between:0,3')); $sp7df839 = (int) $sp13451b->post('id'); $sp8ba2fa = \App\PayWay::find($sp7df839); if (!$sp8ba2fa) { if (\App\PayWay::where('name', $sp13451b->post('name'))->exists()) { return Response::fail('名称已经存在'); } $sp8ba2fa = new \App\PayWay(); } else { if (\App\PayWay::where('name', $sp13451b->post('name'))->where('id', '!=', $sp8ba2fa->id)->exists()) { return Response::fail('名称已经存在'); } } $sp8ba2fa->type = (int) $sp13451b->post('type'); $sp8ba2fa->name = $sp13451b->post('name'); $sp8ba2fa->sort = (int) $sp13451b->post('sort'); $sp8ba2fa->img = $sp13451b->post('img'); $sp8ba2fa->channels = @json_decode($sp13451b->post('channels')) ?? array(); $sp8ba2fa->comment = $sp13451b->post('comment'); $sp8ba2fa->enabled = (int) $sp13451b->post('enabled'); $sp8ba2fa->saveOrFail(); return Response::success(); } function enable(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string', 'enabled' => 'required|integer|between:0,3')); $sp60bb7e = $sp13451b->post('ids'); $sp6a3468 = (int) $sp13451b->post('enabled'); \App\PayWay::whereIn('id', explode(',', $sp60bb7e))->update(array('enabled' => $sp6a3468)); return Response::success(); } function sort(Request $sp13451b) { $this->validate($sp13451b, array('id' => 'required|integer')); $sp7df839 = (int) $sp13451b->post('id'); $sp8ba2fa = \App\PayWay::findOrFail($sp7df839); $sp8ba2fa->sort = (int) $sp13451b->post('sort'); $sp8ba2fa->save(); return Response::success(); } function delete(Request $sp13451b) { $this->validate($sp13451b, array('ids' => 'required|string')); $sp60bb7e = $sp13451b->post('ids'); \App\PayWay::whereIn('id', explode(',', $sp60bb7e))->delete(); return Response::success(); } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/System.php b/app/Http/Controllers/Admin/System.php
index e7a5b6dcb..b21782372 100644
--- a/app/Http/Controllers/Admin/System.php
+++ b/app/Http/Controllers/Admin/System.php
@@ -1,2 +1,2 @@
has($sp2dce9c)) { \App\System::_set($sp2dce9c, $sp26e527->post($sp2dce9c)); } } } private function setMoney(Request $sp26e527, $sp440f25) { foreach ($sp440f25 as $sp2dce9c) { if ($sp26e527->has($sp2dce9c)) { \App\System::_set($sp2dce9c, (int) round($sp26e527->post($sp2dce9c) * 100)); } } } private function setInt(Request $sp26e527, $sp440f25) { foreach ($sp440f25 as $sp2dce9c) { if ($sp26e527->has($sp2dce9c)) { \App\System::_set($sp2dce9c, (int) $sp26e527->post($sp2dce9c)); } } } function setItem(Request $sp26e527) { $sp2dce9c = $sp26e527->post('name'); $sp1e3ccc = $sp26e527->post('value'); if (!$sp2dce9c || !$sp1e3ccc) { return Response::forbidden(); } \App\System::_set($sp2dce9c, $sp1e3ccc); return Response::success(); } function info(Request $sp26e527) { $sp96ba77 = array('app_name', 'app_title', 'app_url', 'app_url_api', 'keywords', 'description', 'shop_ann', 'shop_ann_pop', 'shop_qq', 'company', 'js_tj', 'js_kf'); $sp6ca843 = array('shop_inventory'); if ($sp26e527->isMethod('GET')) { $sp799f04 = array(); foreach ($sp96ba77 as $sp2dce9c) { $sp799f04[$sp2dce9c] = \App\System::_get($sp2dce9c); } foreach ($sp6ca843 as $sp2dce9c) { $sp799f04[$sp2dce9c] = (int) \App\System::_get($sp2dce9c); } return Response::success($sp799f04); } $sp69c1d6 = array('app_url' => Helper::format_url($_POST['app_url']), 'app_url_api' => Helper::format_url($_POST['app_url_api'])); $sp26e527->merge($sp69c1d6); $this->set($sp26e527, $sp96ba77); $this->setInt($sp26e527, $sp6ca843); return Response::success(); } function theme(Request $sp26e527) { if ($sp26e527->isMethod('GET')) { \App\ShopTheme::freshList(); return Response::success(array('themes' => \App\ShopTheme::get(), 'default' => \App\ShopTheme::defaultTheme()->name)); } $sp8f385e = \App\ShopTheme::whereName($sp26e527->post('shop_theme'))->firstOrFail(); \App\System::_set('shop_theme_default', $sp8f385e->name); $sp8f385e->config = @json_decode($sp26e527->post('theme_config')) ?? array(); $sp8f385e->saveOrFail(); return Response::success(); } function order(Request $sp26e527) { $sp440f25 = array('order_clean_unpay_open', 'order_clean_unpay_day'); if ($sp26e527->isMethod('GET')) { $sp799f04 = array(); foreach ($sp440f25 as $sp2dce9c) { $sp799f04[$sp2dce9c] = (int) \App\System::_get($sp2dce9c); } return Response::success($sp799f04); } $this->setInt($sp26e527, $sp440f25); return Response::success(); } function vcode(Request $sp26e527) { $sp96ba77 = array('vcode_driver', 'vcode_geetest_id', 'vcode_geetest_key'); $sp6ca843 = array('vcode_login_admin', 'vcode_shop_buy', 'vcode_shop_search'); if ($sp26e527->isMethod('GET')) { $sp799f04 = array(); foreach ($sp96ba77 as $sp2dce9c) { $sp799f04[$sp2dce9c] = \App\System::_get($sp2dce9c); } foreach ($sp6ca843 as $sp2dce9c) { $sp799f04[$sp2dce9c] = (int) \App\System::_get($sp2dce9c); } return Response::success($sp799f04); } $this->set($sp26e527, $sp96ba77); $this->setInt($sp26e527, $sp6ca843); return Response::success(); } function email(Request $sp26e527) { $sp96ba77 = array('mail_driver', 'mail_smtp_host', 'mail_smtp_port', 'mail_smtp_username', 'mail_smtp_password', 'mail_smtp_from_address', 'mail_smtp_from_name', 'mail_smtp_encryption', 'sendcloud_user', 'sendcloud_key'); $sp6ca843 = array('mail_send_order', 'mail_send_order_use_contact'); if ($sp26e527->isMethod('GET')) { $sp799f04 = array(); foreach ($sp96ba77 as $sp2dce9c) { $sp799f04[$sp2dce9c] = \App\System::_get($sp2dce9c); } foreach ($sp6ca843 as $sp2dce9c) { $sp799f04[$sp2dce9c] = (int) \App\System::_get($sp2dce9c); } return Response::success($sp799f04); } $this->set($sp26e527, $sp96ba77); $this->setInt($sp26e527, $sp6ca843); return Response::success(); } function sms(Request $sp26e527) { $sp96ba77 = array('sms_api_id', 'sms_api_key'); $sp6ca843 = array('sms_send_order', 'sms_price'); if ($sp26e527->isMethod('GET')) { $sp799f04 = array(); foreach ($sp96ba77 as $sp2dce9c) { $sp799f04[$sp2dce9c] = \App\System::_get($sp2dce9c); } foreach ($sp6ca843 as $sp2dce9c) { $sp799f04[$sp2dce9c] = (int) \App\System::_get($sp2dce9c); } return Response::success($sp799f04); } $this->set($sp26e527, $sp96ba77); $this->setInt($sp26e527, $sp6ca843); return Response::success(); } function storage(Request $sp26e527) { $sp96ba77 = array('storage_driver', 'storage_s3_access_key', 'storage_s3_secret_key', 'storage_s3_region', 'storage_s3_bucket', 'storage_oss_access_key', 'storage_oss_secret_key', 'storage_oss_bucket', 'storage_oss_endpoint', 'storage_oss_cdn_domain', 'storage_qiniu_domains_default', 'storage_qiniu_domains_https', 'storage_qiniu_access_key', 'storage_qiniu_secret_key', 'storage_qiniu_bucket', 'storage_qiniu_notify_url'); $sp6ca843 = array('storage_oss_is_ssl', 'storage_oss_is_cname'); if ($sp26e527->isMethod('GET')) { $sp799f04 = array(); foreach ($sp96ba77 as $sp2dce9c) { $sp799f04[$sp2dce9c] = \App\System::_get($sp2dce9c); } foreach ($sp6ca843 as $sp2dce9c) { $sp799f04[$sp2dce9c] = (int) \App\System::_get($sp2dce9c); } return Response::success($sp799f04); } $this->set($sp26e527, $sp96ba77); $this->set($sp26e527, $sp6ca843); return Response::success(); } function emailTest(Request $sp26e527) { $this->validate($sp26e527, array('to' => 'required')); $sp837c4b = $sp26e527->post('to'); try { $spa87332 = Mail::to($sp837c4b)->send(new \App\Mail\Test()); return Response::success($spa87332); } catch (\Throwable $sp7900a2) { \App\Library\LogHelper::setLogFile('mail'); \Log::error('Mail Test Exception:' . $sp7900a2->getMessage()); return Response::fail($sp7900a2->getMessage(), $sp7900a2); } } function orderClean(Request $sp26e527) { $this->validate($sp26e527, array('day' => 'required|integer|min:1')); $spc9ad9e = (int) $sp26e527->post('day'); \App\Order::where('status', \App\Order::STATUS_UNPAY)->where('created_at', '<', (new \Carbon\Carbon())->addDays(-$spc9ad9e))->delete(); return Response::success(); } }
\ No newline at end of file
+namespace App\Http\Controllers\Admin; use App\Library\Helper; use App\Library\Response; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Mail; class System extends Controller { private function set(Request $sp13451b, $sp48df9e) { foreach ($sp48df9e as $sp664a00) { if ($sp13451b->has($sp664a00)) { \App\System::_set($sp664a00, $sp13451b->post($sp664a00)); } } } private function setMoney(Request $sp13451b, $sp48df9e) { foreach ($sp48df9e as $sp664a00) { if ($sp13451b->has($sp664a00)) { \App\System::_set($sp664a00, (int) round($sp13451b->post($sp664a00) * 100)); } } } private function setInt(Request $sp13451b, $sp48df9e) { foreach ($sp48df9e as $sp664a00) { if ($sp13451b->has($sp664a00)) { \App\System::_set($sp664a00, (int) $sp13451b->post($sp664a00)); } } } function setItem(Request $sp13451b) { $sp664a00 = $sp13451b->post('name'); $sp9d1f75 = $sp13451b->post('value'); if (!$sp664a00 || !$sp9d1f75) { return Response::forbidden(); } \App\System::_set($sp664a00, $sp9d1f75); return Response::success(); } function info(Request $sp13451b) { $spac897a = array('app_name', 'app_title', 'app_url', 'app_url_api', 'keywords', 'description', 'shop_ann', 'shop_ann_pop', 'shop_qq', 'company', 'js_tj', 'js_kf'); $sp819aaf = array('shop_inventory'); if ($sp13451b->isMethod('GET')) { $sp0451dd = array(); foreach ($spac897a as $sp664a00) { $sp0451dd[$sp664a00] = \App\System::_get($sp664a00); } foreach ($sp819aaf as $sp664a00) { $sp0451dd[$sp664a00] = (int) \App\System::_get($sp664a00); } return Response::success($sp0451dd); } $sp8042f4 = array('app_url' => Helper::format_url($_POST['app_url']), 'app_url_api' => Helper::format_url($_POST['app_url_api'])); $sp13451b->merge($sp8042f4); $this->set($sp13451b, $spac897a); $this->setInt($sp13451b, $sp819aaf); return Response::success(); } function theme(Request $sp13451b) { if ($sp13451b->isMethod('GET')) { \App\ShopTheme::freshList(); return Response::success(array('themes' => \App\ShopTheme::get(), 'default' => \App\ShopTheme::defaultTheme()->name)); } $sp573d3e = \App\ShopTheme::whereName($sp13451b->post('shop_theme'))->firstOrFail(); \App\System::_set('shop_theme_default', $sp573d3e->name); $sp573d3e->config = @json_decode($sp13451b->post('theme_config')) ?? array(); $sp573d3e->saveOrFail(); return Response::success(); } function order(Request $sp13451b) { $sp48df9e = array('order_clean_unpay_open', 'order_clean_unpay_day'); if ($sp13451b->isMethod('GET')) { $sp0451dd = array(); foreach ($sp48df9e as $sp664a00) { $sp0451dd[$sp664a00] = (int) \App\System::_get($sp664a00); } return Response::success($sp0451dd); } $this->setInt($sp13451b, $sp48df9e); return Response::success(); } function vcode(Request $sp13451b) { $spac897a = array('vcode_driver', 'vcode_geetest_id', 'vcode_geetest_key'); $sp819aaf = array('vcode_login_admin', 'vcode_shop_buy', 'vcode_shop_search'); if ($sp13451b->isMethod('GET')) { $sp0451dd = array(); foreach ($spac897a as $sp664a00) { $sp0451dd[$sp664a00] = \App\System::_get($sp664a00); } foreach ($sp819aaf as $sp664a00) { $sp0451dd[$sp664a00] = (int) \App\System::_get($sp664a00); } return Response::success($sp0451dd); } $this->set($sp13451b, $spac897a); $this->setInt($sp13451b, $sp819aaf); return Response::success(); } function email(Request $sp13451b) { $spac897a = array('mail_driver', 'mail_smtp_host', 'mail_smtp_port', 'mail_smtp_username', 'mail_smtp_password', 'mail_smtp_from_address', 'mail_smtp_from_name', 'mail_smtp_encryption', 'sendcloud_user', 'sendcloud_key'); $sp819aaf = array('mail_send_order', 'mail_send_order_use_contact'); if ($sp13451b->isMethod('GET')) { $sp0451dd = array(); foreach ($spac897a as $sp664a00) { $sp0451dd[$sp664a00] = \App\System::_get($sp664a00); } foreach ($sp819aaf as $sp664a00) { $sp0451dd[$sp664a00] = (int) \App\System::_get($sp664a00); } return Response::success($sp0451dd); } $this->set($sp13451b, $spac897a); $this->setInt($sp13451b, $sp819aaf); return Response::success(); } function sms(Request $sp13451b) { $spac897a = array('sms_api_id', 'sms_api_key'); $sp819aaf = array('sms_send_order', 'sms_price'); if ($sp13451b->isMethod('GET')) { $sp0451dd = array(); foreach ($spac897a as $sp664a00) { $sp0451dd[$sp664a00] = \App\System::_get($sp664a00); } foreach ($sp819aaf as $sp664a00) { $sp0451dd[$sp664a00] = (int) \App\System::_get($sp664a00); } return Response::success($sp0451dd); } $this->set($sp13451b, $spac897a); $this->setInt($sp13451b, $sp819aaf); return Response::success(); } function storage(Request $sp13451b) { $spac897a = array('storage_driver', 'storage_s3_access_key', 'storage_s3_secret_key', 'storage_s3_region', 'storage_s3_bucket', 'storage_oss_access_key', 'storage_oss_secret_key', 'storage_oss_bucket', 'storage_oss_endpoint', 'storage_oss_cdn_domain', 'storage_qiniu_domains_default', 'storage_qiniu_domains_https', 'storage_qiniu_access_key', 'storage_qiniu_secret_key', 'storage_qiniu_bucket', 'storage_qiniu_notify_url'); $sp819aaf = array('storage_oss_is_ssl', 'storage_oss_is_cname'); if ($sp13451b->isMethod('GET')) { $sp0451dd = array(); foreach ($spac897a as $sp664a00) { $sp0451dd[$sp664a00] = \App\System::_get($sp664a00); } foreach ($sp819aaf as $sp664a00) { $sp0451dd[$sp664a00] = (int) \App\System::_get($sp664a00); } return Response::success($sp0451dd); } $this->set($sp13451b, $spac897a); $this->set($sp13451b, $sp819aaf); return Response::success(); } function emailTest(Request $sp13451b) { $this->validate($sp13451b, array('to' => 'required')); $sp3cf1b0 = $sp13451b->post('to'); try { $sp00ac62 = Mail::to($sp3cf1b0)->send(new \App\Mail\Test()); return Response::success($sp00ac62); } catch (\Throwable $sp45222f) { \App\Library\LogHelper::setLogFile('mail'); \Log::error('Mail Test Exception:' . $sp45222f->getMessage()); return Response::fail($sp45222f->getMessage(), $sp45222f); } } function orderClean(Request $sp13451b) { $this->validate($sp13451b, array('day' => 'required|integer|min:1')); $spe595a6 = (int) $sp13451b->post('day'); \App\Order::where('status', \App\Order::STATUS_UNPAY)->where('created_at', '<', (new \Carbon\Carbon())->addDays(-$spe595a6))->delete(); return Response::success(); } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 1842f438c..7a9fe5ac8 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -1,2 +1,2 @@
validate($sp26e527, array('email' => 'required|email', 'password' => 'required|string')); if (System::_getInt('vcode_login_admin') === 1) { $this->validateCaptcha($sp26e527); } if ($this->hasTooManyLoginAttempts($sp26e527)) { $this->fireLockoutEvent($sp26e527); $sp0ab0ca = $this->limiter()->availableIn($this->throttleKey($sp26e527)); return response(array('message' => trans('auth.throttle', array('seconds' => $sp0ab0ca))), Response::HTTP_BAD_REQUEST); } if ($spce7aba = Auth::attempt($sp26e527->only('email', 'password'))) { $sp590011 = Auth::getUser(); $sp350e6d = Helper::getIP() ?? $sp26e527->ip(); $sp590011->logs()->create(array('action' => \App\Log::ACTION_LOGIN, 'ip' => $sp350e6d, 'address' => (new QQWry())->getLocation($sp350e6d))); return response($this->getUserInfo()->getContent(), Response::HTTP_CREATED, array('Authorization' => 'Bearer ' . $spce7aba)); } LOGIN_FAILED: $this->incrementLoginAttempts($sp26e527); return response(array('message' => trans('auth.failed')), Response::HTTP_BAD_REQUEST); } public function getUserInfo() { $sp590011 = Auth::getUser(); $sp590011->addHidden(array('created_at', 'updated_at')); $sp590011->append(array('last_login_at')); $sp590011->setAttribute('shop_name', config('app.name')); $sp7c95a4 = array(); $sp7c95a4['user'] = $sp590011; return response($sp7c95a4); } public function logout() { try { @Auth::logout(); } catch (\Throwable $sp7900a2) { } return response(array()); } }
\ No newline at end of file
+namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Library\Helper; use App\Library\QQWry\QQWry; use App\Library\WeChat; use App\System; use Illuminate\Http\Request; use Illuminate\Foundation\Auth\ThrottlesLogins; use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; class LoginController extends Controller { use ThrottlesLogins; protected function username() { return 'email'; } public function login(Request $sp13451b) { $this->validate($sp13451b, array('email' => 'required|email', 'password' => 'required|string')); if (System::_getInt('vcode_login_admin') === 1) { $this->validateCaptcha($sp13451b); } if ($this->hasTooManyLoginAttempts($sp13451b)) { $this->fireLockoutEvent($sp13451b); $spf57d82 = $this->limiter()->availableIn($this->throttleKey($sp13451b)); return response(array('message' => trans('auth.throttle', array('seconds' => $spf57d82))), Response::HTTP_BAD_REQUEST); } if ($sp61eea9 = Auth::attempt($sp13451b->only('email', 'password'))) { $spc33961 = Auth::getUser(); $sp751445 = Helper::getIP() ?? $sp13451b->ip(); $spc33961->logs()->create(array('action' => \App\Log::ACTION_LOGIN, 'ip' => $sp751445, 'address' => (new QQWry())->getLocation($sp751445))); return response($this->getUserInfo()->getContent(), Response::HTTP_CREATED, array('Authorization' => 'Bearer ' . $sp61eea9)); } LOGIN_FAILED: $this->incrementLoginAttempts($sp13451b); return response(array('message' => trans('auth.failed')), Response::HTTP_BAD_REQUEST); } public function getUserInfo() { $spc33961 = Auth::getUser(); $spc33961->addHidden(array('created_at', 'updated_at')); $spc33961->append(array('last_login_at')); $spc33961->setAttribute('shop_name', config('app.name')); $spfae0a4 = array(); $spfae0a4['user'] = $spc33961; return response($spfae0a4); } public function logout() { try { @Auth::logout(); } catch (\Throwable $sp45222f) { } return response(array()); } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index 5e5c98318..4805d2968 100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -1,2 +1,2 @@
validate($sp26e527, array('token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6')); $sp7c95a4 = Password::broker()->reset($sp26e527->only('email', 'password', 'password_confirmation', 'token'), function ($sp590011, $sp4b3985) { $this->resetPassword($sp590011, $sp4b3985); }); return $sp7c95a4 == Password::PASSWORD_RESET ? response(array()) : response(array('message' => trans($sp7c95a4)), 400); } public function change(Request $sp26e527) { $this->validate($sp26e527, array('old' => 'required|string', 'password' => 'required|string|min:6|max:32|confirmed')); $sp590011 = Auth::user(); if (!Hash::check($sp26e527->post('old'), $sp590011->password)) { return response(array('message' => '旧密码错误,请检查'), Response::HTTP_BAD_REQUEST); } $spce7aba = $this->resetPassword($sp590011, $sp26e527->post('password')); return response(array(), 200, array('Authorization' => 'Bearer ' . $spce7aba)); } public static function resetPassword($sp590011, $sp4b3985, $sp4b0ea9 = true) { $sp590011->password = Hash::make($sp4b3985); $sp590011->setRememberToken(time()); $sp590011->saveOrFail(); event(new PasswordReset($sp590011)); if ($sp4b0ea9) { return Auth::login($sp590011); } else { return true; } } }
\ No newline at end of file
+namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Auth\Events\PasswordReset; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Password; class ResetPasswordController extends Controller { public function reset(Request $sp13451b) { $this->validate($sp13451b, array('token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6')); $spfae0a4 = Password::broker()->reset($sp13451b->only('email', 'password', 'password_confirmation', 'token'), function ($spc33961, $spf35053) { $this->resetPassword($spc33961, $spf35053); }); return $spfae0a4 == Password::PASSWORD_RESET ? response(array()) : response(array('message' => trans($spfae0a4)), 400); } public function change(Request $sp13451b) { $this->validate($sp13451b, array('old' => 'required|string', 'password' => 'required|string|min:6|max:32|confirmed')); $spc33961 = Auth::user(); if (!Hash::check($sp13451b->post('old'), $spc33961->password)) { return response(array('message' => '旧密码错误,请检查'), Response::HTTP_BAD_REQUEST); } $sp61eea9 = $this->resetPassword($spc33961, $sp13451b->post('password')); return response(array(), 200, array('Authorization' => 'Bearer ' . $sp61eea9)); } public static function resetPassword($spc33961, $spf35053, $sp714a62 = true) { $spc33961->password = Hash::make($spf35053); $spc33961->setRememberToken(time()); $spc33961->saveOrFail(); event(new PasswordReset($spc33961)); if ($sp714a62) { return Auth::login($spc33961); } else { return true; } } }
\ No newline at end of file
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index e22f1c21a..370fcec44 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -1,2 +1,2 @@
validate($sp26e527, array('captcha.key' => 'required|string', 'captcha.code' => 'required|captcha_api:' . $sp26e527->input('captcha.key'))); } elseif ($spafe885 === 'geetest') { $this->validate($sp26e527, array('captcha.a' => 'required|string', 'captcha.b' => 'required|string', 'captcha.c' => 'required|string', 'captcha.d' => 'required|string')); if (!Geetest\API::verify($sp26e527->input('captcha.a'), $sp26e527->input('captcha.b'), $sp26e527->input('captcha.c'), $sp26e527->input('captcha.d'))) { throw \Illuminate\Validation\ValidationException::withMessages(array('captcha' => array(trans('validation.captcha')))); } } elseif ($spafe885 === 'recaptcha') { $this->validate($sp26e527, array('captcha.t' => 'required|string')); } } function authQuery(Request $sp26e527, $spcc5caa, $sp470feb = 'user_id', $spbeb4af = 'user_id') { return $spcc5caa::where($sp470feb, \Auth::id()); } protected function getUserId(Request $sp26e527, $spbeb4af = 'user_id') { return \Auth::id(); } protected function getUserIdOrFail(Request $sp26e527, $spbeb4af = 'user_id') { $sp699450 = self::getUserId($sp26e527, $spbeb4af); if ($sp699450) { return $sp699450; } else { throw new \Exception('参数缺少 ' . $spbeb4af); } } protected function getUser(Request $sp26e527) { return \Auth::getUser(); } protected function checkIsInMaintain() { if (System::_getInt('maintain') === 1) { $spad87ef = System::_get('maintain_info'); echo view('message', array('title' => '维护中', 'message' => $spad87ef)); die; } } protected function msg($spdbd7f3, $sp808668 = null, $spa85eb9 = null) { return view('message', array('message' => $spdbd7f3, 'title' => $sp808668, 'exception' => $spa85eb9)); } }
\ No newline at end of file
+namespace App\Http\Controllers; use App\System; use App\Library\Geetest; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Http\Response; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; public function getCaptcha() { $sp719660 = System::_get('vcode_driver'); if ($sp719660 === 'code') { return response(array()); } elseif ($sp719660 === 'geetest') { return response(Geetest\API::get()); } elseif ($sp719660 === 'recaptcha') { } return response(array(), Response::HTTP_NOT_IMPLEMENTED); } function validateCaptcha(Request $sp13451b) { $sp719660 = System::_get('vcode_driver'); if ($sp719660 === 'code') { $this->validate($sp13451b, array('captcha.key' => 'required|string', 'captcha.code' => 'required|captcha_api:' . $sp13451b->input('captcha.key'))); } elseif ($sp719660 === 'geetest') { $this->validate($sp13451b, array('captcha.a' => 'required|string', 'captcha.b' => 'required|string', 'captcha.c' => 'required|string', 'captcha.d' => 'required|string')); if (!Geetest\API::verify($sp13451b->input('captcha.a'), $sp13451b->input('captcha.b'), $sp13451b->input('captcha.c'), $sp13451b->input('captcha.d'))) { throw \Illuminate\Validation\ValidationException::withMessages(array('captcha' => array(trans('validation.captcha')))); } } elseif ($sp719660 === 'recaptcha') { $this->validate($sp13451b, array('captcha.t' => 'required|string')); } } function authQuery(Request $sp13451b, $sp7feaf7, $sp52a450 = 'user_id', $sp24de80 = 'user_id') { return $sp7feaf7::where($sp52a450, \Auth::id()); } protected function getUserId(Request $sp13451b, $sp24de80 = 'user_id') { return \Auth::id(); } protected function getUserIdOrFail(Request $sp13451b, $sp24de80 = 'user_id') { $spc2138c = self::getUserId($sp13451b, $sp24de80); if ($spc2138c) { return $spc2138c; } else { throw new \Exception('参数缺少 ' . $sp24de80); } } protected function getUser(Request $sp13451b) { return \Auth::getUser(); } protected function checkIsInMaintain() { if (System::_getInt('maintain') === 1) { $sp3d22f9 = System::_get('maintain_info'); echo view('message', array('title' => '维护中', 'message' => $sp3d22f9)); die; } } protected function msg($spcdf61d, $sp38de9c = null, $spc81dc7 = null) { return view('message', array('message' => $spcdf61d, 'title' => $sp38de9c, 'exception' => $spc81dc7)); } }
\ No newline at end of file
diff --git a/app/Http/Controllers/DevController.php b/app/Http/Controllers/DevController.php
index a587c6724..4a7228483 100644
--- a/app/Http/Controllers/DevController.php
+++ b/app/Http/Controllers/DevController.php
@@ -1,2 +1,2 @@
R
'; return true; } else { echo $sp0e3884 . ' ...... R
'; return false; } } else { if (file_exists($sp0e3884)) { return is_readable($sp0e3884); } } echo $sp0e3884 . ' ...... 文件不存在
'; return false; } private function check_writable_r($sp0e3884) { if (is_dir($sp0e3884)) { if (is_writable($sp0e3884)) { $sp968ada = scandir($sp0e3884); foreach ($sp968ada as $spe5d678) { if ($spe5d678 != '.' && $spe5d678 != '..') { if (!self::check_writable_r($sp0e3884 . '/' . $spe5d678)) { return false; } else { continue; } } } echo $sp0e3884 . ' ...... W
'; return true; } else { echo $sp0e3884 . ' ...... W
'; return false; } } else { if (file_exists($sp0e3884)) { return is_writable($sp0e3884); } } echo $sp0e3884 . ' ...... 文件不存在
'; return false; } private function checkPathPermission($sp618c15) { self::check_readable_r($sp618c15); self::check_writable_r($sp618c15); } public function install() { $sp31c259 = array(); @ob_start(); self::checkPathPermission(base_path('storage')); self::checkPathPermission(base_path('bootstrap/cache')); $sp31c259['permission'] = @ob_get_clean(); return view('install', array('var' => $sp31c259)); } public function test(Request $sp26e527) { } }
\ No newline at end of file
+namespace App\Http\Controllers; use App\System; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; class DevController extends Controller { private function check_readable_r($sp3558b8) { if (is_dir($sp3558b8)) { if (is_readable($sp3558b8)) { $sp1e6e2c = scandir($sp3558b8); foreach ($sp1e6e2c as $sp0879d3) { if ($sp0879d3 != '.' && $sp0879d3 != '..') { if (!self::check_readable_r($sp3558b8 . '/' . $sp0879d3)) { return false; } else { continue; } } } echo $sp3558b8 . ' ...... R
'; return true; } else { echo $sp3558b8 . ' ...... R
'; return false; } } else { if (file_exists($sp3558b8)) { return is_readable($sp3558b8); } } echo $sp3558b8 . ' ...... 文件不存在
'; return false; } private function check_writable_r($sp3558b8) { if (is_dir($sp3558b8)) { if (is_writable($sp3558b8)) { $sp1e6e2c = scandir($sp3558b8); foreach ($sp1e6e2c as $sp0879d3) { if ($sp0879d3 != '.' && $sp0879d3 != '..') { if (!self::check_writable_r($sp3558b8 . '/' . $sp0879d3)) { return false; } else { continue; } } } echo $sp3558b8 . ' ...... W
'; return true; } else { echo $sp3558b8 . ' ...... W
'; return false; } } else { if (file_exists($sp3558b8)) { return is_writable($sp3558b8); } } echo $sp3558b8 . ' ...... 文件不存在
'; return false; } private function checkPathPermission($spe59991) { self::check_readable_r($spe59991); self::check_writable_r($spe59991); } public function install() { $sp28bfaf = array(); @ob_start(); self::checkPathPermission(base_path('storage')); self::checkPathPermission(base_path('bootstrap/cache')); $sp28bfaf['permission'] = @ob_get_clean(); return view('install', array('var' => $sp28bfaf)); } public function test(Request $sp13451b) { } }
\ No newline at end of file
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 37ad1e1bb..5c77fd6b0 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -1,6 +1,6 @@
config('app.url'), 'company' => config('app.company'), 'name' => config('app.name'), 'logo' => config('app.logo'), 'functions' => array()); if (System::_getInt('product_manual')) { $sp799f04['functions'][] = 'product_manual'; } if (System::_getInt('mail_send_order')) { $sp799f04['functions'][] = 'mail_send_order'; if (System::_getInt('mail_send_order_use_contact')) { $sp799f04['functions'][] = 'mail_send_order_use_contact'; } } if (System::_getInt('sms_send_order')) { $sp799f04['functions'][] = 'sms_send_order'; $sp799f04['sms_send_order'] = array('sms_price' => System::_getInt('sms_price')); } $sp799f04['captcha'] = array('driver' => System::_get('vcode_driver'), 'config' => array(), 'scene' => array('shop' => array('buy' => System::_getInt('vcode_shop_buy'), 'search' => System::_getInt('vcode_shop_search')))); $sp5fb842 = Cookie::get('customer'); $sp75a3c7 = Cookie::make('customer', strlen($sp5fb842) !== 32 ? md5(str_random(16)) : $sp5fb842, 43200, null, null, false, false); $sp8f385e = null; if (isset($_GET['theme'])) { $sp8f385e = \App\ShopTheme::whereName($_GET['theme'])->first(); } if ($sp590011) { $sp799f04['shop'] = array('name' => config('app.name'), 'qq' => System::_get('shop_qq'), 'ann' => System::_get('shop_ann'), 'ann_pop' => System::_get('shop_ann_pop'), 'inventory' => System::_getInt('shop_inventory')); $spa37691 = false; if ($sp222f58) { $sp08b465->setVisible(array('id', 'name', 'password_open')); if ($sp08b465->password_open) { $sp08b465->setAttribute('password', $sp08b465->getTmpPassword()); $sp08b465->addVisible(array('password')); } $sp222f58->setForShop($sp590011); $sp799f04['categories'] = array($sp08b465); $sp799f04['product'] = $sp222f58; $sp2dce9c = $sp222f58->name . ' - ' . $sp799f04['name']; $sp7cb065 = $sp222f58->description; if (@$sp7cb065[0] === '{') { $sp66d84b = array(); preg_match_all('/"insert":"(.+?)"/', $sp7cb065, $sp66d84b); $sp7cb065 = str_replace('\\n', ' ', @join(' ', $sp66d84b[1])); } } elseif ($sp08b465) { $sp08b465->setVisible(array('id', 'name', 'password_open')); $sp799f04['categories'] = array($sp08b465); $sp799f04['product'] = null; $sp2dce9c = $sp08b465->name . ' - ' . $sp799f04['name']; $sp7cb065 = $sp08b465->name; } else { $sp8fc8fc = Category::where('user_id', $sp590011->id)->orderBy('sort')->where('enabled', 1)->get(); foreach ($sp8fc8fc as $sp08b465) { $sp08b465->setVisible(array('id', 'name', 'password_open')); } $sp799f04['categories'] = $sp8fc8fc; if (config('app.name') && config('app.title')) { $sp2dce9c = config('app.name') . ' - ' . config('app.title'); } else { $sp2dce9c = config('app.name') ? config('app.name') : config('app.title'); } $sp7cb065 = config('app.description'); $spa37691 = config('app.keywords'); } $sp799f04['pays'] = \App\PayWay::gets($sp590011, function ($spcfdf85) { $spcfdf85->where('type', \App\PayWay::TYPE_SHOP)->whereRaw('enabled&' . (Helper::is_mobile() ? \App\PayWay::ENABLED_MOBILE : \App\PayWay::ENABLED_PC) . '!=0'); }); if (!$sp8f385e) { $sp8f385e = \App\ShopTheme::defaultTheme(); } $sp799f04['theme'] = $sp590011->theme_config && isset($sp590011->theme_config[$sp8f385e->name]) ? $sp590011->theme_config[$sp8f385e->name] : $sp8f385e->config; $spa37691 = $spa37691 ? $spa37691 : preg_replace('/[、,;。!?]/', ', ', $sp2dce9c); } else { throw new \Exception('不可能到这'); } if (isset($sp799f04['theme']['background']) && $sp799f04['theme']['background'] === '内置1') { $sp799f04['theme']['background'] = Helper::b1_rand_background(); } if ($sp590011 && $sp222f58 === null) { if (@$sp799f04['theme']['list_type'] === 'list') { foreach ($sp799f04['categories'] as $spe137eb) { if (!$spe137eb->password_open) { $spe137eb->getProductsForShop(); } } } else { if (count($sp799f04['categories']) === 1) { $spe137eb = $sp799f04['categories'][0]; if (!$spe137eb->password_open) { $spe137eb->getProductsForShop(); } } } } return response()->view('shop_theme.' . $sp8f385e->name . '.index', array('name' => $sp2dce9c, 'title' => config('app.title'), 'keywords' => $spa37691, 'description' => $sp7cb065, 'js_tj' => System::_get('js_tj'), 'js_kf' => System::_get('js_kf'), 'config' => $sp799f04))->cookie($sp75a3c7); } public function shop_default(Request $sp26e527) { $this->checkIsInMaintain(); $sp787e69 = $sp26e527->get('tab', ''); return response()->redirectTo('/?theme=Material#/record?tab=' . $sp787e69); } private function _shop_404() { $this->checkIsInMaintain(); return view('message', array('title' => '404 NotFound', 'message' => '该链接不存在
-查询订单')); } public function shop_category($spbe1bf0) { $this->checkIsInMaintain(); $sp08b465 = Category::whereId(Helper::id_decode($spbe1bf0, Helper::ID_TYPE_CATEGORY))->with('user')->first(); if (!$sp08b465 && is_numeric($sp08b465)) { $sp08b465 = Category::whereId($spbe1bf0)->where('created_at', '<', \Carbon\Carbon::createFromDate(2019, 1, 1))->with('user')->first(); } if (!$sp08b465) { return $this->_shop_404(); } return $this->_shop_render($sp08b465->user, $sp08b465); } public function shop_product(Request $sp26e527, $sp6b2eb2) { $this->checkIsInMaintain(); $sp222f58 = Product::whereId(Helper::id_decode($sp6b2eb2, Helper::ID_TYPE_PRODUCT))->with(array('user', 'category'))->first(); if (!$sp222f58 && is_numeric($sp6b2eb2)) { $sp222f58 = Product::whereId($sp6b2eb2)->where('created_at', '<', \Carbon\Carbon::createFromDate(2019, 1, 1))->with(array('user', 'category'))->first(); } if (!$sp222f58 || !$sp222f58->category) { return $this->_shop_404(); } if ($sp222f58->password_open && $sp222f58->password !== $sp26e527->input('p')) { return view('message', array('title' => '当前商品需要密码', 'message' => ($sp26e527->has('p') ? '密码错误,请重新输入' : '请输入商品密码') . '
+namespace App\Http\Controllers; use App\Category; use App\Library\Helper; use App\Pay; use App\Product; use App\System; use App\User; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Http\Request; use App\Library\Geetest; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Cookie; class HomeController extends Controller { private function _shop_render($spc33961, $spd58c4f = null, $sp863814 = null) { $sp0451dd = array('url' => config('app.url'), 'company' => config('app.company'), 'name' => config('app.name'), 'logo' => config('app.logo'), 'functions' => array()); if (System::_getInt('product_manual')) { $sp0451dd['functions'][] = 'product_manual'; } if (System::_getInt('mail_send_order')) { $sp0451dd['functions'][] = 'mail_send_order'; if (System::_getInt('mail_send_order_use_contact')) { $sp0451dd['functions'][] = 'mail_send_order_use_contact'; } } if (System::_getInt('sms_send_order')) { $sp0451dd['functions'][] = 'sms_send_order'; $sp0451dd['sms_send_order'] = array('sms_price' => System::_getInt('sms_price')); } $sp0451dd['captcha'] = array('driver' => System::_get('vcode_driver'), 'config' => array(), 'scene' => array('shop' => array('buy' => System::_getInt('vcode_shop_buy'), 'search' => System::_getInt('vcode_shop_search')))); $sp9a876f = Cookie::get('customer'); $sp02f623 = Cookie::make('customer', strlen($sp9a876f) !== 32 ? md5(str_random(16)) : $sp9a876f, 43200, null, null, false, false); $sp573d3e = null; if (isset($_GET['theme'])) { $sp573d3e = \App\ShopTheme::whereName($_GET['theme'])->first(); } if ($spc33961) { $sp0451dd['shop'] = array('name' => config('app.name'), 'qq' => System::_get('shop_qq'), 'ann' => System::_get('shop_ann'), 'ann_pop' => System::_get('shop_ann_pop'), 'inventory' => System::_getInt('shop_inventory')); $sp2b9c94 = false; if ($sp863814) { $spd58c4f->setVisible(array('id', 'name', 'password_open')); if ($spd58c4f->password_open) { $spd58c4f->setAttribute('password', $spd58c4f->getTmpPassword()); $spd58c4f->addVisible(array('password')); } $sp863814->setForShop($spc33961); $sp0451dd['categories'] = array($spd58c4f); $sp0451dd['product'] = $sp863814; $sp664a00 = $sp863814->name . ' - ' . $sp0451dd['name']; $sp6273b8 = $sp863814->description; if (@$sp6273b8[0] === '{') { $sp998ad1 = array(); preg_match_all('/"insert":"(.+?)"/', $sp6273b8, $sp998ad1); $sp6273b8 = str_replace('\\n', ' ', @join(' ', $sp998ad1[1])); } } elseif ($spd58c4f) { $spd58c4f->setVisible(array('id', 'name', 'password_open')); $sp0451dd['categories'] = array($spd58c4f); $sp0451dd['product'] = null; $sp664a00 = $spd58c4f->name . ' - ' . $sp0451dd['name']; $sp6273b8 = $spd58c4f->name; } else { $sp8e63a5 = Category::where('user_id', $spc33961->id)->orderBy('sort')->where('enabled', 1)->get(); foreach ($sp8e63a5 as $spd58c4f) { $spd58c4f->setVisible(array('id', 'name', 'password_open')); } $sp0451dd['categories'] = $sp8e63a5; if (config('app.name') && config('app.title')) { $sp664a00 = config('app.name') . ' - ' . config('app.title'); } else { $sp664a00 = config('app.name') ? config('app.name') : config('app.title'); } $sp6273b8 = config('app.description'); $sp2b9c94 = config('app.keywords'); } $sp0451dd['pays'] = \App\PayWay::gets($spc33961, function ($sp8e2ceb) { $sp8e2ceb->where('type', \App\PayWay::TYPE_SHOP)->whereRaw('enabled&' . (Helper::is_mobile() ? \App\PayWay::ENABLED_MOBILE : \App\PayWay::ENABLED_PC) . '!=0'); }); if (!$sp573d3e) { $sp573d3e = \App\ShopTheme::defaultTheme(); } $sp0451dd['theme'] = $spc33961->theme_config && isset($spc33961->theme_config[$sp573d3e->name]) ? $spc33961->theme_config[$sp573d3e->name] : $sp573d3e->config; $sp2b9c94 = $sp2b9c94 ? $sp2b9c94 : preg_replace('/[、,;。!?]/', ', ', $sp664a00); } else { throw new \Exception('不可能到这'); } if (isset($sp0451dd['theme']['background']) && $sp0451dd['theme']['background'] === '内置1') { $sp0451dd['theme']['background'] = Helper::b1_rand_background(); } if ($spc33961 && $sp863814 === null) { if (@$sp0451dd['theme']['list_type'] === 'list') { foreach ($sp0451dd['categories'] as $spb1c766) { if (!$spb1c766->password_open) { $spb1c766->getProductsForShop(); } } } else { if (count($sp0451dd['categories']) === 1) { $spb1c766 = $sp0451dd['categories'][0]; if (!$spb1c766->password_open) { $spb1c766->getProductsForShop(); } } } } return response()->view('shop_theme.' . $sp573d3e->name . '.index', array('name' => $sp664a00, 'title' => config('app.title'), 'keywords' => $sp2b9c94, 'description' => $sp6273b8, 'js_tj' => System::_get('js_tj'), 'js_kf' => System::_get('js_kf'), 'config' => $sp0451dd))->cookie($sp02f623); } public function shop_default(Request $sp13451b) { $this->checkIsInMaintain(); $sp8e3b29 = $sp13451b->get('tab', ''); return response()->redirectTo('/?theme=Material#/record?tab=' . $sp8e3b29); } private function _shop_404() { $this->checkIsInMaintain(); return view('message', array('title' => '404 NotFound', 'message' => '该链接不存在
+查询订单')); } public function shop_category($sp046fc6) { $this->checkIsInMaintain(); $spd58c4f = Category::whereId(Helper::id_decode($sp046fc6, Helper::ID_TYPE_CATEGORY))->with('user')->first(); if (!$spd58c4f && is_numeric($spd58c4f)) { $spd58c4f = Category::whereId($sp046fc6)->where('created_at', '<', \Carbon\Carbon::createFromDate(2019, 1, 1))->with('user')->first(); } if (!$spd58c4f) { return $this->_shop_404(); } return $this->_shop_render($spd58c4f->user, $spd58c4f); } public function shop_product(Request $sp13451b, $spc63e58) { $this->checkIsInMaintain(); $sp863814 = Product::whereId(Helper::id_decode($spc63e58, Helper::ID_TYPE_PRODUCT))->with(array('user', 'category'))->first(); if (!$sp863814 && is_numeric($spc63e58)) { $sp863814 = Product::whereId($spc63e58)->where('created_at', '<', \Carbon\Carbon::createFromDate(2019, 1, 1))->with(array('user', 'category'))->first(); } if (!$sp863814 || !$sp863814->category) { return $this->_shop_404(); } if ($sp863814->password_open && $sp863814->password !== $sp13451b->input('p')) { return view('message', array('title' => '当前商品需要密码', 'message' => ($sp13451b->has('p') ? '密码错误,请重新输入' : '请输入商品密码') . '