zxhxx 3 yıl önce
ebeveyn
işleme
a13cf4f094

+ 2 - 1
application/common/model/project/ProjectDonationOrder.php

@@ -153,6 +153,7 @@ class ProjectDonationOrder extends BaseModel
 
         if (isset($where['uid']) && $where['uid']>0) $xwhere['uid'] = $where['uid'];
         if (isset($where['cid']) && $where['cid']>0) $xwhere['cid'] = $where['cid'];
+        if (isset($where['project_id']) && $where['project_id']>0) $xwhere['project_id'] = $where['project_id'];
         $count = $model->where($xwhere)->count();
         $list = $model->where($xwhere)->page($where['page'],$where['limit'])->order('id desc')->select();
         foreach ($list as &$v)
@@ -247,7 +248,7 @@ class ProjectDonationOrder extends BaseModel
                     ProjectDonationOrderInfo::create($data);
                 }
                 self::where('id',$rs['id'])->update(['total_num'=>$num]);
-                ProjectDonationRocord::bill('caeate_order',0,$where['project_id'],$rs['id'],$where['name']);
+                ProjectDonationRocord::bill($rs['cid'],'caeate_order',0,$where['project_id'],$rs['id'],$where['name']);
                 self::commitTrans();
                 return $rs;
             }

+ 2 - 2
application/common/model/project/ProjectDonationRocord.php

@@ -45,10 +45,10 @@ class ProjectDonationRocord extends BaseModel
     {
         return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
     }
-    public static function bill($type,$admin_id=0,$project_id=0,$order_id=0,$remark='')
+    public static function bill($cid=0,$type,$admin_id=0,$project_id=0,$order_id=0,$remark='')
     {
         $add_time = time();
-        return self::create(compact('type', 'admin_id', 'order_id', 'remark', 'type', 'add_time','project_id'));
+        return self::create(compact('type', 'admin_id', 'order_id', 'remark', 'type', 'add_time','project_id','cid'));
     }
     public static function getbill($project_id,$type,$page=1,$limit=20,$cid=0)
     {