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.
38 lines
848 B
38 lines
848 B
<?php
|
|
/*
|
|
* @Descripttion:
|
|
* @version:
|
|
* @Author: GuaPi
|
|
* @Date: 2021-07-29 10:40:49
|
|
* @LastEditors: GuaPi
|
|
* @LastEditTime: 2021-08-09 17:41:22
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class InsideTradePair extends Model
|
|
{
|
|
// 币币交易交易对
|
|
|
|
protected $table = 'inside_trade_pair';
|
|
protected $primaryKey = 'pair_id';
|
|
protected $guarded = [];
|
|
|
|
public static function getCachedPairs()
|
|
{
|
|
return Cache::remember('pairs', 60, function () {
|
|
return self::query()->where('status', 1)->orderBy('sort', 'asc')->get()->groupBy('quote_coin_name')->toArray();
|
|
});
|
|
}
|
|
|
|
public function can_store()
|
|
{
|
|
if ($this->trade_status == 0) {
|
|
return '交易暂时关闭';
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|