public function actionInvestinfos() { if (\yii::$app->user->isGuest) { $this->redirect(['site/login']); } $pid = $_GET['id']; $uid = yii::$app->user->id; $model = Product::find()->where('id=' . $pid)->one(); $model_asset = Info::find()->where(['member_id' => Yii::$app->user->id])->one(); $model_orders = Order::find()->where('product_id=' . $pid)->asArray()->all(); //本期投资记录 $query = (new Query())->select("C.real_name,A.start_money,A.start_at")->from("fund_orders AS A")->where("product_id=" . $pid)->join("left join", "ucenter_member AS C", "A.member_id = C.id")->orderBy('start_at DESC'); $rows = $query; $pages = new Pagination(['totalCount' => $rows->count(), 'pageSize' => '8']); $array_investlog = $rows->offset($pages->offset)->limit($pages->limit)->all(); //最大投资限额——(后台设置里取值) $limitConfig = sinapay::getsiteConfig(); $invest_max = 10000; $invest_min = 5; $invest_times = 3; if ($limitConfig) { $invest_max = $limitConfig->invest_max; $invest_min = $limitConfig->invest_min; $invest_times = $limitConfig->invest_num; //当日投资次数 $today_num = Log::find()->where('member_id = ' . $uid . ' AND create_at > ' . strtotime(date("Y-m-d")) . ' AND status=2')->count(); } $k_money = Invest::kmoney($pid); return $this->render('investinfos', compact("invest_max", "invest_min", "invest_times", "today_num", "model", "k_money", "model_orders", "array_investlog", "pages", "model_asset")); }