新手献上的
-
/**
- * 联名卡管理
- * @author shendoudou
- *
- */
- import ( '@.Model.Platform.CommonModel' );
- class IcbccardModel extends CommonModel {
- public function findAllCard(){
- $result = $this->select();
- if ($result === false)
- throw new DBException ( $this->getModelName (), $this->getDbError (), $this->getLastSql () );
- return $result;
- }
-
- public function findOneCard($id){
- $map['id']=$id;
- $result = $this->where ($map)->find();
- if ($result === false)
- throw new DBException ( $this->getModelName (), $this->getDbError (), $this->getLastSql () );
- return $result;
- }
-
- public function updateCard($id,$data){
- $map['id']=$id;
- $result = $this->where($map)->save($data);
- if ($result === false)
- throw new DBException ( $this->getModelName (), $this->getDbError (), $this->getLastSql () );
- return $result;
- }
-
- public function deleteCard($id){
- $map['id']=$id;
- $result = $this->where($map)->delete();
- if ($result === false)
- throw new DBException ( $this->getModelName (), $this->getDbError (), $this->getLastSql () );
- return $result;
- }
-
- public function findStatusId($status){
- $map['status']=$status;
- $result = $this->where($map)->field('id')->select();
- if ($result === false)
- throw new DBException ( $this->getModelName (), $this->getDbError (), $this->getLastSql () );
- return $result;
-
- }
-
- public function changeCardStatus($id,$status){
- $map['id']=$id;
- $map['status']=$status;
- $result = $this->save($map);
- if ($result === false)
- throw new DBException ( $this->getModelName (), $this->getDbError (), $this->getLastSql () );
- return $result;
- }
-
-
-
-
-
- }
-
- ?>
复制代码
|