Hello World - 2019年6月
type: channel
link: https://mww.njfengwei.cn/index.php/2019/06/
description: Your description here.
items: 微信转账：mang
items: 支付宝转账：red
items: 支付和退款（微信支付宝）red

微信转账：mang
type: item
date: 2019-06-24T18:57:00+08:00
description: <?php /** * Created by ghostsf * Date: 2016/4/20 */ namespace app\admin\controller; use app\admin\model\Config; use app\admin\model\Personalconfig; use think\Controller; use think\Db; require 'qiniu/autoload.php'; use Qiniu\Auth; use Qiniu\Storage\UploadManager; use Qiniu\Processing\PersistentFop; use think\Config as redis; /** * 公共 * Class Common * @package app\admin\controller */ class CommonController extends Controller { // 定义配置项 private $config=array( 'APPID' => 'wx12fe768e213a0476', // 微信支付APPID. 'MCHID' => '1508786811', // 微信支付MCHID 商户收款账号 'KEY' => '', // 微信支付KEY 'APPSECRET' => '', // 公众帐号secert (公众号支付专用) 'NOTIFY_URL' => 'http://mms.mangmeshi.com/admin/Apiauth/huidiao', // 接收支付状态的连接 ); public $redis; /** * 拦截器 * * @return bool */ public function _initialize() { //session过期验证 if (!isset($_SESSION['loginSession'])) { header("http/1.1", true, 389); //389 http状态码 session过期 return false; } } /** * 七牛云存储 */ // public function qiniuCommon($type,$rand,$exe,$filePath) public function qiniuCommonVideo() { $name = $_FILES['video']['name']; $type = 5; $rand = date('YmdHis').rand(100000,999999); $filePath = $_FILES['video']['tmp_name']; $exe = explode('.',$name); $exe = end($exe); if($type == 2){ if($exe != 'jpg' && $exe != 'gif' && $exe != 'png'){ $return = array('status'=>0,'msg'=>'请上传图片'); return $return; } } if($type == 3){ if($exe != 'xls' && $exe != 'xlsx' && $exe != 'zip' && $exe != 'docx' && $exe != 'pdf'){ $return = array('status'=>0,'msg'=>'请上传正确的文件格式'); return $return; } } if($type == 4){ if($exe != 'mp3' && $exe != 'm4a' && $exe != 'wav'){ $return = array('status'=>0,'msg'=>'请上传正确的音频格式'); return $return; } } if($type == 5){ if($exe != 'mp4' && $exe != 'mov' && $exe != 'mkv' && $exe != 'flv' && $exe != '3gp' && $exe != 'wmv' && $exe != 'rmvb' && $exe != 'avi'){ $return = array('status'=>0,'msg'=>'请上传正确的视频格式'); return $return; } } $accessKey = 'nEztET3cvxjK87xXvVSOohxPd39zJTlO04jLgD74'; $secretKey = 'ThogMprroyhdDO5q163ClfRQ_CBn8yXRsHAx1_Qk'; $bucket = 'mangmesh…

支付宝转账：red
type: item
date: 2019-06-24T18:57:00+08:00
description: <?php /** * Created by PhpStorm. * User: Kevin * Date: 2018/10/7 * Time: 10:49 */ namespace app\admin\controller; use think\Db; class Money extends Base { public function tixianAgreeShopOrWork($number,$money,$phone,$name,$remark='') // public function tixianAgreeShopOrWork() { header("Content-type:text/html;charset=UTF-8"); // $number='444555661313131316'; // $money='0.1'; // $phone='15895980214'; // $name='麻威我'; // $remark = ''; import('alipay.aop.AopClient',EXTEND_PATH); import('alipay.aop.request.AlipayFundTransToaccountTransferRequest',EXTEND_PATH); $aop = new \AopClient; $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; $aop->appId = '2018090761306686'; $aop->rsaPrivateKey = '/o35qU8Sy9f0YSeOq4JRMast8tyj7hqI5ZEb4LCHioFpK76qmUHrsgAXO48NeQ0AZPsNA7jqYVEPHemcpk+Qzva0VkinUhSb+Hvqeam314lQpg0ctpJf73yjIy9ScxCFxNnoDLybWnbptazW3OwhKNdyVQ675kp/GXVU='; $aop->alipayrsaPublicKey = '[binary]'; $aop->apiVersion = '1.0'; $aop->signType = 'RSA2'; $aop->postCharset='UTF-8'; $aop->format='json'; $request = new \AlipayFundTransToaccountTransferRequest; $request->setBizContent("{" . "\"out_biz_no\":\"".$number."\"," . "\"payee_type\":\"ALIPAY_LOGONID\"," . "\"payee_account\":\"".$phone."\"," . "\"amount\":\"".$money."\"," . "\"payer_show_name\":\"红集提现到账\"," . "\"payee_real_name\":\"".$name."\"," . "\"remark\":\"".$remark."\"" . "}"); $result = $aop->execute($request); $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $resultCode = $result->$responseNode->code; if(!empty($resultCode)&&$resultCode == 10000){ $result = array(); $result['status'] = 200; $result['msg'] = 'OK'; return $result; } else { $result = array(); $result['status'] = 0; $result['msg'] = $result->alipay_fund_trans_toaccount_transfer_response->sub_msg; return $result; } } public function chaxunTixianRes($number) { header("Content-type:text/html;charset=UTF-8"); import('alipay.aop.AopClient',EXTEND_PATH); import('alipay.aop.request.AlipayFundTransOrderQueryRequest',EXTEND_PAT…

支付和退款（微信支付宝）red
type: item
date: 2019-06-24T18:56:00+08:00
description: <?php /** * Created by PhpStorm. * User: 戎大富 * Date: 2018/6/13 * Time: 10:40 */ namespace app\work\controller; use think\Controller; use think\Db; class Base extends Controller { protected $_error; protected $_header;//用户的请求头信息 protected $config = array( 'partner'=>'2088621781822784',//用不着 'seller_id'=>'admin@bagepanzi.com',//用不着 'sign_type'=>'RSA2',// 直接写死了 'it_b_pay'=>'10m',//用不着 'md5'=>'djqm7budkdlki6a76yasuyb9s1riiu1j',//用不着 'ali_public'=>'', 'public_key'=>"", 'private_key'=>'' ); // 定义配置项 private $config2=array( 'APPID' => 'wxa6a14bfed0d430bf', // 微信支付APPID. 'MCHID' => '1515748591', // 微信支付MCHID 商户收款账号 'KEY' => '', // 微信支付KEY 'APPSECRET' => '', // 公众帐号secert (公众号支付专用) 'NOTIFY_URL' => 'http://red.hjv5.com/work/Index/huidiaoWx', // 接收支付状态的连接 ); public function __construct() { // parent::__construct(); } /** * 验证唯一——单点登录 * user_id，time，salt，value * @return string */ public function checkAll($uid,$time,$value,$reqKey){//$uid,$time,$value header("Access-Control-Allow-Origin:*"); if($uid == '0'){ return true; }else{ $user = Db::table('up_work_user')->where('user_id',$uid)->find(); if(!$user){return false;} if($user['user_status'] != 1){ return false; } $token = $user['user_token']; $appId = "A6070308312682"; $appkey = "9AF807B0-BE12-F521-6998-6D57B0CCE8BB"; $myreqKey = md5($appId . 'XW' . $appkey . 'XW' . $time); $myvalue = md5($uid . 'XW' . $token . 'XW' . $time); if($myvalue != $value || $myreqKey != $reqKey){ return false; }else{ return true; } } } /** * 云之讯发送短信 * @param $phone * @param $num * @return mixed */ public function duaxin($phone,$num){ $body_json = array( 'sid'=>'2b6e76df39bef2e4a99eee7b77225c91', 'token'=>'26a41e1a5b90f6a0bd2e4fb4fb6a713e', 'appid'=>'760e6b2f0a45439585835cbed2e12e18', 'templateid'=>'373248', 'param'=>$num, 'mobile'=>$phone, 'uid'=>'', ); $body = json_encode($body_json); $header = array( 'Accept:application/json', 'Content-Type:application/json;charset=utf-8', ); $url = 'https://open.ucpaas.com/ol/sms/sendsms'; $ch = curl_init($url); cu…