edit-api-order_list
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user