8 lines
618 B
PHP
8 lines
618 B
PHP
<?php
|
|
namespace SQL;
|
|
|
|
class GO_TRAINER_GET_GUIDE_RATING extends \SYSTEM\DB\QP {
|
|
public static function get_class(){return \get_class();}
|
|
public static function mysql(){return
|
|
'SELECT sum(case when go_trainer_rating.rating = 1 then 1 else 0 end) class_1, sum(case when go_trainer_rating.rating = 2 then 1 else 0 end) class_2, sum(case when go_trainer_rating.rating = 3 then 1 else 0 end) class_3, sum(case when go_trainer_rating.rating = 4 then 1 else 0 end) class_4 FROM go_trainer_rating INNER JOIN go_trainer_guides ON go_trainer_rating.relation_id = go_trainer_guides.id WHERE go_trainer_guides.id = ?;'
|
|
;}} |