refactor(work): remove BaseAuth enterprise wechat dao dependency

Made-with: Cursor
This commit is contained in:
apple
2026-04-29 17:20:23 +08:00
parent 02bdc41ff8
commit fe72924111
6 changed files with 31 additions and 28 deletions

View File

@@ -8,7 +8,7 @@ namespace app\dao\work;
use app\dao\BaseDao;
use app\model\work\WorkClient;
use crmeb\basic\BaseAuth;
use app\services\dao\SearchConditionBuilder;
use crmeb\basic\BaseModel;
use crmeb\traits\SearchDaoTrait;
use think\db\exception\DbException;
@@ -38,13 +38,7 @@ class WorkClientDao extends BaseDao
*/
public function searchWhere(array $where, bool $authWhere = true)
{
[$with, $whereKey] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
$whereData = [];
foreach ($whereKey as $key) {
if (isset($where[$key])) {
$whereData[$key] = $where[$key];
}
}
[$with] = app()->make(SearchConditionBuilder::class)->build(array_keys($where), $this->setModel());
return $this->getModel()->withSearch($with, $where)->when(!empty($where['label']) || !empty($where['notLabel']), function ($query) use ($where) {
$query->whereIn('id', function ($query) use ($where) {

View File

@@ -8,7 +8,7 @@ namespace app\dao\work;
use app\dao\BaseDao;
use app\model\work\WorkGroupMsgSendResult;
use crmeb\basic\BaseAuth;
use app\services\dao\SearchConditionBuilder;
use crmeb\traits\SearchDaoTrait;
/**
@@ -35,13 +35,7 @@ class WorkGroupMsgSendResultDao extends BaseDao
*/
public function searchWhere(array $where, bool $authWhere = true)
{
[$with, $whereKey] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
$whereData = [];
foreach ($whereKey as $key) {
if (isset($where[$key]) && 'timeKey' !== $key) {
$whereData[$key] = $where[$key];
}
}
[$with] = app()->make(SearchConditionBuilder::class)->build(array_keys($where), $this->setModel());
return $this->getModel()->withSearch($with, $where)->when(!empty($where['client_name']), function ($query) use ($where) {
$query->whereIn('external_userid', function ($query) use ($where) {

View File

@@ -6,7 +6,7 @@ namespace app\dao\work;
use app\dao\BaseDao;
use app\model\work\WorkGroupMsgTask;
use crmeb\basic\BaseAuth;
use app\services\dao\SearchConditionBuilder;
use crmeb\traits\SearchDaoTrait;
/**
@@ -33,13 +33,7 @@ class WorkGroupMsgTaskDao extends BaseDao
*/
public function searchWhere(array $where, bool $authWhere = true)
{
[$with, $whereKey] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
$whereData = [];
foreach ($whereKey as $key) {
if (isset($where[$key]) && 'timeKey' !== $key) {
$whereData[$key] = $where[$key];
}
}
[$with] = app()->make(SearchConditionBuilder::class)->build(array_keys($where), $this->setModel());
return $this->getModel()->withSearch($with, $where)->when(!empty($where['user_name']), function ($query) use ($where) {
$query->whereIn('userid', function ($query) use ($where) {

View File

@@ -8,7 +8,7 @@ namespace app\dao\work;
use app\dao\BaseDao;
use app\model\work\WorkMember;
use crmeb\basic\BaseAuth;
use app\services\dao\SearchConditionBuilder;
use crmeb\basic\BaseModel;
use crmeb\traits\SearchDaoTrait;
@@ -37,7 +37,7 @@ class WorkMemberDao extends BaseDao
*/
public function searchWhere(array $where, bool $authWhere = true)
{
[$with] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
[$with] = app()->make(SearchConditionBuilder::class)->build(array_keys($where), $this->setModel());
return $this->getModel()->withSearch($with, $where)
->when(!empty($where['name']), function ($query) use ($where) {
$query->where('id|name|mobile', 'like', '%' . $where['name'] . '%');

View File

@@ -8,7 +8,7 @@ namespace app\dao\work;
use app\dao\BaseDao;
use app\model\work\WorkWelcome;
use crmeb\basic\BaseAuth;
use app\services\dao\SearchConditionBuilder;
use crmeb\basic\BaseModel;
use crmeb\traits\SearchDaoTrait;
@@ -37,7 +37,7 @@ class WorkWelcomeDao extends BaseDao
*/
public function searchWhere(array $where, bool $authWhere = true)
{
[$with] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
[$with] = app()->make(SearchConditionBuilder::class)->build(array_keys($where), $this->setModel());
return $this->getModel()->withSearch($with, $where)->when(!empty($where['userids']), function ($query) use ($where) {
$query->whereIn('id', function ($query) use ($where) {