ApplyService.php 900 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace bizJd\apply\services;
  3. use biz\shop\classes\MainClass;
  4. use bizJd\apply\classes\ApplyClass;
  5. use bizJd\base\services\BaseService;
  6. use bizJd\sj\services\SjService;
  7. use Yii;
  8. class ApplyService extends BaseService
  9. {
  10. public static $baseFile = '\bizJd\apply\classes\ApplyClass';
  11. //审核通过,商家初始化 ssh 2021.2.23
  12. public static function pass($id, $remark = '')
  13. {
  14. $apply = ApplyClass::getById($id);
  15. if (empty($apply)) {
  16. util::fail('没有找到申请记录');
  17. }
  18. $applyId = $apply['id'];
  19. ApplyClass::updateById($applyId, ['status' => ApplyClass::STATUS_PASS, 'remark' => $remark]);
  20. $apply['name'] = isset($apply['name']) ? $apply['name'] : '';
  21. $main = MainClass::add(['id' => null], true);
  22. $respond = SjService::initJdGhsBaseInfo($apply, $main, true);
  23. return $respond;
  24. }
  25. }