Your Name 2 years ago
parent
commit
4729635d2f

+ 2 - 2
service/agent/database/option_account.php

@@ -35,10 +35,10 @@ return array
     'menu' => true,
     // 'config_type' => $type,
     'config_status' => $status,
-
     'end' => array
     (
         'update' => 'agent/lib/option_account.updateAccount',
+        'insert' => 'agent/lib/option_account.updateAccount',
     ),
     # 数据结构
     'struct' => array
@@ -325,7 +325,7 @@ return array
             'name'      => '确认期权数',
             'default'   => '',
             'desc'      => '姓名',
-            'match'     => 'is_number',
+            'match'     => 'is_numeric',
             'update'    => $col ? 'text' : false, 
             'show'      => 'audit=1', 
         ),

+ 10 - 1
service/agent/lib/Option_account.php

@@ -220,15 +220,24 @@ Class Option_account{
         return 'reload';
     }
 	public function updateAccount($id,$name,$data){
+		if($id){
+			$admin = Dever::load('manage/auth.data');
+			$where['where_id'] = $id;
+			$where['audit_admin'] = $admin['id'];
+	    	Dever::db('agent/option_account')->update($where);
+		}
 		$audit = Dever::param('audit',$data);
+		$num = Dever::param('num',$data);
 		$id = Dever::param('id',$data);
-		// $area = Dever::param('area', $data);
 		$info = Dever::db('agent/option_account')->find($id);
 		if($audit){
 			if ($audit == 1) {
 				$where['where_id'] = $id;
 				$where['set_audit_date'] = time();
 				$where['set_audit_type'] = 2;
+				if($num){
+					$where['set_num'] = $num;
+				}
 				Dever::db('agent/option_account')->update($where);
 			}
 			

+ 5 - 1
service/bill/database/sell.php

@@ -23,6 +23,10 @@ if ($mid) {
     //     '发放业绩' => array('fast', '', 'push_sell&search_option_mid=' . $mid),
     // );
 }
+$excel = false;
+if (Dever::load('manage/auth')->checkFunc('bill.sell', 'auditsell', '业绩流水导出')) {
+    $excel[] = array('数据导出', '业绩流水导出', 'bill/lib/sell.out_sell');
+}
 $type = array
 (
     1 => '直推业绩',
@@ -241,7 +245,7 @@ return array
         'delete' => false,
         'edit' => false,
         'button' => $button,
-
+        'excel' => $excel,
         'list_button' => array
         (
             'list' => array('查看详情', '"push_sell&project=bill&id={id}&page_type=1"'),

+ 24 - 0
service/bill/lib/Sell.php

@@ -180,4 +180,28 @@ class Sell
 
         return $html;
     }
+    public function out_sell($data){
+        $header = array('代理商姓名', '代理商手机号', '下级姓名', '下级手机号', '业绩金额', '下单时间');
+        $body = array();
+        foreach($data as $k => $v){
+            $member = Dever::db('agent/member')->find($v['mid']);
+            $child = Dever::db('agent/member')->find($v['child_mid']);
+            $cdate = '-';
+            if($v['cdate']){
+                $cdate = date('Y-m-d H:i',$v['cdate']);
+            }
+            $d = array
+            (
+                $member['name'],
+                $member['mobile'],
+                $child['name'],
+                $child['mobile'],
+                $v['num'],
+                $cdate,
+            );
+            $body[] = $d;
+        }
+         $file = Dever::input('excel_name');
+         return Dever::excelExport($body, $header, $file);
+    }
 }