瀏覽代碼

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

rabin 2 年之前
父節點
當前提交
ac63a637fd

+ 15 - 0
service/agent/database/member_goods_log.php

@@ -251,5 +251,20 @@ return array
             'type' => 'all',
             'col' => '*, total_num-sell_num as num',
         ),
+
+        'getOne' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'type_id' => 'yes',
+                'type' => 'yes',
+                'sku_id' => 'yes',
+                'state' => 1,
+            ),
+            'order' => array('id' => 'desc'),
+            'type' => 'one',
+            'col' => '*',
+        ),
     ),
 );

+ 7 - 1
service/agent/lib/Dhorder.php

@@ -1253,7 +1253,7 @@ class Dhorder
     }
     #权益管理导出
     public function out_member_goods_api($data){
-        $header = array('权益名称', '会员等级', '姓名', '手机号', '卡号','剩余数量', '总数量', '单件价值', '未兑换价值', '已用面值','5月已用面值','获取方式', '获取时间');
+        $header = array('权益名称', '会员等级', '姓名', '手机号', '卡号','剩余数量', '总数量', '单件价值', '未兑换价值', '已用面值','5月已用面值','备注','获取方式', '获取时间');
         $body = array();
         foreach($data as $k => $v){
             $member = Dever::db('agent/member')->find(array('id'=>$v['mid']));
@@ -1276,6 +1276,11 @@ class Dhorder
                 $card = $code['card']."\t";
                 $mianzhi = $code['total_cash'] - $code['use_cash'];                
             }
+            $desc = '';
+            $member_goods_log = Dever::db('agent/member_goods_log')->getOne(array('type'=>$v['type'],'type_id'=>$v['type_id'],'sku_id'=>$v['sku_id'],'state'=>1));
+            if($member_goods_log && $member_goods_log['desc']){
+                $desc = $member_goods_log['desc'];
+            }
             $d = array
             (
                 $v['name'],
@@ -1289,6 +1294,7 @@ class Dhorder
                 $wd,
                 $mianzhi,
                 $money,
+                $desc,
                 '',
                 date('Y-m-d H:i',$v['cdate']),
                 

+ 9 - 1
service/agent/lib/Manage.php

@@ -15,9 +15,17 @@ class Manage
 
         if ($data) {
             foreach ($data as $k => $v) {
+                $prize_type = '';
                 if (is_array($v)) {
                     if ($v['role']) {
                         $role = Dever::db('setting/role')->find($v['role']);
+                        if($v['role'] == 8){
+                            if($v['prize_type'] == 1){
+                                $prize_type = '-名额外';
+                            }elseif($v['prize_type'] == 2){
+                                $prize_type = '-名额内';
+                            }
+                        }
                     } else {
                         $role = array('name' => '普通代理',);
                     }
@@ -61,7 +69,7 @@ class Manage
                         $v['name'],
                         $v['mobile'],
                         $v['idcard'],
-                        $role['name'],
+                        $role['name'].$prize_type,
                         $area,
                         $agent_cash,
                         $v['cash'],

+ 10 - 2
service/agent/lib/Member.php

@@ -26,8 +26,16 @@ class Member
             if ($code) {
                 $string = '[' . $code . '] <br />';
             }
-
-            $string .= $member['name'] . '('.$member['id'].')' .'<br />' . $member['mobile'] . '<br />' . $member['role']['name'];
+            $prize_type = '';
+            if($member['role']['id'] == 8){
+                if($member['prize_type'] && $member['prize_type'] == 1){
+                    $prize_type = '(名额外)';
+                }elseif($member['prize_type'] && $member['prize_type'] == 2){
+                    $prize_type = '(名额内)';
+                }
+               
+            }
+            $string .= $member['name'] . '('.$member['id'].')' .'<br />' . $member['mobile'] . '<br />' . $member['role']['name'].$prize_type;
             
             if (isset($member['level_id']) && $member['level_id'] && $member['level_id'] > 0) {
                 $member['level'] = Dever::db('setting/level')->find($member['level_id']);