修改评价

This commit is contained in:
2023-04-17 16:30:18 +08:00
parent abeb3f8776
commit 257701e6cd
2 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -50,7 +50,7 @@ class OrderEvaluation extends Model
*/
public static function getPage(array $params, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
{
$raw = self::where($params)->paginate($per_page, $fields, "page", $page);
$raw = self::where($params)->orderBy('created_at','desc')->paginate($per_page, $fields, "page", $page);
$data = array();
$data['current_page'] = $raw->currentPage();// 当前页码
$data['total'] = $raw->total();//数据总数
@@ -74,7 +74,9 @@ class OrderEvaluation extends Model
{
$raw = self::where($params)
->whereBetween('avg_score',$avg_score_params)
->orderBy('created_at','desc')
->paginate($per_page, $fields, "page", $page);
$data = array();
$data['current_page'] = $raw->currentPage();// 当前页码
$data['total'] = $raw->total();//数据总数