public function actionSignupFinish() { try { $member = wanhunet::app()->member; $wechat_id = $member->getOtherInfo(MemberOther::TABLE_WECHAT); /** @var ShareGift $shateGift */ $shateGift = ShareGift::find()->where(['wechat_id' => $wechat_id->row])->one(); $limit = $shateGift->gift_limit; /** @var Invest $invest */ $invest = Invest::find()->where(["type" => Invest::TYPE_REG])->one(); if (InvestList::hasBuy($member->getId(), $invest->id)) { $investOrder = InvestList::find()->where(["member_id" => $member->getId()])->andWhere(['invest_id' => $invest->id])->andWhere(['status' => self::STATUS_PAYED])->one(); } else { $investOrder = new InvestList(); $investOrder->investment_sum = $limit; $investOrder->invest_id = $invest->id; $order = $invest->markOrderReg($investOrder); $investOrder->finishPay(new Event()); $shateGift->has_gift = ShareGift::HAS_GIFT; $shateGift->user_id = $member->id; $shateGift->save(); } return $this->view("signup_finish", ['info' => $investOrder]); } catch (\Exception $e) { // throw $e; return $this->redirect(Url::to(['site/signin'])); } }
public static function jiuxinGet() { $member = wanhunet::app()->member; $key = '988Kgho90LKH8ION9n9oH098hhnoph908Hh9'; $row = $member->getOtherInfo(MemberOther::TABLE_JIUXIN)->row; $j_user_id = explode('=|=', $row); $j_user_id = $j_user_id[1]; $w_user_id = $member->getId(); $data = ['j_user_id' => $j_user_id, 'w_user_id' => $w_user_id, 'sign' => sha1(md5($j_user_id . '&' . $w_user_id . '&' . $key))]; $uri = "http://test.jiuxindai.com/communication/jborrow/getuseraccount"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, 'root:jxd123456'); $return = curl_exec($ch); $return = str_replace('app', "", $return); curl_close($ch); $requests = json_decode($return, true); if (is_array($requests)) { return $requests; } else { throw new ErrorException(self::$errors[$return], ErrorCode::Jiuxin_auth); } }
public function actionCreateMenu() { $url = wanhunet::$app->urlManager; $wechat = wanhunet::app()->wechat; $auth = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx32814d588c44c17c&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base&state=123#wechat_redirect'; $aa = wanhunet::app()->wechat->createMenu([['type' => 'view', 'name' => '进入玖信贷', 'url' => $wechat->getOauth2AuthorizeUrl($url->createAbsoluteUrl(['site/enter']))], ['name' => '玖信特权', 'sub_button' => [['type' => 'view', 'name' => '主人发特权', 'url' => $wechat->getOauth2AuthorizeUrl($url->createAbsoluteUrl(['text/share']))], ['type' => 'view', 'name' => '注册拿特权', 'url' => $url->createAbsoluteUrl(['site/signup'])]]], ['name' => '玖信服务', 'sub_button' => [['type' => 'view', 'name' => '免登录功能', 'url' => $wechat->getOauth2AuthorizeUrl($url->createAbsoluteUrl(['wechat/login']))], ['type' => 'view', 'name' => '取消免登录', 'url' => $wechat->getOauth2AuthorizeUrl($url->createAbsoluteUrl(['wechat/off']))]]]]); var_dump($aa); }
public function init() { parent::init(); $this->_user = wanhunet::app()->member; if ($this->_user === null) { throw new ErrorException("请登陆"); } }
/** * Logs in a user using the provided username and password. * * @return boolean whether the user is logged in successfully */ public function login() { if ($this->validate()) { $rs = Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0); if (!is_null($this->open_id)) { $otherInfo = MemberOther::findOne(['user_id' => wanhunet::$app->user->getId(), 'table' => MemberOther::TABLE_WECHAT]); $otherInfo = $otherInfo == null ? new MemberOther() : $otherInfo; $otherInfo->table = MemberOther::TABLE_WECHAT; $otherInfo->row = $this->open_id; wanhunet::app()->member->setOtherInfo([$otherInfo]); } return $rs; } else { return false; } }
public function setInterest(Event $event) { /** @var InvestList $investList */ $investList = $event->sender; $investList->interest = $this->_calculatedInterest($investList); $investList->interest_status = InvestList::STATUS_ORDER_MADE; $invest = $investList->getInvestModel(); $invest_date = $invest->invest_date; $date = date('Y-m-d H:i:s ', $investList->pay_time); $investList->interest_time = strtotime($date . $invest_date . 'month'); //体验金上限增长 if ($investList->getType() == Invest::TYPE_MONEY) { $member = wanhunet::app()->member; $member->setIncExperienceMoneyInc($investList->investment_sum); if (($parent = $member->getParentModel()) !== null) { Asset::findOne($parent->id)->setIncExperienceMoneyInc($investList->investment_sum); } } }
public function acShare() { $errorAuth = ''; if (wanhunet::$app->user->isGuest) { Utils::ensureOpenId(); $url = wanhunet::$app->urlManager->createAbsoluteUrl(['share/index']); $errorAuth = '您未绑定微信账号'; if (($openId = wanhunet::$app->request->get('open_id')) !== null && ($model = MemberOther::findOne(['row' => $openId, 'table' => MemberOther::TABLE_WECHAT])) !== null) { /** @var MemberOther $model */ if (\Yii::$app->user->login($model->member, 3600 * 24 * 30)) { $url = wanhunet::$app->urlManager->createAbsoluteUrl(['share/index/' . wanhunet::app()->member->invitation]); $errorAuth = ''; } } } else { $url = wanhunet::$app->urlManager->createAbsoluteUrl(['share/index/' . wanhunet::app()->member->invitation]); } $url = wanhunet::app()->wechat->getOauth2AuthorizeUrl($url, 'authorize', 'snsapi_userinfo'); if (wanhunet::$app->request->get('qrcode', null) !== null) { Utils::qrcode(urldecode(wanhunet::$app->request->get('qrcode', urlencode($url)))); } return $this->view('share', ['url' => $url, 'errorAuth' => $errorAuth]); }
<?php $root = \wanhunet\wanhunet::getAlias('@web') . '/'; ?> <!DOCTYPE html> <html lang="en" data-ng-app="app"> <head> <meta charset="utf-8"/> <title>万虎网络 | 玖信贷微信</title> <meta name="description" content="app, web app, responsive, responsive layout, admin, admin panel, admin dashboard, flat, flat ui, ui kit, AngularJS, ui route, charts, widgets, components"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <link rel="stylesheet" href="<?php echo $root; ?> css/bootstrap.css" type="text/css"/> <link rel="stylesheet" href="<?php echo $root; ?> css/animate.css" type="text/css"/> <link rel="stylesheet" href="<?php echo $root; ?> css/font-awesome.min.css" type="text/css"/> <link rel="stylesheet" href="<?php echo $root; ?> css/simple-line-icons.css" type="text/css"/> <link rel="stylesheet" href="<?php echo $root; ?>
<?php $web = \wanhunet\wanhunet::getAlias("@web") . "/"; /** @var modules\invest\models\InvestList $info */ ?> <section> <div class="divoi"> <p class="text-c bag-accept"> <img class="mcenter" width="30px" height="30px" src="<?php echo $web; ?> images/accept.png" alt="成功"> <br>恭喜,领取成功! </p> </div> <div class="login_bt"> <p class="accept-con"> <img class="floatLeft" width="8px" height="8px" src="<?php echo $web; ?> images/circle.png" alt="">系统已为您自动购买<span><?php echo $info->investment_sum; ?> </span>元红包专用标</p> <p class="accept-con"> <img class="floatLeft" width="8px" height="8px" src="<?php echo $web; ?>
} ?> <section id="signup1" <?php echo !$vcodeError ? '' : 'style="display: none;"'; ?> > <div id="loadDiv" class="main" style="display: block;"> <div class="imeeShareBg clearFloat"> <div class="imeeShare" style="position: relative;"> <div class="RobOthersDiv" data-zoom="left: 34%;font-size:2.8em;" style="left: 34%;font-size:2.8em;"> ¥<?php echo $shareGift['gift_limit']; ?> </div> <img src="<?php echo \wanhunet\wanhunet::getAlias("@web") . '/'; ?> images/RobOthers.png"> </div> <p class="homelinkeapriDold" style="margin-top:1.9em;" data-zoom="margin-top:1.9em;"> <label class="RobMar" data-zoom="zoom:1.2;" style="zoom:1.2;">恭喜您</label> <b style="zoom:1.2;line-height: 1.5em;" data-zoom="zoom:1.2;line-height: 1.5em;"> 抢到 <span style="font-family: arial;color:#fac852;"><?php echo $shareGift['gift_limit']; ?> </span>元玖信理财本金红包 </b> <b style="zoom:1.2;line-height: 1.5em;" data-zoom="zoom:1.2;line-height: 1.5em;">投资收益 <span style="font-family: arial;color:#fac852;"><?php echo $num; ?>
/** * 首次验证手机 * @param $event */ public function setIncPhone($event) { /** @var Event $event */ /** @var \modules\member\models\Member $member */ $member = wanhunet::app()->member; if (($parentModel = Member::findByInvitation($member->parent_id)) !== null) { $asset = new Asset(['userId' => $parentModel->id]); $config = Config::getInstance(); $asset->setIncExperienceMoney($config->getProperty('setIncEM.invitationParent'), 'site/invitationParent'); if ($parentModel->findFriends(true) == 9) { $asset->setIncExperienceMoney($config->getProperty('setIncEM.invitationParentConut9'), 'site/invitationParentConut9'); $this->setIncEM(new Event(['name' => 'invitationConut9'])); } $asset->saveExperienceMoney(); } $this->setIncEM(new Event(['name' => 'verify_success_phone'])); $this->setIncEMMax(new Event(['name' => 'verify_success_phone'])); }
<?php use yii\helpers\Html; use yii\bootstrap\ActiveForm; /* @var $this yii\web\View */ /* @var $form yii\bootstrap\ActiveForm */ /* @var $model \common\models\LoginForm */ $this->title = 'Login'; $this->params['breadcrumbs'][] = $this->title; $web_path = \wanhunet\wanhunet::getAlias("@web") . "/"; ?> <!DOCTYPE html> <html lang="<?php echo Yii::$app->language; ?> "> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta charset="utf-8"/> <title>Login Page - wanhunet</title> <meta name="description" content="User login page"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/> <!-- bootstrap & fontawesome --> <link rel="stylesheet" href="<?php echo $web_path; ?> assets/css/bootstrap.min.css"/> <link rel="stylesheet" href="<?php echo $web_path;
public function payOrderWithBalance(Order $order) { /** @var \modules\invest\models\InvestList $order */ $this->ensurePayPass(); $price = $order->getPrice(); $orderStatus = $order->getStatus(); if ($orderStatus != Order::STATUS_UNPAYED) { throw new ErrorException('账单已支付', ErrorCode::Pay_had_pay); } $member = wanhunet::app()->member; if ($order->getType() == Invest::TYPE_MONEY) { $orderName = mb_substr($order->getName(), 0, 5, "utf-8"); if (mb_strlen($order->getName(), "utf-8") > 5) { $orderName .= "..."; } $orderName .= "投资"; $member->setDecMoney($price, $orderName); $save = $member->saveMoney(); if ($save) { return $order->finishPay(new Event()); } } else { $member->setDecExperienceMoney($price); $save = $member->saveExperienceMoney(); $order->finishPay(new Event()); } return $save; }
public function actionOwnProfit() { $member = wanhunet::app()->member; $model = InvestList::find()->where(['member_id' => $member->getId()])->andWhere(['status' => InvestList::STATUS_PAYED])->orWhere(['status' => InvestList::STATUS_ORDER_TRIAL])->orderBy('id desc')->limit(50); $eModel = clone $model; $eModel = $eModel->joinWith(['invest' => function ($query) { /** @var \yii\db\ActiveQuery $query */ $query->andWhere(['type' => Invest::TYPE_EXPERIENCE_MONEY])->orWhere(['type' => Invest::TYPE_REG]); }])->all(); $mModel = clone $model; $mModel = $mModel->joinWith(['invest' => function ($query) { /** @var \yii\db\ActiveQuery $query */ $query->andWhere(['type' => Invest::TYPE_MONEY]); }])->all(); return $this->view('own_profit', ['eModel' => $eModel, 'mModel' => $mModel, 'member' => $member]); }
<?php $member = \wanhunet\wanhunet::app()->member; ?> <section class="login_bt"> <div class="divoi wh-addpage"> <p class="font-s16 wh-addptop">可用余额:<span class="cored"><?php echo $member->getMoney(); ?> </span> 元</p> <form id="form" action="<?php echo \yii\helpers\Url::to(['invest/mention-post']); ?> " method="post"> <div class="divoi_odi" style="padding-bottom:10px;"> <div class="login_td" id="login_dt"> <input style="text-align:right;" type="number" name="step" placeholder="请填写提现金额 "/> </div> <div class="login_od wh-Whitebtn" id="login_do"> <a href="javascript:" style="display:block" disabled="true">元</a> </div> </div> <p class="font-s16 hui8 mb10" style="text-align:right;"> 可用金额<?php echo $member->getMoney(); ?> 元</p> <p class="font-s16 wh-addptop mt20 mb10">提现银行卡:</p>
<section class="login_bt"> <div class="divoi wh-addpage"> <p class="pro-success">操作成功!</p> <p>等待后台审核,审核通过后将在1-2个工作日到达您的账户。</p> <p class="red-paper"><img width="80%" src="<?php echo \wanhunet\wanhunet::getAlias('@web') . '/'; ?> images/red-paper.png" alt="红包"> </p> <p>如有疑问请致电客服电话:400-005-8181</p> <div style="margin:25px 0;"> <a class="wh-addbtn" href="<?php echo \yii\helpers\Url::to(['site/main']); ?> " id="getCaptcha" style="display:block">确 定</a> </div> </div> </section>
public function actionMention() { try { $pass = wanhunet::app()->member->validatePayPass(wanhunet::$app->request->post('paypass')); if (!$pass) { throw new ErrorException('密码验证错误', ErrorCode::Pay_pass_empty); } /** @var AssetMoney $order */ $order = AssetMoney::findOne(wanhunet::$app->getSession()->get("order")[1]); $member = wanhunet::app()->member; $member->setDecMoney($order->step); $member->saveMoney(); $order->status = AssetMoney::STATUS_ORDER_MADE; $order->save(); wanhunet::$app->getSession()->remove('order'); return $this->view('mention'); } catch (\Exception $e) { if ($e->getCode() == ErrorCode::Pay_pass_empty) { return $this->goBack(['info' => $e->getMessage()], Url::to(['pay/pay-pass'])); } elseif ($e->getCode() == 0) { return $this->goBack(['info' => "请输入密码"], Url::to(['pay/pay-pass'])); } else { return $this->goBack(['info' => $e->getMessage()], Url::to(['pay/pay-pass'])); } } }
public function actionResetPayPassDoPost() { $request = wanhunet::$app->request; $member = wanhunet::app()->member; if ($request->isPost) { if ($request->post('newpass') !== $request->post('renewpass')) { return $this->goBack(['info' => '两次输入的密码不同'], Url::to(['site/reset-pay-pass-do'])); } $phone = $member->phone; $vcode = VerificationCode::findByField($phone); $vcode->field = $phone; if ($vcode->verify($request->post('captcha'))) { $vcode->verifySave(); $member->savePayPass($request->post('newpass')); return $this->goBack(['info' => '修改成功'], Url::to(['site/setup'])); } else { return $this->goBack(['info' => '验证码错误', 'email' => $phone], Url::to(['site/reset-pay-pass-do'])); } } return false; }
public static function ensureOpenId() { $wechat = wanhunet::app()->wechat; $request = wanhunet::$app->request; if ($request->post('open_id') == null && $request->get('open_id') == null) { $result = $wechat->getOauth2AccessToken($request->get('code')); $_GET['open_id'] = $result['openid']; } }
echo \wanhunet\wanhunet::$app->request->hostInfo . \wanhunet\wanhunet::getAlias("@web"); ?> /images/hongbao.png', // 分享图标 link: '<?php echo $url; ?> ', // 分享链接 success: function () { WeixinJSBridge.call('closeWindow'); } }); wx.onMenuShareAppMessage({ title: '庆玖信理财上线 任性老板,无限发体验金...', // 分享标题 desc: '玖信出本金,您来赚收益!收益免费提现!', // 分享描述 imgUrl: '<?php echo \wanhunet\wanhunet::$app->request->hostInfo . \wanhunet\wanhunet::getAlias("@web"); ?> /images/hongbao.png', // 分享图标 link: '<?php echo $url; ?> ', // 分享链接 type: 'link', // 分享类型,music、video或link,不填默认为link success: function () { WeixinJSBridge.call('closeWindow'); } }); }); </script> <?php
public function markOrderReg(Order $order) { $price = $order->getPrice(); $order->setUserId(wanhunet::app()->member->getId()); $order->setProductId($this->id); $saveOrder = $order->saveOrder(); if ($saveOrder) { $this->afterMarkOrder(); } return $order; }