Commit 40f18e3a by LiuJunYi

会员关联导入

parent 7d616c62
...@@ -42,6 +42,12 @@ class VipRelation extends AuthBase ...@@ -42,6 +42,12 @@ class VipRelation extends AuthBase
unset($data[0]); unset($data[0]);
$params = []; $params = [];
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
if(in_array(null,$v)){
continue;
}
if(!strtotime($v[3])){
throw new Exception('会员到期格式不正确');
}
$arr = [ $arr = [
'nickname' => $v[0], 'nickname' => $v[0],
'mobile' => $v[1], 'mobile' => $v[1],
...@@ -57,7 +63,7 @@ class VipRelation extends AuthBase ...@@ -57,7 +63,7 @@ class VipRelation extends AuthBase
return json(['code' => 0, 'msg' => '导入成功']); return json(['code' => 0, 'msg' => '导入成功']);
} catch (Exception $e) { } catch (Exception $e) {
Db::rollback(); Db::rollback();
return json(['code' => 1, 'msg' => $e->getMessage()]); return json(['code' => 1, 'msg' => '导入失败']);
} }
} }
} }
\ No newline at end of file
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