人人商城

ewei_shopv2_api.php 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php define("IN_SYS", true);
  2. require(__DIR__ . "/../framework/bootstrap.inc.php");
  3. load()->web("common");
  4. $_W["uniacid"] = intval($_GPC["i"]);
  5. $uniacid = $_W["uniacid"];
  6. $_W["attachurl_local"] = $_W["siteroot"] . $_W["config"]["upload"]["attachdir"] . "/";
  7. $_W["attachurl"] = $_W["attachurl_local"];
  8. if( !empty($_W["setting"]["remote"][$_W["uniacid"]]["type"]) )
  9. {
  10. $_W["setting"]["remote"] = $_W["setting"]["remote"][$_W["uniacid"]];
  11. }
  12. if( !empty($_W["setting"]["remote"]["type"]) )
  13. {
  14. if( $_W["setting"]["remote"]["type"] == ATTACH_FTP )
  15. {
  16. $_W["attachurl_remote"] = $_W["setting"]["remote"]["ftp"]["url"] . "/";
  17. $_W["attachurl"] = $_W["attachurl_remote"];
  18. }
  19. else
  20. {
  21. if( $_W["setting"]["remote"]["type"] == ATTACH_OSS )
  22. {
  23. $_W["attachurl_remote"] = $_W["setting"]["remote"]["alioss"]["url"] . "/";
  24. $_W["attachurl"] = $_W["attachurl_remote"];
  25. }
  26. else
  27. {
  28. if( $_W["setting"]["remote"]["type"] == ATTACH_QINIU )
  29. {
  30. $_W["attachurl_remote"] = $_W["setting"]["remote"]["qiniu"]["url"] . "/";
  31. $_W["attachurl"] = $_W["attachurl_remote"];
  32. }
  33. else
  34. {
  35. if( $_W["setting"]["remote"]["type"] == ATTACH_COS )
  36. {
  37. $_W["attachurl_remote"] = $_W["setting"]["remote"]["cos"]["url"] . "/";
  38. $_W["attachurl"] = $_W["attachurl_remote"];
  39. }
  40. }
  41. }
  42. }
  43. }
  44. if( !empty($_GPC["formwe7"]) )
  45. {
  46. $bind = pdo_fetch("SELECT * FROM " . tablename("ewei_shop_wxapp_bind") . " WHERE wxapp=:wxapp LIMIT 1", array( ":wxapp" => $uniacid ));
  47. if( !empty($bind) && !empty($bind["uniacid"]) )
  48. {
  49. $_GPC["i"] = $bind["uniacid"];
  50. $uniacid = $_GPC["i"];
  51. }
  52. }
  53. if( empty($uniacid) )
  54. {
  55. exit( "Access Denied." );
  56. }
  57. $site = WeUtility::createModuleSite("ewei_shopv2");
  58. $_GPC["c"] = "site";
  59. $_GPC["a"] = "entry";
  60. $_GPC["m"] = "ewei_shopv2";
  61. $_GPC["do"] = "mobile";
  62. $_W["uniacid"] = (int) $_GPC["i"];
  63. $_W["account"] = uni_fetch($_W["uniacid"]);
  64. $_W["acid"] = (int) $_W["account"]["acid"];
  65. if( !isset($_GPC["r"]) )
  66. {
  67. $_GPC["r"] = "app";
  68. }
  69. else
  70. {
  71. $_GPC["r"] = "app." . $_GPC["r"];
  72. }
  73. if( !is_error($site) )
  74. {
  75. $method = "doMobileMobile";
  76. $site->uniacid = $uniacid;
  77. $site->inMobile = true;
  78. if( method_exists($site, $method) )
  79. {
  80. $site->$method();
  81. exit();
  82. }
  83. }
  84. ?>