__('新上架产品'), '在售产品' => __('在售产品'), '停售产品' => __('停售产品')]; } public function getAttributeTextAttr($value, $data) { $value = $value ? $value : (isset($data['attribute']) ? $data['attribute'] : ''); $list = $this->getAttributeList(); return isset($list[$value]) ? $list[$value] : ''; } public function company() { return $this->belongsTo('company','company_id','id',[],'LEFT')->setEagerlyType(0); } public function category() { return $this->belongsTo('category','category_id','id',[],'LEFT')->setEagerlyType(0); } }