Browse Source

Merge branch 'master' of ssh://git.dever.cc:10022/dever-product/churen

rabin 3 years ago
parent
commit
17d9190d82

+ 1 - 1
service/bill/database/cash.php

@@ -364,7 +364,7 @@ return array
                 'state' => 1,
             ),
             'type' => 'one',
-            'col' => 'sum(yue) as total',
+            'col' => 'sum(cash) as total',
         ),
     ),
 );

+ 2 - 1
service/bill/database/tixian.php

@@ -374,7 +374,7 @@ return array
                 'state' => 1,
             ),
             'type' => 'one',
-            'col' => 'mid as mid',
+            'col' => 'sum(cash) as total',
         ),
         'upStatus' => array
         (
@@ -400,6 +400,7 @@ return array
                 'state' => 1,
             ),
             'type' => 'All',
+            'order' => array('cdate' => 'desc'),
             'col' => '*',
         ),
     ),

+ 5 - 5
service/bill/lib/Cron.php

@@ -431,11 +431,11 @@ class Cron
             // print_R($where);die;
             $tixian=Dever::db('bill/tixian')->getwsCash($where);
             if($tixian){
-                $where['status']=1;
-                $where['type']=11;
-                $where['mid']=$tixian['mid'];
-                $cash=Dever::db('bill/cash')->getwsCash($where);
-                $data['ws_cash']=$cash['total']*(-1);
+                // $where['status']=1;
+                // $where['type']=11;
+                // $where['mid']=$tixian['mid'];
+                // $cash=Dever::db('bill/cash')->getwsCash($where);
+                $data['ws_cash']=$tixian['total']*(-1);
             }
             #已审核待发放提现
             $data['df_cash']=0;

+ 25 - 13
service/bill/lib/Manage.php

@@ -71,6 +71,8 @@ class Manage
                         $tixian = Dever::db('bill/tixian')->find($info['type_id']);
                         $where['where_id'] = $tixian['id'];
                         $where['status'] = 1;
+                        $admin = Dever::load('manage/auth.data');
+                        $where['audit_admin'] = $admin['id'];
                         Dever::db('bill/tixian')->update($where);
                     }
                 } else {
@@ -84,6 +86,8 @@ class Manage
                         Dever::db('agent/member')->upCash($where);
                         $update['where_id'] = $tixian['id'];
                         $update['status'] = 3;
+                        $admin = Dever::load('manage/auth.data');
+                        $update['audit_admin'] = $admin['id'];
                         Dever::db('bill/tixian')->update($update);
                     }
                 }
@@ -121,7 +125,9 @@ class Manage
                     continue;
                 }
                 if ($audit == 2) {
-                    Dever::db('bill/tixian')->update(array('where_id' => $id, 'status' => 2, 'operdate' => time()));
+                    $admin = Dever::load('manage/auth.data');
+                    $where['audit_admin'] = $admin['id'];
+                    Dever::db('bill/tixian')->update(array('where_id' => $id, 'status' => 2, 'audit_admin' => $where['audit_admin'],'operdate' => time()));
                     if ($info && $info['status'] == 1) {
                         Dever::db('bill/cash')->update(array('where_id' => $id, 'status' => 2, 'operdate' => time()));
                     }
@@ -131,7 +137,9 @@ class Manage
                         Dever::load('sms/api')->send('daili_tixian_yes', $member['mobile'], array('name' => $member['name']));
                     }
                 } else {
-                    Dever::db('bill/tixian')->update(array('where_id' => $id, 'status' => 3, 'operdate' => time()));
+                    $admin = Dever::load('manage/auth.data');
+                    $where['audit_admin'] = $admin['id'];
+                    Dever::db('bill/tixian')->update(array('where_id' => $id, 'status' => 3, 'audit_admin' => $where['audit_admin'],'operdate' => time()));
                     # 通知短信
                     if (Dever::project('sms')) {
                         $member = Dever::db('agent/member')->find($info['mid']);
@@ -211,25 +219,29 @@ class Manage
         foreach($data as $k => $v){
             $member = Dever::db('agent/member')->find(array('id'=>$v['mid']));
             $role = Dever::db('setting/role')->find(array('id'=>$member['role']));
-            if($v['audit'] == 1){
-                $audit = '待审核';
-            }elseif($v['audit'] == 2){
-                $audit = '已审核';
-            }else{
-                $audit = '已作废';
-            }
+            
             if($v['status'] == -1){
                 $status = '未审核待发放';
+                $audit = '待审核';
             }elseif($v['status'] == 1){
                 $status = '已审核待发放';
+                $audit = '已审核';
             }elseif($v['status'] == 2){
                 $status = '已发放';
+                $audit = '已审核';
             }else{
                  $status = '已作废';
+                 $audit = '已作废';
             }
             $cdate = date('Y-m-d H:i',$v['cdate']);
             $operdate = date('Y-m-d H:i',$v['operdate']);
-            $admin = Dever::load('manage/auth.data');
+            if($v['audit_admin']){
+                $admin = Dever::load('manage/admin-find',$v['audit_admin']);
+                $username = $admin['username'];
+            }else{
+                $username = '';
+            }
+            
             if($v['ycash'] < 0){
                 $ycash = $v['ycash'] * (-1);
             }else{
@@ -244,8 +256,8 @@ class Manage
             (
                 $v['order_num'],
                 $member['name'],
-                "'".$member['mobile'],
-                "'".$member['idcard'],
+                $member['mobile'],
+                $member['idcard'],
                 $role['name'],
                 $ycash,
                 $cash,
@@ -254,7 +266,7 @@ class Manage
                 $operdate,
                 $audit,
                 $status,
-                $admin['username'],
+                $username,
                 '',
             );
              $body[] = $d;