其余文件

This commit is contained in:
2026-04-14 17:46:22 +08:00
parent 294b68fe37
commit 3691f4db22
1343 changed files with 189847 additions and 0 deletions

View File

@ -0,0 +1,135 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\shop\controller\order;
use app\common\basics\ShopBase;
use app\common\server\excel\Excel;
use app\common\server\JsonServer;
use app\shop\logic\order\DeliveryBatchLogic;
use app\shop\validate\order\DeliveryBatchImportValidate;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class DeliveryBatch extends ShopBase
{
/**
* @notes 批量发货列表
* @return \think\response\Json|\think\response\View
* @author lbzy
* @datetime 2025-03-06 18:10:51
*/
function lists()
{
if ($this->request->isAjax()) {
return JsonServer::success('', DeliveryBatchLogic::lists(input()));
}
return view();
}
/**
* @notes 批量发货详情
* @return \think\response\Json
* @author lbzy
* @datetime 2025-03-06 18:10:39
*/
function detail()
{
return JsonServer::success('', [ 'detail' => DeliveryBatchLogic::detail(input('id/d')) ]);
}
/**
* @notes 下载默认文件等
* @return string|\think\response\File
* @author lbzy
* @datetime 2025-03-06 17:35:44
*/
function down()
{
$filename = pathinfo(input('file/s'), PATHINFO_FILENAME);
$path = app()->getRootPath() . 'public/static/excel/' . $filename . '.xls';
if (! file_exists($path)) {
return '文件不存在';
}
return download($path, $filename);
}
/**
* @notes 下载导入失败的
* @return void
* @author lbzy
* @datetime 2025-03-06 18:20:45
*/
function down2()
{
$lists = DeliveryBatchLogic::getFailInfoLists(input('id/d'));
Excel::out($lists, [
[ 'field' => 'sn', 'title' => '订单编号', 'excel_data_type' => DataType::TYPE_STRING ],
[ 'field' => 'express_name', 'title' => '快递公司名称' ],
[ 'field' => 'express_no', 'title' => '快递单号' ],
[ 'field' => 'fail_content', 'title' => '失败原因' ],
], '','', '导入失败订单');
exit;
}
/**
* @notes 立即导入
* @return \think\response\Json
* @author lbzy
* @datetime 2025-03-06 17:56:34
*/
function import()
{
$sheet = IOFactory::load($_FILES['file']['tmp_name'])->getActiveSheet();
$sheet->getStyle('A')->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
$sheet->getStyle('B')->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
$sheet->getStyle('C')->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
$lists = $sheet->toArray(null, true, true, true);
(new DeliveryBatchImportValidate())->goCheck('', [ 'lists' => $lists ]);
$result = DeliveryBatchLogic::importLists($lists, $_FILES['file']['name']);
return is_array($result) ? JsonServer::success('', $result) : JsonServer::error($result);
}
/**
* @notes 执行导入页面
* @return \think\response\Json|\think\response\View
* @author lbzy
* @datetime 2025-03-06 18:08:52
*/
function delivery()
{
$detail = DeliveryBatchLogic::detail(input('id/d'));
if ($this->request->isAjax()) {
DeliveryBatchLogic::delivery($detail);
return JsonServer::success('');
}
return view('', [
'detail' => $detail
]);
}
}

View File

@ -0,0 +1,95 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\shop\controller\order;
use app\common\basics\ShopBase;
use app\common\model\order\Order;
use app\common\server\JsonServer;
use app\shop\logic\order\InvoiceLogic;
use app\shop\validate\order\OrderInvoiceValidate;
/**
* 发票管理
* Class Invoice
* @package app\shop\controller\order
*/
class Invoice extends ShopBase
{
/**
* @notes 发票列表
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/12 17:34
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', InvoiceLogic::getInvoiceLists($get, $this->shop_id));
}
return view('', [
'order_status' => order::getOrderStatus(true)
]);
}
/**
* @notes 开票
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/12 19:00
*/
public function setInvoice()
{
if ($this->request->isAjax()) {
$params = (new OrderInvoiceValidate())->goCheck();
InvoiceLogic::setInvoice($params);
return JsonServer::success('操作成功');
}
$id = $this->request->get('id/d');
return view('detail', [
'detail' => InvoiceLogic::detail($id)
]);
}
/**
* @notes 导出Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function export()
{
$params = $this->request->get();
$result = InvoiceLogic::export($params, $this->shop_id);
if(false === $result) {
return JsonServer::error(InvoiceLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

View File

@ -0,0 +1,410 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\shop\controller\order;
use app\common\basics\ShopBase;
use app\common\model\order\OrderLog;
use app\common\model\order\Order as OrderModel;
use app\common\server\JsonServer;
use app\shop\logic\order\OrderLogic;
use app\common\model\Client_;
use app\common\enum\PayEnum;
use app\shop\validate\order\OrderPrintValidate;
use app\shop\validate\order\VerificationValidate;
use app\shop\validate\order\VirtualDeliveryValidate;
use think\response\Json;
/**
* 订单管理
* Class Goods
*/
class Order extends ShopBase
{
/**
* @notes 订单列表
* @return Json|\think\response\View
* @author suny
* @date 2021/7/14 10:15 上午
*/
public function lists()
{
$data = OrderLogic::statistics(input(), $this->shop_id);
// 订单状态
$order_status = OrderModel::getOrderStatus();
// 拼装数量统计
$order_status = OrderLogic::getStat($order_status, $this->shop_id);
$all = OrderLogic::getAll($this->shop_id);
if ($this->request->isAjax()) {
$data['statistics'] = [
'all' => $all,
'order_status' => $order_status,
];
return JsonServer::success('', $data);
}
return view('', [
'all' => $all,
'statistics' => $data,
'order_status' => $order_status,
'order_type' => OrderModel::getOrderType(true),
'order_source' => Client_::getClient(),
'pay_way' => PayEnum::getPayWay(),
'delivery_type' => OrderModel::getDeliveryType(true),
]);
}
public function totalCount()
{
if ($this->request->isAjax()) {
return JsonServer::success('获取成功', OrderLogic::totalCount($this->shop_id));
}
}
/**
* @notes 订单详情
* @return \think\response\View
* @author suny
* @date 2021/7/14 10:15 上午
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\db\exception\DataNotFoundException
*/
public function detail()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$order_log = OrderLog::getOrderLog($id);
return view('', [
'detail' => $detail,
'logs' => $order_log
]);
}
/**
* @notes 物流信息
* @return \think\response\View
* @author suny
* @date 2021/7/14 10:15 上午
*/
public function express()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
return view('', [
'detail' => $detail
]);
}
/**
* @notes 修改物流单号
* @return Json|\think\response\View
* @author lbzy
* @datetime 2024-04-03 11:02:33
*/
function delivery_change()
{
if ($this->request->isAjax()) {
$result = OrderLogic::change_invoice_no(input());
if ($result !== true) {
return JsonServer::error((string) $result);
}
return JsonServer::success('修改成功');
}
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$express = OrderLogic::express();
$detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
return view('', [
'detail' => $detail,
'express' => $express
]);
}
/**
* @notes 发货
* @return \think\response\View
* @author suny
* @date 2021/7/14 10:15 上午
*/
public function delivery()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$express = OrderLogic::express();
return view('', [
'detail' => $detail,
'express' => $express
]);
}
/**
* @notes 发货操作
* @return Json
* @author suny
* @date 2021/7/14 10:15 上午
* @throws \think\exception\DbException
*/
public function deliveryHandle()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = (OrderLogic::checkDelivery($post));
if (true !== $check) {
return JsonServer::error((string) $check);
}
OrderLogic::deliveryHandle($post, $this->admin_id);
return JsonServer::success('发货成功');
}
}
/**
* @notes 确认收货
* @return Json
* @author suny
* @date 2021/7/14 10:16 上午
*/
public function confirm()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
OrderLogic::confirm($post['order_id'], $this->admin_id);
return JsonServer::success('确认成功');
}
}
/**
* @notes 取消订单
* @return Json
* @author suny
* @date 2021/7/14 10:16 上午
*/
public function cancel()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$result = (OrderLogic::checkCancel($post));
if($result !== true){
return JsonServer::error($result,[],0,0);
}
$result = OrderLogic::cancel($post['order_id'], $this->admin_id);
if($result !== true){
return JsonServer::error($result,[],0,0);
}
return JsonServer::success('取消成功');
}
}
/**
* @notes 删除订单
* @return Json
* @author suny
* @date 2021/7/14 10:16 上午
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
(OrderLogic::checkDel($post));
OrderLogic::del($post['order_id'], $this->admin_id);
return JsonServer::success('删除成功');
}
}
/**
* @notes 商家备注
* @return Json
* @throws \think\Exception
* @author suny
* @date 2021/7/14 10:16 上午
*/
public function remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()) {
$get = $this->request->get();
$detail = OrderLogic::remarks($get, 'get');
return JsonServer::success('获取成功', [$detail]);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = OrderLogic::remarks($post, 'post');
return json(['code' => 1, 'show' => 0, 'msg' => '修改成功', 'data' => $result]);
}
}
/**
* @notes 小票打印
* @return Json
* @author 段誉
* @date 2022/1/20 11:15
*/
public function orderPrint()
{
$post = $this->request->post();
$post['shop_id'] = $this->shop_id;
(new OrderPrintValidate())->goCheck('', $post);
$result = OrderLogic::orderPrint($post['id'], $this->shop_id);
if (true === $result) {
return JsonServer::success('打印成功,如未出小票,请检查打印机是否在线');
}
return JsonServer::error($result);
}
/**
* @notes 修改地址
* @return \think\response\View
* @author suny
* @date 2021/7/14 10:16 上午
*/
public function change_address()
{
// 获取的
$get = $this->request->get();
$data = OrderLogic::change_address($get);
$id = json_decode($data['info'], true)['id'];
return view('', [
'id' => $id,
'info' => $data['info'],
'address_tree' => $data['address_tree']
]);
}
/**
* @notes 修改地址提交
* @return Json
* @author suny
* @date 2021/7/14 10:16 上午
*/
public function change_address_post()
{
// 提交的
if ($this->request->isAjax()) {
$post = $this->request->post();
OrderLogic::change_address_post($post);
return JsonServer::success('修改地址成功');
}
}
/**
* @notes 虚拟发货
* @return Json|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/7 17:47
*/
public function virtualDelivery()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new VirtualDeliveryValidate())->goCheck();
$result = OrderLogic::virtualDelivery($post, $this->admin_id);
if (false == $result) {
return JsonServer::error(OrderLogic::getError() ?: '发货失败');
}
return JsonServer::success('发货成功');
}
}
/**
* @notes 导出Excel
* @return Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function export()
{
$params = $this->request->get();
$result = OrderLogic::statistics($params, $this->shop_id, true);
if(false === $result) {
return JsonServer::error(OrderLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
/**
* @notes 提货核销
* @return Json|void
* @author 段誉
* @date 2022/11/2 15:52
*/
public function verification()
{
if ($this->request->isAjax()) {
$params = $this->request->post();
(new VerificationValidate())->goCheck();
$result = OrderLogic::verification($params, $this->shop);
if(false === $result) {
return JsonServer::error(OrderLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
}
/**
* @notes 确认付款
* @return Json|void
* @author ljj
* @date 2024/7/19 下午6:33
*/
public function confirmPay()
{
if ($this->request->isAjax()) {
$post = $this->request->post('');
$result = OrderLogic::confirmPay($post['order_id'], $this->admin_id);
if(true !== $result) {
return JsonServer::error($result);
}
return JsonServer::success('确认成功');
}
}
}