您好,我有以下架构:
SELECT new GroupByType(tb2.typeName, tb1.aName, coalesce(COUNT(tb2.typeId)),0)
FROM Tbl_1 tb1
INNER JOIN Tbl_3 tb3 ON t1.aId=t3.aId
LEFT JOIN Tbl_2 tb2 on tb2.typeId=tb1.typeId
WHERE tb3.pId=1
GROUP BY b2.typeName, GroupByType.class).getResultList();
所有收入组均相等,但我必须重复此过程。有没有更有效的方式做到这一点?
答案 0 :(得分:1)
function likes() {
$postid = $_GET["videoid"];
$output = '<i if (userLiked($postid)): class="fa fa-thumbs-up like-btn" else: class="fa fa-thumbs-o-up like-btn" endif data-id=" echo $postid "></i>
<span class="likes"> echo getLikes($postid); </span>
<i if (userDisliked($postid)): class="fa fa-thumbs-down dislike-btn" else: class="fa fa-thumbs-o-down dislike-btn" endif data-id=" echo $postid "></i>
<span class="dislikes"> echo getDislikes($postid); </span>';
return $output;
}
答案 1 :(得分:1)
project.js
var ProjectSchema = new Schema({
companyName : {type: String , required : true},
projectName : String,
revenueGroups: [{type: Schema.Types.ObjectId, ref: 'Revenue'}],
});
module.exports = mongoose.model('Project', ProjectSchema);
revenue.js
var RevenueSchema = new Schema({
campMan : Number,
startersPakket : Number,
marketingCon : Number,
});
module.exports = mongoose.model('Revenue', RevenueSchema);