| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace Longyi\RewardPoints\Models;
- use Illuminate\Database\Eloquent\Model;
- use Webkul\Customer\Models\Customer;
- class RewardPointHistory extends Model
- {
- protected $table = 'mw_reward_point_history';
- protected $primaryKey = 'history_id';
- public $timestamps = false;
- protected $fillable = [
- 'customer_id',
- 'type_of_transaction',
- 'amount',
- 'balance',
- 'transaction_detail',
- 'transaction_time',
- 'history_order_id',
- 'expired_day',
- 'expired_time',
- 'point_remaining',
- 'check_time',
- 'status'
- ];
- protected $casts = [
- 'type_of_transaction' => 'integer',
- 'amount' => 'integer',
- 'balance' => 'integer',
- 'history_order_id' => 'integer',
- 'expired_day' => 'integer',
- 'point_remaining' => 'integer',
- 'check_time' => 'integer',
- 'status' => 'integer'
- ];
- protected $dates = ['transaction_time', 'expired_time'];
- const STATUS_PENDING = 0;
- const STATUS_COMPLETED = 1;
- const STATUS_CANCELLED = 2;
- const STATUS_EXPIRED = 3;
- public function customer()
- {
- return $this->belongsTo(Customer::class, 'customer_id');
- }
- }
|