WxOpenClass.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace biz\wx\classes;
  3. use biz\base\classes\BaseClass;
  4. use common\components\dict;
  5. class WxOpenClass extends BaseClass
  6. {
  7. public static $baseFile = '\biz\wx\models\WxOpen';
  8. //获取所有的小程序信息 ssh 2021.2.25
  9. public static function getMiniInfo()
  10. {
  11. $ghsOpen = self::getGhsOpen();
  12. $wxMiniBaseId = $ghsOpen['wxMiniBaseId'] ?? 0;
  13. $arr = [];
  14. $ghsMini = WxMiniBaseClass::getById($wxMiniBaseId);
  15. $arr['ghs']['miniAppId'] = $ghsMini['miniAppId'] ?? '';
  16. $retailOpen = self::getHdOpen();
  17. $wxMiniBaseId = $retailOpen['wxMiniBaseId'] ?? 0;
  18. $wxMini = WxMiniBaseClass::getById($wxMiniBaseId);
  19. $arr['hd']['miniAppId'] = $wxMini['miniAppId'] ?? '';
  20. $mallOpen = self::getMallOpen();
  21. $wxMiniBaseId = $mallOpen['wxMiniBaseId'] ?? 0;
  22. $wxMini = WxMiniBaseClass::getById($wxMiniBaseId);
  23. $arr['mall']['miniAppId'] = $wxMini['miniAppId'] ?? '';
  24. return $arr;
  25. }
  26. //取供货商平台信息 ssh 2021.2.25
  27. public static function getGhsOpen()
  28. {
  29. return self::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
  30. }
  31. //取零售平台信息 ssh 2021.2.25
  32. public static function getHdOpen()
  33. {
  34. return self::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
  35. }
  36. public static function getMallOpen()
  37. {
  38. return self::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
  39. }
  40. public static function getWxBase()
  41. {
  42. $wxBase = [
  43. dict::getDict('ptStyle', 'hd') => WxOpenClass::getWxInfo(),
  44. dict::getDict('ptStyle', 'ghs') => WxOpenClass::getGhsWxInfo(),
  45. dict::getDict('ptStyle', 'mall') => self::getMallWxInfo(),
  46. ];
  47. return $wxBase;
  48. }
  49. public static function getWxInfo()
  50. {
  51. return \bizHd\wx\classes\WxOpenClass::getWxInfo();
  52. }
  53. public static function getGhsWxInfo()
  54. {
  55. return \bizHd\wx\classes\WxOpenClass::getGhsWxInfo();
  56. }
  57. public static function getMallWxInfo()
  58. {
  59. return \bizHd\wx\classes\WxOpenClass::getMallWxInfo();
  60. }
  61. }