1
0

first commit

This commit is contained in:
2020-08-06 15:36:28 +08:00
commit fe5c11976c
12348 changed files with 1411979 additions and 0 deletions

41
app/Models/OrderLog.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
namespace App\Models;
use Auth;
class OrderLog extends Model
{
const UPDATED_AT = null;
public function setUserAttribute($user)
{
if (!is_null($user)) {
$this->attributes['user_id'] = $user->id ?? 0;
$this->attributes['user_type'] = get_class($user) ?? null;
}
}
/**
* 所属订单
* @Author:<C.Jason>
* @Date:2018-10-19T13:49:06+0800
* @return Order
*/
public function order()
{
return $this->belongsTo(Order::class);
}
/**
* 操作用户
* @Author:<C.Jason>
* @Date:2018-10-26T11:42:37+0800
* @return
*/
public function user()
{
return $this->morphTo();
}
}