optimize sql in in.php.

Signed-off-by: Ray Allen <ray@ray-Lenovo-IdeaPad-S400.(none)>