|
@@ -0,0 +1,51 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+declare(strict_types=0);
|
|
|
+
|
|
|
+define('APP_ID', 'sender');
|
|
|
+define('BASE_ROOT_PATH',str_replace('/server','',dirname(__FILE__)));
|
|
|
+define('BASE_PATH',BASE_ROOT_PATH . '/server');
|
|
|
+
|
|
|
+require_once(BASE_ROOT_PATH . '/global.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/fooder.php');
|
|
|
+require_once(BASE_CORE_PATH . '/framework/function/http.php');
|
|
|
+require_once(BASE_HELPER_PATH . '/refill_proxy.php');
|
|
|
+
|
|
|
+//Co::set(['hook_flags' => SWOOLE_HOOK_NATIVE_CURL|SWOOLE_HOOK_SLEEP]);
|
|
|
+
|
|
|
+class RefillSender
|
|
|
+{
|
|
|
+ public function send()
|
|
|
+ {
|
|
|
+ $time = time();
|
|
|
+ Log::record("push message start:{$time}",Log::DEBUG);
|
|
|
+
|
|
|
+ for ($i = 0; $i < 100000; $i++)
|
|
|
+ {
|
|
|
+ $this->push_order(1092,$time,$i);
|
|
|
+ }
|
|
|
+ Log::record("push message end",Log::DEBUG);
|
|
|
+ }
|
|
|
+
|
|
|
+ private function push_order($mchid,$time,$index)
|
|
|
+ {
|
|
|
+ $notify_url = "http://test.xyzshops.cn/mobile/callback/bridge_test.php";
|
|
|
+ $params = [ 'mchid' => $mchid,
|
|
|
+ 'amount' => 30,
|
|
|
+ 'order_sn' => "{$time}" . sprintf("%'010d",$index),
|
|
|
+ 'card_no' => '13911129867',
|
|
|
+ "act" => "refill",
|
|
|
+ "op" => "add",
|
|
|
+ 'notifyurl' => $notify_url
|
|
|
+ ];
|
|
|
+
|
|
|
+ $proxy = new refill_proxy("210fe406954220f56085997d6a4c5b80");
|
|
|
+ $resp = $proxy->send("http://test.xyzshops.cn/mobile/index.php", $params);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+$sender = new RefillSender();
|
|
|
+$sender->send();
|
|
|
+
|
|
|
+
|
|
|
+
|