|
@@ -11,6 +11,7 @@ class Whlabel extends Start_Controller
|
|
$this->load->_model('Model_excel', 'excel');
|
|
$this->load->_model('Model_excel', 'excel');
|
|
$this->load->_model('Model_fullorder', 'fullorder');
|
|
$this->load->_model('Model_fullorder', 'fullorder');
|
|
$this->load->_model('Model_fullordertt', 'fullordertt');
|
|
$this->load->_model('Model_fullordertt', 'fullordertt');
|
|
|
|
+ $this->load->_model('Model_fullorderamz', 'fullorderamz');
|
|
$this->load->_model('Model_fullorder_smt', 'fullorder_smt');
|
|
$this->load->_model('Model_fullorder_smt', 'fullorder_smt');
|
|
$this->load->_model('Model_fullordersmt', 'fullordersmt');
|
|
$this->load->_model('Model_fullordersmt', 'fullordersmt');
|
|
$this->load->_model('Model_express', 'express');
|
|
$this->load->_model('Model_express', 'express');
|
|
@@ -92,6 +93,9 @@ class Whlabel extends Start_Controller
|
|
} else if ($arg == 'toutorder') //TT出库订单
|
|
} else if ($arg == 'toutorder') //TT出库订单
|
|
{
|
|
{
|
|
$this->_toutorder();
|
|
$this->_toutorder();
|
|
|
|
+ }else if ($arg == 'aoutorder') //amz出库订单
|
|
|
|
+ {
|
|
|
|
+ $this->_aoutorder();
|
|
} else if ($arg == 'retreat') //退库订单
|
|
} else if ($arg == 'retreat') //退库订单
|
|
{
|
|
{
|
|
$this->_retreat();
|
|
$this->_retreat();
|
|
@@ -2704,6 +2708,166 @@ class Whlabel extends Start_Controller
|
|
$this->_Template('whlabel_toutorder', $this->data);
|
|
$this->_Template('whlabel_toutorder', $this->data);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //tt出库
|
|
|
|
+ public function _aoutorder()
|
|
|
|
+ {
|
|
|
|
+ if (isset($_SESSION['api'])) {
|
|
|
|
+ $user = $this->user->get_api($_SESSION['api']);
|
|
|
|
+ $usp = $user;
|
|
|
|
+ $fgshop = "";
|
|
|
|
+ $sid = "";
|
|
|
|
+ $user = explode('|', trim($user['shop'], '|'));
|
|
|
|
+ foreach ($user as $value) {
|
|
|
|
+ $fgshop .= " shop = " . $value . " or";
|
|
|
|
+ $sid .= " id = " . $value . " or";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ echo "请重新登录";
|
|
|
|
+ }
|
|
|
|
+ $post = $this->input->post(NULL, TRUE);
|
|
|
|
+ if (isset($post['page'])) {
|
|
|
|
+ $page = $this->input->post('page', true);
|
|
|
|
+ $perpage = $this->input->post('perpage', true);
|
|
|
|
+ $warehouse = $this->input->post('warehouse', true);
|
|
|
|
+ $xztime = $this->input->post('xztime', true);
|
|
|
|
+ $timetk = $this->input->post('timetkk', true);
|
|
|
|
+ $timetj = $this->input->post('timetjj', true);
|
|
|
|
+ $shop = $this->input->post('shop', true);
|
|
|
|
+ $source = $this->input->post('source', true);
|
|
|
|
+ $orderinfo = $this->input->post('orderinfo', true);
|
|
|
|
+ $number = $this->input->post('number', true);
|
|
|
|
+ $sfxh = $this->input->post('sfxh', true);
|
|
|
|
+ $express = $this->input->post('express', true);
|
|
|
|
+ $waybill = $this->input->post('waybill', true);
|
|
|
|
+ $library = $this->input->post('library', true);
|
|
|
|
+ $country = $this->input->post('country', true);
|
|
|
|
+ $so = $this->input->post('so', true);
|
|
|
|
+ $libraryconfirm = $this->input->post('libraryconfirm', true);
|
|
|
|
+ $print = $this->input->post('print', true);
|
|
|
|
+ $state = $this->input->post('state', true);
|
|
|
|
+ $orderurl = $this->input->post('orderurl', true);
|
|
|
|
+ $timetk = strtotime($timetk);
|
|
|
|
+ $timetj = strtotime($timetj);
|
|
|
|
+ /**
|
|
|
|
+ $sj = $this->input->post('sj',true);
|
|
|
|
+ if($sj)
|
|
|
|
+ {
|
|
|
|
+ $sj = $this->input->post('sj',true);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ $sj = "fullorder";
|
|
|
|
+ }
|
|
|
|
+ **/
|
|
|
|
+ $sj = "fullorderamz";
|
|
|
|
+ $where = "1=1";
|
|
|
|
+ if ($warehouse) {
|
|
|
|
+ $where .= " and type = '$warehouse'";
|
|
|
|
+ }
|
|
|
|
+ if ($timetk && $timetj) {
|
|
|
|
+ $where .= " and " . $xztime . " > '$timetk' and " . $xztime . " < '$timetj'";
|
|
|
|
+ }
|
|
|
|
+ if ($orderinfo) {
|
|
|
|
+ $where .= " and orderinfo = '$orderinfo'";
|
|
|
|
+ }
|
|
|
|
+ if ($number) {
|
|
|
|
+ $where .= " and number = '$number'";
|
|
|
|
+ }
|
|
|
|
+ if ($express) {
|
|
|
|
+ $where .= " and express = '$express'";
|
|
|
|
+ }
|
|
|
|
+ if ($waybill) {
|
|
|
|
+ $where .= " and waybill = '$waybill'";
|
|
|
|
+ }
|
|
|
|
+ if ($library) {
|
|
|
|
+ $where .= " and library = '$library'";
|
|
|
|
+ }
|
|
|
|
+ if ($print) {
|
|
|
|
+ $where .= " and print = '$print'";
|
|
|
|
+ }
|
|
|
|
+ if ($libraryconfirm) {
|
|
|
|
+ $where .= " and libraryconfirm = '$libraryconfirm'";
|
|
|
|
+ }
|
|
|
|
+ if ($state) {
|
|
|
|
+ $where .= " and state = '$state'";
|
|
|
|
+ }
|
|
|
|
+ if ($shop) {
|
|
|
|
+ $where .= " and shop = '$shop'";
|
|
|
|
+ }
|
|
|
|
+ if ($country) {
|
|
|
|
+ $where .= " and country = '$country'";
|
|
|
|
+ }
|
|
|
|
+ if ($sfxh != '') {
|
|
|
|
+ $where .= " and sfxh = '$sfxh'";
|
|
|
|
+ }
|
|
|
|
+ if ($so) {
|
|
|
|
+ $where .= " and shipremarks like '%$so%'";
|
|
|
|
+ }
|
|
|
|
+ if ($source) {
|
|
|
|
+ if ($source == '2d') {
|
|
|
|
+ $where .= " and source >= '2'";
|
|
|
|
+ } else {
|
|
|
|
+ $where .= " and source = '$source'";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (isset($_SESSION['api'])) {
|
|
|
|
+ foreach ($user as $value) {
|
|
|
|
+ $fgshop .= " shop = " . $value . " or";
|
|
|
|
+ }
|
|
|
|
+ $where .= " and (" . rtrim($fgshop, 'or') . ")";
|
|
|
|
+ }
|
|
|
|
+ if ($orderurl) {
|
|
|
|
+ $url = $this->orderurl->read($orderurl);
|
|
|
|
+ $where .= " and link like '%" . $url['url'] . "%'";
|
|
|
|
+ }
|
|
|
|
+ //数据排序
|
|
|
|
+ $order_str = "librarytime desc";
|
|
|
|
+ if (empty($page)) {
|
|
|
|
+ $start = 0;
|
|
|
|
+ $perpage = 1;
|
|
|
|
+ } else {
|
|
|
|
+ $start = ($page - 1) * $perpage;
|
|
|
|
+ }
|
|
|
|
+ //取得信息列表
|
|
|
|
+ $info_list = $this->$sj->find_all($where, 'id,shop,type,orderinfo,number,waybill,express,librarytime', $order_str, $start, $perpage);
|
|
|
|
+ //格式化数据
|
|
|
|
+ foreach ($info_list as $key => $value) {
|
|
|
|
+ $shop = $this->shop->read($value['shop']);
|
|
|
|
+ $info_list[$key]['shop'] = $shop['shopname'];
|
|
|
|
+ $express = $this->express->read($value['express']);
|
|
|
|
+ $info_list[$key]['express'] = $express['servicename'];
|
|
|
|
+ $warehouse = $this->warehouse->read($value['type']);
|
|
|
|
+ $info_list[$key]['type'] = $warehouse['title'];
|
|
|
|
+ if ($value['librarytime'] == '0') {
|
|
|
|
+ $info_list[$key]['librarytime'] = '<em class="t"></em>';
|
|
|
|
+ } else {
|
|
|
|
+ $info_list[$key]['librarytime'] = '<em class="t">' . date('Y-m-d H:i:s', $value['librarytime']) . '</em>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $total = $this->$sj->find_count($where);
|
|
|
|
+ $pagenum = ceil($total / $perpage);
|
|
|
|
+ $over = $total - ($start + $perpage);
|
|
|
|
+ $rows = array('total' => $total, 'over' => $over, 'pagenum' => $pagenum, 'rows' => ($info_list));
|
|
|
|
+ echo json_encode($rows);
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
+ $this->data['express'] = $this->express->find_all();
|
|
|
|
+ $wlshop = $this->shop->find_all('1=1 and ' . rtrim($sid, 'or'));
|
|
|
|
+ $this->data['wlshop'] = $wlshop;
|
|
|
|
+ $user = $this->user->get_api($_SESSION['api']);
|
|
|
|
+ $powerid = $this->power->read($user['power']);
|
|
|
|
+ $powertext = explode('|', trim($powerid['excelid'], '|'));
|
|
|
|
+ $pid = '';
|
|
|
|
+ foreach ($powertext as $v) {
|
|
|
|
+ $pid .= " id = " . $v . " or";
|
|
|
|
+ }
|
|
|
|
+ $fullorderexcel = $this->fullorderexcel->find_all("type = '100009' and (" . rtrim($pid, 'or') . ")", '*', 'idorder desc'); //导出模板
|
|
|
|
+ $this->data['fullorderexcel'] = $fullorderexcel;
|
|
|
|
+ $orderurl = $this->orderurl->find_all(rtrim($fgshop, 'or'));
|
|
|
|
+ $this->data['orderurl'] = $orderurl;
|
|
|
|
+ $this->_Template('whlabel_aoutorder', $this->data);
|
|
|
|
+ }
|
|
|
|
+
|
|
//速卖通出库订单
|
|
//速卖通出库订单
|
|
public function _soutorder()
|
|
public function _soutorder()
|
|
{
|
|
{
|