|
@@ -51,7 +51,7 @@ Class Excel {
|
|
#活动核销码导出
|
|
#活动核销码导出
|
|
public function out_active_code($data)
|
|
public function out_active_code($data)
|
|
{
|
|
{
|
|
- $header = array('活动名称', '参加人姓名', '参加人手机号', '购买人姓名', '购买人手机号', '领取日期');
|
|
|
|
|
|
+ $header = array('活动名称', '参加人姓名', '参加人手机号', '购买人姓名', '购买人手机号', '领取日期','座位号');
|
|
$body = array();
|
|
$body = array();
|
|
foreach ($data as $k => $v) {
|
|
foreach ($data as $k => $v) {
|
|
$active_name = '';
|
|
$active_name = '';
|
|
@@ -81,6 +81,10 @@ Class Excel {
|
|
if ($v['cdate']) {
|
|
if ($v['cdate']) {
|
|
$cdate = date('Y-m-d H:i:s',$v['cdate']);
|
|
$cdate = date('Y-m-d H:i:s',$v['cdate']);
|
|
}
|
|
}
|
|
|
|
+ $seat_num = '';
|
|
|
|
+ if ($v['seat_num']) {
|
|
|
|
+ $seat_num = $v['seat_num'];
|
|
|
|
+ }
|
|
$d = array
|
|
$d = array
|
|
(
|
|
(
|
|
$active_name,
|
|
$active_name,
|
|
@@ -89,10 +93,37 @@ Class Excel {
|
|
$buy_name,
|
|
$buy_name,
|
|
$buy_mobile,
|
|
$buy_mobile,
|
|
$cdate,
|
|
$cdate,
|
|
|
|
+ $seat_num,
|
|
);
|
|
);
|
|
$body[] = $d;
|
|
$body[] = $d;
|
|
}
|
|
}
|
|
$file = Dever::input('excel_name');
|
|
$file = Dever::input('excel_name');
|
|
return Dever::excelExport($body, $header, $file);
|
|
return Dever::excelExport($body, $header, $file);
|
|
}
|
|
}
|
|
|
|
+ public function import($file)
|
|
|
|
+ {
|
|
|
|
+ $file = Dever::local($file);
|
|
|
|
+ $data = Dever::excelImport($file,0);
|
|
|
|
+ // print_R($data);die;
|
|
|
|
+ if ($data) {
|
|
|
|
+ $res = array();
|
|
|
|
+ foreach($data as $k=>$v){
|
|
|
|
+ if ($k>=2) {
|
|
|
|
+
|
|
|
|
+ $active_name = $v['A'];
|
|
|
|
+ $mobile = trim($v['C']);
|
|
|
|
+ // $seat_num = $v['G'];
|
|
|
|
+ if (isset($v['G']) && $v['G']) {
|
|
|
|
+ $active = Dever::db('active/info')->find(array('name'=>$active_name));
|
|
|
|
+ $user = Dever::db('active/user')->find(array('mobile'=>$mobile));
|
|
|
|
+ $code = Dever::db('active/code')->find(array('active_id'=>$active['id'],'join_uid'=>$user['id']));
|
|
|
|
+ $where['where_id'] = $code['id'];
|
|
|
|
+ $where['seat_num'] = $v['G'];
|
|
|
|
+ Dever::db('active/code')->update($where);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|