Yspay.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <?php namespace Pay\Lib;
  2. use Dever;
  3. class Yspay extends Core
  4. {
  5. public function __construct($config)
  6. {
  7. $project = Dever::project('pay');
  8. # 通知接口
  9. $config['notify'] = $this->url($config['type'], $config['id']);
  10. $set = explode('|', $config['mchid']);
  11. $config['mid'] = $set[0];
  12. $config['tid'] = $set[1];
  13. if (isset($set[2])) {
  14. $config['prefix'] = $set[2];
  15. }
  16. $set = explode('|', $config['key']);
  17. $config['sub_appid'] = $set[0];
  18. $config['sub_appsecret'] = $set[1];
  19. if (isset($set[2])) {
  20. $config['key'] = $set[2];
  21. }
  22. $this->config = $config;
  23. }
  24. /**
  25. * 通知
  26. */
  27. public function notify()
  28. {
  29. $input = file_get_contents("php://input");
  30. if ($input) {
  31. parse_str($input, $input);
  32. } else {
  33. $input = Dever::input();
  34. }
  35. $test = Dever::input('test');
  36. if ($test == 1) {
  37. $input = json_decode('{"msgType":"wx.notify","payTime":"2021-12-29 18:24:42","buyerCashPayAmt":"1","connectSys":"UNIONPAY","sign":"E82978003E0121B320D3520B1930FB4C2072B639126F3427351631F1D0A998CF","merName":"中食民安(北京)科技有限公司","mid":"89810007372106N","invoiceAmount":"1","settleDate":"2021-12-29","billFunds":"现金:1","buyerId":"otdJ_uD-zTNmDn7-u13oActXu8lA","mchntUuid":"2d9081bd7db8ad75017dbbe68981314f","tid":"DM098308","instMid":"MINIDEFAULT","receiptAmount":"1","couponAmount":"0","targetOrderId":"4200001344202112290882463274","signType":"SHA256","billFundsDesc":"现金支付0.01元。","subBuyerId":"oGlMn5e_vdYK8uAaCgyexarFKBrY","orderDesc":"中食民安(北京)科技有限公司","seqId":"25267273719N","merOrderId":"138K_G202112297347788956443487","targetSys":"WXPay","bankInfo":"OTHERS","totalAmount":"1","createTime":"2021-12-29 18:24:38","buyerPayAmount":"1","iB":"KRHn","notifyId":"d4122965-b772-4f8f-b5c4-f3d483da0962","subInst":"100000","status":"TRADE_SUCCESS"}', true);
  38. $input = json_decode('{"bankInfo":"OTHERS","billDate":"2022-01-06","billDesc":"中食民安(北京)科技有限公司","billNo":"138KG202201064666839470673943","billPayment":"{\"payTime\":\"2022-01-06 13:24:56\",\"buyerCashPayAmt\":1,\"paySeqId\":\"25394941600N\",\"invoiceAmount\":1,\"settleDate\":\"2022-01-06\",\"buyerId\":\"otdJ_uHh75dIaI6EKu-6usw0hjD4\",\"receiptAmount\":1,\"totalAmount\":1,\"couponAmount\":0,\"billBizType\":\"bills\",\"buyerPayAmount\":1,\"targetOrderId\":\"4200001348202201065614123115\",\"payDetail\":\"现金支付0.01元。\",\"merOrderId\":\"138KG2022010646668394706739430\",\"status\":\"TRADE_SUCCESS\",\"targetSys\":\"WXPay\"}","billQRCode":"https:\/\/qr.95516.com\/48020000\/138K2201066502428138291294","billStatus":"PAID","createTime":"2022-01-06 13:24:28","instMid":"QRPAYDEFAULT","mchntUuid":"2d9081bd7db8ad75017dbbe68981314f","merName":"中食民安(北京)科技有限公司","mid":"89810007372106N","notifyId":"49a83755-b476-47c3-a0b6-629dc7a43742","qrCodeId":"138K2201066502428138291294","qrCodeType":"BILLPAY","receiptAmount":"1","seqId":"25394941600N","signType":"SHA256","subInst":"100000","tid":"DM098308","totalAmount":"1","vE":"Bclv","sign":"1D048E292E17225A4EEF4AB438630601A19E50CDA71DF9E7A4304AABBD134A38","e_sign":"1D048E292E17225A4EEF4AB438630601A19E50CDA71DF9E7A4304AABBD134A38"}', true);
  39. }
  40. $sign = $input['sign'];
  41. unset($input['sign']);
  42. if (isset($input['e_sign'])) {
  43. unset($input['e_sign']);
  44. }
  45. ksort($input);
  46. $string = array();
  47. foreach ($input as $k => $v) {
  48. if (strstr($v, '&') || strstr($v, '@')) {
  49. $v = urlencode($v);
  50. }
  51. $string[] = $k . '=' . $v;
  52. }
  53. $string = implode('&', $string);
  54. $string .= $this->config['key'];
  55. if ($input['signType'] == 'SHA256') {
  56. $string = hash("sha256", $string);
  57. } else {
  58. $string = md5($string);
  59. }
  60. $string = strtoupper($string);
  61. $input['sign'] = $sign;
  62. $input['e_sign'] = $string;
  63. $this->log('支付回调-初始化', $input);
  64. if ($sign == $string) {
  65. if (isset($input['billNo']) && $input['billNo']) {
  66. $key = 'billNo';
  67. } else {
  68. $key = 'merOrderId';
  69. }
  70. if (isset($this->config['prefix']) && $this->config['prefix']) {
  71. $input[$key] = str_replace($this->config['prefix'], '', $input[$key]);
  72. }
  73. if (isset($input['billPayment'])) {
  74. $input['billPayment'] = json_decode($input['billPayment'], true);
  75. if (isset($input['billPayment']['status'])) {
  76. $input['status'] = $input['billPayment']['status'];
  77. }
  78. }
  79. if (!isset($input['status'])) {
  80. echo 'FAILED';die;
  81. }
  82. $desc = '';
  83. if ($input['status'] == 'TRADE_SUCCESS') {
  84. # 成功
  85. } elseif ($input['status'] == 'TRADE_REFUND') {
  86. # 退款
  87. echo 'SUCCESS';die;
  88. } elseif ($input['status'] == 'TRADE_CLOSED') {
  89. $desc = '交易关闭';
  90. } elseif ($input['status'] == 'UNKNOWN') {
  91. $desc = '不明确的交易状态';
  92. } else {
  93. echo 'FAILED';die;
  94. }
  95. $this->updateOrder($input[$key], $input['totalAmount']);
  96. echo 'SUCCESS';die;
  97. } else {
  98. echo 'FAILED';die;
  99. }
  100. }
  101. private function getType($type)
  102. {
  103. switch ($type) {
  104. case 1:
  105. //小程序支付
  106. $type = 'MINI';
  107. break;
  108. case 2://扫码支付
  109. $type = 'APP';
  110. break;
  111. case 3://APP支付
  112. $type = 'APP';
  113. break;
  114. case 4://页面拉起支付
  115. $type = 'YUEDAN';
  116. break;
  117. }
  118. return $type;
  119. }
  120. /**
  121. * 获取统一下单的基本信息
  122. */
  123. public function order($account_id, $project_id, $uid, $username, $product_id, $name, $cash, $openid = false, $type = 1, $order_id = false, $other = false, $refer = false)
  124. {
  125. $trade_type = $this->getType($type);
  126. $order_id = $this->createOrder($uid, $username, $account_id, $project_id, $product_id, $name, $cash, $this->config['type'], $order_id);
  127. if (isset($this->config['prefix']) && $this->config['prefix']) {
  128. $request['merOrderId'] = $this->config['prefix'] . $order_id;
  129. } else {
  130. $request['merOrderId'] = $order_id;
  131. }
  132. $request['mid'] = $this->config['mid'];
  133. $request['tid'] = $this->config['tid'];
  134. $request['instMid'] = $trade_type . 'DEFAULT';
  135. $request['totalAmount'] = round($cash * 100, 2);
  136. //$request['totalAmount'] = 100;
  137. $request['subAppId'] = $this->config['sub_appid'];
  138. $request['requestTimestamp'] = date("Y-m-d H:i:s");
  139. $request['expireTime'] = date("Y-m-d H:i:s", time() + $this->config['timeout']);
  140. $request['notifyUrl'] = $this->config['notify'];
  141. $request['tradeType'] = $trade_type;
  142. if ($other) {
  143. $request['originalAmount'] = round($other['oprice'] * 100, 2);
  144. $request['divisionFlag'] = true;
  145. # 平台分账金额
  146. $other['per'] = $other['per'] && $other['per'] >= 0 ? $other['per'] : 0;
  147. $other['per'] = $other['per']/100;
  148. $request['platformAmount'] = round($request['totalAmount'] * $other['per'], 2);
  149. $request['subOrders'] = array();
  150. $request['subOrders']['mid'] = $other['mid'];
  151. if (isset($this->config['prefix']) && $this->config['prefix']) {
  152. $request['subOrders']['merOrderId'] = $this->config['prefix'] . $other['order_id'];
  153. } else {
  154. $request['subOrders']['merOrderId'] = $other['order_id'];
  155. }
  156. $request['subOrders']['totalAmount'] = round($request['totalAmount'] - $request['platformAmount'], 2);
  157. $request['subOrders'] = array($request['subOrders']);
  158. }
  159. if (!$openid) {
  160. # 测试的openid
  161. $request['subOpenId'] = 'ofBUV0RUoy_8C4VctZjrSDGzhUfY';
  162. } else {
  163. $request['subOpenId'] = $openid;
  164. }
  165. if ($type == 2) {
  166. # 二维码支付
  167. $request['instMid'] = 'QRPAYDEFAULT';
  168. $request['billNo'] = $request['merOrderId'];
  169. unset($request['merOrderId']);
  170. $result = Base::get_pay_code($request, $this->config);
  171. if (isset($result['billQRCode'])) {
  172. $result['request'] = $request;
  173. $result['payMsg'] = $result['billQRCode'];
  174. if ($other) {
  175. $result['other'] = $other;
  176. }
  177. $this->updateOrderParam($order_id, $result);
  178. return $result['payMsg'];
  179. }
  180. } elseif ($type == 1) {
  181. # 小程序支付
  182. $result = Base::pay($request, $this->config);
  183. if (isset($result['miniPayRequest'])) {
  184. $result['request'] = $request;
  185. $result['payMsg'] = $result['miniPayRequest'];
  186. unset($result['miniPayRequest']);
  187. if ($other) {
  188. $result['other'] = $other;
  189. }
  190. $this->updateOrderParam($order_id, $result);
  191. return $result['payMsg'];
  192. }
  193. } elseif ($type == 4) {
  194. if ($refer) {
  195. $request['returnUrl'] = $refer;
  196. }
  197. $result = Base::h5_pay($request, $this->config);
  198. return $result;
  199. }
  200. return false;
  201. }
  202. # 退款
  203. public function refund($order_id, $cash, $order, $refund_order_id = false)
  204. {
  205. if ($refund_order_id) {
  206. $refund_order_id = $refund_order_id . '_' . Dever::order();
  207. }
  208. if (isset($this->config['prefix']) && $this->config['prefix']) {
  209. $request['merOrderId'] = $this->config['prefix'] . $order_id;
  210. if ($refund_order_id) {
  211. $request['refundOrderId'] = $this->config['prefix'] . $refund_order_id;
  212. }
  213. } else {
  214. $request['merOrderId'] = $order_id;
  215. if ($refund_order_id) {
  216. $request['refundOrderId'] = $refund_order_id;
  217. }
  218. }
  219. $request['mid'] = $this->config['mid'];
  220. $request['tid'] = $this->config['tid'];
  221. $request['instMid'] = 'MINIDEFAULT';
  222. if (isset($order['param']['targetOrderId'])) {
  223. $request['targetOrderId'] = $order['param']['targetOrderId'];
  224. }
  225. $request['subAppId'] = $this->config['appid'];
  226. $request['requestTimestamp'] = date("Y-m-d H:i:s");
  227. $request['refundAmount'] = round($cash * 100, 2);
  228. if (isset($order['param']['other']) && $order['param']['other']) {
  229. $other = $order['param']['other'];
  230. $other['per'] = $other['per'] && $other['per'] >= 0 ? $other['per'] : 0;
  231. $other['per'] = $other['per']/100;
  232. $request['platformAmount'] = round($request['refundAmount'] * $other['per'], 2);
  233. $request['subOrders'] = array();
  234. $request['subOrders']['mid'] = $other['mid'];
  235. if (isset($this->config['prefix']) && $this->config['prefix']) {
  236. $request['subOrders']['merOrderId'] = $this->config['prefix'] . $other['order_id'];
  237. if ($refund_order_id) {
  238. $request['subOrders']['refundOrderId'] = $this->config['prefix'] . $refund_order_id;
  239. }
  240. } else {
  241. $request['subOrders']['merOrderId'] = $other['order_id'];
  242. if ($refund_order_id) {
  243. $request['subOrders']['refundOrderId'] = $refund_order_id;
  244. }
  245. }
  246. $request['subOrders']['totalAmount'] = round($request['refundAmount'] - $request['platformAmount'], 2);
  247. $request['subOrders'] = array($request['subOrders']);
  248. }
  249. $account = Dever::db('pay/account')->find($order['account_id']);
  250. $method = 'refund';
  251. if ($account && $account['system_source'] == 4) {
  252. $method = 'code_refund';
  253. $request['billNo'] = $request['merOrderId'];
  254. $request['instMid'] = 'QRPAYDEFAULT';
  255. $request['billDate'] = date('Y-m-d');
  256. }
  257. $result = Base::$method($request, $this->config);
  258. if (isset($result['refundStatus']) && $result['refundStatus'] == 'SUCCESS') {
  259. return true;
  260. }
  261. return false;
  262. }
  263. # 查询
  264. public function query($order_id)
  265. {
  266. $request['merOrderId'] = $order_id;
  267. $request['mid'] = $this->config['mchid'];
  268. $request['tid'] = $this->config['key'];
  269. $request['instMid'] = 'MINIDEFAULT';
  270. $request['requestTimestamp'] = date("Y-m-d H:i:s");
  271. $result = Base::refund($request, $this->config);
  272. return $result;
  273. }
  274. # 关闭订单
  275. public function close($order_id)
  276. {
  277. $request['merOrderId'] = $order_id;
  278. $request['mid'] = $this->config['mchid'];
  279. $request['tid'] = $this->config['key'];
  280. $request['instMid'] = 'MINIDEFAULT';
  281. $request['requestTimestamp'] = date("Y-m-d H:i:s");
  282. $result = Base::close($request, $this->config);
  283. return $result;
  284. }
  285. /**
  286. * 获取二维码支付
  287. */
  288. public function qrcode($order, $refer)
  289. {
  290. $result['type'] = 'qrcode';
  291. $result['url'] = $order;
  292. return $result;
  293. }
  294. /**
  295. * 获取小程序支付
  296. */
  297. public function applet($order)
  298. {
  299. $result = array();
  300. if (isset($order['package'])) {
  301. $prepay_id = str_replace('prepay_id=', '', $order['package']);
  302. $result['time'] = $order['timeStamp'];
  303. $result['nonce_str'] = $order['nonceStr'];
  304. $result['prepay_id'] = $prepay_id;
  305. $result['sign_type'] = $order['signType'];
  306. $result['sign'] = $order['paySign'];
  307. $result['type'] = 'applet';
  308. }
  309. return $result;
  310. }
  311. /**
  312. * 获取页面支付 去收银台
  313. */
  314. public function page($order, $refer)
  315. {
  316. return $order;
  317. }
  318. }
  319. class Base
  320. {
  321. static $test_host = 'https://test-api-open.chinaums.com/';
  322. static $host = 'https://api-mop.chinaums.com/';
  323. static $signMethod = 'SHA256'; //签名方式
  324. # 获取token
  325. static $token_url = 'v1/token/access';
  326. # 微信下单支付
  327. static $pay_wechat_url = 'v1/netpay/wx/unified-order';
  328. # 支付宝下单支付
  329. static $pay_alipay_url = 'v1/netpay/trade/create';
  330. # 云闪付下单支付
  331. static $pay_uac_url = 'v1/netpay/uac/mini-order';
  332. # 交易查询
  333. static $query_url = 'v1/netpay/query';
  334. # 退款
  335. static $refund_url = 'v1/netpay/refund';
  336. # 退款查询
  337. static $refund_query_url = 'v1/netpay/refund-query';
  338. # 订单关闭
  339. static $close_url = 'v1/netpay/close';
  340. # 二维码支付
  341. static $qrcode_url = 'v1/netpay/bills/get-qrcode';
  342. # 二维码支付退款
  343. static $qrcode_refund_url = 'v1/netpay/bills/refund';
  344. # h5支付
  345. static $h5_url = 'v1/netpay/webpay/pay';
  346. # h5支付退款
  347. static $h5_refund_url = 'v1/netpay/wx/app-pre-order';
  348. //===================== 支付相关 ==============================
  349. /**
  350. * 支付交易
  351. */
  352. static public function pay($param, $config)
  353. {
  354. $url = self::$pay_wechat_url;
  355. $result = self::get($url, $param, $config);
  356. return $result;
  357. }
  358. /**
  359. * h5支付
  360. */
  361. static public function h5_pay($param, $config)
  362. {
  363. $url = self::$h5_url;
  364. $result = self::get($url, $param, $config);
  365. return $result;
  366. }
  367. /**
  368. * 获取支付二维码
  369. */
  370. static public function get_pay_code($param, $config)
  371. {
  372. $url = self::$qrcode_url;
  373. $result = self::get($url, $param, $config);
  374. return $result;
  375. }
  376. /**
  377. * 二维码交易退款
  378. */
  379. static public function code_refund($param, $config)
  380. {
  381. $url = self::$qrcode_refund_url;
  382. $result = self::get($url, $param, $config);
  383. return $result;
  384. }
  385. /**
  386. * 支付撤销
  387. */
  388. static public function close()
  389. {
  390. $url = self::$close_url;
  391. $result = self::get($url, $param, $config);
  392. return $result;
  393. }
  394. /**
  395. * 交易退款
  396. */
  397. static public function refund($param, $config)
  398. {
  399. $url = self::$refund_url;
  400. $result = self::get($url, $param, $config, false);
  401. return $result;
  402. }
  403. /**
  404. * 交易查询
  405. */
  406. static public function query()
  407. {
  408. $url = self::$query_url;
  409. $result = self::get($url, $param, $config);
  410. return $result;
  411. }
  412. /**
  413. * 交易退款查询
  414. */
  415. static public function refundQuery()
  416. {
  417. $url = self::$refund_query_url;
  418. $result = self::get($url, $param, $config);
  419. return $result;
  420. }
  421. //====================== 获取调用凭证===========================
  422. /**
  423. * 通用调用凭证获取
  424. * 默认使用token方式,使用签名方式需要传入参数
  425. */
  426. static public function getAuth($type = 'token', $param, $config)
  427. {
  428. if ($type === 'token') {
  429. return self::getAccessTokenByToken($config);
  430. } elseif ($type === 'form') {
  431. return self::getAccessTokenByForm($param, $config);
  432. }
  433. return self::getAccessTokenBySig($param, $config);
  434. }
  435. /**
  436. * 方式一,OPEN-ACCESS-TOKEN方式
  437. */
  438. static function getAccessTokenByToken($config)
  439. {
  440. $param = [
  441. 'appId' => $config['appid'],
  442. 'timestamp' => date('YmdHis'),
  443. 'nonce' => md5(uniqid(microtime(true),true)),
  444. 'signMethod' => self::$signMethod,
  445. ];
  446. $param['signature'] = self::signature($param, $config['appsecret']);
  447. $result = self::get(self::$token_url, $param, $config);
  448. if (isset($result['errCode']) && isset($result['accessToken'])) {
  449. return 'OPEN-ACCESS-TOKEN AccessToken='.$result['accessToken'];
  450. }
  451. return '';
  452. }
  453. /**
  454. * 方式二,OPEN-BODY-SIG方式
  455. */
  456. static function getAccessTokenBySig($data, $config)
  457. {
  458. $param = [
  459. 'AppId' => $config['appid'],
  460. 'Timestamp' => date('YmdHis'),
  461. 'Nonce' => md5(uniqid(microtime(true),true))
  462. ];
  463. return 'OPEN-BODY-SIG AppId="'.$param['AppId'].'", Timestamp="'.$param['Timestamp'].'", Nonce="'.$param['Nonce'].'", Signature="'.self::signature2($data, $param, $config['appsecret']).'"';
  464. }
  465. /**
  466. * 方式三,OPEN-FORM-PARAM方式
  467. */
  468. static function getAccessTokenByForm($data, $config)
  469. {
  470. $content = Dever::json_encode($data);
  471. $param = [
  472. 'appId' => $config['appid'],
  473. 'timestamp' => date('YmdHis'),
  474. 'nonce' => md5(uniqid(microtime(true),true)),
  475. 'authorization' => 'OPEN-FORM-PARAM',
  476. 'content' => $content,
  477. ];
  478. $param['signature'] = urlencode(self::signature3($param, $config['appsecret']));
  479. $param['content'] = urlencode($param['content']);
  480. return $param;
  481. }
  482. /**
  483. * 计算签名,方式一
  484. */
  485. static function signature($param, $appsecret)
  486. {
  487. return bin2hex(hash(self::$signMethod, $param['appId'].$param['timestamp'].$param['nonce'].$appsecret, true));
  488. }
  489. /**
  490. * 计算签名,方式二
  491. */
  492. static function signature2($data, $param, $appsecret)
  493. {
  494. $str = bin2hex(hash('sha256', Dever::json_encode($data), true));
  495. return base64_encode(hash_hmac('sha256', $param['AppId'].$param['Timestamp'].$param['Nonce'].$str, $appsecret, true));
  496. }
  497. /**
  498. * 计算签名,方式三
  499. */
  500. static function signature3($param, $appsecret)
  501. {
  502. $str = bin2hex(hash('sha256', $param['content'], true));
  503. return base64_encode(hash_hmac('sha256', $param['appId'].$param['timestamp'].$param['nonce'].$str, $appsecret, true));
  504. }
  505. /**
  506. * 获取信息
  507. */
  508. static function get($url, $param, $config, $state = true)
  509. {
  510. $url = $config['box'] == 1 ? self::$host . $url : self::$test_host . $url;
  511. if (strstr($url, 'webpay')) {
  512. $url .= '?';
  513. $param = self::getAuth('form', $param, $config);
  514. foreach ($param as $k => $v) {
  515. $url .= '&' . $k . '=' . $v;
  516. }
  517. $url = str_replace('?&', '?', $url);
  518. return $url;
  519. } else {
  520. $header = array();
  521. $header['Authorization'] = self::getAuth('sig', $param, $config);
  522. $result = Dever::curl($url, $param, 'post', true, $header);
  523. }
  524. if (strstr($result, '<html><head>')) {
  525. Dever::alert('系统错误');
  526. }
  527. $result = Dever::json_decode($result);
  528. if (isset($result['errCode'])) {
  529. if (!$state) {
  530. return $result;
  531. }
  532. if ($result['errCode'] == '0000' || $result['errCode'] == 'SUCCESS') {
  533. return $result;
  534. } elseif (isset($result['errInfo'])) {
  535. Dever::alert('操作失败,请联系管理员');
  536. Dever::alert($result['errInfo']);
  537. } elseif (isset($result['errMsg'])) {
  538. Dever::alert('操作失败,请联系管理员');
  539. Dever::alert($result['errMsg']);
  540. }
  541. } else {
  542. Dever::alert('系统错误');
  543. }
  544. return $result;
  545. }
  546. }