/**
  * Displays a single UcenterMember model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $sinabank = SinaBank::find()->andWhere(['uid' => $id])->andWhere(['status' => SinaBank::STATUS_BINGING])->asArray()->one();
     $sina = new sina();
     if ($sinabank['identity_id']) {
         $sinabank['sinamoney'] = $sina->query_balance($sinabank['identity_id'])['available_balance'];
     }
     return $this->render('view', ['model' => $this->findModel($id), 'sinabank' => $sinabank]);
 }
Beispiel #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = SinaBank::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', 'identity_id', $this->identity_id])->andFilterWhere(['like', 'request_no', $this->request_no])->andFilterWhere(['like', 'bank_code', $this->bank_code])->andFilterWhere(['like', 'bank_name', $this->bank_name])->andFilterWhere(['like', 'bank_account_no', $this->bank_account_no])->andFilterWhere(['like', 'card_type', $this->card_type])->andFilterWhere(['like', 'card_attribute', $this->card_attribute])->andFilterWhere(['like', 'phone_no', $this->phone_no])->andFilterWhere(['like', 'province', $this->province])->andFilterWhere(['like', 'city', $this->city])->andFilterWhere(['like', 'bank_branch', $this->bank_branch])->andFilterWhere(['like', 'ticket', $this->ticket])->andFilterWhere(['like', 'valid_code', $this->valid_code])->andFilterWhere(['like', 'card_id', $this->card_id])->andFilterWhere(['like', 'msg', $this->msg]);
     return $dataProvider;
 }
Beispiel #3
0
 /**
  * 批量付到银行卡测试
  * @param $uid
  * @param $money
  * @return array|mixed
  */
 public static function test($uid, $money)
 {
     $flag = self::getIdentity($uid);
     if (!$flag) {
         $return = array('errorNum' => '1', 'errorMsg' => '用户不存在', 'data' => null);
         return $return;
     }
     //获取提现用户的绑定银行卡的信息
     $SinaBank = SinaBank::find()->where(['uid' => $uid, 'identity_id' => $flag, 'status' => SinaBank::STATUS_BINGING])->one();
     //批量付款到银行操作
     $batch_no = self::build_order_no();
     //组成出款条目 获取提现人信息
     $member = SinaMember::find()->where(['uid' => $uid, 'status' => SinaMember::STATUS_BINGING])->one();
     //获取配置中--加密密钥
     $config = self::getConfig();
     $public_key = $config->sinapay_rsa_public__key;
     $weibopay = new Weibopay();
     //付款到银行卡
     $list_no = self::build_order_no();
     //用户名
     $list_name = $weibopay->Rsa_encrypt($member->name, $public_key);
     //身份证
     $list_idcard = $weibopay->Rsa_encrypt($member->idcard, $public_key);
     //银行卡号
     $list_bank_account_no = $weibopay->Rsa_encrypt($SinaBank->bank_account_no, $public_key);
     $bank_name = $SinaBank->bank_name;
     $bank_code = $SinaBank->bank_code;
     $province = $SinaBank->province;
     $city = $SinaBank->city;
     $bank_name_zh = $province . $city . $bank_name;
     $bank_money = $money;
     $card_attribute = $SinaBank->card_attribute;
     $card_type = $SinaBank->card_type;
     //组合
     $sina = new sina();
     $detail_list = $list_no . '^' . $list_name . '^' . $list_idcard . '^' . $list_bank_account_no . '^' . $bank_name . '^' . $bank_code . '^' . $province . '^' . $city . '^' . $bank_name_zh . '^' . $bank_money . '^' . $card_attribute . '^' . $card_type;
     $pay2bank = $sina->create_batch_pay2bank($batch_no, $detail_list);
     return $pay2bank;
 }