ShareController.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\shopapi\controller;
  20. use app\shopapi\{
  21. logic\ShareLogic,
  22. validate\ShareValidate
  23. };
  24. /**
  25. * 分享控制器
  26. * Class ShareController
  27. * @package app\shopapi\controller
  28. */
  29. class ShareController extends BaseShopController
  30. {
  31. /**
  32. * @notes 小程序码
  33. * @return \think\response\Json
  34. * @author cjhao
  35. * @date 2021/9/11 18:14
  36. */
  37. public function getMnpQrCode()
  38. {
  39. $params = (new ShareValidate())->goCheck('goods');
  40. $res = (new ShareLogic())->getMnpQrCode($this->userId,$params);
  41. if(true === $res){
  42. return $this->success('获取成功',['qr_code'=>ShareLogic::getReturnData()]);
  43. }
  44. return $this->fail(ShareLogic::getReturnData());
  45. }
  46. /**
  47. * @notes 分享砍价小程序码
  48. * @return \think\response\Json
  49. * @author Tab
  50. * @date 2021/9/28 17:27
  51. */
  52. public function getMnpQrCodeInitiate()
  53. {
  54. $params = (new ShareValidate())->goCheck('initiate');
  55. $res = (new ShareLogic())->getMnpQrCodeInitiate($this->userId,$params);
  56. if(true === $res){
  57. return $this->success('获取成功',['qr_code'=>ShareLogic::getReturnData()]);
  58. }
  59. return $this->fail(ShareLogic::getReturnData());
  60. }
  61. /**
  62. * @notes 获取今日头条小程序码
  63. * @return \think\response\Json
  64. * @throws \Exception
  65. * @author cjhao
  66. * @date 2021/11/25 9:59
  67. */
  68. public function getTouTiaoQrcode(){
  69. $params = (new ShareValidate())->goCheck('goods');
  70. $res = (new ShareLogic())->getTouTiaoQrcode($this->userId,$params);
  71. if(true === $res){
  72. return $this->success('获取成功',['qr_code'=>ShareLogic::getReturnData()]);
  73. }
  74. return $this->fail(ShareLogic::getReturnData());
  75. }
  76. }