Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = payLL::find()->orderBy('id DESC');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10]]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'uid' => $this->uid, 'status' => $this->status, 'create_at' => $this->create_at, 'update_at' => $this->update_at]);
     $query->andFilterWhere(['like', 'idcard', $this->idcard])->andFilterWhere(['like', 'real_name', $this->real_name])->andFilterWhere(['like', 'user_id', $this->user_id])->andFilterWhere(['like', 'busi_partne', $this->busi_partne])->andFilterWhere(['like', 'no_order', $this->no_order])->andFilterWhere(['like', 'name_goods', $this->name_goods])->andFilterWhere(['like', 'money_order', $this->money_order])->andFilterWhere(['like', 'card_no', $this->card_no])->andFilterWhere(['like', 'from_ip', $this->from_ip])->andFilterWhere(['like', 'bank_code', $this->bank_code])->andFilterWhere(['like', 'remark', $this->remark])->andFilterWhere(['like', 'sign_type', $this->sign_type])->andFilterWhere(['like', 'sign', $this->sign])->andFilterWhere(['like', 'oid_paybill', $this->oid_paybill])->andFilterWhere(['like', 'money_lianlian', $this->money_lianlian])->andFilterWhere(['like', 'settle_date', $this->settle_date])->andFilterWhere(['like', 'pay_type', $this->pay_type]);
     return $dataProvider;
 }
Example #2
0
 /**
  * 用户首次支付
  * @param $uid 用户id
  * @param $card_no 银行卡号
  * @param $money 充值金额
  */
 public static function confirmation($uid, $card_no, $money)
 {
     $flag = member::isAuthentic($uid);
     if ($flag) {
         $id_cardno = $flag['idcard'];
         $real_name = $flag['real_name'];
         //TODO 获取银行卡信息
         $bank_code = '01050000';
         //用户标识
         $flag = payLL::find()->where(['status' => self::SUCCESS, 'uid' => $uid])->orderBy('create_at desc')->one();
         if ($flag) {
             $user_id = $flag['user_id'];
         } else {
             $user_id = self::verification($uid);
         }
         //商户业务类型
         $busi_partne = '101001';
         //商户唯一订单号
         $no_order = self::verification($card_no);
         $name_goods = "充值";
         $money_order = $money;
         $notify_url = 'http://www.lianlianpay.com/notify_url.html';
         $id_no = $id_cardno;
         $acct_name = $real_name;
         $card_no = $card_no;
         //写入数据库记录
         $pay = new payLL();
         $pay->uid = $uid;
         $pay->idcard = $id_cardno;
         $pay->real_name = $real_name;
         $pay->user_id = $user_id;
         $pay->busi_partne = $busi_partne;
         $pay->no_order = $no_order;
         $pay->name_goods = $name_goods;
         $pay->money_order = $money;
         $pay->card_no = $card_no;
         $pay->from_ip = Yii::$app->request->userIp;
         $pay->status = self::CONFIRM;
         $res = $pay->save();
         if ($res) {
             $lianlian = new lianlianClass();
             $res = $lianlian->confirmation($user_id, $busi_partne, $no_order, $name_goods, $money_order, $notify_url, $id_no, $acct_name, $card_no, $bank_code);
             return $res;
         }
     } else {
         return "先实名认证";
     }
 }