获取问诊订单消息内页基础数据
This commit is contained in:
@@ -87,23 +87,15 @@ class MessageNotice extends Model
|
||||
/**
|
||||
* 获取数据-分页
|
||||
* @param array $params
|
||||
* @param array $message_notice_system_params
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getMessageNoticePage(array $params, array $message_notice_system_params, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
public static function getMessageNoticePage(array $params, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
// 获取系统消息
|
||||
$message_notice_system = MessageNoticeSystem::select($fields)->where($message_notice_system_params)->orderBy('notice_send_time', 'desc');
|
||||
|
||||
$notice_system = self::select($fields)->where($params)->orderBy('notice_send_time', 'desc');
|
||||
|
||||
// 合并查询结果为一个虚拟表
|
||||
$query = $message_notice_system->union($notice_system);
|
||||
|
||||
$results = $query->orderBy('notice_send_time', 'desc')
|
||||
$results = self::where($params)
|
||||
->orderBy('notice_send_time')
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
|
||||
Reference in New Issue
Block a user