Advertisement
alpa_s

Untitled

Mar 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. $dataProvider = new CActiveDataProvider('PersonalMessage', array(
  2.             'criteria' => array(
  3.                 'condition' => '(t.sender_id = :user_id OR t.recipient_id = :user_id)',
  4.                 'params' => array(
  5.                     ':user_id' => $this->_userId
  6.                 ),
  7.                 'group' => 't.thread_id DESC',
  8.                 'order' => 't.id desc',
  9.                 //(t.read=0 && t.recipient_id='.$this->_userId.' && t.sender_id<>'.$this->_userId.')
  10.                 //, 'sender'=> array('alias' => 'send')
  11.                 'with' => array('recipient'=> array('alias' => 'rec')),
  12.             ),
  13.             'pagination'=>array(
  14.                 'pageSize'=>20,
  15.             ),
  16.         ));
  17.  
  18.         $dataProvider3 = new CActiveDataProvider('PersonalMessage', array(
  19.             'criteria' => array(
  20.                 'condition' => '(t.recipient_id = :user_id) && t.read=0',
  21.                 'params' => array(
  22.                     ':user_id' => $this->_userId
  23.                 ),
  24.                 'group' => 't.thread_id DESC',
  25.                 'order' => 't.id desc',
  26.                 //(t.read=0 && t.recipient_id='.$this->_userId.' && t.sender_id<>'.$this->_userId.')
  27.                 //, 'sender'=> array('alias' => 'send')
  28.                 'with' => array('recipient'=> array('alias' => 'rec')),
  29.             ),
  30.             'pagination'=>array(
  31.                 'pageSize'=>20,
  32.             ),
  33.         ));
  34.  
  35.         $dataProvider2=new CActiveDataProvider('PersonalMessage',array(
  36.             'criteria'=>array(
  37.                 'condition'=>'(t.recipient_id=:support_id)',
  38.                 'params'=>array(':support_id'=>User::model()->find('username="support"')->id),
  39.                 'order'=>'t.id DESC',
  40.                 'group'=>'t.thread_id DESC',
  41.             ),
  42.             'pagination'=>array(
  43.                 'pageSize'=>20,
  44.             ),
  45.         ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement