浏览代码

保留两位小数

jason 6 月之前
父节点
当前提交
499e8f8444
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      application/api/controller/Pledge.php
  2. 1 0
      application/api/logic/PledgeLogic.php

+ 1 - 0
application/api/controller/Pledge.php

@@ -56,6 +56,7 @@ class Pledge extends Api
             if (!empty($pledges)) {
             if (!empty($pledges)) {
                   $pledges->product_list = $productList::getBySynthesisProduct($pledges->product_id,  $pledges->type_id, $this->lan);
                   $pledges->product_list = $productList::getBySynthesisProduct($pledges->product_id,  $pledges->type_id, $this->lan);
             }
             }
+            $pledges['day_num'] = round($pledges['day_num'], 2);
             $this->success('', $pledges);
             $this->success('', $pledges);
       }
       }
 
 

+ 1 - 0
application/api/logic/PledgeLogic.php

@@ -26,6 +26,7 @@ class PledgeLogic
             $item['product_list'] = $model->whereIn('id', $item->product_id);
             $item['product_list'] = $model->whereIn('id', $item->product_id);
             if($item->type_id == ProductPledges::Combin) $item['product_list'] = $model->orderRaw('field(id,'. $item->product_id.')');
             if($item->type_id == ProductPledges::Combin) $item['product_list'] = $model->orderRaw('field(id,'. $item->product_id.')');
             $item['product_list'] = $model->field('id,thum,'.$lan.'_name as name')->select();
             $item['product_list'] = $model->field('id,thum,'.$lan.'_name as name')->select();
+            $item['day_num'] = round($item['day_num'], 2);
         }
         }
         return $list;
         return $list;
     }
     }