OrderRefundW.php 551 B

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