123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- <?php
- namespace app\home\controller;
- use think\facade\View;
- use think\facade\Lang;
- use think\facade\Db;
- /**
- * ============================================================================
- * DSMall多用户商城
- * ============================================================================
- * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
- * 网站地址: http://www.csdeshang.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
- * 不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * 控制器
- */
- class Sellerorder extends BaseSeller
- {
- public function initialize()
- {
- parent::initialize();
- Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/sellerorder.lang.php');
- }
- /**
- * 订单列表
- *
- */
- public function index()
- {
- //上级店铺id
- $store_id = session('store_id');
- $store_arr = Db::name('store')->field('store_id,store_name')
- ->where('p_id', $store_id)
- ->whereOr('store_id', $store_id)
- ->select();
- View::assign('store_arr', $store_arr);
- $store_ids = $store_arr->column('store_id');
- $store_column = [];
- foreach ($store_arr as $store) {
- $store_column[$store['store_id']] = $store['store_name'];
- }
- //店铺搜索条件
- $store_id_input = input('param.store_id', 0);
- if (!empty($store_id_input)) {
- if (in_array($store_id_input, $store_ids)) {
- $store_ids = [$store_id_input];
- } else {
- $store_ids = [0];
- }
- }
- View::assign('store_id_input', $store_id_input);
- $order_model = model('order');
- $condition = [];
- $condition[] = ['store_id', 'in', $store_ids];
- $order_sn = input('get.order_sn');
- if ($order_sn != '') {
- $condition[] = ['order_sn', '=', $order_sn];
- }
- $buyer_name = input('get.buyer_name');
- if ($buyer_name != '') {
- $condition[] = ['buyer_name', '=', $buyer_name];
- }
- $allow_state_array = ['state_new', 'state_pay', 'state_send', 'state_success', 'state_cancel'];
- $state_type = input('param.state_type');
- if (in_array($state_type, $allow_state_array)) {
- $condition[] = ['order_state', '=', str_replace($allow_state_array, [ORDER_STATE_NEW, ORDER_STATE_PAY, ORDER_STATE_SEND, ORDER_STATE_SUCCESS, ORDER_STATE_CANCEL], $state_type)];
- } else {
- $state_type = 'store_order';
- }
- $if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('get.query_start_date'));
- $if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('get.query_end_date'));
- $start_unixtime = $if_start_date ? strtotime(input('get.query_start_date')) : null;
- $end_unixtime = $if_end_date ? (strtotime(input('get.query_end_date')) + 86399) : null;
- if ($start_unixtime) {
- $condition[] = ['add_time', '>=', $start_unixtime];
- }
- if ($end_unixtime) {
- $condition[] = ['add_time', '<=', $end_unixtime];
- }
- $skip_off = input('get.buyer_name');
- if ($skip_off == 1) {
- $condition[] = ['order_state', '<>', ORDER_STATE_CANCEL];
- }
- $order_list = $order_model->getOrderList($condition, 10, '*', 'order_id desc', 0, ['order_goods', 'order_common', 'ppintuanorder', 'member']);
- View::assign('show_page', $order_model->page_info->render());
- //页面中显示那些操作
- foreach ($order_list as $key => $order_info) {
- //显示取消订单
- $order_info['if_cancel'] = $order_model->getOrderOperateState('store_cancel', $order_info);
- //显示调整运费
- $order_info['if_modify_price'] = $order_model->getOrderOperateState('modify_price', $order_info);
- //显示修改价格
- $order_info['if_spay_price'] = $order_model->getOrderOperateState('spay_price', $order_info);
- //显示发货
- $order_info['if_send'] = $order_model->getOrderOperateState('send', $order_info);
- //显示锁定中
- $order_info['if_lock'] = $order_model->getOrderOperateState('lock', $order_info);
- //显示物流跟踪
- $order_info['if_deliver'] = $order_model->getOrderOperateState('deliver', $order_info);
- //店铺名称
- $order_info['store_name'] = $store_column[$order_info['store_id']];
- foreach ($order_info['extend_order_goods'] as $value) {
- $value['image_240_url'] = goods_cthumb($value['goods_image'], 240, $value['store_id']);
- $value['goods_type_cn'] = get_order_goodstype($value['goods_type']);
- $value['goods_url'] = (string)url('Goods/index', ['goods_id' => $value['goods_id']]);
- if ($value['goods_type'] == 5) {
- $order_info['zengpin_list'][] = $value;
- } else {
- $order_info['goods_list'][] = $value;
- }
- }
- if (empty($order_info['zengpin_list'])) {
- $order_info['goods_count'] = count($order_info['goods_list']);
- } else {
- $order_info['goods_count'] = count($order_info['goods_list']) + 1;
- }
- $order_list[$key] = $order_info;
- }
- View::assign('order_list', $order_list);
- /* 设置卖家当前菜单 */
- $this->setSellerCurMenu('sellerorder');
- /* 设置卖家当前栏目 */
- $this->setSellerCurItem($state_type);
- return View::fetch($this->template_dir . 'index');
- }
- /**
- * 卖家订单详情
- *
- */
- public function show_order()
- {
- $order_id = intval(input('param.order_id'));
- if ($order_id <= 0) {
- $this->error(lang('param_error'));
- }
- $order_model = model('order');
- $condition = [];
- $condition[] = ['order_id', '=', $order_id];
- $condition[] = ['store_id', '=', session('store_id')];
- $order_info = $order_model->getOrderInfo($condition, ['order_common', 'order_goods', 'member', 'ppintuanorder']);
- if (empty($order_info)) {
- $this->error(lang('store_order_none_exist'));
- }
- $refundreturn_model = model('refundreturn');
- $order_list = [];
- $order_list[$order_id] = $order_info;
- $order_list = $refundreturn_model->getGoodsRefundList($order_list, 1); //订单商品的退款退货显示
- $order_info = $order_list[$order_id];
- $refund_all = isset($order_info['refund_list'][0]) ? $order_info['refund_list'][0] : '';
- if (!empty($refund_all) && $refund_all['seller_state'] < 3) {//订单全部退款商家审核状态:1为待审核,2为同意,3为不同意
- View::assign('refund_all', $refund_all);
- }
- //显示锁定中
- $order_info['if_lock'] = $order_model->getOrderOperateState('lock', $order_info);
- //显示调整运费
- $order_info['if_modify_price'] = $order_model->getOrderOperateState('modify_price', $order_info);
- //显示调整价格
- $order_info['if_spay_price'] = $order_model->getOrderOperateState('spay_price', $order_info);
- //显示取消订单
- $order_info['if_cancel'] = $order_model->getOrderOperateState('store_cancel', $order_info);
- //显示发货
- $order_info['if_send'] = $order_model->getOrderOperateState('send', $order_info);
- //显示物流跟踪
- $order_info['if_deliver'] = $order_model->getOrderOperateState('deliver', $order_info);
- //显示系统自动取消订单日期
- if ($order_info['order_state'] == ORDER_STATE_NEW) {
- $order_info['order_cancel_day'] = $order_info['add_time'] + config('ds_config.order_auto_cancel_day') * 24 * 3600;
- }
- //显示快递信息
- if ($order_info['shipping_code'] != '') {
- $express = rkcache('express', true);
- $order_info['express_info']['express_code'] = $express[$order_info['extend_order_common']['shipping_express_id']]['express_code'];
- $order_info['express_info']['express_name'] = $express[$order_info['extend_order_common']['shipping_express_id']]['express_name'];
- $order_info['express_info']['express_url'] = $express[$order_info['extend_order_common']['shipping_express_id']]['express_url'];
- } else {
- $order_info['express_info']['express_code'] = '';
- $order_info['express_info']['express_name'] = '';
- $order_info['express_info']['express_url'] = '';
- }
- //显示系统自动收获时间
- if ($order_info['order_state'] == ORDER_STATE_SEND) {
- $order_info['order_confirm_day'] = $order_info['delay_time'] + config('ds_config.order_auto_receive_day') * 24 * 3600;
- }
- //如果订单已取消,取得取消原因、时间,操作人
- if ($order_info['order_state'] == ORDER_STATE_CANCEL) {
- $order_info['close_info'] = $order_model->getOrderlogInfo(['order_id' => $order_info['order_id']], 'log_id desc');
- }
- $order_info['chain_order_type'] = 0;
- //如果是待自提则获取提货码
- $chain_order_model = model('chain_order');
- $chain_order_info = $chain_order_model->getChainOrderInfo([['order_id', '=', $order_info['order_id']]]);
- if ($chain_order_info) {
- $order_info['chain_order_type'] = $chain_order_info['chain_order_type'];
- }
- foreach ($order_info['extend_order_goods'] as $value) {
- $value['image_240_url'] = goods_cthumb($value['goods_image'], 240, $value['store_id']);
- $value['goods_type_cn'] = get_order_goodstype($value['goods_type']);
- $value['goods_url'] = (string)url('Goods/index', ['goods_id' => $value['goods_id']]);
- if ($value['goods_type'] == 5) {
- $order_info['zengpin_list'][] = $value;
- } else {
- $order_info['goods_list'][] = $value;
- }
- }
- if (empty($order_info['zengpin_list'])) {
- $order_info['goods_count'] = count($order_info['goods_list']);
- } else {
- $order_info['goods_count'] = count($order_info['goods_list']) + 1;
- }
- View::assign('order_info', $order_info);
- //发货信息
- if (!empty($order_info['extend_order_common']['daddress_id'])) {
- $daddress_info = model('daddress')->getAddressInfo(['daddress_id' => $order_info['extend_order_common']['daddress_id']]);
- View::assign('daddress_info', $daddress_info);
- }
- /* 设置卖家当前菜单 */
- $this->setSellerCurMenu('sellerorder');
- /* 设置卖家当前栏目 */
- $this->setSellerCurItem();
- return View::fetch($this->template_dir . 'show_order');
- }
- /**
- * 卖家订单状态操作
- *
- */
- public function change_state()
- {
- $state_type = input('param.state_type');
- $order_id = intval(input('param.order_id'));
- $order_model = model('order');
- $condition = [];
- $condition[] = ['order_id', '=', $order_id];
- $condition[] = ['store_id', '=', session('store_id')];
- $order_info = $order_model->getOrderInfo($condition);
- if ($state_type == 'order_cancel') {
- $result = $this->_order_cancel($order_info, input('post.'));
- } elseif ($state_type == 'modify_price') {
- $result = $this->_order_ship_price($order_info, input('post.'));
- } elseif ($state_type == 'spay_price') {
- $result = $this->_order_spay_price($order_info, input('post.'));
- }
- if (!$result['code']) {
- ds_json_encode(10001, $result['msg']);
- } else {
- ds_json_encode(10000, $result['msg']);
- }
- }
- /**
- * 打印订单
- *
- */
- public function print_order()
- {
- $order_id = ds_delete_param(input('param.order_id'));
- if (empty($order_id)) {
- $this->error(lang('param_error'));
- }
- $order_model = model('order');
- $condition = [];
- $condition[] = ['order_id', 'in', $order_id];
- $condition[] = ['store_id', '=', session('store_id')];
- $order_list = $order_model->getOrderList($condition, '', '*', 'order_id desc', 0, ['order_common', 'order_goods']);
- if (empty($order_list)) {
- $this->error(lang('member_printorder_ordererror'));
- }
- //卖家信息
- $store_model = model('store');
- $store_info = $store_model->getStoreInfoByID(session('store_id'));
- if (!empty($store_info['store_avatar'])) {
- $store_info['store_avatar'] = ds_get_pic(ATTACH_STORE . DIRECTORY_SEPARATOR . $store_info['store_id'], $store_info['store_avatar']);
- }
- if (!empty($store_info['store_seal'])) {
- $store_info['store_seal'] = ds_get_pic(ATTACH_STORE, $store_info['store_seal']);
- }
- View::assign('store_info', $store_info);
- //订单商品
- foreach ($order_list as $key => $order_info) {
- $goods_all_num = 0;
- $goods_total_price = 0;
- if (isset($order_info['extend_order_goods']) && !empty($order_info['extend_order_goods'])) {
- foreach ($order_info['extend_order_goods'] as $k => $v) {
- $v['goods_name'] = str_cut($v['goods_name'], 100);
- $goods_all_num += $v['goods_num'];
- $v['goods_all_price'] = ds_price_format($v['goods_num'] * $v['goods_price']);
- $goods_total_price += $v['goods_all_price'];
- $order_list[$key]['extend_order_goods'][$k] = $v;
- }
- //优惠金额
- $order_list[$key]['promotion_amount'] = $goods_total_price - $order_info['goods_amount'];
- $order_list[$key]['goods_all_num'] = $goods_all_num;
- $order_list[$key]['goods_total_price'] = ds_price_format($goods_total_price);
- $order_list[$key]['total_page'] = ceil(count($order_info['extend_order_goods']) / 15);
- }
- }
- View::assign('order_list', $order_list);
- return View::fetch($this->template_dir . 'print_order');
- }
- /**
- * 取消订单
- * @param unknown $order_info
- */
- private function _order_cancel($order_info, $post)
- {
- $order_model = model('order');
- $logic_order = model('order', 'logic');
- if (!request()->isPost()) {
- View::assign('order_info', $order_info);
- View::assign('order_id', $order_info['order_id']);
- echo View::fetch($this->template_dir . 'cancel');
- exit();
- } else {
- $if_allow = $order_model->getOrderOperateState('store_cancel', $order_info);
- if (!$if_allow) {
- return ds_callback(false, lang('have_no_legalpower'));
- }
- $msg = $post['state_info1'] != '' ? $post['state_info1'] : $post['state_info'];
- try {
- Db::startTrans();
- $logic_order->changeOrderStateCancel($order_info, 'seller', session('member_name'), $msg);
- } catch (\Exception $e) {
- Db::rollback();
- return ds_callback(false, $e->getMessage());
- }
- Db::commit();
- return ds_callback(true, lang('ds_common_op_succ'));
- }
- }
- /**
- * 修改运费
- * @param unknown $order_info
- */
- private function _order_ship_price($order_info, $post)
- {
- $order_model = model('order');
- $logic_order = model('order', 'logic');
- if (!request()->isPost()) {
- View::assign('order_info', $order_info);
- View::assign('order_id', $order_info['order_id']);
- echo View::fetch($this->template_dir . 'edit_price');
- exit();
- } else {
- $if_allow = $order_model->getOrderOperateState('modify_price', $order_info);
- if (!$if_allow) {
- return ds_callback(false, lang('have_no_legalpower'));
- }
- return $logic_order->changeOrderShipPrice($order_info, 'seller', session('member_name'), $post['shipping_fee']);
- }
- }
- /**
- * 修改商品价格
- * @param unknown $order_info
- */
- private function _order_spay_price($order_info, $post)
- {
- $order_model = model('order');
- $logic_order = model('order', 'logic');
- if (!request()->isPost()) {
- View::assign('order_info', $order_info);
- View::assign('order_id', $order_info['order_id']);
- echo View::fetch($this->template_dir . 'edit_spay_price');
- exit();
- } else {
- $if_allow = $order_model->getOrderOperateState('spay_price', $order_info);
- if (!$if_allow) {
- return ds_callback(false, lang('have_no_legalpower'));
- }
- return $logic_order->changeOrderSpayPrice($order_info, 'seller', session('member_name'), $post['goods_amount']);
- }
- }
- /**
- * 用户中心右边,小导航
- *
- * @param string $menu_type 导航类型
- * @param string $menu_key 当前导航的menu_key
- * @return
- */
- function getSellerItemList()
- {
- $menu_array = [
- [
- 'name' => 'store_order',
- 'text' => lang('ds_member_path_all_order'),
- 'url' => (string)url('Sellerorder/index'),
- ],
- [
- 'name' => 'state_new',
- 'text' => lang('ds_member_path_wait_pay'),
- 'url' => (string)url('Sellerorder/index', ['state_type' => 'state_new']),
- ],
- [
- 'name' => 'state_pay',
- 'text' => lang('ds_member_path_wait_send'),
- 'url' => (string)url('Sellerorder/index', ['state_type' => 'state_pay']),
- ],
- [
- 'name' => 'state_send',
- 'text' => lang('ds_member_path_sent'),
- 'url' => (string)url('Sellerorder/index', ['state_type' => 'state_send']),
- ],
- [
- 'name' => 'state_success',
- 'text' => lang('ds_member_path_finished'),
- 'url' => (string)url('Sellerorder/index', ['state_type' => 'state_success']),
- ],
- [
- 'name' => 'state_cancel',
- 'text' => lang('ds_member_path_canceled'),
- 'url' => (string)url('Sellerorder/index', ['state_type' => 'state_cancel']),
- ],
- ];
- return $menu_array;
- }
- public function export()
- {
- //上级店铺id
- $store_id = session('store_id');
- $store_arr = Db::name('store')->field('store_id,store_name')
- ->where('p_id', $store_id)
- ->whereOr('store_id', $store_id)
- ->select();
- $store_ids = $store_arr->column('store_id');
- $store_column = [];
- foreach ($store_arr as $store) {
- $store_column[$store['store_id']] = $store['store_name'];
- }
- //店铺搜索条件
- $store_id_input = input('param.store_id', 0);
- if (!empty($store_id_input)) {
- if (in_array($store_id_input, $store_ids)) {
- $store_ids = [$store_id_input];
- } else {
- $store_ids = [0];
- }
- }
- $order_model = model('order');
- $condition = [];
- $condition[] = ['store_id', 'in', $store_ids];
- $ids = input('get.ids');
- if (!empty($ids)) {
- $condition[] = ['order_id', 'in', explode(',', $ids)];
- }
- $order_sn = input('get.order_sn');
- if ($order_sn != '') {
- $condition[] = ['order_sn', '=', $order_sn];
- }
- $buyer_name = input('get.buyer_name');
- if ($buyer_name != '') {
- $condition[] = ['buyer_name', '=', $buyer_name];
- }
- $allow_state_array = ['state_new', 'state_pay', 'state_send', 'state_success', 'state_cancel'];
- $state_type = input('param.state_type');
- if (in_array($state_type, $allow_state_array)) {
- $condition[] = ['order_state', '=', str_replace($allow_state_array, [ORDER_STATE_NEW, ORDER_STATE_PAY, ORDER_STATE_SEND, ORDER_STATE_SUCCESS, ORDER_STATE_CANCEL], $state_type)];
- } else {
- $state_type = 'store_order';
- }
- $if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('get.query_start_date'));
- $if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('get.query_end_date'));
- $start_unixtime = $if_start_date ? strtotime(input('get.query_start_date')) : null;
- $end_unixtime = $if_end_date ? (strtotime(input('get.query_end_date')) + 86399) : null;
- if ($start_unixtime) {
- $condition[] = ['add_time', '>=', $start_unixtime];
- }
- if ($end_unixtime) {
- $condition[] = ['add_time', '<=', $end_unixtime];
- }
- $skip_off = input('get.buyer_name');
- if ($skip_off == 1) {
- $condition[] = ['order_state', '<>', ORDER_STATE_CANCEL];
- }
- $order_list = $order_model->getOrderList($condition, 0, '*', 'order_id desc', 0, ['order_goods', 'order_common', 'ppintuanorder', 'member']);
- //页面中显示那些操作
- foreach ($order_list as $key => $order_info) {
- //显示取消订单
- $order_info['if_cancel'] = $order_model->getOrderOperateState('store_cancel', $order_info);
- //显示调整运费
- $order_info['if_modify_price'] = $order_model->getOrderOperateState('modify_price', $order_info);
- //显示修改价格
- $order_info['if_spay_price'] = $order_model->getOrderOperateState('spay_price', $order_info);
- //显示发货
- $order_info['if_send'] = $order_model->getOrderOperateState('send', $order_info);
- //显示锁定中
- $order_info['if_lock'] = $order_model->getOrderOperateState('lock', $order_info);
- //显示物流跟踪
- $order_info['if_deliver'] = $order_model->getOrderOperateState('deliver', $order_info);
- //店铺名称
- $order_info['store_name'] = $store_column[$order_info['store_id']];
- foreach ($order_info['extend_order_goods'] as $value) {
- $value['image_240_url'] = goods_cthumb($value['goods_image'], 240, $value['store_id']);
- $value['goods_type_cn'] = get_order_goodstype($value['goods_type']);
- $value['goods_url'] = (string)url('Goods/index', ['goods_id' => $value['goods_id']]);
- if ($value['goods_type'] == 5) {
- $order_info['zengpin_list'][] = $value;
- } else {
- $order_info['goods_list'][] = $value;
- }
- }
- if (empty($order_info['zengpin_list'])) {
- $order_info['goods_count'] = count($order_info['goods_list']);
- } else {
- $order_info['goods_count'] = count($order_info['goods_list']) + 1;
- }
- $order_list[$key] = $order_info;
- }
- $this->createExcel($order_list);
- }
- /**
- * 生成excel
- *
- * @param array $data
- */
- private function createExcel($data = [])
- {
- Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
- $excel_obj = new \excel\Excel();
- $excel_data = [];
- //设置样式
- $excel_obj->setStyle(['id' => 's_title', 'Font' => ['FontName' => '宋体', 'Size' => '12', 'Bold' => '1']]);
- //header
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_no')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_store')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => '商品名称'];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_buyer')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_xtimd')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_count')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_yfei')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_paytype')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_state')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_storeid')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_buyerid')];
- $excel_data[0][] = ['styleid' => 's_title', 'data' => lang('exp_od_bemail')];
- //data
- foreach ((array)$data as $k => $v) {
- $tmp = [];
- $tmp[] = ['data' => $v['order_sn']];
- $tmp[] = ['data' => $v['store_name']];
- $goods_name = [];
- if (!empty($v['extend_order_goods'])) {
- foreach ($v['extend_order_goods'] as $goods) {
- $goods_name[] = $goods['goods_name'] . '*' . $goods['goods_num'];
- }
- }
- $tmp[] = ['data' => implode('/', $goods_name)];
- $tmp[] = ['data' => $v['buyer_name']];
- $tmp[] = ['data' => date('Y-m-d H:i:s', $v['add_time'])];
- $tmp[] = ['format' => 'Number', 'data' => ds_price_format($v['order_amount'])];
- $tmp[] = ['format' => 'Number', 'data' => ds_price_format($v['shipping_fee'])];
- $tmp[] = ['data' => get_order_payment_name($v['payment_code'])];
- $tmp[] = ['data' => get_order_state($v)];
- $tmp[] = ['data' => $v['store_id']];
- $tmp[] = ['data' => $v['buyer_id']];
- $tmp[] = ['data' => $v['buyer_email']];
- $excel_data[] = $tmp;
- }
- $excel_data = $excel_obj->charset($excel_data, CHARSET);
- $excel_obj->addArray($excel_data);
- $excel_obj->addWorksheet($excel_obj->charset(lang('exp_od_order'), CHARSET));
- $excel_obj->generateXML($excel_obj->charset(lang('exp_od_order'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
- }
- }
- ?>
|