人人商城

pluginverify.php 1.5KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. require '../../../../framework/bootstrap.inc.php';
  3. require '../../../../addons/ewei_shopv2/defines.php';
  4. require '../../../../addons/ewei_shopv2/core/inc/functions.php';
  5. $notify = $_POST;
  6. $result = p('grant')->verifyNotify($_POST);
  7. $order = pdo_fetch('select * from ' . tablename('ewei_shop_system_plugingrant_order') . ' where logno = \'' . $notify['out_trade_no'] . '\'');
  8. if ($notify['trade_status'] == 'TRADE_SUCCESS' && $result) {
  9. pdo_update('ewei_shop_system_plugingrant_order', array('paytime' => time(), 'paystatus' => 1), array('logno' => $notify['out_trade_no']));
  10. $plugind = explode(',', $order['pluginid']);
  11. $data = array('logno' => $order['logno'], 'uniacid' => $order['uniacid'], 'type' => 'pay', 'month' => $order['month'], 'createtime' => time());
  12. foreach ($plugind as $key => $value) {
  13. $plugin = pdo_fetch('select `identity` from ' . tablename('ewei_shop_plugin') . ' where id = ' . $value . ' ');
  14. $data['identity'] = $plugin['identity'];
  15. $data['pluginid'] = $value;
  16. $log = pdo_fetchcolumn('select count(1) from ' . tablename('ewei_shop_system_plugingrant_log') . ' where logno = \'' . $notify['out_trade_no'] . '\' and pluginid = ' . $value . ' ');
  17. if (!$log) {
  18. pdo_query('update ' . tablename('ewei_shop_system_plugingrant_plugin') . ' set sales = sales + 1 where pluginid = ' . $value . ' ');
  19. pdo_insert('ewei_shop_system_plugingrant_log', $data);
  20. $id = pdo_insertid();
  21. if (p('grant')) {
  22. p('grant')->pluginGrant($id);
  23. }
  24. }
  25. }
  26. echo 'SUCCESS';
  27. }
  28. ?>