Как преобразовать эту форму cdb в sql и какова роль ключевого слова сравнения - PullRequest
0 голосов
/ 16 июня 2019

Я хочу преобразовать этот код в общую форму SQL и сравнить роль ключевого слова.

yii 1.1 framework

public function search()
{
    // @todo Please modify the following code to remove attributes that should not be searched.
    $criteria         = new CDbCriteria;
    //$criteria->with='quotationrel';
    $criteria->select = 'quotationrel.QID,quotationrel.QCode,quotationrel.QDate,quotationrel.CID,quotationrel.status,t.JCode';
    $criteria->join   = 'RIGHT JOIN `quo` `quotationrel` ON (`t`.`QID`=`quotationrel`.`QID`)';
    $criteria->order  = 'QCode DESC';

    $criteria->compare('QCode', $this->QID, true);
    $criteria->compare('CID', $this->CID);
    $criteria->compare('userID', $this->userID);
    $criteria->compare('JID', $this->JID, true);
    $criteria->compare('JCode', $this->JCode, true);
    $criteria->compare('JDate', $this->JDate, true);
    $criteria->compare('dueDate', $this->dueDate, true);
    $criteria->compare('postDate', $this->postDate, true);
    $criteria->compare('note', $this->note, true);

    return new CActiveDataProvider($this, array(
        'criteria'   => $criteria,
        'pagination' => array(
            'pageSize' => Yii::app()->user->getState('pageSize', 25),
        ),
    ));
}
...