12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- Doo::loadCore('db/DooModel');
- class Animation extends DooModel {
- public $aid;
- public $title;
- public $url;
- public $down_url;
- public $img_url;
- public $belong;
-
- public $_table = 'sc_animation';
- public $_primarykey = 'aid';
- public $_fields = array('aid', 'title', 'url', 'down_url','img_url','belong');
- function getAnimationById($aid = 0) {
-
- return $this->find ( array ( 'where' => 'aid=' . $aid, 'asArray' => TRUE ) );
- }
- function getAnimationByIdList($anid=0){
- return $this->find ( array ( 'where' => 'aid in ( ' . $anid.' )', 'asArray' => TRUE ) );
- }
-
- function getAnimationByBelong($belong=1){
-
- return $this->find ( array ( 'where' => 'belong='.$belong , 'asArray' => TRUE ) );
- }
-
- function getAnimationList($data = array(), $condition = "", $limit = ""){
- foreach ( $data as $key => $value ) {
- if (is_numeric ( $value ))
- $condition .= " and " . $key . " = " . $value;
- else
- $condition .= " and " . $key . " like '%" . $value . "%' ";
- }
-
- $condition = ' where 1 ' . $condition . $limit;
-
- $sql = "select * from " . $this->_table . $condition;
-
- $query = Doo::db ()->query ( $sql );
-
- $result = $query->fetchAll ();
-
- return $result;
- }
-
- function deleteAnimationByIdList($id){
- $id = implode ( ",", $id );
-
- $sql = "delete from " . $this->_table . " where aid in ( " . $id . " )";
-
- Doo::db ()->query ( $sql );
- }
-
- }
- ?>
|