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.
30 lines
682 B
30 lines
682 B
<?php
|
|
|
|
namespace App\Models;
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class FinancialRecord extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
protected $dateFormat = 'U';
|
|
|
|
public static $status = [ 0 =>'异常' ,1=> '正常'];
|
|
|
|
/**
|
|
* 根据用户id创建不同模型
|
|
* @param $user_id
|
|
* @return string
|
|
*/
|
|
public static function getFinancialRecordModel($user_id){
|
|
if ($user_id){
|
|
$buider = null;
|
|
$index = $user_id % 5;
|
|
$model_name = 'App\\Models\\'.'FinancialRecord'.$index;
|
|
$buider = new $model_name();
|
|
return $buider;
|
|
}
|
|
|
|
}
|
|
|
|
}
|