| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Builder;
- use Illuminate\Database\Eloquent\Model;
- /**
- * @method static Builder orderBy(string $string, string $string1)
- */use App\Traits\ModelTimeFormat;
- use App\Traits\ModelLogChanging;
- class Logistic extends Model
- {
- use ModelLogChanging;
- use ModelTimeFormat;
- protected $fillable = ['name','code',"type","mobile","remark","delivery_fee"];
- static function nameById($id){
- $logistic=Logistic::where('id',$id)->first();
- return $logistic?$logistic['name']:'';
- }
- public function ownerPriceExpresses()
- {
- return $this->belongsToMany(OwnerPriceExpress::class,"owner_price_express_logistic","logistic_id","owner_price_express_id");
- }
- }
|