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.
41 lines
938 B
41 lines
938 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class LanzuServiceHorseman extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'lanzu_service_horseman';
|
|
protected $dateFormat = 'U';
|
|
|
|
public static function getHorseman($marketId=null)
|
|
{
|
|
if ($marketId){
|
|
$rows = self::where('market_id',$marketId)->get();
|
|
}else{
|
|
$rows = self::get();
|
|
}
|
|
$item = [];
|
|
foreach ($rows as $row) {
|
|
$item[$row->id] = $row->name;
|
|
}
|
|
return $item;
|
|
}
|
|
|
|
public static function getName($hid=null)
|
|
{
|
|
//获取骑手名称
|
|
if ($hid){
|
|
$horseman = LanzuServiceHorseman::find($hid);
|
|
return $horseman->name;
|
|
}else{
|
|
return '-';
|
|
}
|
|
}
|
|
}
|