feat : driver

This commit is contained in:
2024-11-13 17:08:31 +08:00
parent 1077cdfcd8
commit 0b0fc8a1ef
7 changed files with 297 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ namespace App\Model;
use App\Constants\Common\SiteCode;
use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Collection;
use Hyperf\DbConnection\Model\Model;
/**
@@ -23,7 +24,8 @@ use Hyperf\DbConnection\Model\Model;
* @property string $expected_spend_time
* @property int $status
* @property int $image_id
* @property int $delivered_id
* @property int $delivered_id
* @property int $sequence
* @property string $create_time
* @property string $update_time
* @property int $is_del
@@ -81,4 +83,17 @@ class Site extends Model
{
return $this->where('id',$id)->where('is_del',SiteCode::SITE_NO_DEL)->first();
}
/**
* @param int $driverId
* @return Collection|array
*/
public function getSiteSequenceListByDriver(int $driverId): Collection|array
{
return $this
->where('is_del',SiteCode::SITE_NO_DEL)
->where('status',SiteCode::SITE_ENABLE)
->where('delivered_id',$driverId)
->get(['id','name', 'sequence']);
}
}