| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class ReceiveRecord extends Model
- {
- use ModelLogChanging;
- protected $fillable = [
- "logistic_number",
- "logistic_id",
- "record_at",
- "warehouse_id",
- "delayed",
- ];
- public $timestamps = false;
- protected $primaryKey = "logistic_number";
- protected $keyType = "string";
- const DELAYED = [
- 0 => "等待",
- 1 => "正常",
- 2 => "延时",
- ];
- //快递
- public function logistic():BelongsTo
- {
- return $this->belongsTo(Logistic::class,"logistic_id","id");
- }
- //仓库
- public function warehouse():BelongsTo
- {
- return $this->belongsTo(Warehouse::class);
- }
- }
|