admin/customer/search_customer.php DBエラー `OFFSET -10`
- Dominant language
- PHP
- Stars
- 92
- Forks
- 97
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
```
2026/07/04 22:13:21 [/admin/customer/search_customer.php] Fatal error(E_USER_ERROR): DB処理でエラーが発生しました。
SQL: [SELECT customer_id,name01,name02,kana01,kana02,sex,email,email_mobile,tel01,tel02,tel03,pref,status,update_date,mailmaga_flg FROM dtb_customer WHERE del_flg = 0 ORDER BY customer_id DESC LIMIT 10 OFFSET -10]
PlaceHolder: [NULL]
MDB2 Error: unknown error
_doQuery: [Error message: Could not execute statement]
[Last executed query: EXECUTE mdb2_statement_pgsql_37cc6aa5fbd5f79a75121ffd8eee188739a38b79b]
[Native message: ERROR: OFFSET must not be negative]
on [/var/www/app/data/class/SC_Query.php(1198)] from 172.18.0.1
login_id = admin(0)[1f3627bc]
/var/www/app/html/admin/customer/search_customer.php(28): LC_Page_Admin_Customer_SearchCustomer->process
/var/www/app/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php(55): LC_Page_Admin_Customer_SearchCustomer->action
/var/www/app/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php(80): LC_Page_Admin_Customer_SearchCustomer->lfDoSearch
/var/www/app/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php(123): SC_Helper_Customer::sfGetSearchData
/var/www/app/data/class/helper/SC_Helper_Customer.php(699): SC_Query->getAll
/var/www/app/data/class/SC_Query.php(348): SC_Query->execute
/var/www/app/data/class/SC_Query.php(1141): SC_Query->error
/var/www/app/data/class/SC_Query.php(1198): trigger_error
```
## 再現手順
1. 「受注管理>受注登録」画面「会員検索」ボタン。
1. ポップアップ画面で何も入力せず「検索を開始」ボタン。
1. システムエラー画面
679507388f85f581403a2be7c560a9162e328cf0
- PHPバージョン PHP 8.3.31
- DBバージョン PostgreSQL 18.1
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with data/class/helper/SC_Helper_Customer.php around line 699 and trace the call from data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php, using the reported no-input customer search to reproduce it. Confirm the resulting PostgreSQL query does not contain a negative OFFSET and that the empty search completes without a system error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100