__('Type new'), 'video' => __('Type video'), 'live' => __('Type live'), 'want' => __('Type want'), 'activity' => __('Type activity'), 'show' => __('Type show')]; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function setImagesAttr($value) { return is_array($value) ? implode(',', $value) : $value; } public function setGoodsIdsAttr($value) { return is_array($value) ? implode(',', $value) : $value; } public function shop() { return $this->belongsTo('app\index\model\wanlshop\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); } }