Commit 0b6a33ab authored by chenzq's avatar chenzq

添加execl文件导入

parent 1760d83d
......@@ -47,7 +47,7 @@ if ($keyword) {
else {
$where['to_uid !='] = $uid;
}
//添加分公司的地址筛选
$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));
......
......@@ -71,8 +71,8 @@
<label class="layui-form-label">头像</label>
<div class="layui-input-block">
{php echo tpl_form_field_image('avatar', $info['avatar']);}
<span class="span-remark">图片建议尺寸: 750 * 750</span>
</div>
<span class="span-remark">图片建议尺寸: 750 * 750</span>
</div>
</div>
<div class="layui-form-item">
......
......@@ -27,6 +27,8 @@
<i class="layui-icon">&#xe608;</i> 添加公司
</a>
<form class="form-inline">
<div class="form-group" style="display: inline-block;width: 50%">
<label class="sr-only"></label>
......@@ -37,8 +39,15 @@
<button class="layui-btn layui-btn-normal btn-search" type="button">
搜索
</button>
<button type="button" class="layui-btn layui-btn-danger btn-import-order" style="float: left">
导入excel
</button>
</form>
</div>
<table class="layui-table">
......@@ -223,7 +232,58 @@
var url = "{php echo $this->createWebUrl('manage/companyedit')}" + "&id=" +id;
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 src="../../../addons/{$module_name}/images/js/main.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -460,8 +460,34 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
$sql = "select * from ".tablename('sys_region')." where parent_id =".$parent_id;
$list=pdo_fetchall($sql);
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()
{
$this->cross();
......@@ -5485,6 +5511,7 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
if ($info['is_staff'] != 1) {
}
$user_info = pdo_get('longbing_company_user_info', array('fans_id' => $uid));
$user_info['avatar'] = tomedia($user_info['avatar']);
$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