OrderLogistic.php 645 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App;
  3. use App\Services\DbOpenService;
  4. use App\Traits\ModelTimeFormat;
  5. use Illuminate\Database\Eloquent\Model;
  6. use App\Traits\ModelLogChanging;
  7. use Illuminate\Support\Facades\DB;
  8. class OrderLogistic extends Model
  9. {
  10. use ModelLogChanging;
  11. use ModelTimeFormat;
  12. protected $fillable = [
  13. 'id',
  14. 'order_id',
  15. 'order_package_id',
  16. 'status',
  17. 'code',
  18. 'created_at'
  19. ];
  20. public function isExist($id= 0)
  21. {
  22. if (empty($id)) return false;
  23. return OrderLogistic::query()->selectRaw('id,status')->where('order_id','=',$id)->orderByDesc('id')->first();
  24. }
  25. }