<?php
|
namespace app\api\logic;
|
|
use app\common\logic\Basic as BasicLogic;
|
use app\api\model\Message as ModelMessage;
|
|
/**
|
* 消息管理
|
*/
|
class Message extends BasicLogic
|
{
|
|
|
protected $model = null;
|
|
public function __construct()
|
{
|
parent::__construct();
|
|
$this->model = new ModelMessage();
|
}
|
|
/**
|
* 获取轮播图信息
|
*
|
* @return void
|
*/
|
public function getList($offset,$limit)
|
{
|
$where['status'] = 1;
|
$list = $this->model->where($where)->limit($offset,$limit)->order('id desc')->select();
|
if(empty($list)) return [];
|
return $list;
|
}
|
|
public static function getMessageTop()
|
{
|
return ModelMessage::where(['status'=>1])->limit(1)->order('id desc')->value('id');
|
}
|
|
|
}
|