setter
parent
37f5f98951
commit
a74ff7d4d0
|
@ -173,7 +173,7 @@ class Index extends Base
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$search[] = ['phone_active', '=', AccountModel::COMMON_ON];
|
||||
|
||||
try {
|
||||
$items = AccountRepository::getInstance()->getAndHandleAccountList($search, [], $page, $size, function ($q) use ($other) {
|
||||
|
|
|
@ -164,7 +164,6 @@ class Category extends Base
|
|||
Db::startTrans();
|
||||
try {
|
||||
$item['path'] = CategoryModel::getPath($item['pid']);
|
||||
$item['name'] = "name";
|
||||
(new CategoryModel())->create($item);
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
|
|
|
@ -297,8 +297,10 @@ class Order extends Base
|
|||
});
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$data = input("item/a",[]);
|
||||
$item->save($data);
|
||||
$businessRemarks = trim(input('business_remarks/s', ''));
|
||||
|
||||
$item->save(['business_remarks' => $businessRemarks]);
|
||||
|
||||
return $this->json();
|
||||
}
|
||||
|
||||
|
@ -580,7 +582,6 @@ class Order extends Base
|
|||
public function exportOrderInfo()
|
||||
{
|
||||
$id = input("id/d");
|
||||
$type = input("type/s","save");
|
||||
$order = OrderModel::findById($id, [], function ($q) {
|
||||
return $q->with([ 'skus']);
|
||||
});
|
||||
|
@ -696,56 +697,18 @@ class Order extends Base
|
|||
//第一种保存方式
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
//保存的路径可自行设置
|
||||
$path = "storage/order_excel/" ;
|
||||
$path = public_path()."storage/order_excel/" ;
|
||||
if(!is_writable($path)){
|
||||
return $this->json(4001,"上传文件夹需要写入权限");
|
||||
}
|
||||
$path.=date("Ymd")."/";
|
||||
if(!is_dir(public_path().$path)){
|
||||
mkdir(public_path().$path);
|
||||
if(!is_dir($path)){
|
||||
mkdir($path);
|
||||
}
|
||||
$downloadFileName = $order->contacts . "_" . $order->phone . "_" . $order->coding ;
|
||||
$fileName = $downloadFileName . ".xlsx";
|
||||
$filepath = public_path().$path. $fileName;
|
||||
$filepath = $path. $fileName;
|
||||
$writer->save($filepath);
|
||||
if($type =="save"){
|
||||
return download($filepath,$downloadFileName );
|
||||
}else{
|
||||
return $this->json(0,"success",["url"=>$path.$fileName]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单信息
|
||||
* */
|
||||
public function exportOrderInfoZip()
|
||||
{
|
||||
$urls = input("urls/s",'');
|
||||
$urls = array_filter(explode(",", $urls));
|
||||
if(empty($urls)){
|
||||
return $this->json("4001","空的文件");
|
||||
} if(count($urls)>10){
|
||||
return $this->json("4001","最多支持10个文件");
|
||||
}
|
||||
$zipdir = date("Ymd_His_") .randomStr();
|
||||
$downloadZipFilename = $zipdir. '.zip';
|
||||
$zipFilename = public_path() . 'storage/order_excel_zip/' . $downloadZipFilename;
|
||||
$zip = new \ZipArchive();
|
||||
// 打开一个zip文档,ZipArchive::OVERWRITE:如果存在这样的文档,则覆盖;ZipArchive::CREATE:如果不存在,则创建
|
||||
$res = $zip->open($zipFilename, $zip::OVERWRITE | $zip::CREATE);
|
||||
$zip->addEmptyDir($zipdir);
|
||||
if($res){
|
||||
foreach ($urls as $url) {
|
||||
$filrnamearr = explode("/",$url);
|
||||
$filrname = end($filrnamearr);
|
||||
$zip->addFile(public_path() . $url, $zipdir . "/" . $filrname);
|
||||
}
|
||||
$zip->close();
|
||||
|
||||
return download($zipFilename, $downloadZipFilename);
|
||||
}
|
||||
return $this->json(5001,"创建压缩文件失败");
|
||||
|
||||
return download($filepath,$downloadFileName );
|
||||
}
|
||||
}
|
|
@ -469,7 +469,6 @@ class OrderRepository extends Repository
|
|||
$arr['is_activity'] = $sku->is_activity;
|
||||
$arr['activity_type'] = $sku->activity_type;
|
||||
$arr['sku_unit'] = $sku->unit;
|
||||
$arr['subtotal'] = $sku->original_price*$dataSku[$sku->coding];
|
||||
$insert[] = $arr;
|
||||
|
||||
if ($sku->is_virtual > 0) {
|
||||
|
|
|
@ -209,47 +209,6 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
|||
exportFile(type, ids, isScore);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
// toolbar 导出物流
|
||||
case 'export-zip':
|
||||
|
||||
let thischeckStatus = table.checkStatus('table-container'); //idTest 即为基础参数 id 对应的值
|
||||
let thisids = [];
|
||||
$(thischeckStatus.data).each(function (i, item) {
|
||||
thisids.push(item.id);
|
||||
});
|
||||
if(thisids.length==0){
|
||||
layer.msg("请勾选数据");
|
||||
return false;
|
||||
}
|
||||
let index_layer = layer.msg("导出中",{icon: 16,time: 100000,shade : [0.5 , '#000' , true]});
|
||||
//console.log(thisids);
|
||||
let excelUrls = [];
|
||||
|
||||
for(let aa =0;aa<thisids.length;aa++){
|
||||
$.ajax('/manager/mall/order/export-order-info', {
|
||||
data: {id: thisids[aa],type:"zip"},
|
||||
async: false,
|
||||
dataType: 'json',//服务器返回json格式数据
|
||||
type: 'post',//HTTP请求类型
|
||||
timeout: 10000,//超时时间设置为10秒;
|
||||
success: function (res) {
|
||||
// console.log(res)
|
||||
if (res.code === 0) {
|
||||
excelUrls.push(res.data.url);
|
||||
}else{
|
||||
layer.msg("导出订单失败id:"+thisids[aa]);
|
||||
}
|
||||
},
|
||||
error: function (xhr, type, errorThrown) {
|
||||
layer.msg("导出订单失败id:"+thisids[aa]);
|
||||
}
|
||||
});
|
||||
}
|
||||
layer.close(index_layer)
|
||||
window.open("/manager/mall/order/export-order-info-zip?urls="+excelUrls.join(","));
|
||||
|
||||
return false;
|
||||
default:
|
||||
if (layEvent !== 'LAYTABLE_COLS' && layEvent !== 'LAYTABLE_EXPORT') {
|
||||
|
@ -287,8 +246,6 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
|||
type: 'datetime',
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($('.location-operate-page').length > 0) {
|
||||
|
@ -325,21 +282,6 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
|||
if ($('.location-detail-page').length > 0) {
|
||||
miniTab.listen();
|
||||
|
||||
$(".layui-datetime").each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
type: 'datetime',
|
||||
});
|
||||
})
|
||||
$(".layui-date").each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
type: 'date',
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
//监听行工具条
|
||||
table.on('tool(table-container)', function (obj) {
|
||||
let layEvent = obj.event;
|
||||
|
@ -443,7 +385,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
|
|||
layer.close(indexLoad);
|
||||
layer.msg(res.msg)
|
||||
if (res.code === 0) {
|
||||
$("#order_original_price").val(res.data.original_price);
|
||||
$("#order_original_price").text(res.data.original_price);
|
||||
insTb.refresh();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -104,7 +104,6 @@
|
|||
<!-- toolbar -->
|
||||
<script type="text/html" id="toolbar-tpl">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="export-zip">批量导出</a>
|
||||
<!-- <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="export-list">导出待发货物流</a>-->
|
||||
<!-- <a class="layui-btn layui-btn-warm layui-btn-sm" id="upload-order" href="javascript:;">导入待发货物流</a>-->
|
||||
</script>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 0px;">
|
||||
<legend>订单信息</legend>
|
||||
</fieldset>
|
||||
<div class="layui-form">
|
||||
<div>
|
||||
<table class="layui-table" lay-even="" lay-skin="nob">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
@ -16,12 +16,7 @@
|
|||
<td>订单状态:{$statusList[$item['status']] ?? ''}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>应付总价(元):
|
||||
<div class="layui-input-inline">
|
||||
<input id="order_original_price" type="text" class="layui-input " name="item[original_price]" value="{$item.original_price ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>下单时间:{$item.created_at ?? ''}</td>
|
||||
<td>应付总价(元):<span id="order_original_price">{$item.original_price ?? 0}</span></td>
|
||||
<!-- <td>实付总价(元):{$item.price ?? 0}</td>-->
|
||||
</tr>
|
||||
<!-- <tr>-->
|
||||
|
@ -39,16 +34,12 @@
|
|||
{/if}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发货时间:
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input layui-datetime" name="item[shipped_at]" value="{$item.shipped_at ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>确认收货时间:
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input layui-datetime" name="item[accepted_at]" value="{$item.accepted_at ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>下单时间:{$item.created_at ?? ''}</td>
|
||||
<!-- <td>付款时间:{$item.paid_at ?? ''}</td>-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发货时间:{$item.shipped_at ?? ''}</td>
|
||||
<td>确认收货时间:{$item.accepted_at ?? ''}</td>
|
||||
</tr>
|
||||
<!-- <tr>-->
|
||||
<!-- <td>物流方式:{$item.pick_self == 1 ? '自提' : '邮寄'}</td>-->
|
||||
|
@ -71,35 +62,15 @@
|
|||
<!-- </tr>-->
|
||||
{/if}
|
||||
<tr>
|
||||
<td>婚期 :
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input layui-date" name="item[wedding_date]" value="{$item.wedding_date ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>期望送达日期:
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input layui-date" name="item[expected_delivery_date]" value="{$item.expected_delivery_date ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>婚期:{$item.wedding_date ?? ''}</td>
|
||||
<td>期望送达日期:{$item.expected_delivery_date ?? ''}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收货地址:
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="item[address]" value="{$item.address ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>联系人 :
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="item[contacts]" class="layui-input" value="{$item.contacts ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>收货地址:{$item.address ?? ''}</td>
|
||||
<td>联系人:{$item.contacts ?? ''}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话:
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="item[phone]" class="layui-input" value="{$item.phone ?? ''}">
|
||||
</div>
|
||||
</td>
|
||||
<td>联系电话:{$item.phone ?? ''}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{if $item.pick_self != 1}
|
||||
|
@ -109,16 +80,6 @@
|
|||
<!-- <tr>-->
|
||||
<!-- <td>买家备注:{$item.remarks ?? ''}</td>-->
|
||||
<!-- </tr>-->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/mall/order/info?id={$item.id}" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<div class="layui-row upload-file-div">
|
||||
<div class=" layui-col-xs12 layui-col-md8">
|
||||
<input class="layui-input upload-file-value" name="item[src]" type="text" value="">
|
||||
<div class="layui-form-mid layui-word-aux">图片尺寸:710px*400px</div>
|
||||
<div class="layui-form-mid layui-word-aux">图片尺寸:最低高度为200px</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-md3">
|
||||
<span>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<div class="layui-row upload-file-div">
|
||||
<div class=" layui-col-xs12 layui-col-md8">
|
||||
<input class="layui-input upload-file-value" name="item[src]" type="text" value="{$item.src ?? ''}">
|
||||
<div class="layui-form-mid layui-word-aux">图片尺寸:710px*400px</div>
|
||||
<div class="layui-form-mid layui-word-aux">图片尺寸:最低高度为200px</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-md3">
|
||||
<span>
|
||||
|
|
Loading…
Reference in New Issue