rabin 2 years ago
parent
commit
b94402e770
2 changed files with 36 additions and 0 deletions
  1. 14 0
      service/agent/database/order.php
  2. 22 0
      service/agent/lib/Tool.php

+ 14 - 0
service/agent/database/order.php

@@ -1068,5 +1068,19 @@ return array
             'type' => 'all',
             'col' => '*',
         ),
+
+        'getDataBySoft' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'soft_cash' => array('yes', '>='),
+                'status' => 4,
+                'state' => 1,
+            ),
+            'order' => array('id' => 'asc'),
+            'type' => 'all',
+            'col' => '*',
+        ),
     ),
 );

+ 22 - 0
service/agent/lib/Tool.php

@@ -557,6 +557,28 @@ class Tool
         return 'ok';
     }
 
+    # 更新合同内容
+    public function order_agreement_up_api()
+    {
+        $where['soft_cash'] = 1;
+        $data = Dever::db('agent/order')->getDataBySoft($where);
+        $test = Dever::input('test');
+        if ($data) {
+            if ($test == 1) {
+                print_r($data);die;
+            }
+
+            foreach ($data as $k => $v) {
+                $info = Dever::db('agent/member_agreement')->find(array('order_id' => $v['id'], 'agreement_id' => 1));
+                if ($info) {
+                    Dever::load('agent/lib/agreement')->upContent($info['id']);
+                }
+            }
+        }
+
+        return 'ok';
+    }
+
     # 更新业绩流水里的分组id
     public function upSell_api()
     {