/** * function description * * @param * @return void */ public function execute($request) { $id = $request->id; if (empty($id)) { header("Location: " . SP_URL_HOME); exit; } $data = Sp_Account_Attendee::getAttendeeBySn($id); if (empty($data)) { header("Location: " . SP_URL_HOME); exit; } if ($request->type == 'code') { include LIB_ROOT . 'third/phpqrcode/qrlib.php'; $errorCorrectionLevel = "L"; $matrixPointSize = "6"; QRcode::png($id, false, $errorCorrectionLevel, $matrixPointSize); } else { $active = Sp_Active_Active::getActiveById($data['activeId']); if (empty($active)) { $this->show404(); } $data['sn'] = $this->formatSn($data['signId']); $view = new Sp_View(); $view->assign('data', $data); $view->assign('active', $active); $view->display("attendee/code.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $arrary = array(); $id = $request->id; if (!is_numeric($id) || $id < 1) { return array('status' => '-5', 'msg' => '参数错误'); } $pageConfig = $_POST['pageConfig']; $pageItem = $_POST['pageItem']; $letter = array(); $letter['pageConfig'] = $pageConfig; $letter['pageItem'] = $pageItem; Sp_Letter_Letter::save($id, $letter); return array('status' => 0, 'msg' => '保存成功'); } else { $id = $request->id; if (!is_numeric($id) || $id < 1) { $this->show404(); } $letter = Sp_Letter_Letter::getLetterById($id); if (empty($letter)) { $this->show404(); } $active = Sp_Active_Active::getActiveById($letter['active_id'], $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign("id", $id); $view->assign("active", $active); $view->display("active/lettereditor.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $user = Sp_Account_User::current(); $aid = $request->id; if (!is_numeric($aid)) { $data = array(); $data['status'] = '-1'; $data['msg'] = '提交数据有误'; return $data; } // 当前页数 $nowPage = $request->page; empty($nowPage) && ($nowPage = 1); $limitRow = ($nowPage - 1) * self::PAGE_SIZE; // 分页数据 $array = Sp_Letter_Letter::getListByUser($user->id, $aid, $limitRow, self::PAGE_SIZE); $total = Sp_Letter_Letter::getTotalByUser($user->id, $aid); if (is_array($array) && count($array)) { $cry = new Util_Crypt3Des(); foreach ($array as $key => $value) { $id = $cry->encrypt($value['id']); $id = base64_encode($id); $array[$key]['sid'] = $id; } } // 分页 $pager = new Util_Pager($total, $nowPage, self::PAGE_SIZE); $pageString = $pager->renderNav(true); $data = array(); if (is_array($array)) { $data['status'] = '0'; $data['data'] = $array; $data['msg'] = ''; $data['pageString'] = $pageString; $data['nowtime'] = time(); } else { $data['status'] = '-1'; $data['data'] = array(); $data['msg'] = ''; } return $data; } else { $aid = $request->id; if (!is_numeric($aid)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($aid, $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign('active', $active); $view->assign('select', 'letter'); $view->display("letter/index.html"); } }
public function execute($request) { global $priv; $user = Sp_Account_User::current(); $user = Sp_Account_User::getUser($user->id, array('name', 'face', 'gender', 'province', 'city', 'area')); $uploadInfo = Util_FileUpload::getUpfileKey('huitong'); $view = new Sp_View(); $view->assign('user', $user); $view->assign('action', $priv); $view->assign('uploadInfo', $uploadInfo); $view->display("account/password.html"); }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $id = $request->id; if (!is_numeric($id)) { return array('status' => '-1', 'msg' => '参数错误'); } $letter = Sp_Letter_Letter::getLetterById($id); if (is_array($letter) && count($letter) > 0) { $letter['pageConfig'] = json_decode($letter['pageConfig'], TRUE); $letter['pageItem'] = json_decode($letter['pageItem'], TRUE); } if (!empty($letter)) { $active = Sp_Active_Active::getActiveById($letter['active_id']); if (empty($active)) { return array('status' => '-1', 'msg' => '数据有误'); } } return array('status' => '0', 'msg' => '获取成功', 'data' => $letter); } else { $jssdk = new Util_Jssdk("wx91f7f41fce0885bc", "YjlcfXNkdBYjlcfXNkdBYjlcfXNkdBYj"); $signPackage = $jssdk->GetSignPackage(); $id = $request->id; $id = base64_decode($id); $cry = new Util_Crypt3Des(); $id = $cry->decrypt($id); if (!is_numeric($id)) { $this->show404(); } $letter = Sp_Letter_Letter::getLetterById($id); if (empty($letter)) { $this->show404(); } $active = Sp_Active_Active::getActiveById($letter['active_id']); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign("letter", $letter); $view->assign('active', $active); $view->assign('signPackage', $signPackage); $view->display("letter/show.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { global $priv; if ($request->format == 'json') { } else { $view = new Sp_View(); $view->assign("action", $priv); $view->display("account/emailSuccess.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { global $priv; if ($request->format == 'json') { $arrary = array(); return $array; } else { $view = new Sp_View(); $view->assign("action", $priv); $view->display("account/emailAuth.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { /*$total = 90; $page = 8; $size = 10; $pager = new Util_Pager($total, $page, $size, "?page=%d&activeId=19"); $offset = $pager->getOffset(); $pager->setTotal($total); echo $pager->renderNav();*/ $model = new Sp_Account_Attendee(); $activeId = $request->activeId; $header = $model->GetTableHeaderByActiveId($activeId); if (false == $header) { $showHeader = $this->headers; } else { $showHeader = $this->getShowHeader($header); $showHeader = $model->getColumnFormArr($showHeader, 'title', 'field'); } $columns = array_keys($showHeader); array_push($columns, 'id'); $columns[] = 'status'; $columns[] = 'checkStatus'; $dataProvide = $model->AttendeeList($activeId, $columns); if ($request->format == 'json') { $arrary = array(); return $array; } else { /*$user = Sp_Account_User::current(); $user = Sp_Account_User::load($user->id);*/ $aid = $request->activeId; if (!is_numeric($aid)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($aid, $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign('active', $active); $view->assign('data', $dataProvide[1]); $view->assign('page', $dataProvide[0]); $view->assign('header', $showHeader); $view->assign('headerSet', json_encode($header)); $view->assign('activeId', $activeId); $view->assign('uploadInfo', $uploadInfo); $view->display("attendee/index.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { global $priv; if ($request->format == 'json') { if ($request->action == 'sendCode') { return $this->sendCode($request->mobile); } else { if ($request->action == 'authCode') { return $this->authCode($request->mobile, $request->code); } } return array('status' => 123, 'msg' => '参数错误'); } else { $view = new Sp_View(); $view->assign("action", $priv); $view->display("account/phoneAuth.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { return array(); } else { $id = $request->id; if (!is_numeric($id) || $id < 1) { $this->show404(); } $letter = Sp_Letter_Letter::getLetterById($id); if (empty($letter)) { $this->show404(); } $view = new Sp_View(); $view->assign("letter", $letter); $view->display("letter/createsuccess.html"); } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { return array(); } else { $id = $request->id; if (empty($id) || !is_numeric($id)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($id, $user->id); if (empty($active)) { $this->show404(); } $view = new Sp_View(); $view->assign("active", $active); $view->display("active/createsuccess.html"); } }
public function execute($request) { $view = new Sp_View(); $request = Request::current(); $order_sn = $request->c_order; $order_id = $request->c_orderid; $order_amount = $request->c_orderamount; $the_order = Sp_Shopping_Order::load($order_sn, 'odrcode'); if (!$the_order->ID or $the_order->ID != $order_id) { $view->assign('error_message', "错误的订单编号"); $view->out_404(); return; } $TruePr = $the_order["TruePr"]; $ComePr = $the_order["ComePr"]; $BackPr = $the_order["BackPr"]; $the_order['order_amount'] = round($TruePr - $ComePr + $BackPr, 2); $Payment = Sp_Payment::factory("alipay"); $params = array('order_id' => $order_id, 'order_sn' => $order_sn, 'order_amount' => $the_order['order_amount']); $link = $Payment->prepare($params); echo $link; }
public function execute($request) { global $priv; $user = Sp_Account_User::current(); $uploadInfo = Util_FileUpload::getUpfileKey('huitong'); $province = Sp_City_City::getProvince(); $view = new Sp_View(); $userInfo = Sp_Account_User::getUser($user->id, array('name', 'face', 'gender', 'province', 'city', 'area', 'mobile_status', 'email_status')); $auth = array('mobile_status' => $userInfo['mobile_status'], 'email_status' => $userInfo['email_status']); $view->assign('province', $province); $view->assign('action', $priv); $view->assign('auth', $auth); if (!empty($userInfo['province'])) { $city = Sp_City_City::getChlidById($userInfo['province']); $view->assign('city', $city); } if (!empty($userInfo['city'])) { $arrea = Sp_City_City::getChlidById($userInfo['city']); $view->assign('arrea', $arrea); } $view->assign('uploadInfo', $uploadInfo); $view->display("account/index.html"); }
/** * 支付完成后返回处理 * * @param array params * @return void */ public function complete($params) { $view = new Sp_View(); # 解析返回参数. $return = Sp_Payment_Yeepay_Common::getCallBackValue($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac); # 判断返回签名是否正确(True/False) $bRet = Sp_Payment_Yeepay_Common::CheckHmac($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac); # 以上代码和变量不需要修改. # 校验码正确. if ($bRet) { if ($r1_Code == "1") { # 需要比较返回的金额与商家数据库中订单的金额是否相等,只有相等的情况下才认为是交易成功. # 并且需要对返回的处理进行事务控制,进行记录的排它性处理,在接收到支付结果通知后,判断是否进行过业务逻辑处理,不要重复进行业务逻辑处理,防止对同一条交易重复发货的情况发生. $user_id = $r8_MP; //用户id $sn = trim($r6_Order); //订单号 $amount = floatval($r3_Amt); //金额 $recharge_info = Sp_Trade_Recharge::getBySn($sn); if (floatval($recharge_info['amount']) == $amount and $recharge_info['user_id'] == $user_id) { if ($r9_BType == "1") { #交易成功 在线支付页面返回 $request = Request::current(); if ($request->isMobile()) { Loader::redirect(SP_URL_WAP . 'moneyrecord.html'); } else { Loader::redirect(SP_URL_USER . 'moneyrecord.html'); } /* $ret = false; if($recharge_info['status'] < 1) { $param = array( 'id' => $recharge_info['id'], 'user_id' => $user_id, 'sn' => $sn, 'amount' => $amount, 'bank_sn' => $_REQUEST['ro_BankOrderId'], 'trd_sn' => $_REQUEST['r2_TrxId'], 'remark' => json_encode($_REQUEST) ); $ret = Sp_Trade_Tradeprocess::recharge($param); } if($ret) {//处理成功 $user = Sp_Account_User::getUserBase($user_id); //用户信息 $data = array( 'user_id' => $user_id, 'account' => $amount, 'user_name' => $user->data["username"], 'email' => $user->data['email'], 'realname' => $user->data["username"], 'phone' => $user->data['phone'], ); Sp_Message::send('recharge', $data);//发送消息 Loader::redirect(SP_URL_USER.'moneyrecord.html'); }elseif($recharge_info['status'] < 1) {//失败 echo '资金流处理失败!'; $body = print_r($_REQUEST,true); Sp_Admin_Mail::send('*****@*****.**', '资金流处理失败!', $body); }else{ $request = Request::current(); if($request->isMobile()) { Loader::redirect(SP_URL_WAP.'moneyrecord.html'); }else{ Loader::redirect(SP_URL_USER.'moneyrecord.html'); } }*/ } elseif ($r9_BType == "2") { #如果需要应答机制则必须回写流,以success开头,大小写不敏感. $ret = false; if ($recharge_info['status'] == 1) { echo "success"; } elseif ($recharge_info['status'] < 1) { $param = array('id' => $recharge_info['id'], 'user_id' => $user_id, 'sn' => $sn, 'amount' => $amount, 'bank_sn' => $_REQUEST['ro_BankOrderId'], 'trd_sn' => $_REQUEST['r2_TrxId'], 'remark' => json_encode($_REQUEST)); $amount_num = Sp_Trade_Recharge::getUserRechargeReport('WHERE status = 1 AND user_id=' . $user_id); $ret = Sp_Trade_Tradeprocess::recharge($param); if ($ret) { //处理成功 //首冲奖励 if ($amount_num == 0) { $active_send_info = array('uid' => $user_id, 'type' => 'first_recharge'); $client_active = MQClient::factory('active'); $client_active->send('activePrizeReset_new_register', $active_send_info); } $user = Sp_Account_User::getUserBase($user_id); //用户信息 $data = array('user_id' => $user_id, 'account' => $amount, 'user_name' => $user->data["username"], 'email' => $user->data['email'], 'realname' => $user->data["username"], 'phone' => $user->data['phone']); Sp_Message::send('recharge', $data); //发送消息 } else { echo '资金流处理失败!'; $body = print_r($_REQUEST, true); Sp_Admin_Mail::send('*****@*****.**', '资金流处理失败!', $body); } } } } } } else { $body = print_r($_REQUEST, true); Sp_Admin_Mail::send('*****@*****.**', '易宝支付失败(签名验证失败)', $body); $view->assign('error_message', "抱歉,您的支付没有成功,请重新支付,谢谢"); $view->out_404(); return; } }
/** * function description * * @param * @return void */ public function execute($request) { if ($request->format == 'json') { $id = $request->id; $activit_end = $request->activit_end; //活动结束时间 $activit_start = $request->activit_start; //活动开始时间 $address = $request->address; //详细地址 $arrea = $request->arrea; //区域 $city = $request->city; //城市 $enroll_end = $request->enroll_end; $enroll_start = $request->enroll_start; $is_audit = $request->is_audit; $is_enroll = $request->is_enroll; //是否需要审核 $province = $request->province; //省份 $title = $request->title; //标题 $thumbnail = $request->thumbnail; $enroll_num = $request->enroll_num; if (!is_numeric($id) || empty($title) || empty($activit_end) || empty($activit_end) || empty($address) || empty($province) || empty($city)) { return array('status' => '-5', 'msg' => '参数错误'); } if (!empty($is_enroll) && (empty($is_audit) || empty($enroll_start) || empty($enroll_end))) { return array('status' => '-5', 'msg' => '完善活动时间选项'); } if (strtotime($activit_end) < strtotime($activit_start)) { return array('status' => '-5', 'msg' => '举办结束日期不能小于开始日期'); } $user = Sp_Account_User::current(); $active = array(); $active['activit_end'] = strtotime($activit_end); $active['activit_start'] = strtotime($activit_start); $active['address'] = $address; $active['arrea'] = empty($arrea) ? 0 : $arrea; $active['city'] = $city; $active['province'] = $province; $active['title'] = $title; $active['user_id'] = $user->id; $active['thumbnail'] = $thumbnail; if (!empty($is_audit)) { if (strtotime($enroll_end) < strtotime($enroll_start)) { return array('status' => '-5', 'msg' => '报名结束日期不能小于开始日期'); } if (!is_numeric($enroll_num)) { return array('status' => '-5', 'msg' => '人数不能为空'); } $active['is_audit'] = 1; $active['is_enroll'] = 1; $active['enroll_start'] = strtotime($enroll_start); $active['enroll_end'] = strtotime($enroll_end); $active['enroll_num'] = $enroll_num; } else { $active['is_audit'] = 0; $active['is_enroll'] = 0; $active['enroll_start'] = 0; $active['enroll_end'] = 0; $active['enroll_num'] = 0; } $user = Sp_Account_User::current(); $ret = Sp_Active_Active::updateById($id, $active, $user->id); return array('status' => '0', 'msg' => '修改成功'); // if($ret){ // // }else{ // return array('status'=>'-1','msg'=>'修改失败'); // } } else { $aid = $request->id; if (!is_numeric($aid)) { $this->show404(); } $user = Sp_Account_User::current(); $active = Sp_Active_Active::getActiveById($aid, $user->id); if (empty($active)) { $this->show404(); } $province = Sp_City_City::getProvince(); $city = Sp_City_City::getChlidById($active['province']); $arrea = Sp_City_City::getChlidById($active['city']); $view = new Sp_View(); $uploadInfo = Util_FileUpload::getUpfileKey('huitong'); $view->assign('province', $province); $view->assign('city', $city); $view->assign('arrea', $arrea); $view->assign('uploadInfo', $uploadInfo); $view->assign('option', 'edit'); $view->assign('active', $active); $view->display("active/create.html"); } }
/** * 接收支付平台通知(同步) * * @param array params * @return void */ public function complete($params) { $view = new Sp_View(); # 解析返回参数. $version = $params["version"]; $charset = $params["charset"]; $language = $params["language"]; $signType = $params["signType"]; $tranCode = $params["tranCode"]; $merchantID = $params["merchantID"]; $merOrderNum = $params["merOrderNum"]; $tranAmt = $params["tranAmt"]; $feeAmt = $params["feeAmt"]; $frontMerUrl = $params["frontMerUrl"]; $backgroundMerUrl = $params["backgroundMerUrl"]; $tranDateTime = $params["tranDateTime"]; $tranIP = $params["tranIP"]; $respCode = $params["respCode"]; $msgExt = $params["msgExt"]; $orderId = $params["orderId"]; $gopayOutOrderId = $params["gopayOutOrderId"]; $bankCode = $params["bankCode"]; $tranFinishTime = $params["tranFinishTime"]; $merRemark1 = $params["merRemark1"]; $merRemark2 = $params["merRemark2"]; $signValue = $params["signValue"]; # 判断返回签名是否正确(True/False) $bRet = Sp_Payment_Gopay_HttpClient::CheckHmac($version, $tranCode, $merchantID, $merOrderNum, $tranAmt, $feeAmt, $tranDateTime, $frontMerUrl, $backgroundMerUrl, $orderId, $gopayOutOrderId, $tranIP, $respCode, '', self::$verficationCode, $signValue); if ($bRet) { if ($respCode == '0000') { $sn = trim($merOrderNum); //订单号 $amount = floatval($tranAmt); //金额 $recharge_info = Sp_Trade_Recharge::getBySn($sn); if (floatval($recharge_info['amount']) == $amount) { $ret = false; $amount_num = 1; if ($recharge_info['status'] == 1) { $ret = true; } elseif ($recharge_info['status'] < 1) { $amount_num = Sp_Trade_Recharge::getUserRechargeReport('WHERE status = 1 AND user_id=' . $recharge_info['user_id']); $param = array('id' => $recharge_info['id'], 'user_id' => $recharge_info['user_id'], 'sn' => $sn, 'amount' => $amount, 'bank_sn' => $_REQUEST['gopayOutOrderId'], 'trd_sn' => $_REQUEST['orderId'], 'remark' => json_encode($_REQUEST)); $ret = Sp_Trade_Tradeprocess::recharge($param); } if ($ret) { //处理成功 //首冲奖励 if ($amount_num == 0) { $active_send_info = array('uid' => $recharge_info['user_id'], 'type' => 'first_recharge'); $client_active = MQClient::factory('active'); $client_active->send('activePrizeReset_new_register', $active_send_info); } $user = Sp_Account_User::getUserBase($recharge_info['user_id']); //用户信息 $data = array('user_id' => $recharge_info['user_id'], 'account' => $amount, 'user_name' => $user->data["username"], 'email' => $user->data['email'], 'realname' => $user->data["username"], 'phone' => $user->data['phone']); Sp_Message::send('recharge', $data); //发送消息 $request = Request::current(); if ($request->isMobile()) { Loader::redirect(SP_URL_WAP . 'moneyrecord.html'); } else { Loader::redirect(SP_URL_USER . 'moneyrecord.html'); } } else { echo 'RespCode=9999|JumpURL='; $body = print_r($_REQUEST, true); Sp_Admin_Mail::send('*****@*****.**', '国付宝支付失败(数据库操作失败)', $body); } } } else { echo 'RespCode=9999|JumpURL='; $body = print_r($_REQUEST, true); Sp_Admin_Mail::send('*****@*****.**', '国付宝支付失败(国付宝操作失败)', $body); } } else { $body = print_r($_REQUEST, true); Sp_Admin_Mail::send('*****@*****.**', '国付宝支付失败(签名验证失败)', $body); $view->assign('error_message', "抱歉,您的支付没有成功,请重新支付,谢谢"); $view->out_404(); return; } }