edit-api-order_list

This commit is contained in:
lccsw
2021-11-08 15:25:17 +08:00
parent d6844c827f
commit cd5cf5853a
5 changed files with 71 additions and 36 deletions
+33
View File
@@ -37,4 +37,37 @@ class Test extends HD_Controller
}
}
public function inten(){
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('receiver/order/receiver_orders_model');
$page = $this->input->get('page');
$size = $this->input->get('size');
!$page && $page = 1;
!$size && $size = 20;
$where = [
'type' => 4
];
$rows = $this->app_liche_orders_model->select($where,'id desc',$page,$size);
if($rows){
foreach($rows as $key=>$val){
$last_id = $val['id'];
$order = $this->receiver_orders_model->get(['id'=>$val['o_id']]);
if($order){
$money_json = json_decode($order['money_json'],true);
$money_json['price_intention'] = $val['total_price'] ? $val['total_price'] : 0;
$this->receiver_orders_model->update(['money_json'=>json_encode($money_json,JSON_UNESCAPED_UNICODE)],['id'=>$order['id']]);
}
}
$where = [
'type' => 4,
'id<' => $last_id
];
$left = $this->app_liche_orders_model->count($where);
$ids = implode(',',array_column($rows,'o_id'));
echo "do:{$ids} left:{$left}";
}else{
echo 'finish';
}
}
}