链街Dcat后台
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

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\Model;
  5. class FinancialRecord extends Model
  6. {
  7. use HasDateTimeFormatter;
  8. protected $dateFormat = 'U';
  9. public static $status = [ 0 =>'异常' ,1=> '正常'];
  10. /**
  11. * 根据用户id创建不同模型
  12. * @param $user_id
  13. * @return string
  14. */
  15. public static function getFinancialRecordModel($user_id){
  16. if ($user_id){
  17. $buider = null;
  18. $index = $user_id % 5;
  19. $model_name = 'App\\Models\\'.'FinancialRecord'.$index;
  20. $buider = new $model_name();
  21. return $buider;
  22. }
  23. }
  24. }