TestController.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <?php
  2. namespace ghs\controllers;
  3. use biz\sj\services\MerchantService;
  4. use bizGhs\express\services\DadaExpressServices;
  5. use bizGhs\order\classes\OrderClass;
  6. use bizHd\message\classes\InformAdminClass;
  7. use bizHd\order\services\OrderService;
  8. use bizHd\wx\classes\WxOpenClass;
  9. use bizGhs\express\services\MiniExpressService;
  10. use common\components\dict;
  11. use common\components\lakala\Lakala;
  12. use common\components\miniUtil;
  13. use common\components\orderSn;
  14. use common\components\wxUtil;
  15. use Yii;
  16. use common\components\util;
  17. class TestController extends BaseController
  18. {
  19. public $guestAccess = ['inform', 'notice', 'order-query', 'add-order', 'index', 'get'];
  20. public function actionGet()
  21. {
  22. ini_set('memory_limit', '2045M');
  23. set_time_limit(0);
  24. $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
  25. $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
  26. $arr = [
  27. //['name' => '国兰花尚', 'merchantNo' => '82239305992006L', 'wx' => [600913569, 600907053], 'zfb' => '2088820709029782'],
  28. //['name' => '花掌柜', 'merchantNo' => '82240505992000P', 'wx' => [600466131, 600465187], 'zfb' => '2088820656569304'],
  29. //['name' => '纯彩花艺', 'merchantNo' => '82239305992006M', 'wx' => [600922790, 600915407], 'zfb' => '2088820710146836'],
  30. //['name' => '集美天天鲜花', 'merchantNo' => '82239305992006P', 'wx' => [601036538, 601036322], 'zfb' => '2088820726763339'],
  31. //['name' => '丰行花行', 'merchantNo' => '82260205992007P', 'wx' => [601053759, 601052157], 'zfb' => '2088820725885465'],
  32. //['name' => '独家花行', 'merchantNo' => '82239305992006Q', 'wx' => [601049483, 601048223], 'zfb' => '2088820725546555'],
  33. //['name' => '好多花海沧', 'merchantNo' => '82239305992006R', 'wx' => [601052177, 601053735], 'zfb' => '2088820725549695'],
  34. //['name' => '美天鲜花', 'merchantNo' => '82259505992003F', 'wx' => [601062064, 601138175], 'zfb' => '2088820729400990'],
  35. //['name' => '天天陈江店', 'merchantNo' => '82259505992003E', 'wx' => [601060616, 601059382], 'zfb' => '2088820725555368'],
  36. //['name' => '叶上花', 'merchantNo' => '82231805992002G', 'wx' => [601062892, 601062589], 'zfb' => '2088820728763546'],
  37. //['name' => '好又多(小明)', 'merchantNo' => '82239305992006S', 'wx' => [601135715, 601067347], 'zfb' => '2088820729698012'],
  38. //['name' => '我卖花', 'merchantNo' => '82227505992000R', 'wx' => [601177139, 601148755], 'zfb' => '2088820746424032'],
  39. ['name' => '杭州斗南', 'merchantNo' => '8223310599200AD', 'wx' => [601254682, 601250805], 'zfb' => '2088820782666872'],
  40. ['name' => '七彩花都', 'merchantNo' => '8227310599200GF', 'wx' => [601176481, 601148503], 'zfb' => '2088820748594478'],
  41. ['name' => '十年', 'merchantNo' => '82252305992001U', 'wx' => [601285154, 601261795], 'zfb' => '2088820782171763'],
  42. //['name' => '都市花季', 'merchantNo' => '82239305992006U', 'wx' => [601174342, 601147649], 'zfb' => '2088820748507346'],
  43. //['name' => '花样年华', 'merchantNo' => '82260205992007Q', 'wx' => [601134352, 601091710], 'zfb' => '2088820735043444'],
  44. //['name' => '精茂城', 'merchantNo' => '8225840599200TF', 'wx' => [601173752, 601143352], 'zfb' => '2088820746800005'],
  45. ['name' => '莱漫(没用)', 'merchantNo' => '82239305992006T', 'wx' => [601134065, 601125595], 'zfb' => '2088820743859918'],
  46. //['name' => '福州我要花', 'merchantNo' => '82239105992007J', 'wx' => [601134030, 601128111], 'zfb' => '2088820745276973'],
  47. ['name' => '泉城', 'merchantNo' => '82239705992004F', 'wx' => [601273270, 601272854], 'zfb' => '2088820784658561'],
  48. //['name' => '泉城(没用)', 'merchantNo' => '82239705992004E', 'wx' => [601133056, 601133821], 'zfb' => '2088820746111323'],
  49. ['name' => '美丽花行', 'merchantNo' => '82239305992006V', 'wx' => [601155249, 601149712], 'zfb' => '2088820747673312'],
  50. //['name' => '三叶', 'merchantNo' => '82236805992001Y', 'wx' => [601152233, 601151024], 'zfb' => '2088820747556725'],
  51. //['name' => '花大苪', 'merchantNo' => '8227310599200GG', 'wx' => [601174221, 601165136], 'zfb' => '2088820751181377'],
  52. //['name' => '十堰天天鲜花', 'merchantNo' => '82252305992001S', 'wx' => [601171131, 601170642], 'zfb' => '2088820750844626'],
  53. //['name' => '珑松花卉', 'merchantNo' => '82260205992007S', 'wx' => [601176093, 601174262], 'zfb' => '2088820754742492'],
  54. //['name' => '惠雅鲜花', 'merchantNo' => '82260205992007R', 'wx' => [601173390, 601174002], 'zfb' => '2088820753174540'],
  55. //['name' => '锦绣花卉', 'merchantNo' => '82252305992001T', 'wx' => [601176719, 601176660], 'zfb' => '2088820754751663'],
  56. //['name' => '祥瑞鲜花同安店', 'merchantNo' => '82239305992006W', 'wx' => [601178350, 601177795], 'zfb' => '2088820755715024'],
  57. //['name' => '祥瑞鲜花翔安店', 'merchantNo' => '82239305992006X', 'wx' => [601178260, 601178199], 'zfb' => '2088820754481553'],
  58. //['name' => '初见花季', 'merchantNo' => '82239305992006Y', 'wx' => [601178998, 601179605], 'zfb' => '2088820757223312'],
  59. //['name' => '荣发鲜花', 'merchantNo' => '82242705992000D', 'wx' => [601179681, 601179180], 'zfb' => '2088820756926593'],
  60. //['name' => '花千朵(多多)', 'merchantNo' => '82239305992006Z', 'wx' => [601223474, 601208096], 'zfb' => '2088820766783276'],
  61. //['name' => '花悠星', 'merchantNo' => '8225810599200NH', 'wx' => [601228194, 601227691], 'zfb' => '2088820774587446'],
  62. //['name' => '花悠星(没用)', 'merchantNo' => '8225810599200NG', 'wx' => [601223630, 601210952], 'zfb' => '2088820767072874'],
  63. //['name' => '源花汇', 'merchantNo' => '82222105992004A', 'wx' => [601221944, 601214269], 'zfb' => '2088820770594246'],
  64. //['name' => '源花汇2(没用)', 'merchantNo' => '8227310599200GD', 'wx' => [601136305, 601067016], 'zfb' => '2088820729832744'],
  65. ];
  66. $new = [];
  67. foreach ($arr as $item) {
  68. $wx = $item['wx'];
  69. $zfb = $item['zfb'];
  70. $merchantNo = $item['merchantNo'];
  71. $name = $item['name'] . ' ' . $merchantNo;
  72. $group = [];
  73. foreach ($wx as $oneWx) {
  74. $params = [
  75. 'appid' => 'OP00002119',
  76. 'serial_no' => '018b08cfddbd',
  77. 'merchant_no' => $merchantNo,
  78. 'term_no' => 'C6337694',
  79. 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
  80. 'lklCertificatePath' => $lklCertificatePath,
  81. ];
  82. $data = [
  83. 'subMerchantId' => $oneWx,
  84. 'tradeMode' => 'WECHAT',
  85. ];
  86. $laResource = new Lakala($params);
  87. $response = $laResource->openStateQuery($data);
  88. $statusName = '出错了';
  89. if ($response['retCode'] == '000000') {
  90. $checkResult = $response['respData']['checkResult'] ?? '';
  91. $statusName = '未确认';
  92. if ($checkResult == 'AUTHORIZE_STATE_AUTHORIZED') {
  93. $statusName = '已确认';
  94. }
  95. }
  96. $group[] = '微信 ' . $oneWx . ' ' . $statusName;
  97. }
  98. $params = [
  99. 'appid' => 'OP00002119',
  100. 'serial_no' => '018b08cfddbd',
  101. 'merchant_no' => $merchantNo,
  102. 'term_no' => 'C6337694',
  103. 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
  104. 'lklCertificatePath' => $lklCertificatePath,
  105. ];
  106. $data = [
  107. 'subMerchantId' => $zfb,
  108. 'tradeMode' => 'ALIPAY',
  109. ];
  110. $laResource = new Lakala($params);
  111. $response = $laResource->openStateQuery($data);
  112. $statusName = '出错了';
  113. if ($response['retCode'] == '000000') {
  114. $checkResult = $response['respData']['checkResult'] ?? '';
  115. $statusName = '未确认';
  116. if ($checkResult == 'AUTHORIZED') {
  117. $statusName = '已确认';
  118. }
  119. }
  120. $group[] = '支付宝 ' . $zfb . ' ' . $statusName;
  121. $new[] = ['name' => $name, 'status' => $group];
  122. }
  123. echo '<pre>';
  124. print_r($new);
  125. die;
  126. }
  127. public function actionAliRun2()
  128. {
  129. $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
  130. $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
  131. $params = [
  132. 'appid' => 'OP00002119',
  133. 'serial_no' => '018b08cfddbd',
  134. 'merchant_no' => '82240505992000N',
  135. 'term_no' => 'C6337694',
  136. 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
  137. 'lklCertificatePath' => $lklCertificatePath,
  138. ];
  139. $outTradeNo = orderSn::getPurchaseSn();
  140. $notifyUrl = Yii::$app->params['hdHost'] . "/notice/pay-callback";
  141. $currentCapitalType = dict::getDict('capitalType', 'xhPurchase', 'id');
  142. $aliParams = [
  143. 'orderSn' => $outTradeNo,
  144. 'amount' => 0.16,
  145. 'capitalType' => $currentCapitalType,
  146. 'notifyUrl' => $notifyUrl,
  147. ];
  148. $laResource = new Lakala($params);
  149. $response = $laResource->driveAliPay($aliParams);
  150. if ($response && isset($response['cmdRetCode']) && $response['cmdRetCode'] == 'GLOBAL_SUCCESS') {
  151. echo '<pre>';
  152. echo "下单成功<br/>";
  153. print_r($response);
  154. } else {
  155. echo '<pre>';
  156. echo "下单失败<br/>";
  157. print_r($response);
  158. }
  159. }
  160. public function actionAliRun3()
  161. {
  162. $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
  163. $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
  164. $params = [
  165. 'appid' => 'OP00002119',
  166. 'serial_no' => '018b08cfddbd',
  167. 'merchant_no' => '82240505992000N',
  168. 'term_no' => 'C6337694',
  169. 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
  170. 'lklCertificatePath' => $lklCertificatePath,
  171. ];
  172. $laResource = new Lakala($params);
  173. $outTradeNo = orderSn::getPurchaseSn();
  174. $notifyUrl = Yii::$app->params['hdHost'] . "/notice/pay-callback";
  175. $currentCapitalType = dict::getDict('capitalType', 'xhPurchase', 'id');
  176. $wxParams = [
  177. 'orderSn' => $outTradeNo,
  178. 'amount' => 0.16,
  179. 'capitalType' => $currentCapitalType,
  180. 'notifyUrl' => $notifyUrl,
  181. ];
  182. $response = $laResource->driveWxPay($wxParams);
  183. if ($response && isset($response['cmdRetCode']) && $response['cmdRetCode'] == 'GLOBAL_SUCCESS') {
  184. echo '<pre>';
  185. echo "下单成功<br/>";
  186. print_r($response);
  187. } else {
  188. echo '<pre>';
  189. echo "下单失败<br/>";
  190. print_r($response);
  191. }
  192. }
  193. //dada 城市code
  194. public function actionDadaCityCode()
  195. {
  196. $res = dada::getCityCode(0);
  197. util::success($res);
  198. }
  199. //理由
  200. public function actionDadaReasons()
  201. {
  202. $res = dada::getCancelReason(0);
  203. util::success($res);
  204. }
  205. //达达 :下单
  206. public function actionDadaAddOrder()
  207. {
  208. $orderSn = 'XSD_CS26316851';
  209. $orderInfo = OrderClass::getByOrderSn($orderSn);
  210. $res = DadaExpressServices::addOrder($orderInfo);
  211. util::success($res);
  212. }
  213. //重发快递
  214. public function actionDadaReAdd()
  215. {
  216. $orderSn = 'XSD_CS26316851';
  217. $orderInfo = OrderClass::getByOrderSn($orderSn);
  218. $res = DadaExpressServices::reAddOrder($orderInfo);
  219. util::success($res);
  220. }
  221. //达达状态查询
  222. public function actionDadaOrderStatus()
  223. {
  224. $orderSn = 'XSD_CS26316851';
  225. $res = DadaExpressServices::statusOrder($orderSn);
  226. util::success($res);
  227. }
  228. //达达取消下单
  229. public function actionDadaCancelOrder()
  230. {
  231. $orderSn = 'XSD_CS26316851';
  232. $res = DadaExpressServices::cancelOrder($orderSn, 1);
  233. util::success($res);
  234. }
  235. //获取已支持的配送公司列表接口
  236. public function actionGetAllDelivery()
  237. {
  238. $data = MiniExpressService::getAllImmeDelivery();
  239. util::success($data);
  240. }
  241. //即时配送
  242. /*
  243. * Array
  244. (
  245. [resultcode] => 0
  246. [resultmsg] => OK
  247. [shop_list] => Array
  248. (
  249. [0] => Array
  250. (
  251. [shopid] => 1588714266
  252. [delivery_id] => SFTC
  253. [audit_result] => 0
  254. [create_time] => 1612172838
  255. [remark] =>
  256. [delivery_name] => 顺丰同城急送
  257. )
  258. )
  259. )
  260. */
  261. public function actionGetBindAccount()
  262. {
  263. $merchant = WxOpenClass::getGhsWxInfo();
  264. $isOpen = 2;
  265. $r = miniUtil::getBindAccount($merchant, $isOpen);
  266. dd($r);
  267. }
  268. //下单 (沙箱)
  269. /**
  270. * Array
  271. * (
  272. * [resultcode] => 0
  273. * [resultmsg] => ok
  274. * [fee] => 10
  275. * [waybill_id] => test_shop_id1612365974_waybillid
  276. * [order_status] => 101
  277. * [dispatch_duration] => 300
  278. * )
  279. */
  280. public function actionCreateWaybill()
  281. {
  282. $merchant = WxOpenClass::getGhsWxInfo();
  283. $isOpen = 2;
  284. $shopId = 'test_shop_id';
  285. $shopOrderId = 'test_shop_id' . time();
  286. $appSecret = 'test_app_secrect';
  287. $data = [
  288. 'shopid' => $shopId,
  289. 'shop_order_id' => $shopOrderId,
  290. 'shop_no' => '1',
  291. 'delivery_sign' => miniUtil::getDeliverySign($shopId, $shopOrderId, $appSecret), //,则delivery_sign=SHA1(shopid + shop_order_id + AppSecret)
  292. 'delivery_id' => "TEST",
  293. 'openid' => 'oGKMp45YLxewOTWEbpMFzWoVqdW0',
  294. 'sender' => [
  295. 'name' => 'test',
  296. 'city' => '厦门市',
  297. 'address' => '思明区',
  298. 'address_detail' => '软件园二期',
  299. 'phone' => '19959271111',
  300. 'lng' => 118.134343,
  301. 'lat' => 24.483566,
  302. 'coordinate_type' => 0,
  303. ],
  304. 'receiver' => [
  305. 'name' => 'test',
  306. 'city' => '厦门市',
  307. 'address' => '思明区',
  308. 'address_detail' => '软件园二期',
  309. 'phone' => '19959271111',
  310. 'lng' => 118.134343,
  311. 'lat' => 24.493566,
  312. 'coordinate_type' => 0,
  313. ],
  314. 'cargo' => [
  315. 'goods_value' => 1,
  316. 'goods_weight' => 0.1,
  317. 'cargo_first_class' => '鲜花',
  318. 'cargo_second_class' => '鲜花',
  319. ],
  320. 'order_info' => [
  321. 'order_type' => 0,
  322. ],
  323. 'shop' => [
  324. 'wxa_path' => '/shop',
  325. 'img_url' => 'http://www.baidu.com/test.png',
  326. 'goods_name' => 'test',
  327. 'goods_count' => 1,
  328. ],
  329. ];
  330. $r = miniUtil::addOrder($data, $merchant, $isOpen);
  331. dd($r);
  332. }
  333. //获取运单数据
  334. /**
  335. * Array
  336. * (
  337. * [resultcode] => 0
  338. * [resultmsg] => ok
  339. * [order_status] => 101
  340. * [agent_info] => Array
  341. * (
  342. * )
  343. *
  344. * [waybill_id] => test_shop_id1612365974_waybillid
  345. * [rider_name] =>
  346. * [rider_phone] =>
  347. * [order_token] => NsXweKCKhSyAEIhAdnX3TYZsVDES0-t-tymHDONG0MpRsF31dQvVxiP_JJvLFaKS-kwXuOG3D0hzKkl7o-gzew
  348. * )
  349. */
  350. public function actionGetOrder()
  351. {
  352. $shopId = 'test_shop_id';
  353. $shopOrderId = 'test_shop_id1612365974';
  354. $appSecret = 'test_app_secrect';
  355. $merchant = WxOpenClass::getGhsWxInfo();
  356. $isOpen = 2;
  357. $data = [
  358. 'shopid' => $shopId,
  359. 'shop_order_id' => $shopOrderId,
  360. 'shop_no' => '1',
  361. 'delivery_sign' => MiniExpressService::getDeliverySign($shopId, $shopOrderId, $appSecret),
  362. ];
  363. $r = miniUtil::getOrder($data, $merchant, $isOpen);
  364. dd($r);
  365. }
  366. //沙盒 更新快递状态
  367. public function actionMockUpdateOrder()
  368. {
  369. $merchant = WxOpenClass::getGhsWxInfo();
  370. $isOpen = 2;
  371. /**
  372. * {
  373. * "shopid": "test_shop_id",
  374. * "shop_order_id": "xxxxxxxxxxx",
  375. * "waybill_id": "xxxxxxxxxxxxx",
  376. * "action_time": 12345678,
  377. * "order_status": 101,
  378. * "action_msg": "",
  379. * }
  380. */
  381. $shopId = 'test_shop_id';
  382. $shopOrderId = 'test_shop_id1612365974';
  383. $data = [
  384. 'shop_order_id' => $shopOrderId,
  385. "shopid" => $shopId,
  386. "action_time" => time(),
  387. "order_status" => 302,
  388. 'action_msg' => '状态变更',
  389. ];
  390. $r = miniUtil::mockUpdateOrder($data, $merchant, $isOpen);
  391. dd($r);
  392. }
  393. public function actionTest()
  394. {
  395. }
  396. //新增订单
  397. public function actionAddOrder()
  398. {
  399. $dada = Yii::getAlias("@vendor/dada/");
  400. require_once $dada . 'api/addOrderApi.php';
  401. require_once $dada . 'client/dadaRequestClient.php';
  402. require_once $dada . 'client/dadaResponse.php';
  403. require_once $dada . 'config/config.php';
  404. require_once $dada . 'model/orderModel.php';
  405. // isOnline 判断是否是测试环境,会有不同的域名等
  406. $isOnline = false;
  407. $sourceId = 1000000;
  408. // 初始化一个config
  409. $config = new \Config($sourceId, $isOnline);
  410. $orderModel = new \OrderModel();
  411. $orderModel->setShopNo('11047059');
  412. $orderModel->setOriginId('2018091100000002');
  413. $orderModel->setCityCode('021');
  414. $orderModel->setCargoPrice(10);
  415. $orderModel->setIsPrepay(0);
  416. $orderModel->setReceiverName('测试达达');
  417. $orderModel->setReceiverAddress('上海市崇明岛');
  418. $orderModel->setReceiverLat(31.63);
  419. $orderModel->setReceiverLng(121.41);
  420. $orderModel->setReceiverPhone('18588888888');
  421. $orderModel->setCallback('http://api.b.huaml.com/data/request');
  422. // api主要有2个参数,一个是url, 一个是业务参数
  423. $addOrderApi = new \AddOrderApi(json_encode($orderModel));
  424. $dada_client = new \DadaRequestClient($config, $addOrderApi);
  425. $resp = $dada_client->makeRequest();
  426. echo json_encode($resp);
  427. }
  428. //订单详情查询
  429. public function actionOrderQuery()
  430. {
  431. $dada = Yii::getAlias("@vendor/dada/");
  432. require_once $dada . 'api/OrderQueryApi.php';
  433. require_once $dada . 'client/dadaRequestClient.php';
  434. require_once $dada . 'client/dadaResponse.php';
  435. require_once $dada . 'config/config.php';
  436. require_once $dada . 'model/orderModel.php';
  437. // isOnline 判断是否是测试环境,会有不同的域名等
  438. $isOnline = false;
  439. $sourceId = 1000000;
  440. // 初始化一个config
  441. $config = new \Config($sourceId, $isOnline);
  442. $orderModel = new \OrderModel();
  443. $orderModel->setOrderId('2018091100000002');
  444. // api主要有2个参数,一个是url, 一个是业务参数
  445. $addOrderApi = new \OrderQueryApi(json_encode($orderModel));
  446. $dada_client = new \DadaRequestClient($config, $addOrderApi);
  447. $resp = $dada_client->makeRequest();
  448. echo json_encode($resp);
  449. }
  450. public function actionFocus()
  451. {
  452. $name = '花卉宝';
  453. if (getenv('YII_ENV') == 'dev') {
  454. $name = '花美灵';
  455. }
  456. $merchant = MerchantService::getByCondition(['name' => $name]);
  457. $list = wxUtil::getSubscribeUserList($merchant);
  458. dd($list);
  459. }
  460. //宝贝售出提醒 ssh 2020.1.30
  461. public function actionInform()
  462. {
  463. $merchant = MerchantService::getMerchantById(12362);
  464. $order = OrderService::getById(214810);
  465. InformAdminClass::sendComplete($order);
  466. }
  467. public function actionNotice()
  468. {
  469. $data = ['messageType' => 'inform', 'informWay' => 'wx', 'userType' => 'admin', 'id' => 6, 'mobile' => '15280215347'];
  470. $producer = Yii::$app->rabbitmq->getProducer('informProducer');
  471. echo '<pre>';
  472. print_r($data);
  473. $msg = serialize($data);
  474. $r = $producer->publish($msg, 'informExchange', 'informRoute');
  475. }
  476. }