public function actionDoinvest() { $uid = Yii::$app->user->id; if ($_POST) { $money = $_POST['money']; $pid = $_POST['product_id']; $result = Invest::Invest($uid, $pid, $money); Invest::gold($uid, $money); //体验金 if ($result['errorNum'] == 1) { return $result['errorMsg']; } else { return '您已成功完成了投资'; } } }