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

42 lines
940 B

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\SoftDeletes;
  5. use Illuminate\Database\Eloquent\Model;
  6. class LanzuServiceHorseman extends Model
  7. {
  8. use HasDateTimeFormatter;
  9. use SoftDeletes;
  10. protected $table = 'lanzu_service_horseman';
  11. protected $dateFormat = 'U';
  12. public static function getHorseman($marketId=null)
  13. {
  14. if ($marketId){
  15. $rows = self::where('market_id',$marketId)->get();
  16. }else{
  17. $rows = self::get();
  18. }
  19. $item = [];
  20. foreach ($rows as $row) {
  21. $item[$row->id] = $row->name;
  22. }
  23. return $item;
  24. }
  25. public static function getName($hid=null)
  26. {
  27. //获取骑手名称
  28. if ($hid){
  29. $horseman = LanzuServiceHorseman::find($hid);
  30. return $horseman->name;
  31. }else{
  32. return '--';
  33. }
  34. }
  35. }