public function actionIndex() { $uid = Yii::$app->user->id; $isAuthentic = member::isAuthentic(yii::$app->user->id); if ($isAuthentic['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有实名制认证')</script>"; echo "<script>window.location.href='" . \yii\helpers\Url::to(['site/step2']) . "'</script>"; exit; } //判断用户是否绑定银行卡 $is_bind = sinapay::isBinding($uid); $model = UcenterMember::find()->where(['id' => $uid])->one(); if ($is_bind['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有绑定银行卡');</script>"; echo "<script>location.href='" . \yii\helpers\Url::to(['site/bindcard']) . "'</script>"; exit; } $uid = Yii::$app->user->id; $info = Info::find()->where(['member_id' => $uid])->one(); $limitConfig = sinapay::getsiteConfig(); if ($limitConfig) { $withdraw_max = $limitConfig->withdraw_max; $withdraw_min = $limitConfig->withdraw_min; $withdraw_times = $limitConfig->withdraw_num; } return $this->view('index', compact('info', 'withdraw_max', 'withdraw_min', 'withdraw_times')); }
public function actionIndex() { $uid = Yii::$app->user->id; //判断用户是否绑定银行卡 $is_bind = sinapay::isBinding($uid); $datas = ''; if ($is_bind[errorNum] == 0) { $datas = $is_bind[data]; } return $this->view('index', compact("datas")); }
public function actionIndex() { $uid = Yii::$app->user->id; Utils::ensureOpenId(); $openId = Yii::$app->request->get('open_id'); if (($usermodel = UcenterMember::findOne(['openid' => $openId])) !== null) { Yii::$app->user->login($usermodel); } elseif (empty(Yii::$app->user->id)) { return $this->redirect(['site/signin']); } $isAuthentic = member::isAuthentic(yii::$app->user->id); if ($isAuthentic['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有实名制认证')</script>"; echo "<script>window.location.href='" . \yii\helpers\Url::to(['site/step2']) . "'</script>"; exit; } //判断用户是否绑定银行卡 $is_bind = sinapay::isBinding($uid); $model = UcenterMember::find()->where(['id' => $uid])->one(); if ($is_bind['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有绑定银行卡');</script>"; echo "<script>location.href='" . \yii\helpers\Url::to(['site/bindcard']) . "'</script>"; exit; } //全部记录 $logs = AloneMethod::total_log($uid, 1, 15); $logs_pages = Log::find()->select(['step', 'remark', 'status', 'create_at'])->where(['member_id' => $uid])->andWhere(['>', 'status', '0'])->andWhere(['<>', 'step', '0.00'])->asArray()->all(); $logs_pages = ceil(count($logs_pages) / 15); //$logs = Log::find()->select(['step','create_at','status'])->where(['member_id'=>$uid])->andWhere(['in','status',[1,2,3,4]])->orderBy('id desc')->asArray()->all(); //充值 $recharge = AloneMethod::recharge_log($uid, 1, 15); $recharge_pages = Log::find()->select(['step', 'remark', 'status', 'create_at'])->where(['member_id' => $uid, 'status' => Log::STATUS_RECHAR_SUC])->asArray()->all(); $recharge_pages = ceil(count($recharge_pages) / 15); //投资 $invest = AloneMethod::invest_log($uid, 1, 15); $invest_pages = Log::find()->select(['step', 'remark', 'status', 'create_at'])->where(['member_id' => $uid, 'status' => Log::STATUS_INVEST_SUC])->asArray()->all(); $invest_pages = ceil(count($invest_pages) / 15); //赎回 $ransom = AloneMethod::redeem_log($uid, 1, 15); $ransom_pages = Log::find()->select(['step', 'remark', 'status', 'create_at'])->where(['member_id' => $uid, 'status' => Log::STATUS_REDEM_SUC])->asArray()->all(); $ransom_pages = ceil(count($recharge_pages) / 15); //提现 $withdraw = AloneMethod::withdrawals_log($uid, 1, 15); $withdraw_pages = Log::find()->select(['step', 'remark', 'status', 'create_at'])->where(['member_id' => $uid, 'status' => Log::STATUS_WITHDRAW_SUC])->asArray()->all(); $withdraw_pages = ceil(count($recharge_pages) / 15); return $this->view('index', compact('invest', 'recharge', 'withdraw', 'ransom', 'logs', 'logs_pages', 'recharge_pages', 'invest_pages', 'ransom_pages', 'withdraw_pages')); }
public function actionIndex() { $uid = Yii::$app->user->id; $isAuthentic = member::isAuthentic(yii::$app->user->id); if ($isAuthentic['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有实名制认证')</script>"; echo "<script>window.location.href='" . \yii\helpers\Url::to(['site/step2']) . "'</script>"; exit; } //判断用户是否绑定银行卡 $is_bind = sinapay::isBinding($uid); $model = UcenterMember::find()->where(['id' => $uid])->one(); if ($is_bind['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有绑定银行卡');</script>"; echo "<script>location.href='" . \yii\helpers\Url::to(['site/bindcard']) . "'</script>"; exit; } $limitConfig = sinapay::getsiteConfig(); if ($limitConfig) { $ransom_max = $limitConfig->ransom_max; $ransom_min = $limitConfig->ransom_min; $ransom_times = $limitConfig->ransom_num; } $collect = AloneMethod::user_collect($uid)[data]; //在投金额和在投收益 $red_packet = member::get_user_red_packet($uid)[data]; //个人账户 $model_asset = Info::find()->where('member_id=' . Yii::$app->user->id)->one(); //投资总额 $invest_total = 0; $model_order = Order::find()->where('member_id=' . Yii::$app->user->id . " AND status=1")->all(); if (count($model_order) > 0) { foreach ($model_order as $K => $V) { $invest_total += $V->money; } } $invest_total += $model_asset->profit; return $this->view('index', compact('invest_total', 'ransom_max', 'ransom_min', 'ransom_times', 'collect', 'red_packet')); }
public function actionIndex() { if (Yii::$app->user->isGuest) { return $this->redirect(array('/site/signin')); } $uid = Yii::$app->user->id; $isAuthentic = member::isAuthentic(yii::$app->user->id); if ($isAuthentic['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有实名制认证')</script>"; echo "<script>window.location.href='" . \yii\helpers\Url::to(['site/step2']) . "'</script>"; exit; } //判断用户是否绑定银行卡 $is_bind = sinapay::isBinding($uid); $model = UcenterMember::find()->where(['id' => $uid])->one(); if ($is_bind['errorNum'] != 0) { header("Content-type: text/html; charset=utf-8"); echo "<script>alert('您还没有绑定银行卡');</script>"; echo "<script>location.href='" . \yii\helpers\Url::to(['site/bindcard']) . "'</script>"; exit; } if ($_GET) { $uid = Yii::$app->user->id; $info = Info::find()->where(['member_id' => $uid])->one(); $product = Product::find(['id' => $_GET['id']])->one(); //项目可投金额 $kmoney = \frontend\actions\App\Invest::kmoney($_GET['id'])[data]; $limitConfig = sinapay::getsiteConfig(); if ($limitConfig) { $invest_max = $limitConfig->invest_max; $invest_min = $limitConfig->invest_min; $invest_times = $limitConfig->invest_num; } return $this->view('index', compact('info', 'product', 'invest_max', 'invest_min', 'invest_num', 'kmoney')); } }
public static function BankInfos() { $uid = yii::$app->user->id; $infos = sinapay::isBinding($uid); $bank_code = $infos['data']['bank_code']; $logo = ''; switch ($bank_code) { case 'ICBC': $logo = 'ICBC'; break; case 'ABC': $logo = 'ABC'; break; case 'BOC': $logo = 'BOC'; break; case 'CCB': $logo = 'CCB'; break; case 'COMM': $logo = 'COMM'; break; case 'SPDB': $logo = 'SPDB'; break; case 'CIB': $logo = 'CIB'; break; case 'CEB': $logo = 'CEB'; break; case 'CMBC': $logo = 'CMBC'; break; case 'CITIC': $logo = 'CITIC'; break; case 'CMB': $logo = 'CMB'; break; case 'PSBC': $logo = 'PSBC'; break; case 'SZPAB': $logo = 'SZPAB'; break; case 'BCCB': $logo = 'BCCB'; break; case 'GDB': $logo = 'GDB'; break; case 'CBHB': $logo = 'CBHB'; break; case 'HXB': $logo = 'HXB'; break; case 'BOS': $logo = 'BOS'; break; case 'NJCB': $logo = 'NJCB'; break; case 'CZB': $logo = 'CZB'; break; } return $logo; }
<?php use yii\helpers\Html; use yii\helpers\Url; use frontend\actions\sinapay; use common\models\base\asset\Info; /* @var $this yii\web\View */ $this->title = 'My Yii Application'; $upload = yii::$app->request->baseUrl . '/../../backend/web/upload/'; //判断用户是否绑定银行卡 $is_bind = sinapay::isBinding($user->id); if ($is_bind['errorNum'] != 0) { $bind = false; } else { $bind = true; } $info = Info::find()->andWhere(['member_id' => $user->id])->one(); ?> <style> .zhszlist{ padding: 0 5%; background: #fff; color: #3c3c3c; } .f13 { font-size: 1.3rem; } </style> <div class="wapper bgd-f5f5f4"> <!--content--> <div class="content">