PayRandomMx.class.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2018/1/23
  6. * Time: 10:42
  7. */
  8. class PayRandomMx{
  9. public function getRandomaccessproviderKey($orderid){
  10. require_once('../../init.php');
  11. ///---查随机接口商家帐号、密码开始---///
  12. //2.从数据库中查询数据
  13. $cache=Cache::getInstance();
  14. $userkey='';
  15. $accessProvider=$cache->get('accessProvider');
  16. //3.获取orderlist表中数据
  17. $orderlist_ob = new randomjiekoushang_class();
  18. $wenjianjia_arr = $orderlist_ob->get_orderlist_by_orderid_wenjianjia($orderid);
  19. $wenjianjia = $wenjianjia_arr['returnmsg'];
  20. // $file = fopen(date('ymd').'_PayRandom_log.txt', 'a+');
  21. // fwrite($file,"\r\n wenjianjia_arr:".http_build_query($wenjianjia_arr));
  22. // fwrite($file,"\r\n wenjianjia:".$wenjianjia);
  23. if($accessProvider){
  24. foreach($accessProvider as $key=>$val){
  25. if($val['id']==$wenjianjia){
  26. $userid=$val['accessID'];
  27. $userkey=$val['accessKey'];
  28. break;
  29. }
  30. }
  31. }
  32. // fwrite($file,"\r\n accessKey:".$userkey);
  33. return ['userid' => $userid, 'userkey' => $userkey];
  34. ///---查随机接口商家帐号、密码结束---///
  35. }
  36. }