例子:
$sql = ‘SELECT SUM(o.price) as `sum` FROM `order` o WHERE o.customer_id =‘.$profile->id; $ret = Yii::$app->db->createCommand($sql)->queryScalar();
时间: 2024-10-09 09:55:36
例子:
$sql = ‘SELECT SUM(o.price) as `sum` FROM `order` o WHERE o.customer_id =‘.$profile->id; $ret = Yii::$app->db->createCommand($sql)->queryScalar();