GameScores.php 715 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Admin\Actions\Games;
  3. use App\Models\UserInfoModel;
  4. use Dcat\Admin\Admin;
  5. use Dcat\Admin\Grid\RowAction;
  6. use Dcat\Admin\Widgets\Modal;
  7. use Dcat\Admin\Widgets\Table;
  8. class GameScores extends RowAction
  9. {
  10. protected $title;
  11. protected $type;
  12. public function href(): string
  13. {
  14. if($this->type=='game'){
  15. return "/admin/game_user_scores?game_id=".$this->getKey();
  16. }else{
  17. return "/admin/game_user_scores?user_id=".$this->getKey();
  18. }
  19. }
  20. public function __construct(string $type = 'game')
  21. {
  22. $this->type = $type;
  23. $this->title = '<i class="feather icon-aperture"></i> '.trans('games.fields.game_record');
  24. }
  25. }