【发布时间】:2019-05-02 16:10:41
【问题描述】:
MySQL 查询:
select
count(distinct vote_checks.user_id) AS count from vote_checks
join
vote_items on vote_checks.item_id=vote_items.id
where
vote_items.vote_id = 3;
【问题讨论】:
-
你试过了吗?
-
告诉我们你到目前为止尝试了什么......
-
$check_point = Vote_check::where('item_id', $item[0]->vote_checks->vote_id)->first(); ///////////////////////////////////////// //$chk_point = DB::table('vote_checks') ->join('vote_checks', function($join) { $join->on('vote_checks.item_id', '=', 'vote_items.id') ; })->where('vote_items.vote_id', $board)->select('vote_checks.user_id')->distinct()->count(); ////$chk_point=Vote_check::where(, $board)->get();//distinct()->count('user_id'); //$chk_point = Vote_check::where('item_id', '1'->vote_item->vote_id)->get();
-
对不起我第一次使用stackoverflow