Просмотр исходного кода

修复后台列表页样式及一些小bug

sugar1569 7 лет назад
Родитель
Сommit
1d8847c29e

+ 5 - 6
.htaccess

@@ -1,8 +1,7 @@
 <IfModule mod_rewrite.c>
-Options +FollowSymlinks -Multiviews
-RewriteEngine on
-
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
+  Options +FollowSymlinks -Multiviews
+  RewriteEngine On
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
 </IfModule>

+ 8 - 0
application/admin/controller/finance/UserExtract.php

@@ -83,6 +83,10 @@ class UserExtract extends AuthController
     {
         if(!UserExtractModel::be(['id'=>$id,'status'=>0])) return JsonService::fail('操作记录不存在或状态错误!');
         $fail_msg =$request->post();
+        $extract=UserExtractModel::get($id);
+        if(!$extract)  return JsonService::fail('操作记录不存在!');
+        if($extract->status==1)  return JsonService::fail('已经提现,错误操作');
+        if($extract->status==-1)  return JsonService::fail('您的提现申请已被拒绝,请勿重复操作!');
         $res = UserExtractModel::changeFail($id,$fail_msg['message']);
         if($res){
             return JsonService::successful('操作成功!');
@@ -95,6 +99,10 @@ class UserExtract extends AuthController
         if(!UserExtractModel::be(['id'=>$id,'status'=>0]))
             return JsonService::fail('操作记录不存在或状态错误!');
         UserExtractModel::beginTrans();
+        $extract=UserExtractModel::get($id);
+        if(!$extract)  return JsonService::fail('操作记录不存!');
+        if($extract->status==1)  return JsonService::fail('您已提现,请勿重复提现!');
+        if($extract->status==-1)  return JsonService::fail('您的提现申请已被拒绝!');
         $res = UserExtractModel::changeSuccess($id);
         if($res){
             return JsonService::successful('操作成功!');

+ 4 - 2
application/admin/controller/ump/StoreSeckill.php

@@ -60,7 +60,7 @@ class StoreSeckill extends AuthController
         if(is_object($seckillList['list'])) $seckillList['list'] = $seckillList['list']->toArray();
         $data = $seckillList['list']['data'];
         foreach ($data as $k=>$v){
-            $data[$k]['_stop_time'] = date('Y/m/d H:i:s',$v['stop_time']);
+            $data[$k]['_stop_time'] =$v['stop_time'] ?  date('Y/m/d H:i:s',$v['stop_time']) : '';
         }
         return Json::successlayui(['count'=>$seckillList['list']['total'],'data'=>$data]);
     }
@@ -103,6 +103,7 @@ class StoreSeckill extends AuthController
     {
         $data = Util::postMore([
             'title',
+            'product_id',
             'info',
             'unit_name',
             ['image',''],
@@ -159,6 +160,7 @@ class StoreSeckill extends AuthController
         if(!$product) return Json::fail('数据不存在!');
         $f = array();
         $f[] = Form::input('title','产品标题',$product->getData('store_name'));
+        $f[] = Form::hidden('product_id',$id);
         $f[] = Form::input('info','秒杀活动简介',$product->getData('store_info'))->type('textarea');
         $f[] = Form::input('unit_name','单位',$product->getData('unit_name'))->placeholder('个、位');
         $f[] = Form::dateTimeRange('section_time','活动时间');
@@ -170,7 +172,7 @@ class StoreSeckill extends AuthController
         $f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12);
         $f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12);
         $f[] = Form::number('sort','排序',$product->getData('sort'))->col(12);
-        $f[] = Form::number('num','单次购买产品个数')->precision(0)->col(12);
+        $f[] = Form::number('num','单次购买产品个数',1)->precision(0)->col(12);
         $f[] = Form::number('give_integral','赠送积分',$product->getData('give_integral'))->min(0)->precision(0)->col(12);
         $f[] = Form::number('postage','邮费',$product->getData('postage'))->min(0)->col(12);
         $f[] = Form::radio('is_postage','是否包邮',$product->getData('is_postage'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(12);

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
application/admin/controller/user/User.php


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
application/admin/model/user/User.php


+ 7 - 1
application/admin/model/user/UserBill.php

@@ -16,11 +16,17 @@ class UserBill extends ModelBasic
 {
     use ModelTrait;
 
+    protected $insert = ['add_time'];
+
+    protected function setAddTimeAttr()
+    {
+        return time();
+    }
+    
     public static function income($title,$uid,$category,$type,$number,$link_id = 0,$balance = 0,$mark = '',$status = 1){
         $pm = 1;
         return self::set(compact('title','uid','link_id','category','type','number','balance','mark','status','pm'));
     }
-
     //获取柱状图和饼状图数据
     public static function getUserBillChart($where,$category='now_money',$type='brokerage',$pm=1,$zoom=15){
         $model=self::getModelTime($where,new self());

+ 12 - 61
application/admin/view/finance/user_extract/index.php

@@ -169,115 +169,66 @@
         </div>
 
     </div>
-
 </div>
-
 {/block}
-
 {block name="script"}
-
 <script>
-
     (function(){
-
         $('.j-fail').on('click',function(){
-
             var url = $(this).data('url');
-
             $eb.$alert('textarea',{
-
                 title:'请输入未通过愿意',
-
                 value:'输入信息不完整或有误!',
-
             },function(value){
-
                 $eb.axios.post(url,{message:value}).then(function(res){
-
-                    if(res.data.code == 200)
-
-                        $eb.$swal('success',res.data.msg);
-
-                    else
-
+                    if(res.data.code == 200) {
+                        $eb.$swal('success', res.data.msg);
+                        setTimeout(function () {
+                            window.location.reload();
+                        },1000);
+                    }else
                         $eb.$swal('error',res.data.msg||'操作失败!');
-
                 });
-
             });
-
         });
-
         $('.j-success').on('click',function(){
-
             var url = $(this).data('url');
-
             $eb.$swal('delete',function(){
-
                 $eb.axios.post(url).then(function(res){
-
-                    if(res.data.code == 200)
-
-                        $eb.$swal('success',res.data.msg);
-
-                    else
-
+                    if(res.data.code == 200) {
+                        setTimeout(function () {
+                            window.location.reload();
+                        },1000);
+                        $eb.$swal('success', res.data.msg);
+                    }else
                         $eb.$swal('error',res.data.msg||'操作失败!');
-
                 });
-
             },{
-
                 title:'确定审核通过?',
-
                 text:'通过后无法撤销,请谨慎操作!',
-
                 confirm:'审核通过'
-
             });
-
         });
-
         $('.btn-warning').on('click',function(){
-
             window.t = $(this);
-
             var _this = $(this),url =_this.data('url');
-
             $eb.$swal('delete',function(){
-
                 $eb.axios.get(url).then(function(res){
-
                     if(res.status == 200 && res.data.code == 200) {
-
                         $eb.$swal('success',res.data.msg);
-
                         _this.parents('tr').remove();
-
                     }else
-
                         return Promise.reject(res.data.msg || '删除失败')
-
                 }).catch(function(err){
-
                     $eb.$swal('error',err);
-
                 });
-
             })
-
         });
-
         $(".open_image").on('click',function (e) {
-
             var image = $(this).data('image');
-
             $eb.openImage(image);
-
         })
-
     }());
-
 </script>
 
 {/block}

+ 1 - 1
application/admin/view/system/system_databackup/index.php

@@ -10,7 +10,7 @@
                 <div class="table-responsive">
                     <table class="layui-hide" id="fileList" lay-filter="fileList"></table>
                     <script type="text/html" id="fileListtool">
-                        <button type="button" class="layui-btn layui-btn-xs" lay-event="import"><i class="layui-icon layui-icon-edit"></i>入</button>
+                        <button type="button" class="layui-btn layui-btn-xs" lay-event="import"><i class="layui-icon layui-icon-edit"></i>入</button>
                         <button type="button" class="layui-btn layui-btn-xs" lay-event="delFile"><i class="layui-icon layui-icon-edit"></i>删除</button>
                         <button type="button" class="layui-btn layui-btn-xs" lay-event="downloadFile"><i class="layui-icon layui-icon-edit"></i>下载</button>
 

+ 7 - 8
application/admin/view/ump/store_combination/index.php

@@ -215,31 +215,30 @@
     $(document).click(function (e) {
         $('.layui-nav-child').hide();
     })
-    function dropdown(that) {
+    function dropdown(that){
         var oEvent = arguments.callee.caller.arguments[0] || event;
         oEvent.stopPropagation();
         var offset = $(that).offset();
+        var top=offset.top-$(window).scrollTop();
         var index = $(that).parents('tr').data('index');
         $('.layui-nav-child').each(function (key) {
             if (key != index) {
                 $(this).hide();
             }
         })
-        if($(document).height() < offset.top+$(that).next('ul').height()){
+        if($(document).height() < top+$(that).next('ul').height()){
             $(that).next('ul').css({
                 'padding': 10,
-                'top': offset.top-$(that).next('ul').height()-30,
+                'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
                 'min-width': 'inherit',
-                'left': offset.left - $(that).width() / 2,
-                'position': 'fixed'
+                'position': 'absolute'
             }).toggle();
         }else{
             $(that).next('ul').css({
                 'padding': 10,
-                'top': offset.top + 30,
+                'top':$(that).parent('td').height() / 2 + $(that).height(),
                 'min-width': 'inherit',
-                'left': offset.left - $(that).width() / 2,
-                'position': 'fixed'
+                'position': 'absolute'
             }).toggle();
         }
     }

+ 66 - 24
application/admin/view/user/user/see.php

@@ -66,6 +66,7 @@
                             <li>签到记录</li>
                             <li>持有优惠劵</li>
                             <li>余额变动记录</li>
+                            <li>推广下线明细</li>
                         </ul>
                         <div class="layui-tab-content" id="content">
                             {volist name='headerList' id='vo'}
@@ -82,7 +83,7 @@
                             </div>
                             {/volist}
                             <div class="layui-tab-item layui-show">
-                                <table class="layui-table" lay-skin="line">
+                                <table class="layui-table" lay-skin="line" v-cloak="">
                                     <thead>
                                         <tr>
                                             <th>订单编号</th>
@@ -118,7 +119,7 @@
                                 <div ref="page_order" v-show="count.order_count > limit" style="text-align: right;"></div>
                             </div>
                             <div class="layui-tab-item">
-                                <table class="layui-table" lay-skin="line">
+                                <table class="layui-table" lay-skin="line" v-cloak="">
                                     <thead>
                                     <tr>
                                         <th>来源/用途</th>
@@ -144,7 +145,7 @@
                                 <div ref="integral_page" v-show="count.integral_count > limit" style="text-align: right;"></div>
                             </div>
                             <div class="layui-tab-item">
-                                <table class="layui-table" lay-skin="line">
+                                <table class="layui-table" lay-skin="line" v-cloak="">
                                     <thead>
                                     <tr>
                                         <th>动作</th>
@@ -168,7 +169,7 @@
                                 <div ref="Sign_page" v-show="count.sign_count > limit" style="text-align: right;"></div>
                             </div>
                             <div class="layui-tab-item">
-                                <table class="layui-table">
+                                <table class="layui-table" v-cloak="">
                                     <thead>
                                     <tr>
                                         <th>优惠券名称</th>
@@ -198,7 +199,7 @@
                                 <div ref="copons_page" v-show="count.coupon_count > limit" style="text-align: right;"></div>
                             </div>
                             <div class="layui-tab-item">
-                                <table class="layui-table">
+                                <table class="layui-table" v-cloak="">
                                     <thead>
                                     <tr>
                                         <th>变动金额</th>
@@ -229,6 +230,37 @@
                                 </table>
                                 <div ref="balancechang_page" v-show="count.balanceChang_count > limit" style="text-align: right;"></div>
                             </div>
+                            <!--推广人-->
+                            <div class="layui-tab-item">
+                                <table class="layui-table" v-cloak="">
+                                    <thead>
+                                    <tr>
+                                        <th>昵称</th>
+                                        <th>余额</th>
+                                        <th>积分</th>
+                                        <th>加入时间</th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+                                    <tr v-for="item in SpreadList">
+                                        <td>
+                                            {{item.nickname}}
+                                            <p v-show="item.is_vip">
+                                                <span class="layui-badge layui-bg-orange" v-text="item.vip_name"></span>
+                                            </p>
+                                        </td>
+                                        <td>{{item.now_money}}</td>
+                                        <td>{{item.integral}}</td>
+                                        <td>{{item.add_time}}</td>
+                                    </tr>
+                                    <tr v-show="balanceChangList.length<=0" style="text-align: center">
+                                        <td colspan="4">暂无数据</td>
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <div ref="spread_page" v-show="count.spread_page > limit" style="text-align: right;"></div>
+                            </div>
+                            <!--end-->
                         </div>
                     </div>
                 </div>
@@ -251,13 +283,15 @@
                 SignList:[],
                 CouponsList:[],
                 balanceChangList:[],
+                SpreadList:[],
                 count:count,
                 page:{
                     order_page:1,
                     integral_page:1,
                     sign_page:1,
                     copons_page:1,
-                    balancechang_page:1
+                    balancechang_page:1,
+                    spread_page:1,
                 },
             },
             watch:{
@@ -275,37 +309,34 @@
                 },
                 'page.balancechang_page':function () {
                     this.getOneBalanceChangList();
+                },
+                'page.spread_page':function () {
+                    this.getSpreadList();
                 }
             },
             methods:{
+                getSpreadList:function(){
+                    this.request('getSpreadList',this.page.spread_page,'SpreadList');
+                },
                 getOneorderList:function () {
-                    var that=this;
-                    layList.baseGet(layList.U({a:'getOneorderList',p:{page:this.page.order_page,limit:this.limit,uid:this.uid}}),function (res) {
-                        that.orderList=res.data;
-                    });
+                    this.request('getOneorderList',this.page.order_page,'orderList');
                 },
                 getOneIntegralList:function () {
-                    var that=this;
-                    layList.baseGet(layList.U({a:'getOneIntegralList',p:{page:this.page.integral_page,limit:this.limit,uid:this.uid}}),function (res) {
-                        that.integralList=res.data;
-                    });
+                    this.request('getOneIntegralList',this.page.integral_page,'integralList');
                 },
                 getOneSignList:function () {
-                    var that=this;
-                    layList.baseGet(layList.U({a:'getOneSignList',p:{page:this.page.sign_page,limit:this.limit,uid:this.uid}}),function (res) {
-                        that.SignList=res.data;
-                    });
+                    this.request('getOneSignList',this.page.sign_page,'SignList');
                 },
                 getOneCouponsList:function () {
-                    var that=this;
-                    layList.baseGet(layList.U({a:'getOneCouponsList',p:{page:this.page.copons_page,limit:this.limit,uid:this.uid}}),function (res) {
-                        that.CouponsList=res.data;
-                    });
+                    this.request('getOneCouponsList',this.page.copons_page,'CouponsList');
                 },
                 getOneBalanceChangList:function () {
+                    this.request('getOneBalanceChangList',this.page.balancechang_page,'balanceChangList');
+                },
+                request:function (action,page,name) {
                     var that=this;
-                    layList.baseGet(layList.U({a:'getOneBalanceChangList',p:{page:this.page.balancechang_page,limit:this.limit,uid:this.uid}}),function (res) {
-                        that.balanceChangList=res.data;
+                    layList.baseGet(layList.U({a:action,p:{page:page,limit:this.limit,uid:this.uid}}),function (res) {
+                        that.$set(that,name,res.data)
                     });
                 }
             },
@@ -315,6 +346,7 @@
                 this.getOneSignList();
                 this.getOneCouponsList();
                 this.getOneBalanceChangList();
+                this.getSpreadList();
                 var that=this;
                 layList.laypage.render({
                     elem: that.$refs.page_order
@@ -361,6 +393,16 @@
                         that.page.balancechang_page=obj.curr;
                     }
                 });
+
+                layList.laypage.render({
+                    elem: that.$refs.spread_page
+                    ,count:that.count.spread_count
+                    ,limit:that.limit
+                    ,theme: '#1E9FFF',
+                    jump:function(obj){
+                        that.page.spread_page=obj.curr;
+                    }
+                });
             }
         });
     });

+ 5 - 6
public/.htaccess

@@ -1,8 +1,7 @@
 <IfModule mod_rewrite.c>
-Options +FollowSymlinks -Multiviews
-RewriteEngine on
-
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
+  Options +FollowSymlinks -Multiviews
+  RewriteEngine On
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
 </IfModule>

+ 12 - 4
public/system/css/layui-admin.css

@@ -1,8 +1,17 @@
 @charset "UTF-8";
-
 .layui-table-box{
     overflow: initial;
 }
+.layui-table-body{
+    overflow: initial;
+}
+.layui-table-cell{
+    overflow: initial;
+}
+.table-responsive{
+    overflow: initial;
+}
+.layui-table img{width: 100% !important;}
 /*
 部分样式重构
  */
@@ -68,9 +77,8 @@
     width: auto;
 }
 .layui-table-cell {
-    overflow: hidden;
+    white-space:normal;
     height: auto!important;
-    white-space:normal,
 }
 .layui-input-block .layui-admin-input{
     width: 50%;
@@ -82,7 +90,7 @@
 .layui-input-block .time-w{
     width: 200px;
 }
-.layui-table-body{overflow: initial;}
+
 .layui-btn-group button i{
     line-height: 30px;
     margin-right: 3px;