rabin 2 anos atrás
pai
commit
b8c065a0df
1 arquivos alterados com 26 adições e 10 exclusões
  1. 26 10
      service/bill/lib/Manage.php

+ 26 - 10
service/bill/lib/Manage.php

@@ -125,7 +125,17 @@ class Manage
                     continue;
                 }
 
-                $info = Dever::db('bill/cash')->find(array('type' => 11, 'type_id' => $id));
+                if ($tixian['type'] == 1) {
+                    $info = Dever::db('bill/cash')->find(array('type' => 11, 'type_id' => $id));
+                    $table = 'bill/cash';
+                } elseif ($tixian['type'] == 2) {
+                    $info = Dever::db('shop/record')->find(array('type' => 2, 'type_id' => $id));
+                    $table = 'shop/record';
+                } elseif ($tixian['type'] == 3) {
+                    $info = Dever::db('shop/user_money')->find(array('type' => 11, 'type_id' => $id));
+                    $table = 'shop/user_money';
+                }
+                
                 if (!$info) {
                     continue;
                 }
@@ -134,33 +144,39 @@ class Manage
                     $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()));
+                        Dever::db($table)->update(array('where_id' => $id, 'status' => 2, 'operdate' => time()));
                     }
                     # 通知短信
+                    /*
                     if (Dever::project('sms')) {
                         $member = Dever::db('agent/member')->find($info['mid']);
                         Dever::load('sms/api')->send('daili_tixian_yes', $member['mobile'], array('name' => $member['name']));
                     }
+                    */
                 } else {
                     $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()));
                     $w = array();
                     $w['where_id'] = $info['mid'];
-                    $w['cash'] = -1*$tixian['ycash'];
-                    Dever::db('agent/member')->upCash($w);
-                    /*
-                    $update = array();
-                    $update['where_id'] = $info['id'];
-                    $update['status'] = 3;
-                    Dever::db('bill/cash')->update($update);
-                    */
+                    if ($tixian['type'] == 1) {
+                        $w['cash'] = -1*$tixian['ycash'];
+                        Dever::db('agent/member')->upCash($w);
+                    } elseif ($tixian['type'] == 2) {
+                        $w['price'] = -1*$tixian['ycash'];
+                        Dever::db('shop/info')->upCash($w);
+                    } elseif ($tixian['type'] == 3) {
+                        $w['cash'] = -1*$tixian['ycash'];
+                        Dever::db('passport/user')->upCash($w);
+                    }
 
                     # 通知短信
+                    /*
                     if (Dever::project('sms')) {
                         $member = Dever::db('agent/member')->find($info['mid']);
                         Dever::load('sms/api')->send('daili_tixian_no', $member['mobile'], array('name' => $member['name'], 'content' => $desc));
                     }
+                    */
                 }
             }
         }