灵符lingfu
F

fu.ling-lang.org

↓ 0 downloads

ทะเบียนแพ็กเกจ fu.ling-lang.org — เขียนด้วยภาษา Ling (ไทย) ทั้งหมด

Keywords registry, packages, web, ling, thai
lingfu install fu.ling-lang.org
LicenseApache-2.0 OR MIT
Authorsลิงลิน
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (22)

models/organizations.ling
// models/organizations.ling — โมเดลองค์กร

ฟังก์ชัน องค์กรสร้าง(ชื่อ, ชื่อแสดง) {
    ฐานข้อมูลรัน("INSERT OR IGNORE INTO organizations (name, display_name) VALUES (?1, ?2)", ชื่อ, ชื่อแสดง)
}

ฟังก์ชัน องค์กรทั้งหมด() {
    คืน ฐานข้อมูลถาม("SELECT id, name, display_name, bio, created_at FROM organizations ORDER BY name")
}

ฟังก์ชัน สมาชิกเพิ่ม(ไอดีองค์กร, ไอดีผู้ใช้, บทบาท) {
    ฐานข้อมูลรัน("INSERT OR IGNORE INTO org_members (org_id, user_id, role) VALUES (?1, ?2, ?3)", ไอดีองค์กร, ไอดีผู้ใช้, บทบาท)
}

← Back to index