user = $user; $form->attributes = get_params(); $form->store_id = get_store_id(); $res = $form->search(); if ($res['code'] == 1) { return $this->asJson($res); } // 余额页设置 $form = new RechargeModule(); $form->store_id = get_store_id(); $setting = $form->search_recharge(); $data = [ 'money' => $user->money, 'list' => $res['data']['list'], 'setting' => $setting, 'date' => $res['data']['date'], ]; return $this->asJson(['code' => 0, 'msg' => 'success', 'data' => $data]); } /** * 搜索指定月份的充值记录及余额消费记录 * @return \yii\web\Response * @throws \yii\db\Exception */ public function actionRecord() { $user = get_user(); $form = new RecordForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user = $user; $res = $form->search(); return $this->asJson($res); } //充值记录 public function actionRechargeOrder() { $user = get_user(); $form = new RecordForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user = $user; return $this->asJson($form->rechargeOrder()); } /** * 充值可选列表 * @return \yii\web\Response */ public function actionList() { $list = IntegralRecharge::find()->where(['store_id' => get_store_id(), 'is_delete' => 0, 'state' => 1]) ->orderBy(['pay_price' => SORT_DESC])->asArray()->all(); $user = get_user(); $qs_s = QAndASetting::find()->where(['store_id' => get_store_id()])->one(); $data = [ 'integral' => $user->integral, 'rule' => $qs_s->rule, 'list' => $list, ]; return $this->asJson(['code' => 0, 'msg' => 'success', 'data' => $data]); } /** * 充值提交 * @return \yii\web\Response */ public function actionSubmit() { $form = new IntegralRechargeSubmitForm(); $form->store_id = get_store_id(); $form->user = get_user(); $form->attributes = post_params(); if (post_params('_form') === 'h5') { $form->pay_type = 1; } return $this->asJson($form->save()); } /** * 余额收支详情 * @return \yii\web\Response */ public function actionDetail() { $form = new DetailForm(); $form->store_id = get_store_id(); $form->attributes = get_params(); return $this->asJson($form->search()); } }