rabin há 2 anos atrás
pai
commit
b04b45be72

+ 15 - 13
app/card/src/Api.php

@@ -376,24 +376,26 @@ class Api extends Core
                         $goods = array_keys($goods);
                     }
                     # 检测当前商品是否符合该卡的限制
-                    foreach ($data['list'] as $k1 => $v1) {
-                        if (!isset($v1['cash'])) {
-                            $v1['cash'] = $v1['price'];
-                        }
-                        if ($goods) {
-                            if (in_array($v1['id'], $goods)) {
-                                if ($v['info']['category']) {
-                                    if (in_array($v1['top_category_id'], $v['info']['category'])) {
+                    if ($goods_id && isset($data['list']) && $data['list']) {
+                        foreach ($data['list'] as $k1 => $v1) {
+                            if (!isset($v1['cash'])) {
+                                $v1['cash'] = $v1['price'];
+                            }
+                            if ($goods) {
+                                if (in_array($v1['id'], $goods)) {
+                                    if ($v['info']['category']) {
+                                        if (in_array($v1['top_category_id'], $v['info']['category'])) {
+                                            $price += ($v1['cash'] * $v1['num']);
+                                        }
+                                    } else {
                                         $price += ($v1['cash'] * $v1['num']);
                                     }
-                                } else {
+                                }
+                            } elseif ($v['info']['category']) {
+                                if (in_array($v1['top_category_id'], $v['info']['category'])) {
                                     $price += ($v1['cash'] * $v1['num']);
                                 }
                             }
-                        } elseif ($v['info']['category']) {
-                            if (in_array($v1['top_category_id'], $v['info']['category'])) {
-                                $price += ($v1['cash'] * $v1['num']);
-                            }
                         }
                     }
                 } else {

+ 2 - 1
service/agent/database/member_agreement.php

@@ -302,6 +302,7 @@ return array
             'name'      => '协议签订时间',
             'match'     => 'is_numeric',
             'desc'      => '协议签订时间',
+            'search'    => 'date',
             'update'    => 'text',
         ),
 
@@ -331,7 +332,7 @@ return array
             'desc'      => '更新时间',
             'search'    => 'date',
             // 'list'      => 'date("Y-m-d H:i", {udate})',
-            'list_name' => '创建时间<br/>更新时间',
+            'list_name' => '创建时间<br/>更新时间<br/>签署时间',
             'list'      => 'Dever::load("agent/lib/agreement.data",{id})',
             'list_order' => 5,
         ),

+ 6 - 1
service/agent/lib/Agreement.php

@@ -1656,7 +1656,12 @@ class Agreement
         $info = Dever::db('agent/member_agreement')->find($id);
         $cdate = date('Y-m-d H:i',$info['cdate']);
         $udate = date('Y-m-d H:i',$info['udate']);
-        $html = $cdate.'<br />'.$udate;
+        $qdate = '-';
+        if ($info['qdate']) {
+            $qdate = date('Y-m-d H:i',$info['qdate']);
+        }
+        
+        $html = $cdate.'<br />'.$udate.'<br />'.$qdate;
         return $html;
     }
 }