$orderId = $data['order_id'] ?? null;
$phone = $data['phone'] ?? null;
$pointsToUse = $data['points_to_use'] ?? null;
- $comment = $data['comment'] ?? null;
- if (!$orderId || !$phone || !$pointsToUse) {
+ if (!$orderId || !$phone) {
return $this->asJson(['error' => ['code' => 400, 'message' => 'Недостаточно параметров']]);
}
$orderId = $data['order_id'] ?? null;
$phone = $data['phone'] ?? null;
$pointsToAdd = $data['points_to_add'] ?? null;
- $comment = $data['comment'] ?? null;
if (!$orderId || !$phone || !$pointsToAdd) {
return $this->asJson(['error' => ['code' => 400, 'message' => 'Недостаточно параметров']]);
$userBonus = new UsersBonus();
$userBonus->phone = $phone;
- $userBonus->name = $comment . sprintf(
- 'Возврат с покупки 10%%. Чек %s от %s. Сумма чека %s',
+ $userBonus->name = sprintf(
+ 'Возврат с покупки. Чек %s от %s. Сумма чека %s',
$sale->number,
date('d.m.Y H:i:s', strtotime($sale->date)),
$sale->summ