rabin 3 rokov pred
rodič
commit
71d292c679

+ 17 - 0
app/goods/database/info.php

@@ -16,6 +16,12 @@ $sell_type = array
     2 => '不可售卖',
 );
 
+$buy_type = array
+(
+    1 => '可采购',
+    2 => '不可采购',
+);
+
 $mode = array
 (
     1 => '自提',
@@ -143,6 +149,17 @@ $config = array
             'control'   => 'sell_type',
         ),
 
+        'buy_type'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '采购类型',
+            'default'   => '1',
+            'desc'      => '采购类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $buy_type,
+        ),
+
         'column_id'        => array
         (
             'type'      => 'varchar-8000',

+ 5 - 5
app/goods/database/info_sku.php

@@ -282,7 +282,7 @@ $config = array
             ),
             'type' => 'all',
             'order' => array('id' => 'desc'),
-            'col' => 'id,info_id,`key`,price,s_price,f_price,c_price,type,min,code,unit,weight',
+            'col' => 'id,info_id,`key`,price,s_price,f_price,c_price,type,min,code,unit,weight,cunhuo_code',
         ),
 
         # 列表
@@ -296,7 +296,7 @@ $config = array
             ),
             'type' => 'all',
             'order' => array('id' => 'desc'),
-            'col' => 'id,info_id,`key`,price,s_price,f_price,c_price,min,code,unit,weight|key',
+            'col' => 'id,info_id,`key`,price,s_price,f_price,c_price,min,code,unit,weight,cunhuo_code|key',
         ),
 
         # 获取单条数据
@@ -309,7 +309,7 @@ $config = array
                 'state' => 1,
             ),
             'type' => 'one',
-            'col' => 'id,info_id,price,s_price,f_price,c_price,min,code,unit,weight',
+            'col' => 'id,info_id,price,s_price,f_price,c_price,min,code,unit,weight,cunhuo_code',
         ),
 
         'getMinOne' => array
@@ -322,7 +322,7 @@ $config = array
             ),
             'type' => 'one',
             'order' => array('price' => 'asc', 'id' => 'desc'),
-            'col' => 'id,info_id,price,s_price,min,code,unit,weight',
+            'col' => 'id,info_id,price,s_price,min,code,unit,weight,cunhuo_code',
         ),
 
         'getMaxOne' => array
@@ -335,7 +335,7 @@ $config = array
             ),
             'type' => 'one',
             'order' => array('price' => 'desc', 'id' => 'desc'),
-            'col' => 'id,info_id,price,s_price,min,code,unit,weight',
+            'col' => 'id,info_id,price,s_price,min,code,unit,weight,cunhuo_code',
         ),
 
         # 更新售出量

+ 9 - 4
app/shop/lib/Info.php

@@ -173,10 +173,15 @@ class Info
                             $result_1[] = $d;
                         }
                     } else {
-                        if ($d['total'] <= 0) {
-                            $result_2[] = $d;
-                        } else {
-                            $result_1[] = $d;
+                        if (!isset($d['buy_type'])) {
+                            $d['buy_type'] = 1;
+                        }
+                        if ($d['buy_type'] == 1) {
+                            if ($d['total'] <= 0) {
+                                $result_2[] = $d;
+                            } else {
+                                $result_1[] = $d;
+                            }
                         }
                     }
                     

+ 3 - 2
service/agent/src/My.php

@@ -1068,12 +1068,13 @@ class My extends Core
                 $u = array();
                 $u = array('sign' => $sign, 'where_id' => $info['id'], 'status' => 2);
                 if ($info['qdate'] && $info['qdate'] > 0) {
-
+                    $qdate = $info['qdate'];
                 } else {
-                    $u['qdate'] = time();
+                    $qdate = $u['qdate'] = time();
                 }
                 $state = Dever::db('agent/member_agreement')->update($u);
                 if ($state) {
+                    //Dever::load('agent/lib/agreement')->log($state, $where['mid'], $qdate);
                     $role = Dever::db('setting/role')->find($info['role']);
                     $info['sign'] = $sign;
                     $name = Dever::load('agent/lib/agreement')->name($info['agreement_id'], $info, $role, 2, 2);