當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sbr_meta::getStatePayout方法代碼示例

本文整理匯總了PHP中sbr_meta::getStatePayout方法的典型用法代碼示例。如果您正苦於以下問題:PHP sbr_meta::getStatePayout方法的具體用法?PHP sbr_meta::getStatePayout怎麽用?PHP sbr_meta::getStatePayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sbr_meta的用法示例。


在下文中一共展示了sbr_meta::getStatePayout方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: serve

 public function serve($method, $params = array())
 {
     switch ($method) {
         case 'checkOrCreateWallet':
             $num = $params['num'];
             //имитация
             $test['+71234567890'] = array("state" => "EXIST", "message" => "Уже создан +71234567890", "fio" => "Власов Павел Владимирович", "verified" => TRUE, "identified" => false);
             $test['+79272540217'] = array("state" => "EXIST", "message" => "Cоздан +79272540217", "fio" => "Власов Павел Владимирович", "verified" => TRUE, "identified" => TRUE);
             $test['+380664848120'] = array("state" => "EXIST", "message" => "Уже создан +380664848120", "fio" => "Власов Павел Владимирович", "verified" => FALSE, "identified" => TRUE);
             $test['+79034731235'] = array("state" => "EXIST", "message" => "Уже создан +79034731235", "fio" => "Власов Павел Владимирович", "verified" => TRUE, "identified" => TRUE);
             /*
             $test['+380664848120'] = array(
                 "state" => "EXIST",
                 "message" => "Уже создан +380664848120",
                 "fio" => "Власов Павел Владимирович",
                 "verified" => TRUE,
                 "identified" => false
             );                 
             */
             if (isset($test[$num])) {
                 $lc = $test[$num];
             } else {
                 $lc = array();
             }
             break;
         case 'superCheck':
             //$params = json_decode(file_get_contents('php://input'), 1);
             $ids = explode(",", $params['id']);
             /*if(is_array($params['id'])) {
                   $ids = array_map('intval', $params['id']);
               } else {
                   $ids = array(intval($params['id']));
               }*/
             $ids = array_map('intval', $ids);
             $lcs = $this->getRows($ids);
             if (!$lc) {
                 $lc = $this->_err('Ошибка. Счет не найден.');
             }
             $pskb = new pskb();
             foreach ($lcs as $k => $lc) {
                 if ($lc->state == 'trans') {
                     $lc->state = pskb::PAYOUT_END;
                     $this->set($lc);
                 }
                 $pskb_lc = $pskb->getLCbyLCId($lc->id);
                 $lc->sum = $pskb_lc['sum'];
                 $lc->sumOpen = $pskb_lc['sumOpen'];
                 $lc->numDog = $pskb_lc['sbr_id'];
                 $lc->cover = date('d.m.Y H:i', strtotime($pskb_lc['dateCoverLC']));
                 $payouts = sbr_meta::getStatePayout(array($pskb_lc['sbr_id'], 0), true);
                 if ($payouts) {
                     foreach ($payouts as $payout) {
                         if ($lc->state != pskb::PAYOUT_END) {
                             continue;
                         }
                         $history = array('id' => $lc->id, 'state' => $lc->state, 'date' => date('d.m.Y H:i'), 'uid' => $pskb_lc['sbr_id'] . '-' . ($payout['num'] + 1), 'target' => $payout['user_id'] == $payout['emp_id'] ? false : true, 'sum' => $payout['credit_sum'], 'account' => $payout['user_id'] == $payout['emp_id'] ? $pskb_lc['accCust'] : $pskb_lc['accPerf'], 'ps' => $payout['user_id'] == $payout['emp_id'] ? $pskb_lc['ps_emp'] : $pskb_lc['ps_frl']);
                         $lc->history[] = new pskb_lc(json_encode($history));
                     }
                 }
                 $lcs[$k] = $lc;
             }
             $post = json_encode($lcs);
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $params['urlRejoin']);
             curl_setopt($ch, CURLOPT_POST, 1);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
             curl_setopt($ch, CURLOPT_TIMEOUT, 30);
             if (defined('BASIC_AUTH')) {
                 curl_setopt($ch, CURLOPT_USERPWD, BASIC_AUTH);
             }
             $res = curl_exec($ch);
             return;
             break;
         case 'historyLC':
             $id = intval($params['id']);
             $lc = $this->get($id);
             if (!$lc) {
                 $lc = $this->_err('Ошибка. Счет не найден.');
             }
             if ($lc->state == 'trans') {
                 $lc->state = pskb::PAYOUT_END;
                 $this->set($lc);
             }
             $lc->sum = 1000;
             $lc->account = '79210000000';
             $lc->uid = $params['uid'];
             $lc->target = $params['target'] ? $params['target'] : true;
             $lc->date = date('d.m.Y H:i');
             break;
         case 'addLC':
             $lc = new pskb_lc();
             $lc->state = 'form';
             $lc->stateReason = 'test';
             foreach ($params as $k => $v) {
                 $lc->{$k} = $v;
             }
//.........這裏部分代碼省略.........
開發者ID:uadev,項目名稱:fl-ru-damp,代碼行數:101,代碼來源:pskb.php


注:本文中的sbr_meta::getStatePayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。