| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- Doo::loadCore ( 'db/DooModel' );
- class invoiceStatistics extends DooModel {
- public $sid;
- public $priceClass;
- public $date;
- public $cid;
- public $staff;
- public $invoicePrice;
- public $accountPrice;
- public $receivablesPrice;
- public $irid;
- public $_table = 'CLD_invoiceStatistics';
- public $_primarykey = 'sid';
- public $_fields = array (
- 'sid',
- 'staff',
- 'priceClass',
- 'invoicePrice',
- 'receivablesPrice',
- 'accountPrice',
- 'date',
- 'cid',
- 'irid'
- );
-
- /**
- * 根据参数字段更新相应字段(主键ID必须传)
- * @param array $item 相关需要更新的字段信息
- * @return number 返回发票ID
- */
- public function setInvoiceStatisticsByCondition($item = array()) {
- $lid = 0;
- if (is_array ( $item ) && ! empty ( $item )) {
- foreach ( $item as $key => $value ) {
- $this->$key = $value;
- }
- $lid = $this->insert ();
- }
- return $lid;
- }
-
- /**
- * 根据参数字段更新相应字段(主键ID必须传)
- * @param array $item 相关需要更新的字段信息
- * @return number 返回发票ID
- */
- public function updateInvoiceStatisticsByIrid($item = array(), $irid = 0) {
- if (is_numeric ( $irid ) && is_array ( $item ) && ! empty ( $item )) {
- foreach ( $item as $key => $value ) {
- $this->$key = $value;
- }
- $lid = $this->update ( array (
- 'where' => 'irid=' . $irid
- ) );
- }
- return $lid;
- }
- function getClientByCid($cid) {
- $sql = "select sum(price) from " . $this->_table . " where staff= '" . $cid . "' and ";
-
- $query = Doo::db ()->query ( $sql );
-
- $result = $query->fetch ();
-
- return $result;
- }
- /*
- * public function getProjectByIdList($projectid){ return $this->find ( array ('where' => "pid= '".$projectid."'", 'asArray' => TRUE ) ); }
- */
- }
- ?>
|