protected function getList() { $passData = array(); if (isset($this->request->get['filter_order_id'])) { $passData = array(1); $filter_order_id = $this->request->get['filter_order_id']; } else { $filter_order_id = null; } if (isset($this->request->get['filter_customer'])) { $passData = array("uname" => $this->request->get['filter_customer']); $filter_customer = $this->request->get['filter_customer']; } else { $filter_customer = null; } if (isset($this->request->get['filter_order_status_id'])) { $passData = array("filter_order_status_id" => $this->request->get['filter_order_status_id']); $filter_order_status_id = $this->request->get['filter_order_status_id']; } else { $filter_order_status_id = null; } if (isset($this->request->get['firstname'])) { $firstname = $this->request->get['firstname']; } else { $firstname = null; } if (isset($this->request->get['filter_sid'])) { $passData = array(1); $filter_sid = $this->request->get['filter_sid']; } else { $filter_sid = null; } if (isset($this->request->get['filter_sn'])) { $filter_sn = $this->request->get['filter_sn']; } else { $filter_sn = null; } if (isset($this->request->get['filter_date_added'])) { $filter_date_added = $this->request->get['filter_date_added']; } else { $filter_date_added = null; } if (isset($this->request->get['filter_date_modified'])) { $filter_date_modified = $this->request->get['filter_date_modified']; } else { $filter_date_modified = null; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'o.order_id'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'DESC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $url = ''; if (isset($this->request->get['filter_order_id'])) { $url .= '&filter_order_id=' . $this->request->get['filter_order_id']; } if (isset($this->request->get['filter_customer'])) { $url .= '&filter_customer=' . urlencode(html_entity_decode($this->request->get['filter_customer'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_order_status_id'])) { $url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id']; } if (isset($this->request->get['filter_sn'])) { $url .= '&filter_sn=' . $this->request->get['filter_sn']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['filter_date_modified'])) { $url .= '&filter_date_modified=' . $this->request->get['filter_date_modified']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => '运单管理', 'href' => $this->url->link('yundan/yundan', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: '); if (isset($this->request->post['selected']) && isset($this->request->post['filter_order_status_id'])) { $select = $this->request->post['selected']; $filter_order_status_id = $this->request->post['filter_order_status_id']; $this->model_yundan_yundan->updata_status($select, $filter_order_status_id); //手机推送消息 if ($filter_order_status_id == 2 || $filter_order_status_id == 3) { foreach ($this->request->post['selected'] as $order_id) { $sendorder = $this->model_yundan_yundan->getOrder($order_id); $uname = $sendorder['0']['uname']; $email = $sendorder['0']['email']; $apps = $this->model_sale_order->getOnlineAppByCustomer($sendorder['0']['uid']); if ($apps) { //已邮寄2,已确认收货3 if ($filter_order_status_id == 2) { $message = '已邮寄,您可以通过快递编号查看运单的物流跟踪信息。'; $state = 2; } elseif ($filter_order_status_id == 3) { $message = '已确认收货,戳我进来看看又新进了些啥好货~'; $state = 3; } $custom_content = array('order_id' => $order_id, 'state' => $state); include_once DIR_SYSTEM . 'baepush.class.php'; $baepush = new Baepush(); foreach ($apps as $app) { if ($app['device_type'] == 1) { //ios $device_type = 4; } elseif ($app['device_type'] == 2) { //android $device_type = 3; } $pm = array('push_type' => 1, 'user_id' => $app['user_id'], 'device_type' => $device_type, 'description' => '您的运单' . $order_id . $message, 'deploy_status' => 2, 'custom_content' => $custom_content); $baepush->push($pm); } } if ($filter_order_status_id == 2) { $subject = 'CNstorm运单' . $order_id . '发出提示邮件'; $message = "<div style = 'background-color:#f7f7f7;text-align:center;padding:30px 0;margin:0;width:100%;'>\n <div style = 'max-width:800px;margin:0 auto;text-align:left;padding:0;background-color:#ffffff;'>\n <div style = 'margin:0;padding:0;text-align:center;'><img src = 'http://www.acgstorm.com/image/data/logo.png' width = '226' height = '52' style = 'margin:45px 0;'></div>\n <div style = 'padding:0;margin:0;'>\n <div style = 'margin:0 3px;background-color:#fff;padding:0;'>\n <div style = 'padding:0 5%;margin:0;word-wrap:break-word;color:#818181;font-size:1em;font-family:helvetica,Arial,NanumGothic,Dotum'>\n <h3 style = 'margin:0 0 20px 0;padding-top:10px;font-weight:normal;'>您好, " . $uname . " <span style = 'font-size:22px;color:#FF6d85;'>♥</span></h3>\n <p><b style = 'color:#000;'>您的运单号: {$order_id} 包裹已发出!</b></p>\n <div style = 'width:98%; margin:0 auto; padding:10px; border:1px solid #E8CCCC'>接下来,您可访问“用户中心” – “<a href = 'http://www.acgstorm.com/order-sendorder.html' target = '_blank' style = 'color:#fb6e52;font-weight: bold'>国际运单</a>”查询您的包裹及物流跟踪信\n 息。 </br>\n 别忘了在收到包裹后前往用户中心确认收货,并给我们留下宝贵评价以获赠运单积分哦^^!<br>\n 我们非常荣幸能为您服务,期待您的下次访问!\n </div>\n <p style = 'margin:20px 0;'>CNstorm致力于提升海外留学生及华人生活体验,让您在海外生活,也能如同国内一样方便。接下来您可以:</p>\n 1、 继续在中国购物网站挑选商品,并寄至您指定的海外地址(<a href = 'http://www.acgstorm.com/procurement.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>代购</a>)\n <p>2、 您自行准备商品并邮寄至CNstorm中国大陆地址,通过CNstorm极具性价比的国际物流系统,与本次商品合并快运至您的海外地址。(<a href = 'http://www.acgstorm.com/selfshopping.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>代寄</a>)</p>\n <p>3、 亲人朋友生日,重大节日,纪念日... CNstorm都能为您下单,将礼物寄至您指定的国内地址(<a href = 'http://www.acgstorm.com/international-express.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>国内送</a>)。</p>\n <p>4、 前往Share(晒尔华人互动社区)分享您的海外生活轶事(<a href = 'http://www.acgstorm.com/index.php?route=social/social' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>晒尔社区</a>)</p>\n <p>我们为您提供的所有服务都同时接受外币及人民币支付,让您不必再为支付感到烦恼。有关支付方式介绍请<a href = 'http://www.acgstorm.com/index.php?route=help/help&cid=40' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>点此查阅</a>。</p>\n <p style = 'margin:68px 0 40px 0;'>我们衷心感谢您选择并使用CNstorm为您服务!</p>\n <p style = 'margin:20px 0 40px 0;'>CNstorm客户关怀部</p>\n <p style = 'margin:0;text-align:center;'><a href = 'http://www.weibo.com/cnstorm' style = 'margin-right:10px;text-decoration:none;color:#fb6e52;' target = '_blank'>Weibo</a> | <a href = 'http://www.acgstorm.com/index.php?route=app/appload' style = 'margin:0 10px;text-decoration:none;color:#fb6e52;' target = '_blank'>Ios App</a> | <a href = 'http://www.acgstorm.com/help.html' style = 'margin-left:10px;text-decoration:none;color:#fb6e52;' target = '_blank'>FAQ</a></p>\n </div>\n </div>\n </div>\n <div style = 'background-color:#ffffff;height:70px;padding:0;'></div>\n <div style = 'text-align:center;background-color:#f7f7f7;padding-top:20px;'>\n <p style = 'color:#b1b1b1;font-size:.85em;'>如果您需要联系我们的客户服务小组,请访问我们的官网(<a href = 'www.acgstorm.com' target = '_blank' style = 'text-decoration:none;color:#fb6e52'>http://www.acgstorm.com</a>)点击右上角帮助中心与我们取得联系。</p>\n <p style = 'font-size:.7em;color:#818181;'>Copyright © 2014 CNstorm Co., Ltd. 2 Exhibition center, F518 Creative park, Shenzhen, China. All Rights Reserved.<br>\n <a href = 'http://www.acgstorm.com/help-agreement.html' style = 'text-decoration:none;color:#fb6e52;' target = '_blank'>Terms of Service</a> | <a href = 'http://www.acgstorm.com/help-privacy.html' style = 'text-decoration:none;color:#fb6e52;' target = '_blank'>Privacy Policy</a></p>\n </div>\n </div>\n </div>"; $data = array('sendto' => $email, 'receiver' => $uname, 'subject' => $subject, 'msg' => $message); $this->load->model('tool/sendmail'); $this->model_tool_sendmail->send($data); } } } } else { $order = 'DESC'; } $this->data['invoice'] = $this->url->link('sale/order/invoice', 'token=' . $this->session->data['token'], 'SSL'); $this->data['insert'] = $this->url->link('sale/order/insert', 'token=' . $this->session->data['token'], 'SSL'); $this->data['delete'] = $this->url->link('yundan/yundan', 'token=' . $this->session->data['token'] . $url, 'SSL'); $this->data['emali'] = $this->url->link('sale/contact', 'token=' . $this->session->data['token'], 'SSL'); $this->data['update_order'] = $this->url->link('yundan/yundan', 'token=' . $this->session->data['token'] . $url, 'SSL'); $this->data['orders'] = array(); $data = array('filter_order_id' => $filter_order_id, 'filter_customer' => $filter_customer, 'firstname' => $firstname, 'filter_order_status_id' => $filter_order_status_id, 'filter_sn' => $filter_sn, 'filter_sid' => $filter_sid, 'filter_date_added' => $filter_date_added, 'filter_date_modified' => $filter_date_modified, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $this->config->get('config_admin_limit'), 'limit' => $this->config->get('config_admin_limit')); date_default_timezone_set('Asia/Shanghai'); $results = $this->model_yundan_yundan->getOrders($data); // print_r($results); foreach ($results as $result) { //var_dump($result);exit(); $action = array(); $action[] = array('text' => $this->language->get('text_view'), 'href' => $this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $result['sid'] . $url, 'SSL')); if ($result['state'] == 1) { $state = "已付款"; } elseif ($result['state'] == 2) { $state = "已邮寄"; } elseif ($result['state'] == 3) { $state = "已确认收货"; } elseif ($result['state'] == 4) { $state = "无效运单"; } elseif ($result['state'] == 5) { $state = "准备邮寄"; } elseif ($result['state'] == 6) { $state = "待补交运费"; } elseif ($result['state'] == 8) { $state = "已评价"; } else { $state = ""; } $express_all = $this->model_yundan_yundan->International_express($result['country']); $country_cn = $this->model_yundan_yundan->Destination_cn($result['country']); $zengzhi = explode(',', $result['zengzhi']); if (count($zengzhi) == 1) { $result['zengzhi'] = $zengzhi[0]; } else { $result['zengzhi'] = $zengzhi; } $this->data['orders'][] = array('pak_free' => $result['pak_free'], 'sid' => $result['sid'], 'remarks' => $result['remarks'], 'uname' => $result['uname'], 'remark' => $result['remark'], 'sn' => $result['sn'], 'express' => $result['did'], 'deliveryname' => $result['deliveryname'], 'express_all' => $express_all, 'country' => $result['country'], 'country_cn' => $country_cn, 'city' => $result['city'], 'address' => $result['address'], 'consignee' => $result['consignee'], 'freight' => $result['freight'], 'email' => $result['email'], 'serverfee' => $result['serverfee'], 'customsfee' => $result['customsfee'], 'totalfee' => $result['totalfee'], 'countweight' => $result['countweight'], 'dabao' => $result['dabao'], 'dingdan' => $result['dingdan'], 'baozhuang' => $result['baozhuang'], 'zengzhi' => $result['zengzhi'], 'tel' => $result['tel'], 'addtime' => date("Y-m-d H:i:s", $result['addtime']), 'yundan_long' => $result['length'], 'yundan_wide' => $result['width'], 'yundan_high' => $result['height'], 'uptime' => date("Y-m-d H:i:s", $result['uptime']), 'state' => $state, 'countweight' => $result['countweight'], 'volume_free' => $result['volumn_price'], 'zip' => $result['zip'], 'selected' => isset($this->request->post['selected']) && in_array($result['sid'], $this->request->post['selected']), 'action' => $action, 'wrapperfee' => $result['wrapperfee'], 'oldtotalfee' => $result['oldtotalfee']); } $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_no_results'] = $this->language->get('text_no_results'); $this->data['text_missing'] = $this->language->get('text_missing'); $this->data['token'] = $this->session->data['token']; if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $this->data['success'] = ''; } $url = ''; if (isset($this->request->get['filter_order_id'])) { $url .= '&filter_order_id=' . $this->request->get['filter_order_id']; } if (isset($this->request->get['filter_customer'])) { $url .= '&filter_customer=' . urlencode(html_entity_decode($this->request->get['filter_customer'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_order_status_id'])) { $url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id']; } if (isset($this->request->get['filter_total'])) { $url .= '&filter_total=' . $this->request->get['filter_total']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['filter_date_modified'])) { $url .= '&filter_date_modified=' . $this->request->get['filter_date_modified']; } if ($order == 'ASC') { $url .= '&order=DESC'; } else { $url .= '&order=ASC'; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['sort_order'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=o.order_id' . $url, 'SSL'); $this->data['sort_customer'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=customer' . $url, 'SSL'); $this->data['sort_status'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=status' . $url, 'SSL'); $this->data['sort_total'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=o.total' . $url, 'SSL'); $this->data['sort_date_added'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=o.date_added' . $url, 'SSL'); $this->data['sort_date_modified'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=o.date_modified' . $url, 'SSL'); $url = ''; if (isset($this->request->get['filter_order_id'])) { $url .= '&filter_order_id=' . $this->request->get['filter_order_id']; } if (isset($this->request->get['filter_customer'])) { $url .= '&filter_customer=' . urlencode(html_entity_decode($this->request->get['filter_customer'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_order_status_id'])) { $url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id']; } if (isset($this->request->get['filter_total'])) { $url .= '&filter_total=' . $this->request->get['filter_total']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['filter_date_modified'])) { $url .= '&filter_date_modified=' . $this->request->get['filter_date_modified']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $order_total = $this->model_yundan_yundan->total($passData); $pagination = new Pagination(); $pagination->total = $order_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('yundan/yundan', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['filter_order_id'] = $filter_order_id; $this->data['filter_customer'] = $filter_customer; $this->data['filter_order_status_id'] = $filter_order_status_id; $this->data['filter_date_added'] = $filter_date_added; $this->data['filter_date_modified'] = $filter_date_modified; $this->data['order_statuses'] = $this->model_yundan_yundan->getyundanStatuses(); $this->data['sort'] = $sort; $this->data['order'] = $order; $this->template = 'yundan/yundan.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }
public function update_order() { if (isset($this->request->post['filter_order_status_id'])) { $order_status_id = $this->request->post['filter_order_status_id']; } else { $order_status_id = ''; } if (isset($this->request->post['auction_id'])) { $auction_id = $this->request->post['auction_id']; } else { $auction_id = ''; } $this->language->load('sale/order'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('sale/order'); if (isset($this->request->post['selected']) && $this->validateDelete()) { foreach ($this->request->post['selected'] as $order_id) { if ($order_status_id != 0) { $this->model_sale_order->order_updat($order_id, $order_status_id); if ($order_status_id == 6) { $query = $this->db->query("SELECT o.customer_id,o.firstname,o.email,op.producturl,op.name FROM " . DB_PREFIX . "order o LEFT JOIN " . DB_PREFIX . "order_product op ON o.order_id=op.order_id WHERE o.order_id = '" . (int) $order_id . "'"); $customer_id = $query->row['customer_id']; $uname = $query->row['firstname']; $email = $query->row['email']; $producturl = $query->row['producturl']; $productname = $query->row['name']; $message = "<div style='background-color:#f7f7f7;text-align:center;padding:30px 0;margin:0;width:100%;'>\n <div style = 'max-width:800px;margin:0 auto;text-align:left;padding:0;background-color:#ffffff;'>\n <div style = 'margin:0;padding:0;text-align:center;'><img src = 'http://www.acgstorm.com/image/data/logo.png' width = '226' height = '52' style = 'margin:45px 0;'></div>\n <div style = 'padding:0;margin:0;'>\n <div style = 'margin:0 3px;background-color:#fff;padding:0;'>\n <div style = 'padding:0 5%;margin:0;word-wrap:break-word;color:#818181;font-size:1em;font-family:helvetica,Arial,NanumGothic,Dotum'>\n <h3 style = 'margin:0 0 20px 0;padding-top:10px;font-weight:normal;'>您好, " . $uname . " <span style = 'font-size:22px;color:#FF6d85;'>♥</span></h3>\n <p><b style = 'color:#000;'>我们已接收到您以下CNstorm订单包裹!</b></p>\n <div style = 'width:98%; margin:0 auto; padding:10px; border:1px solid #E8CCCC'>订单号为{$order_id} 的订单已完成检验并入库,请您留意并及时处理该订单(<a href = 'http://www.acgstorm.com/order.html' target = '_blank' style = 'color:#fb6e52;font-weight: bold'>查看订单</a>)</br>\n 订单详情:<a href='{$producturl}' target = '_blank'>{$productname}</a> \n </div>\n <p style = 'margin:20px 0;'>CNstorm致力于提升海外留学生及华人生活体验,让您在海外生活,也能如同国内一样方便。接下来您可以:</p>\n 1、 继续在中国购物网站挑选商品,并与此次商品合并寄至您指定的海外地址(<a href = 'http://www.acgstorm.com/procurement.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>代购</a>)\n <p>2、 您自行准备商品并邮寄至CNstorm中国大陆地址,通过CNstorm极具性价比的国际物流系统,与本次商品合并快运至您的海外地址。(<a href = 'http://www.acgstorm.com/selfshopping.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>代寄</a>)</p>\n <p>3、 亲人朋友生日,重大节日,纪念日... CNstorm都能为您下单,将礼物寄至您指定的国内地址(<a href = 'http://www.acgstorm.com/international-express.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>国内送</a>)。</p>\n <p>4、 立刻勾选您要邮寄的商品提交运送(<a href = 'http://www.acgstorm.com/order.html' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>查看订单并提交</a>)</p>\n <p>我们为您提供的所有服务都同时接受外币及人民币支付,让您不必再为支付感到烦恼。有关支付方式介绍请<a href = 'http://www.acgstorm.com/index.php?route=help/help&cid=40' style = 'color:#fb6e52;font-size:1em;text-decoration:none;font-weight: bold' target = '_blank'>点此查阅</a>。</p>\n <p style = 'margin:68px 0 40px 0;'>我们衷心感谢您选择并使用CNstorm为您服务!</p>\n <p style = 'margin:20px 0 40px 0;'>CNstorm客户关怀部</p>\n <p style = 'margin:0;text-align:center;'><a href = 'http://www.weibo.com/cnstorm' style = 'margin-right:10px;text-decoration:none;color:#fb6e52;' target = '_blank'>Weibo</a> | <a href = 'http://www.acgstorm.com/index.php?route=app/appload' style = 'margin:0 10px;text-decoration:none;color:#fb6e52;' target = '_blank'>Ios App</a> | <a href = 'http://www.acgstorm.com/help.html' style = 'margin-left:10px;text-decoration:none;color:#fb6e52;' target = '_blank'>FAQ</a></p>\n </div>\n </div>\n </div>\n <div style = 'background-color:#ffffff;height:70px;padding:0;'></div>\n <div style = 'text-align:center;background-color:#f7f7f7;padding-top:20px;'>\n <p style = 'color:#b1b1b1;font-size:.85em;'>如果您需要联系我们的客户服务小组,请访问我们的官网(<a href = 'www.acgstorm.com' target = '_blank' style = 'text-decoration:none;color:#fb6e52'>http://www.acgstorm.com</a>)点击右上角帮助中心与我们取得联系。</p>\n <p style = 'font-size:.7em;color:#818181;'>Copyright © 2014 CNstorm Co., Ltd. 2 Exhibition center, F518 Creative park, Shenzhen, China. All Rights Reserved.<br>\n <a href = 'http://www.acgstorm.com/help-agreement.html' style = 'text-decoration:none;color:#fb6e52;' target = '_blank'>Terms of Service</a> | <a href = 'http://www.acgstorm.com/help-privacy.html' style = 'text-decoration:none;color:#fb6e52;' target = '_blank'>Privacy Policy</a></p>\n </div>\n </div>\n </div>"; $data = array('sendto' => $email, 'receiver' => $uname, 'subject' => '您的CNstorm订单' . $order_id . '已到货!', 'msg' => $message); // 手机推送消息 $apps = $this->model_sale_order->getOnlineAppByCustomer($customer_id); if ($apps) { $custom_content = array('order_id' => $order_id, 'state' => 1); include_once DIR_SYSTEM . 'baepush.class.php'; $baepush = new Baepush(); foreach ($apps as $app) { if ($app['device_type'] == 1) { // ios $device_type = 4; } elseif ($app['device_type'] == 2) { // android $device_type = 3; } $pm = array('push_type' => 1, 'user_id' => $app['user_id'], 'device_type' => $device_type, 'description' => '您的订单' . $order_id . '已入库,请下运单。', 'deploy_status' => 2, 'custom_content' => $custom_content); $baepush->push($pm); } } $this->load->model('tool/sendmail'); $this->model_tool_sendmail->send($data); } } if ($auction_id != '') { $this->model_sale_order->order_updat2($order_id, $auction_id); } } $this->session->data['success'] = $this->language->get('text_success'); $url = ''; if (isset($this->request->get['filter_order_id'])) { $url .= '&filter_order_id=' . $this->request->get['filter_order_id']; } if (isset($this->request->get['filter_customer'])) { $url .= '&filter_customer=' . urlencode(html_entity_decode($this->request->get['filter_customer'], ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['filter_order_status_id'])) { $url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id']; } if (isset($this->request->get['filter_total'])) { $url .= '&filter_total=' . $this->request->get['filter_total']; } if (isset($this->request->get['filter_date_added'])) { $url .= '&filter_date_added=' . $this->request->get['filter_date_added']; } if (isset($this->request->get['filter_date_modified'])) { $url .= '&filter_date_modified=' . $this->request->get['filter_date_modified']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->redirect($this->url->link('sale/order', 'token=' . $this->session->data['token'] . $url, 'SSL')); } $this->getList(); }
protected function getList() { if (isset($this->request->get['filter_gid'])) { $filter_gid = $this->request->get['filter_gid']; } else { $filter_gid = null; } if (isset($this->request->get['filter_uname'])) { $filter_uname = $this->request->get['filter_uname']; } else { $filter_uname = null; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'o.order_id'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'DESC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $url = ''; $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('interaction/consult', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: '); if (isset($this->request->get['reply'])) { if (isset($this->request->get['gid'])) { $reply_gid = $this->request->get['gid']; } else { $reply_gid = null; } if (isset($this->request->get['reply'])) { $reply_msg = $this->request->get['reply']; } else { $reply_msg = null; } $this->model_interaction_interaction->replyConsult($reply_gid, $reply_msg); //手机推送消息 $consult = $this->model_interaction_interaction->getConsult($reply_gid); $this->load->model('sale/order'); $apps = $this->model_sale_order->getOnlineAppByCustomer($consult['uid']); if ($apps) { $custom_content = array('gid' => $reply_gid, 'state' => 6); include_once DIR_SYSTEM . 'baepush.class.php'; $baepush = new Baepush(); foreach ($apps as $app) { if ($app['device_type'] == 1) { //ios $device_type = 4; } elseif ($app['device_type'] == 2) { //android $device_type = 3; } $pm = array('push_type' => 1, 'user_id' => $app['user_id'], 'device_type' => $device_type, 'description' => 'cnstorm客服:' . $reply_msg, 'deploy_status' => 2, 'custom_content' => $custom_content); $baepush->push($pm); } } } if (isset($this->request->post['selected']) && isset($this->request->post['filter_order_status_id'])) { $select = $this->request->post['selected']; $filter_order_status_id = $this->request->post['filter_order_status_id']; } else { $order = 'DESC'; } $this->data['token'] = $this->session->data['token']; $this->data['manager'] = $this->user->getUserName(); $this->data['orders'] = array(); $data = array('gid' => $filter_gid, 'uname' => $filter_uname, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $this->config->get('config_admin_limit'), 'limit' => $this->config->get('config_admin_limit')); date_default_timezone_set('Asia/Shanghai'); $results = $this->model_interaction_interaction->getConsults($data); foreach ($results as $result) { $this->data['orders'][] = array('mid' => $result['gid'], 'fromuname' => $result['uname'], 'type' => $result['type'], 'reply' => $result['reply'], 'hasview' => $result['state'], 'message' => $result['msg'], 'sendtime' => date("Y-m-d H:i:s", $result['addtime']), 'selected' => isset($this->request->post['selected']) && in_array($result['sid'], $this->request->post['selected'])); } $record_total = $this->model_interaction_interaction->totalConsults(); $pagination = new Pagination(); $pagination->total = $record_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('interaction/consult', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->template = 'interaction/consult.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }
public function index() { $this->language->load('interaction/pm'); $this->document->setTitle("站内信"); $this->data['token'] = $this->session->data['token']; $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('interaction/pm', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: '); if (isset($this->request->get['send'])) { if (isset($this->request->get['receiver'])) { $receiver = $this->request->get['receiver']; } else { $receiver = null; } if (isset($this->request->get['receiver_id'])) { $receiver_id = $this->request->get['receiver_id']; } else { $receiver_id = null; } if (isset($this->request->get['message'])) { $message = $this->request->get['message']; } else { $message = null; } if (isset($this->request->get['title'])) { $title = $this->request->get['title']; } else { $title = null; } $data = array('fromuname' => 'CNstorm客服', 'touid' => $receiver_id, 'touname' => $receiver, 'subject' => $title, 'message' => $message); $this->load->model('interaction/interaction'); $mid = $this->model_interaction_interaction->replyPm($data); if ($mid) { $this->data['result_message'] = '操作成功'; //手机推送消息 $this->load->model('sale/order'); $apps = $this->model_sale_order->getOnlineAppByCustomer($receiver_id); if ($apps) { include_once DIR_SYSTEM . 'baepush.class.php'; $baepush = new Baepush(); $custom_content = array('mid' => $mid, 'state' => 4); foreach ($apps as $app) { if ($app['device_type'] == 1) { //ios $device_type = 4; } elseif ($app['device_type'] == 2) { //android $device_type = 3; } $pm = array('push_type' => 1, 'user_id' => $app['user_id'], 'device_type' => $device_type, 'description' => 'CNstorm客服:' . $title, 'deploy_status' => 2, 'custom_content' => $custom_content); $baepush->push($pm); } } } else { $this->data['result_message'] = '发送失败,请重试!'; } } $this->template = 'interaction/pm.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }