255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'pro_cate_id' => 'Pro Cate ID', 'img_url' => 'Img Url', 'redirect_url' => 'Redirect Url', 'memo' => 'Memo', 'img_type' => 'Img Type', 'create_time' => 'Create Time', ]; } /** * Des:获取产品的轮播图 * Name: getProdImg * @param $pro_cate_id * @return array|ActiveRecord[] * @author 倪宗锋 */ public function getProdImg($pro_cate_id) { $select = [ 'img_url', 'img_type', 'img_type' ]; $where = [ 'and', ['=', 'img_type', 1], ['=', 'pro_cate_id', $pro_cate_id] ]; $getList = self::find()->select($select) ->where($where) ->asArray() ->all(); if (count($getList) == 0) { return []; } return $getList; } }