OrderRefund.php 630 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class OrderRefund extends Model
  6. {
  7. use SoftDeletes;
  8. protected $table='order_refund';
  9. protected $guarded=[];
  10. public function store(){
  11. return $this->HasOne(Store::class,'id','store_id')->withTrashed();
  12. }
  13. public function user(){
  14. return $this->HasOne(User::class,'id','user_id');
  15. }
  16. public function order(){
  17. return $this->HasOne(Order::class,'order_no','order_no');
  18. }
  19. public function getAccountAttribute($value){
  20. return round($value);
  21. }
  22. }