123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Builder;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\HasOne;
- class UserDataModifyLog extends Model {
- const UPDATED_AT = null;
- protected $table = 'user_data_modify_log';
-
- public function user(): HasOne {
- return $this->hasOne(User::class, 'id', 'user_id');
- }
-
- public function order(): HasOne {
- return $this->hasOne(Order::class, 'oid', 'order_id');
- }
- public function getBeforeAttribute($value) {
- return $this->attributes['before'] = flowAutoShow($value);
- }
- public function getAfterAttribute($value) {
- return $this->attributes['after'] = flowAutoShow($value);
- }
- }
|