链街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.

28 lines
622 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
  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. /**
  10. * 根据用户id创建不同模型
  11. * @param $user_id
  12. * @return string
  13. */
  14. public static function getFinancialRecordModel($user_id){
  15. if ($user_id){
  16. $buider = null;
  17. $index = $user_id % 5;
  18. $model_name = 'App\\Models\\'.'FinancialRecord'.$index;
  19. $buider = new $model_name();
  20. return $buider;
  21. }
  22. }
  23. }