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; 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')); } }
/** * 判定用户是否实名认证 * @return array|bool|string */ public static function actionIsauthentic() { $result = App::AppGet(); try { if ($result['errorNum']) { $result = array('errorNum' => $result['errorNum'], 'errorMsg' => $result['errorMsg'], 'data' => null); } else { $data = $result['data']; if (array_key_exists('uid', $data)) { $uid = $data['uid']; $result = member::isAuthentic($uid); } else { $result = array('errorNum' => '1', 'errorMsg' => '参数错误', 'data' => null); } } } catch (ErrorException $e) { Yii::error("判定用户是否实名认证异常 方法:actionIsauthentic 参数:" . json_encode($result['data']), "app"); Yii::trace($e->getMessage(), "app"); $result = array('errorNum' => '7', 'errorMsg' => '服务器异常,请联系管理员', 'data' => null); } $result = App::AppReturn($result); return $result; }
public function actionBindcard() { $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; } $model = UcenterMember::find()->where(['id' => $uid])->one(); return $this->view('bindcard', compact("model")); }