diff --git a/application/third_party/ctmobilefirst/models/dms_model.php b/application/third_party/ctmobilefirst/models/dms_model.php index e326f0f9..2361ddb7 100644 --- a/application/third_party/ctmobilefirst/models/dms_model.php +++ b/application/third_party/ctmobilefirst/models/dms_model.php @@ -90,9 +90,6 @@ class Dms_model extends CI_Model { SELECT row_number() over (order by dt_id desc) as rownumber,dt_id,dt_username,dt_password,dt_HTid,dt_payrule,dt_usertype,isnull(dt_status,1) as dt_status ,(select dpr_rule from dms_payrule where dpr_id = dt_payrule) as dpr_rule ,(select syc2_CodeDiscribe FROM tourmanager.dbo.V_System_Code where SYC_Type=32 AND LGC_LGC=2 AND SYC_SN=dt_HtId) as dmsName - ,( select COUNT(*) as ordercount from tourmanager.dbo.BIZ_ConfirmLineInfo where COLI_sourcetype=dt_HtId - and COLI_State in(8,9,61,62) AND COLI_servicetype='2' - and isnull(DeleteFlag,0)<>1 ) as trainOrderCount ,isnull((select SUM(dp_paymoney) from DMS_PayRecord where dp_HtId=dt_HtId and dp_status>0),0) as TrainPaySum from DMS_Distributor )t where 1=1 "; @@ -110,8 +107,15 @@ class Dms_model extends CI_Model { $count = $qurey->num_rows(); //总记录数 $qurey2 = $this->INFO->query($sql2, array($begin, $end)); + //计算订单总额 + $returndata = $qurey2->result(); + foreach ($returndata as $item) { + $paydetail = $this->get_paydetail($item->dt_HTid); + $trainOrderCount = $paydetail->total; + $item->trainOrderCount = $trainOrderCount; + } //return 数据和总数 - return array('data' => $qurey2->result(), 'total' => $count); + return array('data' => $returndata, 'total' => $count); } /** @@ -294,7 +298,9 @@ class Dms_model extends CI_Model { return $result; } - + /** + * 支付记录 + */ function payRecord($arrKeyword){ $htid = $arrKeyword->htid ==false?0:$arrKeyword->htid; $page = $arrKeyword->page ==false?0:$arrKeyword->page; @@ -361,6 +367,9 @@ class Dms_model extends CI_Model { } + /*** + * + */ function payrecord_delete($id,$htid){ $sql = " update DMS_PayRecord set dp_status = 0 where dp_id=? and dp_HtId=? "; $qurey = $this->INFO->query($sql ,array($id,$htid));