From a044f3de3aae4bde3f14251ac3eeb0b43ef1bb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Tue, 21 Nov 2023 12:05:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=80=BB=E9=A2=9D?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=87=BA=E6=9D=A5=EF=BC=8C=E6=9C=89=E4=BA=9B?= =?UTF-8?q?=E5=88=86=E9=94=80=E5=95=86=E7=9A=84=E8=AE=A1=E7=AE=97=E9=9D=9E?= =?UTF-8?q?=E5=B8=B8=E5=A4=8D=E6=9D=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctmobilefirst/models/dms_model.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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)); From 09d418d8382787723f32522154c8675f7f2c2939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Tue, 21 Nov 2023 13:57:07 +0800 Subject: [PATCH 2/2] fix --- application/third_party/ctmobilefirst/models/dms_model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/third_party/ctmobilefirst/models/dms_model.php b/application/third_party/ctmobilefirst/models/dms_model.php index 2361ddb7..e2a7730d 100644 --- a/application/third_party/ctmobilefirst/models/dms_model.php +++ b/application/third_party/ctmobilefirst/models/dms_model.php @@ -111,8 +111,10 @@ class Dms_model extends CI_Model { $returndata = $qurey2->result(); foreach ($returndata as $item) { $paydetail = $this->get_paydetail($item->dt_HTid); - $trainOrderCount = $paydetail->total; + $trainOrderCount = $paydetail->count; + $trainOrderTotal = $paydetail->total; $item->trainOrderCount = $trainOrderCount; + $item->trainOrderTotal = $trainOrderTotal; } //return 数据和总数 return array('data' => $returndata, 'total' => $count); @@ -181,7 +183,7 @@ class Dms_model extends CI_Model { $result = new stdClass(); $result->count = $count; - $result->total = $total; + $result->total = round($total,2); $result->sum = round($sum,2); return $result;