Item::getMainPicPath PHP Method

getMainPicPath() public method

得到商品主图路径
public getMainPicPath ( ) : type
return type
    public function getMainPicPath()
    {
        $images = ItemImg::model()->findAllByAttributes(array('item_id' => $this->item_id));
        foreach ($images as $k => $v) {
            if ($v['position'] == 0) {
                return '/upload/item/image/' . $v['url'];
            }
        }
    }