Prechádzať zdrojové kódy

【Mod】代码优化

liuxiangxin 4 mesiacov pred
rodič
commit
d95f3f29ca

+ 2 - 1
app/Http/Controllers/Admin/RegimentActive.php

@@ -116,10 +116,11 @@ class RegimentActive extends Auth{
             // 提示
             if ($product_res)               return json_send(['code'=>'error','msg'=>'该产品正在参加拼团活动']);
             // 核对产品
-            $product_res                    = $Model::query()->where([['business_id','=', $data['business_id']],['product_id','=', $data['product_id']]])->first();
+            $product_res                    = $Product::query()->where([['business_id','=', $data['business_id']],['product_id','=', $data['product_id']]])->first();
             if (!$product_res)               return json_send(['code'=>'error','msg'=>'该店铺产品不存在']);
             //核对产品价格
             $productInfo                    =   $Product->getOne($data['product_id']);
+            // 如果拼团价格大于产品价格
             if ($productInfo['price'] < $data['regiment_price'])    return json_send(['code'=>'error','msg'=>'拼团价格不能大于产品价格']);
             // 写入数据表
             $id						        = $Model->add($data);

+ 6 - 0
resources/views/admin/auth_manager/index.blade.php

@@ -4,7 +4,9 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 @endsection
 @section('content')
 <div class="page-header">
+	@if(check_auth('admin/auth_manager/add'))
 	<a href="{{url('admin/auth_manager/add')}}" class="btn btn-primary">新增用户组</a>
+	@endif
 </div>		
 <div class="row">
 	<div class="col-xs-12">	
@@ -31,7 +33,9 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 								<a href="{{url('admin/auth_manager/access?'.http_build_query(['id'=>$a['id']]))}}">访问授权</a>
 							</td>
 							<td>
+								@if(check_auth('admin/auth_manager/edit'))
 								<a href="{{url('admin/auth_manager/edit?'.http_build_query(['id'=>$a['id']]))}}" class="btn btn-sm btn-warning" >编辑</a>
+								@endif
 								@switch($a['status'])
 									@case(1)
 										<a data-url="{{url('admin/auth_manager/set_status?'.http_build_query(['id'=>$a['id'],'status'=>0]))}}" class="set_status btn btn-sm btn-danger" >禁用</a>
@@ -40,9 +44,11 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 										<a data-url="{{url('admin/auth_manager/set_status?'.http_build_query(['id'=>$a['id'],'status'=>1]))}}" class="set_status btn btn-sm btn-success" >启用</a>
 										@break
 								@endswitch
+								@if(check_auth('admin/auth_manager/del'))
 								<a class="delete btn btn-sm btn-danger" data-url="{{url('admin/auth_manager/del?'.http_build_query(['id'=>$a['id']]))}}" >
 									删除
 								</a>
+								@endif
 							</td>
 						</tr>
 						@endforeach

+ 0 - 1
resources/views/admin/coupon/index.blade.php

@@ -55,7 +55,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 						<th>活动城市</th>
 						<th>商品范围</th>
 						<th>发放类型</th>
-						<th>店铺</th>
 						<th>优惠券状态</th>
 						<th>发放时间</th>
 						<th>修改时间</th>

+ 1 - 2
resources/views/admin/coupon_active/index.blade.php

@@ -30,7 +30,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 						<th>结束时间</th>
 						<th>内部跳转</th>
 						<th>宣发链接</th>
-						<th>店铺</th>
 						<th>活动状态</th>
 						<th>修改时间</th>
 						<th>操作</th>									
@@ -86,7 +85,7 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 							<td colspan="20" class="page">{{$list->render()}}</td>
 						</tr>
 						<tr>
-							<td colspan="20">总计 {{$list->total()}} 个商店</td>
+							<td colspan="20">总计 {{$list->total()}} 个活动</td>
 						</tr>
 				</tbody>
 				

+ 1 - 1
resources/views/admin/coupon_active_coupon/index.blade.php

@@ -66,7 +66,7 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 							<td colspan="20" class="page">{{$list->render()}}</td>
 						</tr>
 						<tr>
-							<td colspan="20">总计 {{$list->total()}} 个商店</td>
+							<td colspan="20">总计 {{$list->total()}} 个优惠券</td>
 						</tr>
 				</tbody>
 				

+ 1 - 2
resources/views/admin/coupon_reward_rule/index.blade.php

@@ -30,7 +30,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 						<th>开始时间</th>
 						<th>结束时间</th>
 						<th>优惠券</th>
-						<th>店铺</th>
 						<th>配置状态</th>
 						<th>修改时间</th>
 						<th>操作</th>									
@@ -69,7 +68,7 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 							<td colspan="20" class="page">{{$list->render()}}</td>
 						</tr>
 						<tr>
-							<td colspan="20">总计 {{$list->total()}} 个商店</td>
+							<td colspan="20">总计 {{$list->total()}} 个配置</td>
 						</tr>
 				</tbody>
 				

+ 0 - 1
resources/views/admin/custom_coupon/index.blade.php

@@ -50,7 +50,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 					<tr>
 						<th>优惠券编码</th>
 						<th>优惠券名称</th>
-						<th>店铺名称</th>
 						<th>客户编码</th>
 						<th>客户名称</th>
 						<th>商品范围</th>

+ 0 - 1
resources/views/admin/promo/index.blade.php

@@ -54,7 +54,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 						<th>活动城市</th>
 						<th>标签范围</th>
 						<th>商品范围</th>
-						<th>店铺</th>
 						<th>状态</th>
 						<th>活动时间</th>
 						<th>修改时间</th>