Skip to content

Commit

Permalink
new release build of 3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Tai7sy committed Oct 12, 2021
1 parent 2efc21b commit 8bc77fd
Show file tree
Hide file tree
Showing 55 changed files with 132 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"3.14","md5":"028daf1575d827a9550017a07ba14ed8","url":"http:\/\/p.qpic.cn\/qqshihua\/0\/78bb0f663b168f3c9c29403b5d3a6e98\/0\/1.png","description":"","data":{"version":"3.14","description":""}}
{"version":"3.14","md5":"66a12d9772ff13377cdd7ea38c9c5b6d","url":"http:\/\/p.qpic.cn\/qqshihua\/0\/103f2857ed71bb93049e9005a8532996\/0\/1.png","description":"","data":{"version":"3.14","description":""}}
2 changes: 1 addition & 1 deletion app/Card.php
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($spf93fb1, $spfb3e15, $sp915043, $sp24b3a3, $spb26d17, $spd6240b) { DB::statement('call add_cards(?,?,?,?,?,?)', array($spf93fb1, $spfb3e15, $sp915043, $sp24b3a3, $spb26d17, (int) $spd6240b)); } public static function _trash($spc64cdd) { DB::transaction(function () use($spc64cdd) { $sp331291 = clone $spc64cdd; $sp331291->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($spc894da) { foreach ($spc894da as $spbded80) { $sp94204a = \App\Product::where('id', $spbded80->product_id)->lockForUpdate()->first(); if ($sp94204a) { $sp94204a->count_all -= $spbded80->count_left; $sp94204a->saveOrFail(); } } }); $spc64cdd->delete(); return true; }); } public static function _restore($spc64cdd) { DB::transaction(function () use($spc64cdd) { $sp331291 = clone $spc64cdd; $sp331291->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($spc894da) { foreach ($spc894da as $spbded80) { $sp94204a = \App\Product::where('id', $spbded80->product_id)->lockForUpdate()->first(); if ($sp94204a) { $sp94204a->count_all += $spbded80->count_left; $sp94204a->saveOrFail(); } } }); $spc64cdd->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($sp3546ff, $sp2f9632, $spb2a0bb, $sp671ce9, $sp114fae, $sp4b22b4) { DB::statement('call add_cards(?,?,?,?,?,?)', array($sp3546ff, $sp2f9632, $spb2a0bb, $sp671ce9, $sp114fae, (int) $sp4b22b4)); } public static function _trash($sp90af04) { DB::transaction(function () use($sp90af04) { $sp31ddba = clone $sp90af04; $sp31ddba->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp4f3a9b) { foreach ($sp4f3a9b as $sp9f8d97) { $spd39704 = \App\Product::where('id', $sp9f8d97->product_id)->lockForUpdate()->first(); if ($spd39704) { $spd39704->count_all -= $sp9f8d97->count_left; $spd39704->saveOrFail(); } } }); $sp90af04->delete(); return true; }); } public static function _restore($sp90af04) { DB::transaction(function () use($sp90af04) { $sp31ddba = clone $sp90af04; $sp31ddba->selectRaw('`product_id`,SUM(`count_all`-`count_sold`) as `count_left`')->groupBy('product_id')->orderByRaw('`product_id`')->chunk(100, function ($sp4f3a9b) { foreach ($sp4f3a9b as $sp9f8d97) { $spd39704 = \App\Product::where('id', $sp9f8d97->product_id)->lockForUpdate()->first(); if ($spd39704) { $spd39704->count_all += $sp9f8d97->count_left; $spd39704->saveOrFail(); } } }); $sp90af04->restore(); return true; }); } }
2 changes: 1 addition & 1 deletion app/Category.php
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() { $sp3e77bf = Product::where('category_id', $this->id)->where('enabled', 1)->orderBy('sort')->get(); foreach ($sp3e77bf as $sp94204a) { $sp94204a->setForShop($this->user); } $this->addVisible(array('products')); $this->setAttribute('products', $sp3e77bf); return $sp3e77bf; } }
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() { $spf9727f = Product::where('category_id', $this->id)->where('enabled', 1)->orderBy('sort')->get(); foreach ($spf9727f as $spd39704) { $spd39704->setForShop($this->user); } $this->addVisible(array('products')); $this->setAttribute('products', $spf9727f); return $spf9727f; } }
4 changes: 2 additions & 2 deletions app/Console/Commands/ResetPassword.php
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 user@email.com'; public function __construct() { parent::__construct(); } public function handle() { $sp8daf27 = $this->argument('email'); if (!$sp8daf27) { $this->warn('please input the user\'s email
'); return false; } $sp0a324a = \App\User::where('email', $sp8daf27)->first(); if (!$sp0a324a) { $this->warn("can't find the user: {$sp8daf27} \nplease input the user's email\n"); return false; } $sp7e9f47 = $this->argument('password'); $sp0a324a->password = bcrypt($sp7e9f47); $sp0a324a->save(); $this->info("the password of '{$sp8daf27}' has been set to {$sp7e9f47}\n"); return true; } }
Usage: php artisan reset:password user@email.com'; public function __construct() { parent::__construct(); } public function handle() { $spbc6ccc = $this->argument('email'); if (!$spbc6ccc) { $this->warn('please input the user\'s email
'); return false; } $sp24cedd = \App\User::where('email', $spbc6ccc)->first(); if (!$sp24cedd) { $this->warn("can't find the user: {$spbc6ccc} \nplease input the user's email\n"); return false; } $sp7a8ba8 = $this->argument('password'); $sp24cedd->password = bcrypt($sp7a8ba8); $sp24cedd->save(); $this->info("the password of '{$spbc6ccc}' has been set to {$sp7a8ba8}\n"); return true; } }
Loading

0 comments on commit 8bc77fd

Please sign in to comment.