__('Gift_type 1'), '2' => __('Gift_type 2'), '3' => __('Gift_type 3'), '4' => __('Gift_type 4'), '5' => __('Gift_type 5')]; } public function getGiftTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['gift_type']) ? $data['gift_type'] : ''); $list = $this->getGiftTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function newbag() { return $this->belongsTo('app\admin\model\bag\Bag', 'bag_id', 'id', [], 'LEFT')->setEagerlyType(0); } }