This commit is contained in:
cano
2024-03-08 00:58:23 +08:00
parent bebbee4184
commit b14c000bc3
25 changed files with 1681 additions and 8 deletions

View File

@ -0,0 +1,44 @@
<?php
namespace App\Models\Wallet\PlatformUser;
use App\Exceptions\ModelException;
use App\Models\Wallet\Base\WalletBaseModel;
class WalletPlatformUserWalletAddrHistoryModel extends WalletBaseModel
{
protected $table = 'wallet_platform_user_wallet_addr';
protected $primaryKey = 'id';
protected $fillable = [
'id',
'type',
'desc',
'platform_id',
'uid',
'username',
'nickname',
'wallet_addr_id',
'wallet_addr',
'currency_id',
'currency_code',
'created_at',
];
const TYPE_BIND = 1;
const TYPE_UNBIND = 2;
const TYPE = [
self::TYPE_BIND => '绑定',
self::TYPE_UNBIND => '解绑',
];
function addUserWalletAddrHistory($aItem,$type,$desc = ''): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder|array|null
{
if(!in_array($type,self::TYPE)) throw new ModelException('type error');
unset($aItem['id']);//去掉id(主键)
$aItem['type'] = $type;
$aItem['desc'] = $desc;
$sDateTime = date('Y-m-d H:i:s');
$aItem['created_at'] = $sDateTime;
return $this->addItem($aItem);
}
}