Commit 0b6a33ab authored by chenzq's avatar chenzq

添加execl文件导入

parent 1760d83d
...@@ -47,7 +47,7 @@ if ($keyword) { ...@@ -47,7 +47,7 @@ if ($keyword) {
else { else {
$where['to_uid !='] = $uid; $where['to_uid !='] = $uid;
} }
//添加分公司的地址筛选
$province = pdo_getall('sys_region',array('parent_id'=> 1)); $province = pdo_getall('sys_region',array('parent_id'=> 1));
$parent_id = isset($_GPC["agency_id"])?$_GPC["agency_id"]:1; $parent_id = isset($_GPC["agency_id"])?$_GPC["agency_id"]:1;
//$city= pdo_getall('sys_region',array('agency_id'=>$agency_id)); //$city= pdo_getall('sys_region',array('agency_id'=>$agency_id));
......
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
<label class="layui-form-label">头像</label> <label class="layui-form-label">头像</label>
<div class="layui-input-block"> <div class="layui-input-block">
{php echo tpl_form_field_image('avatar', $info['avatar']);} {php echo tpl_form_field_image('avatar', $info['avatar']);}
<span class="span-remark">图片建议尺寸: 750 * 750</span> <span class="span-remark">图片建议尺寸: 750 * 750</span>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
<i class="layui-icon">&#xe608;</i> 添加公司 <i class="layui-icon">&#xe608;</i> 添加公司
</a> </a>
<form class="form-inline"> <form class="form-inline">
<div class="form-group" style="display: inline-block;width: 50%"> <div class="form-group" style="display: inline-block;width: 50%">
<label class="sr-only"></label> <label class="sr-only"></label>
...@@ -37,8 +39,15 @@ ...@@ -37,8 +39,15 @@
<button class="layui-btn layui-btn-normal btn-search" type="button"> <button class="layui-btn layui-btn-normal btn-search" type="button">
搜索 搜索
</button> </button>
<button type="button" class="layui-btn layui-btn-danger btn-import-order" style="float: left">
导入excel
</button>
</form> </form>
</div> </div>
<table class="layui-table"> <table class="layui-table">
...@@ -223,7 +232,58 @@ ...@@ -223,7 +232,58 @@
var url = "{php echo $this->createWebUrl('manage/companyedit')}" + "&id=" +id; var url = "{php echo $this->createWebUrl('manage/companyedit')}" + "&id=" +id;
window.location.href = url; window.location.href = url;
}); });
// 点击上传
$('.btn-import-order').click(function () {
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'yourClass',
content: '<div style="padding: 20px; width: 260px; height: 50px;">' +
'<input type="file" class="layui-input" value="" name="file" id="import_file" onchange="btnUpload(this)">' + '</div>'+
'<input type="submit" class="layui-input" >'
});
});
// 提交
var uploading;
function btnUpload (obj)
{
if(uploading){
alert("文件正在上传中,请稍候");
return false;
}
layer.load();
file = obj.files[0]
var form = new FormData(); // FormData 对象
form.append("file", file);
form.append("action", "import");
var url = "{php echo $this->createWebUrl('manage/excel')}";
$.ajax({
url: url,
type: 'POST',
cache: false,
data: form,
processData: false,
contentType: false,
dataType:"json",
beforeSend: function(){
uploading = true;
},
success : function(data) {
alert(data.message);
//layer.msg(data.message);
uploading = false;
layer.closeAll();
}
});
return false;
}
</script> </script>
<script src="../../../addons/{$module_name}/images/js/main.js"></script> <script src="../../../addons/{$module_name}/images/js/main.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -460,8 +460,34 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -460,8 +460,34 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
$sql = "select * from ".tablename('sys_region')." where parent_id =".$parent_id; $sql = "select * from ".tablename('sys_region')." where parent_id =".$parent_id;
$list=pdo_fetchall($sql); $list=pdo_fetchall($sql);
return $this->result(0, '',$list); return $this->result(0, '',$list);
// $province = pdo_getall('sys_region',array('parent_id'=> 1));
// $parent_id = isset($_GPC["agency_id"])?$_GPC["agency_id"]:1;
////$city= pdo_getall('sys_region',array('agency_id'=>$agency_id));
// $type=pdo_getall('sys_region',array('parent_id'=>$parent_id,'type'=>2));
// $city_id = isset($_GPC["id"])?$_GPC["id"]:1;
// $company_first = pdo_getall('longbing_company_company', array('uniacid' => $_W['uniacid'], 'status' => 1,'city'=>$city_id));
// $data = array(
// 'pro'=>array(
// 'province'=>$province,
// 'ci'=>array(
// 'city'=> $type,
// 'com'=>array(
// 'company' => $company_first
// )
// )
// )
// );
// return $this->result(0, '', $data);
} }
public function doPageCardV2() public function doPageCardV2()
{ {
$this->cross(); $this->cross();
...@@ -5485,6 +5511,7 @@ class longbing_companyModuleWxapp extends WeModuleWxapp ...@@ -5485,6 +5511,7 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
if ($info['is_staff'] != 1) { if ($info['is_staff'] != 1) {
} }
$user_info = pdo_get('longbing_company_user_info', array('fans_id' => $uid)); $user_info = pdo_get('longbing_company_user_info', array('fans_id' => $uid));
$user_info['avatar'] = tomedia($user_info['avatar']); $user_info['avatar'] = tomedia($user_info['avatar']);
$user_info['voice'] = tomedia($user_info['voice']); $user_info['voice'] = tomedia($user_info['voice']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment