Example #1
0
 /**
  * Creates a new Payment model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Payment();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Example #2
0
 /**
  * 记录用户的充值记录
  * @param $uid
  * @param $orderid
  * @param $transtime
  * @param $amount
  * @param $productname
  * @param $identityid
  * @param $orderexpdate
  * @param $phone
  * @param $userip
  * @param $status
  * @param $msg
  * @param string $sendtime
  * @param string $yborderid
  * @param string $ybamount
  * @return bool
  */
 private static function paymentLog($uid, $orderid, $transtime, $amount, $productname, $identityid, $orderexpdate, $phone, $userip, $status, $msg, $sendtime = '', $yborderid = '', $ybamount = '')
 {
     $pay = new Payment();
     $pay->uid = (int) $uid;
     $pay->orderid = $orderid;
     $pay->transtime = $transtime;
     $pay->amount = (int) $amount;
     $pay->productname = $productname;
     $pay->identityid = $identityid;
     $pay->orderexpdate = (int) $orderexpdate;
     $pay->phone = $phone;
     $pay->userip = $userip;
     $pay->status = $status;
     $pay->msg = $msg;
     $pay->sendtime = $sendtime;
     $pay->yborderid = $yborderid;
     $pay->ybamount = $ybamount;
     $flag = $pay->save();
     return $flag;
 }