|
@@ -195,7 +195,7 @@ class Task
|
|
|
if ($data && isset($data[0]['sum'])) {
|
|
|
//$sum = $data[0]['sum'] - $v['credit'];
|
|
|
$sum = $data[0]['sum'];
|
|
|
- Dever::db('info', 'seller')->update($v['id'], array('cash' => $sum));
|
|
|
+ //Dever::db('info', 'seller')->update($v['id'], array('cash' => $sum));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -241,11 +241,49 @@ class Task
|
|
|
# 插入测试数据
|
|
|
public function test()
|
|
|
{
|
|
|
- $order = Dever::db('order_bak', 'seller')->load([]);
|
|
|
+ $where = array();
|
|
|
+ //$where['id'] = '65c345d7d46ba46b32041d32';
|
|
|
+ $where['status'] = 10;
|
|
|
+ $set = array();
|
|
|
+ //$where['sku_id'] = 18;
|
|
|
+ //$set['limit'] = 10;
|
|
|
+ //$set['order'] = 'total desc';
|
|
|
+ //$set['col'] = 'id,cash,seller_id';
|
|
|
+ //$set['group'] = 'cash';
|
|
|
+ //$set['col'] = 'sum(cash)';
|
|
|
+ //$info = Dever::db('order_log1', 'seller')->count($where, $set);
|
|
|
+ //print_r($info);die;
|
|
|
+ $order = Dever::db('order', 'seller')->load([]);
|
|
|
foreach ($order as $k => $v) {
|
|
|
//$v['cdate'] = time();
|
|
|
- Dever::db('order_log1', 'seller')->insert($v);
|
|
|
+ //unset($v['id']);
|
|
|
+ $id = Dever::db('order_log1', 'seller')->insert($v);
|
|
|
+ //print_r($id);die;
|
|
|
+ }
|
|
|
+ $this->test();
|
|
|
+ }
|
|
|
+
|
|
|
+ # 历史数据整理
|
|
|
+ public function history_order()
|
|
|
+ {
|
|
|
+ $order = Dever::db('order', 'seller')->load([]);
|
|
|
+ foreach ($order as $k => $v) {
|
|
|
+ $order_log = Dever::db('order_log1', 'seller')->find(array('order_num' => $v['order_num']));
|
|
|
+ if (!$order_log) {
|
|
|
+ Dever::db('order_log1', 'seller')->insert($v);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public function history()
|
|
|
+ {
|
|
|
+ $order = Dever::db('log', 'seller')->load([]);
|
|
|
+ foreach ($order as $k => $v) {
|
|
|
+ $log = Dever::db('log1', 'seller')->find(array('sid' => $v['id']));
|
|
|
+ if (!$log) {
|
|
|
+ $v['sid'] = $v['id'];
|
|
|
+ unset($v['id']);
|
|
|
+ Dever::db('log1', 'seller')->insert($v);
|
|
|
+ }
|
|
|
}
|
|
|
- //$this->test();
|
|
|
}
|
|
|
}
|