UserCommunicationRewards.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\admin\model\user;
  3. use app\admin\model\system\SystemUserLevel;
  4. use crmeb\traits\ModelTrait;
  5. use crmeb\basic\BaseModel;
  6. /**
  7. * 用户管理 model
  8. * Class User
  9. * @package app\admin\model\user
  10. */
  11. class UserCommunicationRewards extends BaseModel
  12. {
  13. /**
  14. * 数据表主键
  15. * @var string
  16. */
  17. protected $pk = 'id';
  18. /**
  19. * 模型名称
  20. * @var string
  21. */
  22. protected $name = 'user_communication_rewards';
  23. use ModelTrait;
  24. public static function setWhere($where, $alias = '', $userAlias = 'u.', $model = null)
  25. {
  26. $model = is_null($model) ? new self() : $model;
  27. if ($alias) {
  28. $model = $model->alias($alias);
  29. $alias .= '.';
  30. }
  31. // if (isset($where['nickname']) && $where['nickname'] != '') $model = $model->where("{$userAlias}nickanme", $where['nickname']);
  32. // if (isset($where['level_id']) && $where['level_id'] != '') $model = $model->where("{$alias}level_id", $where['level_id']);
  33. return $model->where("{$alias}status", 1)->where("{$alias}is_del", 0);
  34. }
  35. }