作者 刘朕

合并分支 '1iuzhen' 到 'master'

后台导入优化



查看合并请求 !39
@@ -76,8 +76,8 @@ class LogisticsController extends AdminBaseController @@ -76,8 +76,8 @@ class LogisticsController extends AdminBaseController
76 $array = $this->import_excel('./upload/'.$excel); 76 $array = $this->import_excel('./upload/'.$excel);
77 //执行导入操作 77 //执行导入操作
78 Db::startTrans(); 78 Db::startTrans();
79 - $t = 24 * 60 * 60;  
80 foreach ($array as $k=>$v) { 79 foreach ($array as $k=>$v) {
  80 + $insert = $update = [];
81 // if(!$this->logistics_model->check($v[1])) { 81 // if(!$this->logistics_model->check($v[1])) {
82 $insert['mobile'] = $update['mobile'] = $v[0]; 82 $insert['mobile'] = $update['mobile'] = $v[0];
83 $insert['send_time'] = $update['send_time'] = date('Y-m-d H:i:s',\PHPExcel_Shared_Date::ExcelToPHP($v[1])); 83 $insert['send_time'] = $update['send_time'] = date('Y-m-d H:i:s',\PHPExcel_Shared_Date::ExcelToPHP($v[1]));
@@ -86,12 +86,19 @@ class LogisticsController extends AdminBaseController @@ -86,12 +86,19 @@ class LogisticsController extends AdminBaseController
86 $insert['is_del'] = $update['is_del'] = $v[4]; 86 $insert['is_del'] = $update['is_del'] = $v[4];
87 if(empty($v[4])) { 87 if(empty($v[4])) {
88 $insert['is_del'] = $update['is_del'] = 0; 88 $insert['is_del'] = $update['is_del'] = 0;
  89 + if($v[4] == 0) {
  90 + $update['delete_time'] = 0;
  91 + $insert['is_del'] = $update['is_del'] = 0;
  92 + }
  93 + } else{
  94 + if($v[4] == 1) {
  95 + $update['delete_time'] = time();
  96 + $update['is_del'] = 1;
  97 + }
89 } 98 }
90 $info = $this->logistics_model->where(['express'=>$insert['express']])->find(); 99 $info = $this->logistics_model->where(['express'=>$insert['express']])->find();
91 if($info) { 100 if($info) {
92 - $update['id'] = $info['id'];  
93 - $update['update_time'] = time();  
94 - if(!$this->logistics_model->editLogistics($update)) { 101 + if(!$this->logistics_model->where(['id'=>$info['id']])->update($update)) {
95 Db::rollback(); 102 Db::rollback();
96 $this->error('数据导入中出错,请重试'); 103 $this->error('数据导入中出错,请重试');
97 } 104 }
@@ -266,10 +273,10 @@ class LogisticsController extends AdminBaseController @@ -266,10 +273,10 @@ class LogisticsController extends AdminBaseController
266 $id = $this->request->param('id',0,'intval'); 273 $id = $this->request->param('id',0,'intval');
267 $ids = $this->request->param('ids/a'); 274 $ids = $this->request->param('ids/a');
268 if(isset($id)) { 275 if(isset($id)) {
269 - $result = $this->logistics_model->where(['id'=>$id])->update(['delete_time'=>time()]); 276 + $result = $this->logistics_model->where(['id'=>$id])->update(['delete_time'=>time(),'is_del'=>1]);
270 } 277 }
271 if(isset($ids)) { 278 if(isset($ids)) {
272 - $result = $this->logistics_model->where(['id'=>['in',$ids]])->update(['delete_time'=>time()]); 279 + $result = $this->logistics_model->where(['id'=>['in',$ids]])->update(['delete_time'=>time(),'is_del'=>1]);
273 } 280 }
274 if(!$result) { 281 if(!$result) {
275 $this->error('删除失败'); 282 $this->error('删除失败');
@@ -34,7 +34,15 @@ @@ -34,7 +34,15 @@
34 <div class="swiper-container"> 34 <div class="swiper-container">
35 <div class="swiper-wrapper"> 35 <div class="swiper-wrapper">
36 <volist name="slideList" id="vo"> 36 <volist name="slideList" id="vo">
37 - <div class="swiper-slide"><div class="index_swiper"><img src="{:cmf_get_asset_url($vo['image'])}" style="vertical-align:middle;"/><span style="display:inline-block; height:100%; vertical-align:middle;"></span></div></div> 37 + <div class="swiper-slide">
  38 + <div class="index_swiper">
  39 + <notempty name="vo.url">
  40 + <a href="{$vo.url}"><img src="{:cmf_get_asset_url($vo['image'])}" style="vertical-align:middle;"/></a>
  41 + <else/>
  42 + <img src="{:cmf_get_asset_url($vo['image'])}" style="vertical-align:middle;"/>
  43 + </notempty>
  44 + </div>
  45 + </div>
38 </volist> 46 </volist>
39 </div> 47 </div>
40 <!-- Add Pagination --> 48 <!-- Add Pagination -->
@@ -151,7 +151,7 @@ @@ -151,7 +151,7 @@
151 event.stopPropagation(); 151 event.stopPropagation();
152 location.href = $(this).data('href'); 152 location.href = $(this).data('href');
153 }); 153 });
154 - $('.deal_list').on('click','.write_order',function(){ 154 + $('.tab_tit').on('click','.write_order',function(){
155 location.href = "{$orderUrl}"; 155 location.href = "{$orderUrl}";
156 }); 156 });
157 </script> 157 </script>