You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
956 B
PHP
36 lines
956 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class SmsLogService
|
|
{
|
|
public function GetList($arr){
|
|
$result = [];
|
|
$page = $arr['page'] ?? 1;
|
|
$pagesize = $arr['pagesize'] ?? 15;
|
|
$searchInfo = $arr['searchInfo'] ?? [];
|
|
|
|
$query = DB::table('sms_log');
|
|
|
|
if (isset($searchInfo['phone']) && !empty($searchInfo['phone'])) {
|
|
$query = $query->where('phone', 'like', '%' . $searchInfo['phone'] . '%');
|
|
}
|
|
|
|
if (isset($searchInfo['status']) && !empty($searchInfo['status'])) {
|
|
$query = $query->where('status', $searchInfo['status']);
|
|
}
|
|
|
|
$count = $query->count();
|
|
$list = $query->orderBy('id', 'desc')
|
|
->skip(($page - 1) * $pagesize)
|
|
->take($pagesize)
|
|
->get();
|
|
|
|
$result['list'] = $list;
|
|
$result['count'] = $count;
|
|
|
|
return \Yz::Return(true, '获取成功', $result);
|
|
}
|
|
}
|