select count(*) as cnt from nfor_campaign where cp_approve='1' and cp_step='4' and cp_use='1' and cp_sdatetime <= '2026-04-08 15:33:39' and cp_recruit > cp_asign_count and ( (cp_asign_type = '1' and DATE(cp_pick_datetime) >= DATE('2026-04-08 15:33:39')) OR (cp_asign_type = '2' and cp_yoil_3 = '1') ) order by CASE WHEN cp_asign_type = '2' AND ( cp_day_order <= (SELECT COUNT(*) FROM nfor_review WHERE rv_cp_id = nfor_campaign.cp_id AND rv_step <> '10' AND rv_delete = '0' AND (DATE(rv_asign_datetime) = CURDATE() OR (rv_step = '11' AND rv_asign_datetime = '2099-12-31 23:59:59'))) OR CONCAT(LPAD(cp_h_s,2,'0'), ':', LPAD(cp_m_s,2,'0'), ':00') > '15:33:39' OR CONCAT(LPAD(cp_h_e,2,'0'), ':', LPAD(cp_m_e,2,'0'), ':00') < '15:33:39' ) THEN 1 WHEN cp_asign_type = '1' AND cp_recruit <= cp_asign_count THEN 1 ELSE 0 END,

1064 : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 16

error file : /campaign_list.php