/* $card_pic1 = uploadFile('cardPic1', 'cardPic1'); $card_pic2 = uploadFile('cardPic2', 'cardPic2'); $card_pic3 = uploadFile('cardPic', 'cardPic3'); $card_pic = $card_pic1 . "," . $card_pic2 . "," . $card_pic3;*/ $card_pic1 = param("cardPic1"); $card_pic2 = param("cardPic2"); $card_pic3 = param("cardPic3"); $card_pic = $card_pic1 . "," . $card_pic2 . "," . $card_pic3; //$card_pic = param("cardPic"); $inviter = param('inviter'); $accountExtra = AccountExtra::getInfo($openid); if ($accountExtra == null) { $r = AccountExtra::applyDelivery($openid, $icon, $address, $fullname, $idcard, $contact, $contact_phone, $card_pic, $inviter); if ($r) { $extra = AccountExtra::getInfo($openid); if ($extra != null) { $_SESSION['account_extra'] = $extra; } json_put("result", $r); json_output(); } else { operation_fail("申请失败,请重试"); } } else { if ($accountExtra['status'] == AccountExtra::STATUS_APPLYING) { operation_fail("你的快递资格已在申请中,请耐心等待审核"); } else { if ($accountExtra['status'] == AccountExtra::STATUS_ACCEPT) { operation_fail("你已经有快递资格了"); }
$code = param("code"); if ($code == null) { operation_fail("登陆失败"); } $weixinAPI = new WeixinAPI(); $json = $weixinAPI->getOpenid($code); session_start(); // 记录用户信息 $_SESSION['openid'] = $json['openid']; $_SESSION['access_token'] = $json; $openid = $json['openid']; $home_url = '../index.php'; $account = Account::getAccount($json['openid']); if ($account != null) { $_SESSION['account'] = $account; $extra = AccountExtra::getInfo($json['openid']); if ($extra != null) { $_SESSION['account_extra'] = $extra; } } else { $weixinAPI = new WeixinAPI(); $userInfo = $weixinAPI->getUserInfo($json['access_token'], $openid); Account::createAccount($openid, $userInfo['nickname']); $account = Account::getAccount($json['openid']); $_SESSION['account'] = $account; } //$home_url = '../h5/publish_task_page.php'; header('Location: ' . $home_url); json_put("session", $_SESSION['access_token']); json_output(); ?>
<?php require_once '../common/common.php'; $openId = $_SESSION['openid']; $taskId = param('taskId'); //$acceptPhone = param("acceptPhone"); $verifyCode = param("verifyCode"); if ($taskId == null) { operation_fail('任务ID不能为空'); } $account = Account::getAccount($openId); if ($account["user_scheme"] != 1) { operation_fail("请先去认证快递资格,然后才能接单"); } $accountExtra = AccountExtra::getInfo($openId); $acceptPhone = $accountExtra["contact_phone"]; $task = TaskModel::getTaskById($taskId); if ($task == null) { operation_fail("任务不存在"); } if ($task['status'] != TaskModel::STATUS_PUBLISHING) { operation_fail("任务不是发布中,不能接单"); } if ($task['publisher_openid'] == $openId) { operation_fail("不能接自己发布的单"); } //if ($verifyCode == null) { // operation_fail("验证码不能为空"); //} /*$r = VerifyCodeModel::getCodeByPhone($acceptPhone); if ($r == null ||