* @version : HUOSDK 8.0 */ namespace huo\controller\slide; use huo\controller\common\Base; use huo\logic\slide\SlideLogic; use huolib\status\AdsStatus; class Slide extends Base { protected $slide_model; public function __construct(SlideLogic $slide_model = null) { if (null === $slide_model) { $this->slide_model = new SlideLogic(); } else { $this->slide_model = $slide_model; } } /** * @param string $type * @param string $page * * @return array */ public function getList($type, $page = '') { if (empty($type)) { $_code = AdsStatus::ADSTYPE_EMPTY; return $this->huoError($_code, AdsStatus::getMsg($_code)); } $_map['type'] = $type; $_data = (new SlideLogic())->getList($_map, $page); if (is_numeric($_data)) { $_code = $_data; return $this->huoError($_code, AdsStatus::getMsg($_code)); } $_code = AdsStatus::NO_ERROR; return $this->huoSuccess($_code, AdsStatus::getMsg($_code), $_data); } }