-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
124 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"2.95d","md5":"2451129b92d3e083db53a53494e61521","url":"https:\/\/github.com\/Tai7sy\/card-system\/releases\/download\/2.95d\/card_release.tar.gz"} | ||
{"version":"2.95e","md5":"6d665cc909072a6fb5a2216b1e7061f9","url":"https:\/\/github.com\/Tai7sy\/card-system\/releases\/download\/2.95e\/card_release.tar.gz"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
### 关于 | ||
|
||
> 当前版本: 2.95d | ||
> 当前版本: 2.95e | ||
> 支付网关: [card-gateway](https://github.com/Tai7sy/card-gateway) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?php | ||
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($spf5ae13, $sp1b83a8, $spe7b1c7, $sp732cf7, $spb73662, $spd3d838) { DB::statement('call add_cards(?,?,?,?,?,?)', array($spf5ae13, $sp1b83a8, $spe7b1c7, $sp732cf7, $spb73662, (int) $spd3d838)); } public static function _trash($spca8acc) { DB::transaction(function () use($spca8acc) { $spd2ab5e = clone $spca8acc; $spd2ab5e->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp43445b) { foreach ($sp43445b as $sp78bb46) { $sp9dfc99 = \App\Product::where('id', $sp78bb46->product_id)->lockForUpdate()->first(); if ($sp9dfc99) { $sp9dfc99->count_all -= $sp78bb46->count_left; $sp9dfc99->saveOrFail(); } } }); $spca8acc->delete(); return true; }); } public static function _restore($spca8acc) { DB::transaction(function () use($spca8acc) { $spd2ab5e = clone $spca8acc; $spd2ab5e->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp43445b) { foreach ($sp43445b as $sp78bb46) { $sp9dfc99 = \App\Product::where('id', $sp78bb46->product_id)->lockForUpdate()->first(); if ($sp9dfc99) { $sp9dfc99->count_all += $sp78bb46->count_left; $sp9dfc99->saveOrFail(); } } }); $spca8acc->restore(); return true; }); } } | ||
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($spdad372, $sp5d967e, $sp0fe7ec, $sp31859f, $sp3301fd, $sp0d89d4) { DB::statement('call add_cards(?,?,?,?,?,?)', array($spdad372, $sp5d967e, $sp0fe7ec, $sp31859f, $sp3301fd, (int) $sp0d89d4)); } public static function _trash($sp6cb35e) { DB::transaction(function () use($sp6cb35e) { $spb8b025 = clone $sp6cb35e; $spb8b025->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp1432b9) { foreach ($sp1432b9 as $sp4c126d) { $spe7d79d = \App\Product::where('id', $sp4c126d->product_id)->lockForUpdate()->first(); if ($spe7d79d) { $spe7d79d->count_all -= $sp4c126d->count_left; $spe7d79d->saveOrFail(); } } }); $sp6cb35e->delete(); return true; }); } public static function _restore($sp6cb35e) { DB::transaction(function () use($sp6cb35e) { $spb8b025 = clone $sp6cb35e; $spb8b025->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp1432b9) { foreach ($sp1432b9 as $sp4c126d) { $spe7d79d = \App\Product::where('id', $sp4c126d->product_id)->lockForUpdate()->first(); if ($spe7d79d) { $spe7d79d->count_all += $sp4c126d->count_left; $spe7d79d->saveOrFail(); } } }); $sp6cb35e->restore(); return true; }); } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?php | ||
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() { $spde3992 = Product::where('category_id', $this->id)->where('enabled', 1)->orderBy('sort')->get(); foreach ($spde3992 as $sp9dfc99) { $sp9dfc99->setForShop($this->user); } $this->addVisible(array('products')); $this->setAttribute('products', $spde3992); return $spde3992; } } | ||
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() { $sp6c9c2f = Product::where('category_id', $this->id)->where('enabled', 1)->orderBy('sort')->get(); foreach ($sp6c9c2f as $spe7d79d) { $spe7d79d->setForShop($this->user); } $this->addVisible(array('products')); $this->setAttribute('products', $sp6c9c2f); return $sp6c9c2f; } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
namespace App\Console\Commands; use Illuminate\Console\Command; class ResetPassword extends Command { protected $signature = 'reset:password {email} {password}'; protected $description = 'Reset the password of user | ||
Usage: php artisan reset:password [email protected]'; public function __construct() { parent::__construct(); } public function handle() { $sp667296 = $this->argument('email'); if (!$sp667296) { $this->warn('please input the user\'s email | ||
'); return false; } $spac34b1 = \App\User::where('email', $sp667296)->first(); if (!$spac34b1) { $this->warn("can't find the user: {$sp667296} \nplease input the user's email\n"); return false; } $spdc3802 = $this->argument('password'); $spac34b1->password = bcrypt($spdc3802); $spac34b1->save(); $this->info("the password of '{$sp667296}' has been set to {$spdc3802}\n"); return true; } } | ||
Usage: php artisan reset:password [email protected]'; public function __construct() { parent::__construct(); } public function handle() { $sp551dce = $this->argument('email'); if (!$sp551dce) { $this->warn('please input the user\'s email | ||
'); return false; } $spb14cf0 = \App\User::where('email', $sp551dce)->first(); if (!$spb14cf0) { $this->warn("can't find the user: {$sp551dce} \nplease input the user's email\n"); return false; } $sp42016f = $this->argument('password'); $spb14cf0->password = bcrypt($sp42016f); $spb14cf0->save(); $this->info("the password of '{$sp551dce}' has been set to {$sp42016f}\n"); return true; } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.