ApplyLogic.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Created by Administrator.
  4. * User: 向往那片天空
  5. * Date: 2022\5\21 0021
  6. * Time: 15:11
  7. * 格言: 抓住中心,宁精勿杂,宁专勿多
  8. * QQ/微信: 250023777
  9. * 描述: 无
  10. */
  11. namespace app\api\logic\enterprise;
  12. use app\api\logic\BaseLogic;
  13. use app\admin\model\user\User;
  14. use crmeb\services\JsonService;
  15. use crmeb\traits\ModelTrait;
  16. class ApplyLogic extends BaseLogic
  17. {
  18. use ModelTrait;
  19. protected $pk = 'id';
  20. protected $name = 'user_apply_enterprise_record';
  21. public function add($data)
  22. {
  23. if (!self::save($data)) {
  24. return app('json')->fail('申请失败');
  25. }
  26. return app('json')->success('申请成功');
  27. }
  28. /**
  29. * 用户是否有正在审核的记录
  30. * @param $userId 用户
  31. * @return bool true-有,false-无
  32. */
  33. public function hasApllying($userId)
  34. {
  35. $query = [];
  36. $query['apply_user_id'] = $userId;
  37. $query['is_delete'] = '0';
  38. $query['audit_status'] = 0;
  39. return self::be($query);
  40. }
  41. }