32 lines
737 B
PHP
32 lines
737 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Guide extends BaseModel
|
|
{
|
|
const STATUS_REVIEW = "REVIEW";
|
|
const STATUS_SCHEDULED = "SCHEDULED";
|
|
const STATUS_CANCELED = "CANCELED";
|
|
const STATUS_FINISHED = "FINISHED";
|
|
const SEND_GUIDE_MSG = 'send_guide_msg:';
|
|
use HasFactory;
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
|
}
|
|
|
|
public function order()
|
|
{
|
|
return $this->belongsTo(Order::class, 'order_id', 'id');
|
|
}
|
|
|
|
public function officialWechat()
|
|
{
|
|
return $this->hasOne(Wechat::class, 'user_id', 'user_id')->where('type', 'official');
|
|
}
|
|
}
|