Logistic.php 458 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * @method static Builder orderBy(string $string, string $string1)
  7. */use App\Traits\ModelTimeFormat;
  8. class Logistic extends Model
  9. {
  10. use ModelTimeFormat;
  11. protected $fillable = ['name','code'];
  12. static function nameById($id){
  13. $logistic=Logistic::where('id',$id)->first();
  14. return $logistic?$logistic['name']:'';
  15. }
  16. }