当前位置: 首页>>代码示例>>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;未经允许,请勿转载。