| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App;
- use App\Traits\ModelTimeFormat;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\LogModelChanging;
- class OrderFreeze extends Model
- {
- use LogModelChanging;
- use ModelTimeFormat;
- protected $fillable = [
- "status","logistic_id","province_id","city_id","location_id"
- ];
- const status=[
- 0 => "冻结",
- 1 => "解冻",
- ];
- public function logistic()
- { //承运商
- return $this->belongsTo(Logistic::class);
- }
- public function province()
- { //省
- return $this->belongsTo(Province::class);
- }
- public function city()
- { //市
- return $this->belongsTo(City::class);
- }
- public function location()
- { //区
- return $this->belongsTo(City::class)->where("type","3");
- }
- }
|