首页
文章分类
源码资源
技术教程
程序软件
文创娱乐
公告通知
其他页面
友情链接
闲聊灌水
关于我们
发布
登录
注册
找回密码
首页
文章分类
源码资源
技术教程
程序软件
文创娱乐
公告通知
其他页面
友情链接
闲聊灌水
关于我们
登录
注册
找回密码
28
1
更多资料
搜索内容
韩昊杰
管理员
这家伙很懒,什么都没有写...
关注
私信
文章
66
收藏
0
评论
1
粉丝
0
排序
最新发布
最近更新
最多查看
最多点赞
最多回复
最多收藏
销售数量
人人商城处理导入Excel和导入Excel的方法
人人商城处理导入Excel和导入Excel的方法 导入 前端 <form id="importform" class="form-horizontal form" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="typeid" value="{$item['id']}"/> <div class='form-group'> <div class="form-group"> <label class="col-lg control-label must">EXCEL</label> <div class="col-sm-5 goodsname" style="padding-right:0;" > <input type="file" name="excelfile" class="form-control" /> <!-- <span class="help-block">如果遇到数据重复则将进行数据更新</span>--> </div> </div> </div> <div class='form-group'> <div class="col-sm-12"> <div class="modal-footer" style="text-align: left"> <!-- {ifp 'order.batchsend.main'}--> <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button> <!-- {/if}--> <!-- {ifp 'order.batchsend.import'}--> <!-- <a class="btn btn-primary" href="{php echo webUrl('order/batchsend/import')}" style="margin-right: 10px;" ><i class="fa fa-download" title=""></i> 下载Excel模板文件</a>--> <!-- {/if}--> </div> </div> </div> <!--</div>--> </form>后端 if ($_W['ispost']) { // 读取Excel $rows = m('excel')->import('excelfile'); $num = count($rows); $time = time(); $i = 0; $err_array = array(); unset($rows[0]); // 循环插入数据 foreach ($rows as $k=>$v){ var_dump($v); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[1]; $createData['work_number'] = $v[2]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = 0; pdo_insert('ewei_shop_team', $createData); $superior_id = pdo_insertid(); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[3]; $createData['work_number'] = $v[4]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[5]; $createData['work_number'] = $v[6]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); } }导出 // 导出excel if ($_GPC['export'] == 1) { ca('statistics.goods.export'); $list[] = array('data' => '商品总计', 'count' => $total); foreach ($list as &$row) { $row['createtime'] = date('Y-m-d H:i', $row['createtime']); } unset($row); // $list是每一行的数据 m('excel')->export($list, array( 'title' => '商品销售报告-' . date('Y-m-d-H-i', time()), 'columns' => array( array('title' => '订单号', 'field' => 'ordersn', 'width' => 24), array('title' => '商品名称', 'field' => 'title', 'width' => 48), array('title' => '规格名称', 'field' => 'optiontitle', 'width' => 24), array('title' => '商品编号', 'field' => 'goodssn', 'width' => 12), array('title' => '数量', 'field' => 'total', 'width' => 12), array('title' => '价格', 'field' => 'price', 'width' => 12), array('title' => '成交时间', 'field' => 'createtime', 'width' => 24) ) )); plog('statistics.goods.export', '导出商品销售明细'); }
php
韩昊杰
4年前
0
0
0
[go语言]手把手专属情侣测试号推送信息教程
人人商城处理导入Excel和导入Excel的方法 导入 前端 <form id="importform" class="form-horizontal form" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="typeid" value="{$item['id']}"/> <div class='form-group'> <div class="form-group"> <label class="col-lg control-label must">EXCEL</label> <div class="col-sm-5 goodsname" style="padding-right:0;" > <input type="file" name="excelfile" class="form-control" /> <!-- <span class="help-block">如果遇到数据重复则将进行数据更新</span>--> </div> </div> </div> <div class='form-group'> <div class="col-sm-12"> <div class="modal-footer" style="text-align: left"> <!-- {ifp 'order.batchsend.main'}--> <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button> <!-- {/if}--> <!-- {ifp 'order.batchsend.import'}--> <!-- <a class="btn btn-primary" href="{php echo webUrl('order/batchsend/import')}" style="margin-right: 10px;" ><i class="fa fa-download" title=""></i> 下载Excel模板文件</a>--> <!-- {/if}--> </div> </div> </div> <!--</div>--> </form>后端 if ($_W['ispost']) { // 读取Excel $rows = m('excel')->import('excelfile'); $num = count($rows); $time = time(); $i = 0; $err_array = array(); unset($rows[0]); // 循环插入数据 foreach ($rows as $k=>$v){ var_dump($v); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[1]; $createData['work_number'] = $v[2]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = 0; pdo_insert('ewei_shop_team', $createData); $superior_id = pdo_insertid(); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[3]; $createData['work_number'] = $v[4]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[5]; $createData['work_number'] = $v[6]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); } }导出 // 导出excel if ($_GPC['export'] == 1) { ca('statistics.goods.export'); $list[] = array('data' => '商品总计', 'count' => $total); foreach ($list as &$row) { $row['createtime'] = date('Y-m-d H:i', $row['createtime']); } unset($row); // $list是每一行的数据 m('excel')->export($list, array( 'title' => '商品销售报告-' . date('Y-m-d-H-i', time()), 'columns' => array( array('title' => '订单号', 'field' => 'ordersn', 'width' => 24), array('title' => '商品名称', 'field' => 'title', 'width' => 48), array('title' => '规格名称', 'field' => 'optiontitle', 'width' => 24), array('title' => '商品编号', 'field' => 'goodssn', 'width' => 12), array('title' => '数量', 'field' => 'total', 'width' => 12), array('title' => '价格', 'field' => 'price', 'width' => 12), array('title' => '成交时间', 'field' => 'createtime', 'width' => 24) ) )); plog('statistics.goods.export', '导出商品销售明细'); }
Golang
韩昊杰的软件
韩昊杰
4年前
0
0
0
Golang开发项目目录简介以及目录结构设置规范
人人商城处理导入Excel和导入Excel的方法 导入 前端 <form id="importform" class="form-horizontal form" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="typeid" value="{$item['id']}"/> <div class='form-group'> <div class="form-group"> <label class="col-lg control-label must">EXCEL</label> <div class="col-sm-5 goodsname" style="padding-right:0;" > <input type="file" name="excelfile" class="form-control" /> <!-- <span class="help-block">如果遇到数据重复则将进行数据更新</span>--> </div> </div> </div> <div class='form-group'> <div class="col-sm-12"> <div class="modal-footer" style="text-align: left"> <!-- {ifp 'order.batchsend.main'}--> <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button> <!-- {/if}--> <!-- {ifp 'order.batchsend.import'}--> <!-- <a class="btn btn-primary" href="{php echo webUrl('order/batchsend/import')}" style="margin-right: 10px;" ><i class="fa fa-download" title=""></i> 下载Excel模板文件</a>--> <!-- {/if}--> </div> </div> </div> <!--</div>--> </form>后端 if ($_W['ispost']) { // 读取Excel $rows = m('excel')->import('excelfile'); $num = count($rows); $time = time(); $i = 0; $err_array = array(); unset($rows[0]); // 循环插入数据 foreach ($rows as $k=>$v){ var_dump($v); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[1]; $createData['work_number'] = $v[2]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = 0; pdo_insert('ewei_shop_team', $createData); $superior_id = pdo_insertid(); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[3]; $createData['work_number'] = $v[4]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[5]; $createData['work_number'] = $v[6]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); } }导出 // 导出excel if ($_GPC['export'] == 1) { ca('statistics.goods.export'); $list[] = array('data' => '商品总计', 'count' => $total); foreach ($list as &$row) { $row['createtime'] = date('Y-m-d H:i', $row['createtime']); } unset($row); // $list是每一行的数据 m('excel')->export($list, array( 'title' => '商品销售报告-' . date('Y-m-d-H-i', time()), 'columns' => array( array('title' => '订单号', 'field' => 'ordersn', 'width' => 24), array('title' => '商品名称', 'field' => 'title', 'width' => 48), array('title' => '规格名称', 'field' => 'optiontitle', 'width' => 24), array('title' => '商品编号', 'field' => 'goodssn', 'width' => 12), array('title' => '数量', 'field' => 'total', 'width' => 12), array('title' => '价格', 'field' => 'price', 'width' => 12), array('title' => '成交时间', 'field' => 'createtime', 'width' => 24) ) )); plog('statistics.goods.export', '导出商品销售明细'); }
golang配置
韩昊杰
4年前
0
0
0
Windows下安装Golang开发环境-SDK安装
人人商城处理导入Excel和导入Excel的方法 导入 前端 <form id="importform" class="form-horizontal form" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="typeid" value="{$item['id']}"/> <div class='form-group'> <div class="form-group"> <label class="col-lg control-label must">EXCEL</label> <div class="col-sm-5 goodsname" style="padding-right:0;" > <input type="file" name="excelfile" class="form-control" /> <!-- <span class="help-block">如果遇到数据重复则将进行数据更新</span>--> </div> </div> </div> <div class='form-group'> <div class="col-sm-12"> <div class="modal-footer" style="text-align: left"> <!-- {ifp 'order.batchsend.main'}--> <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button> <!-- {/if}--> <!-- {ifp 'order.batchsend.import'}--> <!-- <a class="btn btn-primary" href="{php echo webUrl('order/batchsend/import')}" style="margin-right: 10px;" ><i class="fa fa-download" title=""></i> 下载Excel模板文件</a>--> <!-- {/if}--> </div> </div> </div> <!--</div>--> </form>后端 if ($_W['ispost']) { // 读取Excel $rows = m('excel')->import('excelfile'); $num = count($rows); $time = time(); $i = 0; $err_array = array(); unset($rows[0]); // 循环插入数据 foreach ($rows as $k=>$v){ var_dump($v); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[1]; $createData['work_number'] = $v[2]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = 0; pdo_insert('ewei_shop_team', $createData); $superior_id = pdo_insertid(); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[3]; $createData['work_number'] = $v[4]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[5]; $createData['work_number'] = $v[6]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); } }导出 // 导出excel if ($_GPC['export'] == 1) { ca('statistics.goods.export'); $list[] = array('data' => '商品总计', 'count' => $total); foreach ($list as &$row) { $row['createtime'] = date('Y-m-d H:i', $row['createtime']); } unset($row); // $list是每一行的数据 m('excel')->export($list, array( 'title' => '商品销售报告-' . date('Y-m-d-H-i', time()), 'columns' => array( array('title' => '订单号', 'field' => 'ordersn', 'width' => 24), array('title' => '商品名称', 'field' => 'title', 'width' => 48), array('title' => '规格名称', 'field' => 'optiontitle', 'width' => 24), array('title' => '商品编号', 'field' => 'goodssn', 'width' => 12), array('title' => '数量', 'field' => 'total', 'width' => 12), array('title' => '价格', 'field' => 'price', 'width' => 12), array('title' => '成交时间', 'field' => 'createtime', 'width' => 24) ) )); plog('statistics.goods.export', '导出商品销售明细'); }
golang配置
韩昊杰
4年前
0
0
0
使用SQL语句来判断数据库中时间,是否为当日时间
人人商城处理导入Excel和导入Excel的方法 导入 前端 <form id="importform" class="form-horizontal form" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="typeid" value="{$item['id']}"/> <div class='form-group'> <div class="form-group"> <label class="col-lg control-label must">EXCEL</label> <div class="col-sm-5 goodsname" style="padding-right:0;" > <input type="file" name="excelfile" class="form-control" /> <!-- <span class="help-block">如果遇到数据重复则将进行数据更新</span>--> </div> </div> </div> <div class='form-group'> <div class="col-sm-12"> <div class="modal-footer" style="text-align: left"> <!-- {ifp 'order.batchsend.main'}--> <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button> <!-- {/if}--> <!-- {ifp 'order.batchsend.import'}--> <!-- <a class="btn btn-primary" href="{php echo webUrl('order/batchsend/import')}" style="margin-right: 10px;" ><i class="fa fa-download" title=""></i> 下载Excel模板文件</a>--> <!-- {/if}--> </div> </div> </div> <!--</div>--> </form>后端 if ($_W['ispost']) { // 读取Excel $rows = m('excel')->import('excelfile'); $num = count($rows); $time = time(); $i = 0; $err_array = array(); unset($rows[0]); // 循环插入数据 foreach ($rows as $k=>$v){ var_dump($v); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[1]; $createData['work_number'] = $v[2]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = 0; pdo_insert('ewei_shop_team', $createData); $superior_id = pdo_insertid(); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[3]; $createData['work_number'] = $v[4]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); $createData['uniacid'] = $_W['uniacid']; $createData['name'] = $v[5]; $createData['work_number'] = $v[6]; $createData['serial_number'] = $v[0]; $createData['superior_id'] = $superior_id; pdo_insert('ewei_shop_team', $createData); } }导出 // 导出excel if ($_GPC['export'] == 1) { ca('statistics.goods.export'); $list[] = array('data' => '商品总计', 'count' => $total); foreach ($list as &$row) { $row['createtime'] = date('Y-m-d H:i', $row['createtime']); } unset($row); // $list是每一行的数据 m('excel')->export($list, array( 'title' => '商品销售报告-' . date('Y-m-d-H-i', time()), 'columns' => array( array('title' => '订单号', 'field' => 'ordersn', 'width' => 24), array('title' => '商品名称', 'field' => 'title', 'width' => 48), array('title' => '规格名称', 'field' => 'optiontitle', 'width' => 24), array('title' => '商品编号', 'field' => 'goodssn', 'width' => 12), array('title' => '数量', 'field' => 'total', 'width' => 12), array('title' => '价格', 'field' => 'price', 'width' => 12), array('title' => '成交时间', 'field' => 'createtime', 'width' => 24) ) )); plog('statistics.goods.export', '导出商品销售明细'); }
Mysql
韩昊杰
4年前
0
0
0
上一页
1
...
10
11
12
...
14
下一页
在手机上浏览此页面
退出登录
您好!
确认要退出当前登录吗?
取消
确认退出
我是韩昊杰
一个一直在用心写代码的程序员
必须认同
认同吧