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

44 lines
995 B

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