| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
- Doo::loadCore ( 'db/DooModel' );
- /**
- * 发票培训班相关信息及其操作业务逻辑
- * @author CP.
- * @version 1.0
- * @namespace invoice
- * @package invoiceModel
- */
- class invoiceTraining extends DooModel {
- public $itid;
- public $status;
- public $trainName;
- public $cid;
- public $categoryName;
- public $creator;
- public $trainDate;
- public $invoiceTotal;
- public $invoiceTotalAmount;
- public $invoiceArriveAmount;
- public $arriveSchedule;
- public $creatorDate;
- public $_table = 'CLD_invoiceTraining';
- public $_primarykey = 'itid';
- public $_fields = array (
- 'itid',
- 'status',
- 'trainName',
- 'cid',
- 'categoryName',
- 'creator',
- 'trainDate',
- 'invoiceTotal',
- 'invoiceTotalAmount',
- 'invoiceArriveAmount',
- 'arriveSchedule',
- 'creatorDate'
- );
-
- /**
- * 添加一个培训班
- * @param array $item 培训班相关数据
- * @return number 返回培训班ID
- */
- public function addInvoiceTraining($item = array()) {
- $itid = 0;
- if (is_array ( $item ) && ! empty ( $item )) {
- foreach ( $item as $key => $value ) {
- $this->$key = $value;
- }
- $itid = $this->insert ();
- }
- return $itid;
- }
-
- function getInvoiceTrainingByTodo($select = ""){
- Doo::loadModel ( 'staff' );
- $staff = new staff ();
- Doo::loadModel ( 'L_category' );
- $lCategory = new L_category ();
-
- $condition = array (
- 'where' => "status= 0 or status=1 ",
- 'limit'=>8,
- 'asArray' => TRUE
- );
- if (! empty ( $select ))
- $condition += array (
- 'select' => $select
- );
-
- $list=$this->find (
- $condition
- );
-
- foreach ($list as $key=>$value){
- $detail=$staff->getStaffBySid($value['creator']);
- $list[$key]['staff']=$detail;
- $detail=$lCategory->getCategoryById($value['cid']);
- $list[$key]['category']=$detail;
- }
-
- return $list;
- }
-
- /**
- * 根据状态获取培训班
- * @param number $status
- */
- function getInvoiceTrainingByStatus($status = 0, $select = "") {
- Doo::loadModel ( 'staff' );
- $staff = new staff ();
- Doo::loadModel ( 'L_category' );
- $lCategory = new L_category ();
-
- $condition = array (
- 'where' => "status= '" . $status . "' ",
- 'limit'=>8,
- 'asArray' => TRUE
- );
- if (! empty ( $select ))
- $condition += array (
- 'select' => $select
- );
-
- $list=$this->find (
- $condition
- );
-
- foreach ($list as $key=>$value){
- $detail=$staff->getStaffBySid($value['creator']);
- $list[$key]['staff']=$detail;
- $detail=$lCategory->getCategoryById($value['cid']);
- $list[$key]['category']=$detail;
- }
-
- return $list;
- }
- }
- ?>
|