例子:
$sql = 'SELECT SUM(o.price) as `sum`
FROM `order` o
WHERE o.customer_id ='.$profile->id; $ret = Yii::$app->db->createCommand($sql)->queryScalar();
2022-11-02 21:18:16
例子:
$sql = 'SELECT SUM(o.price) as `sum`
FROM `order` o
WHERE o.customer_id ='.$profile->id; $ret = Yii::$app->db->createCommand($sql)->queryScalar();