Sign.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <?php
  2. namespace Pay\Yspay;
  3. use Dever;
  4. header("Content-Type:text/html;charset=utf-8");
  5. Class Sign
  6. {
  7. private $key = "o5ho739mgrphdm28g5rwx1nw";
  8. private $accesser_id = '2d9081bd7db8ad75017dbbe68981314f';
  9. private $url = 'https://yinshangpai.chinaums.com/self-contract-nmrs/interface/autoReg/';
  10. private $sign_type = 'SHA-256';
  11. private $test = 2;
  12. /*
  13. 0-银联卡(1)
  14. 1-全民付(86)
  15. 2-POS通(68)
  16. 4-营销联盟(40)
  17. 8-公共支付-通用(9)
  18. 16-代付业务(74)
  19. 21-统一会员卡(37)
  20. in1-APP支付(in1)
  21. in2-H5支付(in2)
  22. in3-公众号支付(in3)
  23. in4-小程序支付(in4)
  24. */
  25. private $product_id = array('8');
  26. private $document_type = array
  27. (
  28. 'idcard_front' => ['document_type' => '0001','document_name' => '身份证正面'],
  29. 'idcard_back' => ['document_type' => '0011','document_name' => '身份证反面'],
  30. 'license' => ['document_type' => '0002','document_name' => '营业执照'],
  31. 'tax' => ['document_type' => '0003','document_name' => '税务登记证'],
  32. 'door' => ['document_type' => '0005','document_name' => '门头照'],
  33. 'hand_idcard' => ['document_type' => '0007','document_name' => '手持身份证自拍照'],
  34. 'open' => ['document_type' => '0006','document_name' => '开户许可证'],
  35. 'bank_fount' => ['document_type' => '0025','document_name' => '银行卡正面照'],
  36. 'bank_back' => ['document_type' => '0026','document_name' => '银行卡反面照'],
  37. 'house_pic' => ['document_type' => '0015','document_name' => '室内照片'],
  38. 'screen_pic' => ['document_type' => '0034','document_name' => '商户网站/APP截图'],
  39. );
  40. public function update($id, $name, $data)
  41. {
  42. $cash = Dever::param('cash', $data);
  43. $sign = Dever::db('pay/yspay_sign')->find($id);
  44. if ($cash && $cash > 0) {
  45. $this->account_check($sign, $cash);
  46. }
  47. }
  48. # 计划任务
  49. public function cron_api()
  50. {
  51. $where['step'] = '4,5';
  52. $data = Dever::db('pay/yspay_sign')->getData($where);
  53. if ($data) {
  54. foreach ($data as $k => $v) {
  55. $this->check($v);
  56. }
  57. }
  58. return 'ok';
  59. }
  60. # 获取合同链接
  61. public function getAgreement_api($sign_id)
  62. {
  63. $sign = Dever::db('pay/yspay_sign')->find($sign_id);
  64. return $this->agreement($sign, false);
  65. }
  66. # 获取当前状态
  67. public function getStatus_api($sign_id)
  68. {
  69. $sign = Dever::db('pay/yspay_sign')->find($sign_id);
  70. return $this->check($sign);
  71. }
  72. # 获取最新一条日志
  73. public function getLog($sign_id, $status)
  74. {
  75. if ($status == 1) {
  76. return '签约已完成';
  77. }
  78. $sign = Dever::db('pay/yspay_sign')->find($sign_id);
  79. if ($sign) {
  80. $log = Dever::db('pay/yspay_sign_log')->find(array('merchant_id' => $sign['merchant_id']));
  81. if ($log) {
  82. $date = date('Y-m-d H:i', $log['cdate']);
  83. $step = Dever::db('pay/yspay_sign_log')->config['step'][$log['step']];
  84. return $date . '<br />' . $step . '<br />' . $log['desc'];
  85. } else {
  86. return '待签约提审';
  87. }
  88. } else {
  89. return '待签约提审';
  90. }
  91. }
  92. # 获取日志列表
  93. public function getLogList($sign_id)
  94. {
  95. $sign = Dever::db('pay/yspay_sign')->find($sign_id);
  96. if (!$sign) {
  97. return Dever::timeline('填写资料');
  98. }
  99. $result = array();
  100. $log = Dever::db('pay/yspay_sign_log')->select(array('merchant_id' => $sign['merchant_id']));
  101. if ($log) {
  102. foreach ($log as $k => $v) {
  103. if ($v['step'] == 4) {
  104. //$v['response'] = Dever::json_decode($v['response']);
  105. $url = $this->agreement($sign, false);
  106. $v['desc'] .= ' <a href="'.$url.'" target="_blank">点此打开</a> <a style="cursor:pointer" data-clipboard-text="'.$url.'" class="clipboard">复制链接</a>';
  107. }
  108. $date = date('Y-m-d H:i', $v['cdate']);
  109. $name = '';
  110. if ($v['admin_id'] > 0) {
  111. $admin = Dever::db('manage/admin')->find($v['admin_id']);
  112. if ($admin) {
  113. $name = '[' . $admin['username'] . ']&nbsp;&nbsp;';
  114. }
  115. }
  116. $result[] = $date . '&nbsp;&nbsp;' . $name . ''. $v['desc'];
  117. }
  118. }
  119. if ($sign['step'] == -1) {
  120. $url = Dever::url('pay/yspay/sign.handle?sign_id=' . $sign['id'] . '&json=1');
  121. $result[] = '<a href="javascript:;" onclick="load(\''.$url.'\')">点此上传资料</a>';
  122. }
  123. $result = Dever::timeline('签约记录', $result);
  124. return $result;
  125. }
  126. # 统一处理接口
  127. public function handle_api($sign_id)
  128. {
  129. $sign = Dever::db('pay/yspay_sign')->find($sign_id);
  130. if (!$sign) {
  131. Dever::alert('档案资料未上传');
  132. }
  133. $sign['merchant'] = Dever::db('pay/yspay_merchant')->one($sign['merchant_id']);
  134. $sign['yspay'] = Dever::db('pay/yspay')->one(array('account_id' => $sign['merchant']['account_id']));
  135. $this->key = $sign['yspay']['sign_key'];
  136. $this->accesser_id = $sign['yspay']['sign_accesser_id'];
  137. $sign['bank_acct_no'] = trim($sign['bank_acct_no']);
  138. switch($sign['step']) {
  139. case -1:
  140. # 提交资料
  141. return $this->up($sign);
  142. break;
  143. case 1:
  144. case 6:
  145. if ($sign['bank_acct_type'] == 1) {
  146. # 对公打款
  147. return $this->account($sign);
  148. } else {
  149. # 签约
  150. return $this->agreement($sign);
  151. }
  152. break;
  153. case 2:
  154. # 打款验证
  155. return $this->account_check($sign);
  156. break;
  157. case 4:
  158. case 5:
  159. # 验证签约
  160. return $this->check($sign);
  161. break;
  162. case 6:
  163. # 签约成功,变更签约?
  164. return '签约已成功,后续可以变更签约';
  165. return $this->up($sign);
  166. break;
  167. }
  168. return 'ok';
  169. }
  170. # 上传图片
  171. public function upload_api()
  172. {
  173. $document_type = $this->document_type;
  174. $key = Dever::input('key');
  175. $upload = Dever::json_decode(Dever::input('upload'));
  176. if ($upload && isset($document_type[$key]) && isset($upload['url'])) {
  177. $url = md5($upload['url']);
  178. $sign_pic = Dever::db('pay/yspay_sign_pic')->find(array('key' => $key, 'url' => $url));
  179. if (!$sign_pic) {
  180. $pic = $this->pic($upload['url']);
  181. if ($pic && isset($pic['data']['file_path']) && $pic['data']['file_path']) {
  182. $insert = array();
  183. $insert['url'] = $url;
  184. $insert['document_type'] = $document_type[$key]['document_type'];
  185. $insert['document_name'] = $document_type[$key]['document_name'];
  186. $insert['key'] = $key;
  187. $insert['path'] = Dever::json_encode($pic['data']);
  188. Dever::db('pay/yspay_sign_pic')->insert($insert);
  189. }
  190. }
  191. }
  192. return 'ok';
  193. }
  194. #3.2 详细采集档案资料上传接口
  195. private function up($sign)
  196. {
  197. $service = 'complex_upload';
  198. $data['remark'] = '线上支付商户';
  199. $data['accesser_user_id'] = $sign['id'];
  200. if ($sign['reg_mer_type'] == 1) {
  201. $sign['reg_mer_type'] = '00';
  202. } elseif ($sign['reg_mer_type'] == 2) {
  203. $sign['reg_mer_type'] = '01';
  204. } elseif ($sign['reg_mer_type'] == 3) {
  205. $sign['reg_mer_type'] = '02';
  206. }
  207. $data['reg_mer_type'] = $sign['reg_mer_type'];#注册类型
  208. $data['legal_name'] = $sign['name'];#法人姓名
  209. $data['legal_idcard_no'] = $sign['idcard'];#法人身份证号
  210. $data['legal_mobile'] = $sign['mobile'];#法人手机号
  211. $data['legal_card_deadline'] = $sign['card_deadline'] == '长期' ? '9999-12-31' : date('Y-m-d',$sign['card_deadline']);#证件截止代表日期
  212. $data['shop_name'] = $sign['merchant']['name'];#商户名称
  213. if ($sign['bank_acct_type'] == -1) {
  214. $data['bank_acct_type'] = 0;
  215. $data['bank_acct_name'] = $sign['name'];#开户账号名称
  216. } else {
  217. $data['bank_acct_type'] = 1;
  218. $data['bank_acct_name'] = $sign['company_name'];#开户账号名称
  219. }
  220. $data['bank_acct_no'] = $sign['bank_acct_no'];#开户行账号
  221. $data['mccCode'] = $sign['mccCode'];
  222. $area = explode(',', $sign['area']);
  223. $data['shop_province_id'] = $area[0]/10000;
  224. $data['shop_city_id'] = $area[1]/100;
  225. $data['shop_country_id'] = $area[2];
  226. $sign_area = explode(',',$sign['area']);
  227. $data['shop_lic'] = $sign['license_number'];#营业执照号
  228. $bank = $this->bank_list($sign_area[0]/10000, $sign['bank_acct_noname']);
  229. if($bank && isset($bank['branchBankList']) && $bank['branchBankList']){
  230. $bank['branchBankList'] = $bank['branchBankList'][0];
  231. $in['where_id'] = $sign['id'];
  232. $in['bank_no'] = $bank['branchBankList']['code'];
  233. $in['shop_addr_ext'] = $bank['branchBankList']['bankBranchName'];
  234. Dever::db('pay/yspay_sign')->update($in);
  235. $data['bank_no'] = $bank['branchBankList']['code'];
  236. $data['shop_addr_ext'] = $bank['branchBankList']['bankBranchName'];
  237. } else {
  238. return $this->log(1, $sign, '开户行行号不存在');
  239. }
  240. if ($sign['reg_mer_type'] == '00' && $sign['bank_acct_type'] != '1') {
  241. return $this->log(1, $sign, '账户类型不正确1');
  242. }
  243. if ($sign['legalmanHomeAddr']) {
  244. $data['legalmanHomeAddr'] = $sign['legalmanHomeAddr'];
  245. }
  246. $document_type = $this->document_type;
  247. foreach ($document_type as $k => $v) {
  248. if (isset($sign[$k]) && $sign[$k]) {
  249. $sign[$k] = Dever::pic($sign[$k]);
  250. $url = md5($sign[$k]);
  251. $sign_pic = Dever::db('pay/yspay_sign_pic')->find(array('key' => $k, 'url' => $url));
  252. if (!$sign_pic) {
  253. $pic = $this->pic($sign[$k]);
  254. if ($pic && isset($pic['data']['file_path']) && $pic['data']['file_path']) {
  255. $insert = array();
  256. $insert['url'] = $url;
  257. $insert['document_type'] = $v['document_type'];
  258. $insert['document_name'] = $v['document_name'];
  259. $insert['key'] = $k;
  260. $insert['path'] = Dever::json_encode($pic['data']);
  261. Dever::db('pay/yspay_sign_pic')->insert($insert);
  262. $data['pic_list'][] = array('document_name' => $v['document_name'], 'document_type' => $v['document_type'] , 'file_path'=> $pic['data']['file_path'], 'file_size'=>$pic['data']['file_size']);
  263. }
  264. } else {
  265. $pic = Dever::json_decode($sign_pic['path']);
  266. $data['pic_list'][] = array('document_name' => $sign_pic['document_name'], 'document_type' => $sign_pic['document_type'] , 'file_path'=> $pic['file_path'], 'file_size'=>$pic['file_size']);
  267. }
  268. }
  269. }
  270. $ids = $this->product_id;
  271. $data['product'] = array();
  272. foreach ($ids as $k => $v) {
  273. $data['product'][$k] = ['product_id' => $v];
  274. }
  275. $result = $this->get($service, $data);
  276. if ($result && $result['code'] == 1 && isset($result['data']['ums_reg_id']) && $result['data']['ums_reg_id']) {
  277. $update = array();
  278. $update['where_id'] = $sign['id'];
  279. $sign['ums_reg_id'] = $update['ums_reg_id'] = $result['data']['ums_reg_id'];
  280. Dever::db('pay/yspay_sign')->update($update);
  281. $this->log(1, $sign, '资料上传成功', $data, $result['data'], $result['request_seq']);
  282. if ($data['bank_acct_type'] == 1) {
  283. return $this->account($sign);
  284. } else {
  285. return $this->agreement($sign);
  286. }
  287. } else {
  288. $this->log(1, $sign, $result['msg'], $data, $result['data'], $result['request_seq']);
  289. }
  290. return Dever::input('json') == 1 ? 'reload' : $result;
  291. }
  292. # 3.7 发起对公账户验证交易接口
  293. public function account($sign)
  294. {
  295. $step = 2;
  296. $service = 'request_account_verify';
  297. $data['ums_reg_id'] = $sign['ums_reg_id'];
  298. $data['company_account'] = $sign['bank_acct_no'];
  299. $result = $this->get($service, $data);
  300. if ($result && $result['code'] == 1 && isset($result['data']['request_seq']) && $result['data']['request_seq']) {
  301. $update = array();
  302. $update['where_id'] = $sign['id'];
  303. $update['step'] = $step;
  304. $update['clear'] = true;
  305. Dever::db('pay/yspay_sign')->update($update);
  306. $this->log($update['step'], $sign, '公户打款成功', $data, $result['data'], $result['request_seq']);
  307. } else {
  308. $this->log($step, $sign, $result['msg'], $data, $result['data'], $result['request_seq']);
  309. }
  310. return Dever::input('json') == 1 ? 'reload' : $result;
  311. }
  312. # 3.6 对公账户认证接口
  313. public function account_check($sign, $num)
  314. {
  315. $step = 3;
  316. $trans_amt = $num;
  317. $service = 'company_account_verify';
  318. $data['ums_reg_id'] = $sign['ums_reg_id'];
  319. $data['company_account'] = $sign['bank_acct_no'];
  320. $data['trans_amt'] = $trans_amt;
  321. $result = $this->get($service, $data, $sign['ums_reg_id']);
  322. if ($result && $result['code'] == 1 && isset($result['data']['request_seq']) && $result['data']['request_seq']) {
  323. $update = array();
  324. $update['where_id'] = $sign['id'];
  325. $update['step'] = $step;
  326. $update['clear'] = true;
  327. Dever::db('pay/yspay_sign')->update($update);
  328. $this->log($update['step'], $sign, '公户对账成功', $data, $result['data'], $result['request_seq']);
  329. return $this->agreement($sign);
  330. } else {
  331. $this->log($step, $sign, $result['msg'], $data, $result['data'], $result['request_seq']);
  332. }
  333. return $result;
  334. }
  335. # 3.3 前台签约接口
  336. public function agreement($sign, $log = true)
  337. {
  338. $step = 4;
  339. $service = 'agreement_sign';
  340. $data['ums_reg_id'] = $sign['ums_reg_id'];
  341. $data['pcOrH5'] = 'H5';
  342. $result = $this->get($service, $data);
  343. if ($result && $result['code'] == 1 && isset($result['data']['url']) && $result['data']['url']) {
  344. $update = array();
  345. $update['where_id'] = $sign['id'];
  346. $update['step'] = $step;
  347. $update['url'] = $result['data']['url'];
  348. $update['clear'] = true;
  349. Dever::db('pay/yspay_sign')->update($update);
  350. if ($log) {
  351. $this->log($update['step'], $sign, '请复制链接进行合同签署', $data, $result['data'], $result['request_seq']);
  352. } else {
  353. return $update['url'];
  354. }
  355. } else {
  356. $this->log($step, $sign, $result['msg'], $data, $result['data'], $result['request_seq']);
  357. }
  358. return Dever::input('json') == 1 ? 'reload' : $result;
  359. }
  360. # 3.4 入网状态查询接口
  361. public function check($sign)
  362. {
  363. $step = 5;
  364. $service = 'apply_qry';
  365. $data['ums_reg_id'] = $sign['ums_reg_id'];
  366. $result = $this->get($service, $data, $sign['ums_reg_id']);
  367. if ($result && $result['code'] == 1 && isset($result['data']['apply_status'])) {
  368. if ($result['data']['apply_status'] == '03') {
  369. $step = 6;
  370. }
  371. $update = array();
  372. $update['where_id'] = $sign['id'];
  373. $update['step'] = $step;
  374. $update['clear'] = true;
  375. if ($result['data']['apply_status'] == '03' && isset($result['data']['mer_no']) && $result['data']['mer_no']) {
  376. $mid = $result['data']['mer_no'];
  377. Dever::db('pay/yspay_merchant')->update(array('merchant_id' => $sign['merchant_id'], 'mid' => $mid));
  378. }
  379. Dever::db('pay/yspay_sign')->update($update);
  380. $this->log($update['step'], $sign, $result['data']['apply_status_msg'], $data, $result['data'], $result['request_seq']);
  381. } else {
  382. $this->log($step, $sign, $result['data']['apply_status_msg'], $data, $result['data'], $result['request_seq']);
  383. }
  384. return $result;
  385. }
  386. private function encrypt($data)
  387. {
  388. $res = bin2hex(openssl_encrypt($data, 'DES-EDE3', $this->key, OPENSSL_RAW_DATA));
  389. return $res;
  390. }
  391. private function decrypt($data)
  392. {
  393. return openssl_decrypt(pack('H*',$data), 'DES-EDE3', $this->key, OPENSSL_RAW_DATA);
  394. }
  395. private function get($service, $data)
  396. {
  397. $accesser_id = $this->accesser_id;
  398. $sign_type = $this->sign_type;
  399. $param = $data;
  400. $param['service'] = $service;
  401. $param['sign_type'] = $sign_type;
  402. $param['accesser_id'] = $accesser_id;
  403. $param['request_date'] = date('YmdHis');
  404. $param['request_seq'] = Dever::order();
  405. $sign_data = json_encode($param, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
  406. $send['json_data'] = $this->encrypt($sign_data);
  407. $send['sign_data'] = hash('sha256', $sign_data);
  408. $send['accesser_id'] = $accesser_id;
  409. $url = $this->url;
  410. $result = array();
  411. $result['request_seq'] = $param['request_seq'];
  412. $result['code'] = 2;
  413. $result['msg'] = '请求失败';
  414. $result['data'] = array();
  415. if ($service == 'agreement_sign') {
  416. $result['code'] = 1;
  417. $result['msg'] = '请求成功';
  418. $result['data']['url'] = $url . '?' . http_build_query($send);
  419. return $result;
  420. }
  421. if ($this->test != 1) {
  422. $response = Dever::curl($url, $send, 'post');
  423. } else {
  424. # 数据模拟
  425. $response = $this->data($service, $param);
  426. }
  427. $result['data'] = $response;
  428. if ($response) {
  429. $response = Dever::json_decode($response);
  430. if (isset($response['res_code']) && ($response['res_code'] == '0000' || $response['res_code'] == '1446')) {
  431. $result['code'] = 1;
  432. $result['msg'] = '请求成功';
  433. $result['data'] = $response;
  434. } elseif (isset($response['res_msg']) && $response['res_msg']) {
  435. $result['code'] = 2;
  436. $result['msg'] = $response['res_msg'];
  437. $result['data'] = $response;
  438. } elseif (isset($response['apply_status_msg']) && $response['apply_status_msg']) {
  439. $result['code'] = 2;
  440. $result['msg'] = $response['apply_status_msg'];
  441. $result['data'] = $response;
  442. }
  443. }
  444. return $result;
  445. }
  446. private function data($service, $data)
  447. {
  448. $result = array();
  449. $result['res_code'] = '0000';
  450. $result['res_msg'] = 'ok';
  451. $result['request_seq'] = $data['request_seq'];
  452. if ($service == 'pic_upload') {
  453. $result['file_path'] = $data['request_seq'];
  454. $result['file_type'] = 'jpg';
  455. $result['file_size'] = strlen($result['file_path']);
  456. } elseif ($service == 'complex_upload') {
  457. $result['ums_reg_id'] = $data['request_seq'];
  458. } elseif ($service == 'agreement_sign') {
  459. $result['url'] = 'https://www.baidu.com/';
  460. } elseif ($service == 'apply_qry') {
  461. $result['apply_status'] = '03';
  462. $result['apply_status_msg'] = '入网成功(最终成功状态)';
  463. } elseif ($service == 'branch_bank_list') {
  464. $result['branchBankList'][] = array('code' => '308100005607', 'bankBranchName' => '招商银行股份有限公司北京天通苑支行');
  465. }
  466. return Dever::json_encode($result);
  467. }
  468. private function pic($pic)
  469. {
  470. $service = 'pic_upload';
  471. if ($pic) {
  472. $pic_base64 = $this->test != 1 ? file_get_contents($pic) : 'content';
  473. if ($pic_base64) {
  474. $temp = explode('?', $pic);
  475. if ($temp) {
  476. $one = pathinfo($temp[0]);
  477. } else {
  478. $one = pathinfo($pic);
  479. }
  480. $data['pic_base64'] = "data:image/".$one['extension'].";base64,".base64_encode($pic_base64);
  481. $result = $this->get($service, $data);
  482. return $result;
  483. }
  484. }
  485. return false;
  486. }
  487. # 查询支行
  488. private function bank_list($areaCode, $key)
  489. {
  490. $service = 'branch_bank_list';
  491. $data['areaCode'] = $areaCode;
  492. $data['key'] = $key;
  493. $result = $this->get($service,$data);
  494. return $result['data'];
  495. }
  496. # 记录日志
  497. private function log($step, $sign, $msg, $request = array(), $response = array(), $request_seq = '')
  498. {
  499. if (!$sign) {
  500. return $msg;
  501. }
  502. $data['step'] = $step;
  503. $data['merchant_id'] = $sign['merchant_id'];
  504. $data['desc'] = $msg;
  505. $info = false;
  506. if ($step == 4 || $step == 5) {
  507. $info = Dever::db('pay/yspay_sign_log')->find($data);
  508. }
  509. $admin = Dever::load('manage/auth.info');
  510. if ($admin) {
  511. $data['admin_id'] = $admin['id'];
  512. }
  513. if ($request_seq) {
  514. $data['request_seq'] = $request_seq;
  515. }
  516. if ($request) {
  517. $data['request'] = Dever::json_encode($request);
  518. }
  519. if ($response) {
  520. if (is_array($response)) {
  521. $response = Dever::json_encode($response);
  522. }
  523. $data['response'] = $response;
  524. }
  525. if ($info) {
  526. $data['where_id'] = $info['id'];
  527. Dever::db('pay/yspay_sign_log')->update($data);
  528. } else {
  529. Dever::db('pay/yspay_sign_log')->insert($data);
  530. }
  531. return $msg;
  532. }
  533. }