Answer the question
In order to leave comments, you need to log in
How to properly organize the receipt of a list of data with an additional field - quantity?
There is a request like this:
public function getAll($data) {
$params = [
'user_id' => $data->user_id,
'period' => $data->period,
'limit' => $data->limit,
'offset' => $data->offset,
];
return $this->db->row('SELECT id, amount, DATE_FORMAT(date, "%d.%m.%Y %H:%i:%s") as date FROM enrollments WHERE user_id = :user_id && status = 1 && UNIX_TIMESTAMP(date) > :period ORDER BY id DESC LIMIT :limit OFFSET :offset', $params);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question