rabin 3 tahun lalu
induk
melakukan
da0ff687d9
2 mengubah file dengan 47 tambahan dan 0 penghapusan
  1. 16 0
      service/agent/database/order.php
  2. 31 0
      service/agent/lib/Import.php

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

@@ -1102,5 +1102,21 @@ return array
             'type' => 'all',
             'col' => '*',
         ),
+
+        'getDataBySign' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'id' => 'yes',
+                'ids' => array('yes-id', '<'),
+                'sign' => array('yes', 'like'),
+                'state' => 1,
+            ),
+            'order' => array('id' => 'asc'),
+            'type' => 'all',
+            //'limit' => '0,2',
+            'col' => 'id,mid,sign',
+        ),
     ),
 );

+ 31 - 0
service/agent/lib/Import.php

@@ -538,6 +538,37 @@ class Import
         }
     }
 
+    # 订单图片本地化
+    public function order_local_api()
+    {
+        $where['ids'] = 50000;
+        $where['sign'] = 'cryl';
+        $data = Dever::db('agent/order')->getDataBySign($where);
+        $test = Dever::input('test');
+        if ($test == 1) {
+            return $data;
+            print_r($data);die;
+        }
+        if ($data) {
+            foreach ($data as $k => $v) {
+                if ($v['mid'] >= 50000) {
+                    continue;
+                }
+                $member = Dever::db('agent/member')->one($v['mid']);
+                if ($member && $member['sign'] && strstr($v['sign'], 'cryl.')) {
+                    $update = array();
+                    $update['where_id'] = $v['id'];
+                    $update['sign'] = str_replace('https://cryl.yijiuguanfang.com/', 'http://d2.churenyiliao.com:8080/', $v['sign']);
+                    Dever::db('agent/order')->update($update);
+                } else {
+                    continue;
+                }
+                echo $v['id'];
+                echo "\r\n";
+            }
+        }
+    }
+
     # 图片本地化
     public function local_api()
     {