CustomController.php 784 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace mall\controllers;
  3. use bizHd\custom\classes\CustomClass;
  4. use common\components\httpUtil;
  5. use common\components\util;
  6. class CustomController extends BaseController
  7. {
  8. public $guestAccess = ['init-custom'];
  9. //生成客户信息 shish 2021.5.1
  10. public function actionInitCustom()
  11. {
  12. $custom = [];
  13. //非登陆情况的请求,支付宝扫码付款需要用到
  14. if (httpUtil::isMiniProgram() == false) {
  15. util::success($custom);
  16. }
  17. if (!empty($this->shopId)) {
  18. $custom = CustomClass::replaceCustom($this->sjId, $this->user, $this->shopId);
  19. if (empty($custom)) {
  20. util::fail('没有找到客户信息');
  21. }
  22. }
  23. util::success($custom);
  24. }
  25. }