| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace Longyi\RewardPoints\Models;
- use Illuminate\Database\Eloquent\Model;
- use Webkul\Customer\Models\Customer;
- class GrowthValueCustomer extends Model
- {
- protected $table = 'mw_growth_value_customer';
- protected $fillable = [
- 'customer_id',
- 'growth_value',
- 'growth_level',
- 'first_order_completed_at',
- 'level_updated_at',
- 'growth_value_expires_at',
- ];
- protected $casts = [
- 'customer_id' => 'integer',
- 'growth_value' => 'integer',
- 'first_order_completed_at' => 'datetime',
- 'level_updated_at' => 'datetime',
- 'growth_value_expires_at' => 'datetime',
- ];
- public function customer()
- {
- return $this->belongsTo(Customer::class, 'customer_id');
- }
- public function history()
- {
- return $this->hasMany(GrowthValueHistory::class, 'customer_id', 'customer_id');
- }
- public function levelConfig()
- {
- return $this->hasOne(GrowthValueLevel::class, 'level_code', 'growth_level');
- }
- }
|