ชื่อ API: getCustomersList

--- ### 📘 รายละเอียด API **Method:** `GET` **Endpoint:** `http://127.0.0.1/w6/getCustomersList.php` --- ### 📩 Request Parameters | Parameter | Type | Description | | ---------------- | ------ | --------------------------------------------------- | | keyCustomertName | string | คีย์เวิร์ดสำหรับค้นหาชื่อลูกค้า | --- ### 🧠 ตัวอย่าง Request ``` /w6/getCustomersList.php?keyCustomertName=supawat ``` --- ### ✅ ตัวอย่าง Response (สำเร็จ) ```json { "result": 1, "message": "success", "datalist": [ { "cus_id": "CUS01", "cus_name": "supawat boondee" } ] } ``` --- ### ⚠️ ตัวอย่าง Response (ไม่พบข้อมูล) ```json { "result": 0, "message": "No customer found" } ``` --- ### ❌ ตัวอย่าง Response (Error) ```json { "error": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'shop.customers' doesn't exist" } ``` --- ### 🔢 HTTP Codes | Code | Message | | ---- | ----------------------- | | 200 | OK | | 400 | Bad Request | | 404 | Not Found | | 500 | Internal Server Error | --- ### 📄 คำอธิบาย API นี้ใช้สำหรับค้นหารายชื่อลูกค้าในระบบ โดยสามารถค้นหาจากชื่อบางส่วนได้ ผลลัพธ์จะส่งกลับเฉพาะ **รหัสลูกค้า (cus_id)** และ **ชื่อ–นามสกุล (cus_name)** หากไม่พบข้อมูล จะส่งกลับข้อความ `"No customer found"` --- > 🖋️ **หมายเหตุ:** > ใช้เพื่อแสดงรายการลูกค้าสำหรับการเลือกหรือแก้ไขข้อมูลในระบบจัดการร้านค้า (Shop Management System)