function validate($mobile, $code) { $where['Phone'] = $mobile; $where['RandomCode'] = $code; $time = time() - 60 * 30; $where['UpdateTime'] = array("egt", $time); $info = M("phonevalidation")->where($where)->find(); if ($info) { $zhuce = new OrderAction(); $zhuce->AutoRegister($mobile); return "1"; } else { return "0"; } }