Пример #1
0
 public function actionExport()
 {
     $request = wanhunet::$app->request;
     $startTime = strtotime($request->get('start_time'));
     $endTime = strtotime($request->get('end_time'));
     $asset = $this->rechargeList($startTime, $endTime);
     Utils::exportExcel($asset, ['ID', '会员ID', '金额', '金额状态', '类型', '动作', '动作用户ID', '', '创建时间', '更新时间', '会员ID', '会员用户名', '用户手机号', '用户状态', '用户创建时间', '用户身份证号', '身份证名称', '用户身份证状态', '用户邮箱', '用户邮箱状态', '父级邀请码', '邀请码'], '充值记录导出' . date('Y.m.d'));
 }
Пример #2
0
 /**
  * @return array
  */
 public static function getUserModulesOfMenus()
 {
     $menusTree = [];
     foreach (Utils::getUserModules() as $moduleName => $module) {
         $menusTree[] = wanhunet::app()->getModule($moduleName)->getMenus();
     }
     return $menusTree;
 }
Пример #3
0
 public function getMeunNav()
 {
     $auth = wanhunet::$app->authManager;
     $this->_permissions = $auth->getPermissionsByUser(wanhunet::$app->user->getId());
     $menus = Utils::getUserModulesOfMenus();
     $this->_buildAllNav($menus);
     $this->_buildNav($this->allNav);
     $this->_formatNav($this->allNav);
     return $this->allNav;
 }
Пример #4
0
 public function setInterestm(Event $event)
 {
     /** @var InvestList $investList */
     $investList = $event->sender;
     $investListId = $investList->id;
     $step = Utils::moneyFormat($investList->interest / $investList->invest->invest_date);
     $payTime = $investList->pay_time;
     if ($investList->invest->type == Invest::TYPE_MONEY) {
         for ($i = 1; $i <= $investList->invest->invest_date; $i++) {
             wanhunet::$app->db->createCommand()->insert(InvestMonth::tableName(), ['invest_list_id' => $investListId, 'm_step' => $step, 'm_status' => Invest::STATUS_ACTIVE, 'm_time' => $payTime + 3600 * 24 * 30 * $i, 'm_date' => $i, 'created_at' => $payTime, 'updated_at' => $payTime])->execute();
         }
     }
 }
Пример #5
0
 public function actionRbac()
 {
     wanhunet::$app->authManager->removeAll();
     $menusTree = Utils::getUserModulesOfMenus();
     $this->addPermission($menusTree);
     //        print_r($menusTree);
     //        $this->actionRole();
     //        print_r($this->auth_item);
     //        print_r($this->auth_child);
     $this->addItem();
     $this->addChild();
     $this->actionRole();
 }
Пример #6
0
 public function actionOff()
 {
     Utils::ensureOpenId();
     $request = wanhunet::$app->request;
     if ($request->isPost) {
         if (($model = MemberOther::findOne(['row' => $request->post('open_id'), 'table' => MemberOther::TABLE_WECHAT])) !== null) {
             /** @var MemberOther $model */
             $model->row = '';
             $model->save();
         }
         wanhunet::$app->user->logout();
         return $this->goBack(['info' => "解绑成功"], Url::to(['site/signin']));
     }
     return $this->view('off');
 }
Пример #7
0
 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]);
 }
Пример #8
0
 public function behaviors()
 {
     return Utils::behaviorMerge(self::className(), parent::behaviors());
 }
Пример #9
0
 /**
  * @throws ErrorException
  */
 private function _sendVcode()
 {
     $vcodeTime = Config::getInstance()->getProperty('setTime.vcode');
     $content = '您的验证码为:' . $this->code . '请在' . $vcodeTime / 60 . '分钟内进行处理';
     if (($old = self::findByField($this->field)) !== null && $old->created_at > time() - $vcodeTime) {
         throw new ErrorException($vcodeTime - (time() - $old->created_at), ErrorCode::Vcode_short_time);
     }
     if ($this->type == self::TYPE_EMAIL) {
         try {
             Utils::sendEmail($this->field, '玖信贷邮箱验证码', $content);
         } catch (\Exception $e) {
             throw new ErrorException('验证码发送错误', ErrorCode::Send_email_error);
         }
     } else {
         if (Utils::sendSMS($this->field, $content) < 0) {
             throw new ErrorException('验证码发送错误', ErrorCode::Send_phone_error);
         }
     }
 }
Пример #10
0
//= \yii\helpers\Url::to(['invest/fund'])
?>
<!--">查看资金流水</a></p>-->
</aside>
<section class="profit-content">
    <table>
        <?php 
foreach ($list as $key => $vo) {
    ?>
            <tr>
                <td><?php 
    echo date('Y.m.d', $key);
    ?>
</td>
                <td>+<?php 
    echo \wanhunet\helpers\Utils::moneyFormat($vo);
    ?>
</td>
            </tr>
        <?php 
}
?>

    </table>
</section>
<script>
    var a = function () {
        $(".amsincome-word").width(($(".ams-income").width() - 13) / 2);
        $(".profit-content").css("min-height", $(window).height() - $(".Y-income").height() - $(".ams-income").height() - 101);
    };
    $(document).ready(function () {
Пример #11
0
    ?>
                <tr>
                    <td><?php 
    echo Utils::moneyFormat($e->investment_sum);
    ?>
</td>
                    <td><?php 
    echo date('Y.m.d', $e->interest_time);
    ?>
</td>
                    <td><?php 
    echo $e->invest->rate;
    ?>
%</td>
                    <td>+<?php 
    echo Utils::moneyFormat($e->interest);
    ?>
</td>
                </tr>
            <?php 
}
?>
        </table>
    </section>

<?php 
$this->beginBlock('inline_scripts');
?>

    <script>
        var a = function () {
Пример #12
0
?>
">查看体验金规则 &gt;</a>
            </div>
        </div>
        <aside class=" profit-content">
            <table>
                <?php 
foreach ($einvestList as $invest) {
    ?>
                    <tr>
                        <td><?php 
    echo $invest->invest->title;
    ?>
</td>
                        <td>+<?php 
    echo \wanhunet\helpers\Utils::moneyFormat($invest->interest);
    ?>
(元)</td>
                    </tr>
                <?php 
}
?>
            </table>
        </aside>
        <div style="height:50px;"></div>
        <div class="pvi_fo">
            <a href="<?php 
echo \yii\helpers\Url::to(['text/tiyanjishangxian']);
?>
" class="pvi_fo_od" style="border-right:1px solid #ccc;">
                <p>提高体验金投标上限</p>
Пример #13
0
 public function actionInformation()
 {
     if (($moneyModel = Invest::findByLately(Invest::TYPE_MONEY)) !== null) {
         $inverstOfMoney = Utils::timeCut($moneyModel->buy_time_start, time());
     } else {
         $inverstOfMoney = '未发布';
     }
     if (($emoneyModel = Invest::findByLately(Invest::TYPE_EXPERIENCE_MONEY)) !== null) {
         $inverstOfeMoney = Utils::timeCut($emoneyModel->buy_time_start, time());
     } else {
         $inverstOfeMoney = '未发布';
     }
     try {
         $jiuxinInfo = JiuxinApi::jiuxinGet();
         $row = wanhunet::app()->member->getOtherInfo(MemberOther::TABLE_JIUXIN)->row;
         $jiuxinInfo['j_user_name'] = current(explode('=|=', $row));
     } catch (\Exception $e) {
         $jiuxinInfo = [];
         //
         //            if ($e->getCode() == ErrorCode::Jiuxin_auth) {
         //                $jiuxinInfo = [];
         //            } else {
         //            }
     }
     return $this->view('information', ['inverstOfMoney' => $inverstOfMoney, 'inverstOfeMoney' => $inverstOfeMoney, 'jiuxinInfo' => $jiuxinInfo, 'actives' => Post::find()->where(['status' => Post::STATUS_ACTIVE])->orderBy('id desc')->all()]);
 }
Пример #14
0
 private function makeView(&$investList)
 {
     $investList['created_at'] = Utils::dateFormat('Y-m-d H:i:s', $investList['created_at']);
     $investList['updated_at'] = Utils::dateFormat('Y-m-d H:i:s', $investList['updated_at']);
     $investList['interest_time'] = Utils::dateFormat('Y-m-d H:i:s', $investList['interest_time']);
     $investList['pay_time'] = Utils::dateFormat('Y-m-d H:i:s', $investList['pay_time']);
     $investList['status'] = InvestList::get_status($investList['status']);
     $investList['interest_status'] = InvestList::get_status($investList['interest_status']);
     if ($investList['status'] == '终审通过') {
         $investList['interest_status'] = '已返息';
     }
     if (isset($investList['member'])) {
         $investList['member']['idcard_status'] = Member::get_auth_status($investList['member']['idcard_status']);
         $investList['member']['email_status'] = Member::get_auth_status($investList['member']['email_status']);
         $investList['member']['status'] = Member::get_record_status($investList['member']['status']);
         $investList['member']['created_at'] = Utils::dateFormat('Y-m-d', $investList['member']['created_at']);
         foreach ($investList['member'] as $key => &$memberInfo) {
             $investList['member_' . $key] = $memberInfo;
         }
         unset($investList['member']);
     }
     if (isset($investList['invest'])) {
         $investList['invest']['invest_status'] = InvestList::get_record_status($investList['invest']['invest_status']);
         $investList['invest']['created_at'] = Utils::dateFormat('Y-m-d', $investList['invest']['created_at']);
         $investList['invest']['updated_at'] = Utils::dateFormat('Y-m-d', $investList['invest']['updated_at']);
         $investList['invest']['buy_time_start'] = Utils::dateFormat('Y-m-d', $investList['invest']['buy_time_start']);
         $investList['invest']['buy_time_end'] = Utils::dateFormat('Y-m-d', $investList['invest']['buy_time_end']);
         $investList['invest']['type'] = Invest::get_type($investList['invest']['type']);
         foreach ($investList['invest'] as $key => &$investInfo) {
             $investList['invest_' . $key] = $investInfo;
         }
         unset($investList['invest']);
     }
 }
Пример #15
0
 /**
  * 保存身份证
  * @return bool
  * @throws ErrorException
  */
 public function saveIdcard()
 {
     $verify = Utils::idcardVerify($this->idcard, $this->idcard_name);
     if ($verify == null) {
         $this->trigger(self::EVENT_BEFORE_SAVE_IDCARD);
         $this->idcard_status = self::STATUS_HAVE_AUTH;
         $save = $this->save();
         $this->trigger(self::EVENT_AFTER_SAVE_IDCARD);
         return $save;
     } else {
         throw new ErrorException($verify, ErrorCode::Idcard_validate_error);
     }
 }
Пример #16
0
echo $sum;
?>
</td>
                    <td><?php 
echo Utils::moneyFormat($earnSum);
?>
</td>
                </tr>
                <tr>
                    <td>体验投标</td>
                    <td><?php 
echo Utils::moneyFormat($esum);
?>
</td>
                    <td><?php 
echo Utils::moneyFormat($eearnSum);
?>
</td>
                </tr>
            </table>
        </a>
    </section>
    <aside class='p10'>
        <p>*玖信理财承诺不会泄露您的个人信息*</p>
    </aside>

    <footer class="ind-footer" style="padding-bottom:40px;">
        <aside class="fot">
            <ul>
                <li><a href="<?php 
echo \yii\helpers\Url::to(['text/about']);
Пример #17
0
 /**
  * @return array
  */
 public function events()
 {
     return Utils::eventMerge(self::className(), parent::events());
 }
Пример #18
0
                <td>金额</td>
            </tr>
            <?php 
foreach ($investList as $invest) {
    ?>
                <tr>
                    <td><?php 
    echo date("Y.m.d", $invest->pay_time);
    ?>
</td>
                    <td><?php 
    echo $invest->invest->title;
    ?>
</td>
                    <td>¥<?php 
    echo \wanhunet\helpers\Utils::moneyFormat($invest->investment_sum);
    ?>
</td>
                </tr>
            <?php 
}
?>
        </table>
    </section>
<?php 
$this->beginBlock('inline_scripts');
?>

    <script>
        var a = function () {
            $(".amsincome-word").width(($(".ams-income").width() - 13) / 2);
Пример #19
0
?>
" method="post">
        <div class="divoi_odi mt10">
            <div class="login_td login-fall">
                <input type="text" placeholder="请填写玖信贷账号" name="jiuxinusername" value="<?php 
echo $this->getParamsErrors('jiuxinusername');
?>
" />
            </div>
        </div>
        <div class="divoi_odi mt10">
            <div class="login_td login-fall">
                <input type="password" placeholder="请填写玖信贷账号密码" name="jiuxinpwd" value="<?php 
echo $this->getParamsErrors('jiuxinpwd');
?>
" />
            </div>
        </div>
        <div>
            <?php 
echo \wanhunet\helpers\Utils::csrfField();
?>
            <input style="box-shadow: #61a627 0px 5px 0px 0px; background: #6eb92b;" type="submit" value="确认绑定"
                   class="login_btn mt10" id="bt">
        </div>
        <div class="divoi">
            <p style="text-align:right;">还没有账号? 马上去<a href="http://www.jiuxindai.com/web_user/user/register_show" style="color:#0096e0;">注册</a></p>
        </div>
    </form>
</section>
Пример #20
0
 /**
  * 获取账户余额
  * @return int
  */
 public function getMoney()
 {
     return Utils::moneyFormat($this->assetModel->money);
 }