public function mark() { $sqlOrder = new sql_orderMod(); $a_id = $this->in_cookie('aid', None, 1, 'True'); $ids = $this->in_post('ids', '', 2, 'True'); $action = $this->in_post('action', '', 2, 'True'); $idArr = explode('@@', $ids); foreach ($idArr as $value) { if (strlen($value) < 17) { $tempArr[] = '\'' . $value . '\''; } } $ids = implode(',', $tempArr); if (strlen($ids) < 6) { $action = 'useless'; } switch ($action) { case 'finish': $res = $sqlOrder->set_order_finish($a_id, $ids); break; case 'del': $res = $sqlOrder->set_order_del($a_id, $ids); break; default: $res = 0; break; } if ($res) { echo 1; } else { echo 0; } }
public function export() { $sqlOrder = new sql_orderMod(); $a_id = $this->in_cookie('aid', None, 1, 'True'); $temp = $_GET['status']; if (is_numeric($temp)) { $status = $temp; } else { $status = -1; } $school = $this->in_get('sc', 0, 1, True); $cid = $this->in_get('cid', 0, 1); $aid = $this->in_get('sell', 0, 1); $ex_d = $this->in_get('ex_d', date('Y-m-d'), 2); $pr_d = $this->in_get('pr_d', date('Y-m-d', strtotime('+1 day')), 2); $res = $sqlOrder->export_order_super($status, $school, $cid, $aid, $ex_d, $pr_d); if (!$res) { echo '没有该品牌的订水情况'; } if ($res) { header("Content-Type: application/{$file_type};charset=gbk"); header("Content-Disposition: attachment; filename=1.xls"); header("Pragma: no-cache"); $title = "日期\t用户名\t手机号\t学校\t宿舍号\t品牌\t数量\t结算方式\t状态\n"; echo "{$title}"; foreach ($res as $key => $value) { if ($value['pay_type'] == 0) { $pay_type = '预付+提水'; } else { if ($value['pay_type'] == 1) { $pay_type = '提水'; } else { if ($value['pay_type'] == 2) { $pay_type = '线下支付'; } else { if ($value['pay_type'] == 3) { $pay_type = '积分兑换'; } } } } if ($value['send_status'] == 0) { $send_status = '未配送'; } else { if ($value['send_status'] == 1) { $send_status = '正在配送'; } else { if ($value['send_status'] == 2) { $send_status = '已配送'; } } } echo $value['created'] . "\t" . $value['name'] . "\t" . $value['phone'] . "\t" . $value['s_name'] . '-' . $value['c_name'] . "\t" . $value['addr'] . "\t" . $value['g_name'] . "\t" . $value['num'] . "\t" . $vpay_type . "\t" . $send_status . "\n"; } } else { $this->alert('没有找到相关数据'); } }
private function write_order($user_res, $tempArr, $type) { $this->init(); $sqlOrder = new sql_orderMod(); $ins_data['o_id'] = 'E' . uniqid(); $ins_data['p_id'] = $user_res['p_id']; $ins_data['name'] = $user_res['name']; $ins_data['addr'] = $user_res['addr']; $ins_data['phone'] = $user_res['phone']; $ins_data['a_id'] = $user_res['a_id']; $ins_data['s_id'] = $user_res['s_id']; $ins_data['s_name'] = $user_res['s_name']; $ins_data['g_id'] = $user_res['g_id']; $ins_data['g_name'] = $user_res['g_name']; $ins_data['num'] = $tempArr['num']; $ins_data['points'] = $tempArr['points']; $ins_data['total_fee'] = $tempArr['total_fee']; $ins_data['created'] = date('Y-m-d h:i:s'); $ins_data['send_status'] = 0; $ins_data['pre_pay'] = 0; $ins_data['pre_num'] = 0; $ins_data['pre_left_num'] = 0; $send_res = $sqlOrder->get_sender($user_res['a_id'], $user_res['addr']); $ins_data['send_id'] = $send_res['send_id']; $ins_data['send_name'] = $send_res['name']; if ($type == 0) { $ins_data['pay_type'] = 0; } else { if ($type == 1) { $ins_data['pay_type'] = 1; $ins_data['consume_points'] = $tempArr['consume_points']; } } $res = $this->model->table($this->config['order'])->data($ins_data)->insert(); if (!$res) { $this->alert('对不起,网络暂时除了点小问题'); } }