1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class OrderRefund extends Model
- {
- use SoftDeletes;
- protected $table='order_refund';
- protected $guarded=[];
- public function store(){
- return $this->HasOne(Store::class,'id','store_id')->withTrashed();
- }
- public function user(){
- return $this->HasOne(User::class,'id','user_id');
- }
- public function order(){
- return $this->HasOne(Order::class,'order_no','order_no');
- }
- public function getAccountAttribute($value){
- return round($value);
- }
- }
|