Exemplo n.º 1
0
}
$now = date("Y-m-d H:i:s", time());
//date_default_timezone_set('PRC');
if ($endTime != null && strtotime($now) > strtotime($endTime)) {
    operation_fail("任务的送达时间" . $endTime . "不能小于当前时间" . $now);
} else {
    if ($endTime == null) {
        $endTime = $now;
    }
}
//if ($verifyCode == null) {
//	operation_fail("验证码不能为空");
//}
//$r = VerifyCodeModel::getCodeByPhone($phone);
//if ($r == null || $r['status'] != 0 || strtotime($r['time']) + VERIFY_CODE_VALID_TIME*60 < time() || $verifyCode != $r['code']) {
//	operation_fail('验证码不正确或者已失效');
//}
if ($reward < 0) {
    operation_fail('任务奖励不能为负数');
}
// 转成分
$reward = intval(100 * $reward);
//$r = TaskModel::publishTask($openId, $phone, $title, $desc, $reward, $now, $endTime, $address, $fromAddress, $lng, $lat);
$r = TaskModel::publishTask($publisher, $openId, $phone, $title, $desc, $reward, $now, $endTime, $address, '', $lng, $lat);
//VerifyCodeModel::deleteVerifyCode($phone);
if ($r) {
    json_put("result", $r);
} else {
    json_put("result", '发布任务失败');
}
json_output();