input->get('data'); $sql = urldecode(base64_decode($data)); if($sql){ $re=$this->db->query($sql)->result_array(); print_r($re); } } public function o_log(){ $oid = $this->input->get('id'); if($oid){ $this->load->library('entity/deal_entity',['app_id'=>1]); $res = $this->deal_entity->deal_log($oid); var_dump($res); } } public function finish(){ $oid = $this->input->get('id'); if($oid){ $this->load->library('entity/deal_entity',['app_id'=>1]); $res = $this->deal_entity->deal_log_finish($oid); var_dump($res); } } 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'; } } public function bill_time(){ $this->load->model('items/items_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 = [ 'bill_time>' => '0000-00-00 00:00:00' ]; $rows = $this->items_model->select($where,'id desc',$page,$size); if($rows){ foreach($rows as $key=>$val){ $last_id = $val['id']; $this->receiver_orders_model->update(['bill_time'=>$val['bill_time']],['item_id'=>$val['id']]); } $where = [ 'bill_time>' => '0000-00-00 00:00:00', 'id<' => $last_id ]; $left = $this->items_model->count($where); $ids = implode(',',array_column($rows,'id')); echo "do:{$ids} left:{$left}"; }else{ echo 'finish'; } } }