public function actionPay() { $modelDetail = new MerBase(); //实例化商家信息 $modelStu = new Students(); //实例化学生 $session = yii::$app->session; $mer_id = $session->get('mer_id'); $user_info = $session->get('userinfo'); $payDetail = $modelDetail->getSmall($mer_id); $user = $modelStu->getPassword($user_info['user_id']); return $this->render('payment', ['payDetail' => $payDetail, 'user' => $user]); }
/** * @验证企业名称唯一 */ public function onlyEnterprise($name) { $res = MerBase::find()->select(['mer_name'])->where(['mer_name' => $name])->asArray()->one(); return $res['mer_name']; }
public function getSmall($mer_id) { $mer_details = MerBase::find()->select('mer_id,mer_name,merchant_id')->joinwith('preferential')->where("mer_id={$mer_id}")->asArray()->one(); return $mer_details; }