Yii Framework Forum: Cdbcriteria With Params - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cdbcriteria With Params Rate Topic: -----

#1 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 47
  • Joined: 31-October 12
  • Location:Indonesia

Posted 29 April 2013 - 09:27 PM

Hi everybody.

i have a search form like this in admin.php
Attached File  Capture.PNG (7.15K)
Number of downloads: 10

in sql this query works fine,
SELECT * FROM pendapatan_baru WHERE tanggal BETWEEN '$tgl_awal' AND '$tgl_akhir' AND id = '$kd_dokter' AND unit_pelaksanaa LIKE '%$kd_pelayanan%'


how to parsing params to model.php??
or anyone has a idea how to use params combination with a CDbCriteria?

sorry to my bad english. . .
0

#2 User is offline   yii new expert 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 60
  • Joined: 30-May 12
  • Location:pune, india

Posted 30 April 2013 - 01:00 AM

$criteria=new CDbCriteria;
$criteria->addBetweenCondition('tanggal',$tgl_awal,$tgl_akhir,'AND');
$criteria->addCondition('id',$kd_dokter);
$criteria->addSearchCondition('unit_pelaksanaa', $kd_pelayanan);

1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users