| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?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;
- }
-
- /**
- * 根据状态获取培训班
- * @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;
- }
- }
- ?>
|