xus admin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.1 KiB

<?php
/*
* @Descripttion:
* @version:
* @Author: GuaPi
* @Date: 2021-07-29 10:40:49
* @LastEditors: GuaPi
* @LastEditTime: 2021-08-09 17:41:05
*/
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2020/7/10
* Time: 16:43
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ContractPair extends Model
{
#合约交易对
protected $primaryKey = 'id';
protected $table = 'contract_pair';
protected $guarded = [];
protected $attributes = [
'margin_coin_id' => 1,
];
protected $casts = [
'lever_rage' => 'array',
];
// public function getLeverRageAttribute($v)
// {
// dd(json_decode(json_decode($v,true)),true);
// return blank($v) ? [] : json_decode($v,true);
// }
public function can_store()
{
if ($this->trade_status == 0) {
return '交易暂时关闭';
}
return true;
}
public function coin()
{
return $this->belongsTo(Coins::class, 'contract_coin_id', 'coin_id');
}
}