| | |
| | | if ($operate == 'check_pay_result') { |
| | | $orderid = intval($_GPC['orderid']); |
| | | $pay_type = pdo_getcolumn('site_store_order', array('id' => $orderid), 'type'); |
| | | |
| | | |
| | | $condition = array('id' => $orderid); |
| | | $order_info = pdo_get('site_store_order', $condition, ''); |
| | | |
| | | // 2018-12-19 购买成功后,直接添加到绑定的小程序上 chenlei start |
| | | $module = pdo_fetch("SELECT g.module,g.type,m.version FROM ".tablename('site_store_order'). |
| | | " o LEFT JOIN ".tablename('site_store_goods')." g on o.goodsid = g.id LEFT JOIN ".tablename('modules'). |
| | | " m on m.name = g.module WHERE o.id = :id LIMIT 1", array(':id' => $orderid)); |
| | | if ($pay_type == STORE_ORDER_FINISH) { |
| | | $module = pdo_fetch("SELECT g.module,g.type,m.version,MAX(v.version),v.id FROM ".tablename('site_store_order'). |
| | | " o LEFT JOIN ".tablename('site_store_goods')." g on o.goodsid = g.id LEFT JOIN ".tablename('modules'). |
| | | " m on m.name = g.module LEFT JOIN".tablename('wxapp_versions')." v on v.uniacid = o.uniacid WHERE o.id = :id LIMIT 1", array(':id' => $orderid)); |
| | | |
| | | if (!empty($module)) { |
| | | if ($module[type] == ACCOUNT_TYPE_APP_NORMAL) { |
| | | $new_module_data = array( |
| | | $module[module] => array( |
| | | 'name' => $module[module], |
| | | 'version' => $module[version] |
| | | ) |
| | | ); |
| | | pdo_update('wxapp_versions', array('modules' => iserializer($new_module_data)), array('id' => $module[id])); |
| | | cache_delete(cache_system_key('miniapp_version', array('version_id' => $module[id]))); |
| | | } |
| | | } |
| | | // 2018-12-19 购买成功后,直接添加到绑定的小程序上 chenlei end |
| | | |
| | | iajax(1); |
| | | } else { |
| | | iajax(2); |