合并分支 'lyh-server' 到 'master'
变更数据 查看合并请求 !3003
正在显示
1 个修改的文件
包含
14 行增加
和
3 行删除
| @@ -34,9 +34,20 @@ class GeoQuestionResLogic extends BaseLogic | @@ -34,9 +34,20 @@ class GeoQuestionResLogic extends BaseLogic | ||
| 34 | * @time :2025/7/8 17:16 | 34 | * @time :2025/7/8 17:16 |
| 35 | */ | 35 | */ |
| 36 | public function getCount(){ | 36 | public function getCount(){ |
| 37 | - $total = $this->model->counts(['project_id'=>$this->user['project_id']]); | ||
| 38 | - $type_1 = $this->model->counts(['type'=>$this->model::BRAND_TYPE,'project_id'=>$this->user['project_id']]); | ||
| 39 | - $type_2 = $this->model->counts(['type'=>$this->model::MARKETING_TYPE,'project_id'=>$this->user['project_id']]); | 37 | + $total = $this->model |
| 38 | + ->where('project_id', $this->user['project_id']) | ||
| 39 | + ->distinct('question') | ||
| 40 | + ->count('question'); | ||
| 41 | + $type_1 = $this->model | ||
| 42 | + ->where('type', $this->model::BRAND_TYPE) | ||
| 43 | + ->where('project_id', $this->user['project_id']) | ||
| 44 | + ->distinct('question') | ||
| 45 | + ->count('question'); | ||
| 46 | + $type_2 = $this->model | ||
| 47 | + ->where('type', $this->model::MARKETING_TYPE) | ||
| 48 | + ->where('project_id', $this->user['project_id']) | ||
| 49 | + ->distinct('question') | ||
| 50 | + ->count('question'); | ||
| 40 | return $this->success(['total'=>$total,'type_1'=>$type_1,'type_2'=>$type_2]); | 51 | return $this->success(['total'=>$total,'type_1'=>$type_1,'type_2'=>$type_2]); |
| 41 | } | 52 | } |
| 42 | 53 |
-
请 注册 或 登录 后发表评论