我在主查询中有一个子查询,如下所示:
$subquery = (new Query())->select('COUNT(project_sup_id)')
->from('project_supervisors AS sup')
->where(['AND','sup.project_ref_id = p.project_id']);
$uQuery =(new Query())->select(['project_id','supcount' => $subquery])
->from('projects AS p')
->join('LEFT JOIN','project_supervisors AS sup','sup.project_ref_id = project_id')
->andWhere('IF(supcount>0, sup_project_status=1, project_status=1)');
Run Code Online (Sandbox Code Playgroud)
我正在尝试根据逻辑编写 where 条件,即,如果从子查询获得的计数大于零,则 where 条件必须为sup_project_status=1else project_status=1。在普通的Mysql中,很容易在where里面写if条件,但在yii2中我不明白如何写。
我有两个系列及其交点。我想在图表上有一个椭圆形,中心位于交叉点。椭圆半径应根据轴单位设置,以显示每个轴的感兴趣区域。
Highcharts.chart('container', {
series: [
// first series
{
name: 'IPR',
data: [[0, 30.5],[18.5, 25.4],[30, 19.4],[38, 9.7],[42, 0.02]]
},
// second series
{
name: 'VLP',
data: [[2, 0.5],[7, 1],[14, 6],[21, 22],[29, 29.6],[40, 30.3],[50, 27.2]]
},
// intersection
{
name: 'Operating point',
data: [
[22.42, 23.35]
]
}
],
})
Run Code Online (Sandbox Code Playgroud)
如何以编程方式在相交处绘制椭圆形并进行缩放?