feature/main20240421
郭嘉 7 months ago
parent c2dbcbc10d
commit c53cbdd3d5
  1. 3
      app/api/controller/Square.php

@ -65,6 +65,7 @@ class Square extends Controller
$pageSize = $this->request->param('pageSize');
$pageSize = empty($pageSize) ? 15 : $pageSize;
$useInfo = UserService::getCurrentLoginUser(true)->toArray();
$model = new squareModel;
$list = $model->getList($this->request->param(), intval($pageSize))->toArray();
@ -73,7 +74,7 @@ class Square extends Controller
$user = $model->where(['user_id' => $r['user_name']])->find()->toArray();
$modelLike = new squarelikeModel();
$like = $modelLike->where(['user_name' => $r['user_name']])->where(['square_id' => $r['square_id']])->find();
$like = $modelLike->where(['user_name' => $useInfo['user_id'],'square_id' => $r['square_id']])->find();
$res[$kr]['imgs'] = [];
$list['data'][$kr]['isLike'] = !empty($like) ? true : false;

Loading…
Cancel
Save