__('好评'), 1 => __('中评'), 2 => __('差评')]; } public function getStateTextAttr($value, $data) { $value = $value ? $value : (isset($data['state']) ? $data['state'] : ''); $list = $this->getStateList(); return isset($list[$value]) ? $list[$value] : ''; } public function getImagesAttr($value) { return $value ? explode(',', $value) : []; } protected function setImagesAttr($value) { return is_array($value) ? implode(',', $value) : $value; } public function user() { return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function goods() { return $this->belongsTo('app\api\model\wanlshop\Goods', 'goods_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function orderGoods() { return $this->belongsTo('app\api\model\wanlshop\OrderGoods', 'order_goods_id', 'id', [], 'LEFT')->setEagerlyType(0); } }