0 && $end_unixtime > $start_unixtime) { $condition['add_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and']; } elseif ($start_unixtime > 0) { $condition['add_time'] = ['egt', $start_unixtime]; } elseif ($end_unixtime > 0) { $condition['add_time'] = ['lt', $end_unixtime]; } else { $start = strtotime(date('Y-m-d', time())); $condition['add_time'] = ['egt', $start]; } if(!empty($_GET['mchid'])) { $condition['mchid'] = $_GET['mchid']; } if(in_array($_GET['handled'], ['0', '1'])) { $condition['handled'] = $_GET['handled']; } if (!empty($_GET['mch_orders'])) { $mch_orders = rtrim($_GET['mch_orders'],','); $condition['mch_order'] = ['in', $mch_orders]; } $list = $mod->getRefillErrorlList($condition, 200, 1000); $merchants = []; $merchant_list = $this->merchants(); foreach ($merchant_list as $value) { $merchants[$value['mchid']] = $value; } $list = $this->DataFormat($list, $merchants); Tpl::output('merchant_list', $merchant_list); Tpl::output('list', $list); Tpl::output('show_page', $mod->showpage()); Tpl::showpage('refill.error'); } private function DataFormat($list,$merchants) { foreach ($list as $key => $value) { $list[$key]['company_name'] = $merchants[$value['mchid']]['company_name']; if($value['handled'] == 0) { $list[$key]['handled_text'] = '未处理'; } else { $list[$key]['handled_text'] = '已处理'; } } return $list; } public function handledOp() { $mod = Model('refill_error'); $id = $_GET['error_id']; $condition['error_id'] = ['in',$id]; $condition['handled'] = 0; $resp = $mod->where($condition)->update(['handled' => 1]); if(!$resp) { showMessage('操作失败', 'index.php?act=refill_error&op=index'); } showMessage('操作成功', 'index.php?act=refill_error&op=index'); } }