Procházet zdrojové kódy

Merge branch 'liuxiangxin' into jun

jun před 4 měsíci
rodič
revize
23df71c738

+ 0 - 18
app/Http/Controllers/Admin/Coupon.php

@@ -42,19 +42,8 @@ class Coupon extends Auth{
 		if( $startTime )		$map[] = ['start_time','>=',strtotime($startTime)];
 		if( $endTime )			$map[] = ['end_time','<=',strtotime($endTime)];
 		if( !is_null($status) )	$map[] = ['status','=',$status];
-        $session                = session('userRule');
-        if ($session){
-            $map[] = ['company_id','=',$session['company_id']];
-            if ($session['business_id']){
-                $map[] = ['business_id','=',$session['business_id']];
-            }
-            if ($session['menu_type'] == 1 && $session['data_type'] == 2){
-                $shopIds       =  Business::query()->where('leader_uid',$session['admin_uid'])->pluck('id')->toArray();
-            }
-        }
 		// 查询数据
 		$list					= $Model->query()->where($map);
-        if (isset($shopIds))    $list->whereIn('business_id',$shopIds);
         $list                   =  $list->orderByDesc('id')->paginate(request('limit',config('page_num',10)))->appends(request()->all());
 		// 计算各个优惠券的数量
 		$customTotal			= $CustomCoupon->whereIn('coupon_id',array_column($list->toArray()['data'],'id'))->groupBy('coupon_id')->select([DB::raw('count(*) as total'),'coupon_id'])->pluck('total','coupon_id')->toArray();
@@ -62,7 +51,6 @@ class Coupon extends Auth{
 		foreach ($list as $key => $value) {
 			// id转编号
 			$value['coupon_code']= $Model->idToCode($value['id']);
-			$value['business_name']= Business::query()->where('id',$value['business_id'])->value('name');
 			// 发放类型
 			$value['gant_name']  = $Model->getGrantType($value['grant_type'],'name');
 			// 如果已经到了结束时间。活动结束
@@ -122,7 +110,6 @@ class Coupon extends Auth{
 			$data['type_id']		= request('type_id',1);
 			$data['grant_type']		= request('grant_type',1);
 			$data['status']			= request('status',2);
-            $data['business_id']	= request('business_id',0);
 			$cityIds				= request('city_ids',[]);
 			$data['city_ids']		= implode(',',$cityIds);
 			// 转换时间,默认现在现在生效
@@ -189,11 +176,9 @@ class Coupon extends Auth{
 		// 获取列表
 		$cityList					= $City->getCityList();
 		$grantList					= $Model->getGrantTypeList();
-        $businessList 			    = $Business->getList();
 		// 分配数据
 		$this->assign('cityList',$cityList);
 		$this->assign('grantList',$grantList);
-		$this->assign('businessList',$businessList);
 		$this->assign('crumbs','新增');
 		// 加载模板
 		return 						$this->fetch();
@@ -222,7 +207,6 @@ class Coupon extends Auth{
 			$data['end_time'] 		= request('end_time','');
 			$data['type_id']		= request('type_id',1);
 			$data['grant_type']		= request('grant_type',1);
-			$data['business_id']	= request('business_id',1);
 			$cityIds				= request('city_ids',[]);
 			$data['city_ids']		= implode(',',$cityIds);
 			// 转换时间,默认现在现在生效
@@ -306,11 +290,9 @@ class Coupon extends Auth{
 		// 获取列表
 		$cityList					= $City->getCityList();
 		$grantList					= $Model->getGrantTypeList();
-        $businessList 			    = $Business->getList();
 		// 分配数据
 		$this->assign('cityList',$cityList);
 		$this->assign('grantList',$grantList);
-		$this->assign('businessList',$businessList);
 		$this->assign('oldData',$oldData);
 		$this->assign('crumbs','修改');
 		// 加载模板

+ 0 - 13
app/Http/Controllers/Admin/CouponRewardRule.php

@@ -63,17 +63,9 @@ class CouponRewardRule extends Auth{
 			$data['start_time']		= $data['start_time'] ? strtotime($data['start_time']) : 0;
 			$data['end_time']		= $data['end_time'] ? strtotime($data['end_time']) : 0;
 			$data['status']			= 1;
-            $data['business_id']	= request('business_id',0);
-            $session                = session('userRule');
-            if ($session){
-                $data['company_id'] = $session['company_id'];
-            }
 			$cityIds				= request('city_ids',[]);
 			$data['city_ids']		= implode(',',$cityIds);
 			$removeCustom			= request('remove_custom','');
-            //店铺优惠卷是否存在
-            $res                    = $Coupon::query()->where(['id'=>$data['coupon_id'],'business_id'=>$data['business_id']])->first();
-            if (!$res)              return json_send(['code'=>'error','msg'=>'新增失败,店铺优惠卷编码错误']);
 			// 循环处理
 			if( $removeCustom )		{
 				// 兼容逗号问题
@@ -107,10 +99,8 @@ class CouponRewardRule extends Auth{
 		}
 		// 获取列表
 		$cityList					= $City->getCityList();
-        $businessList 			    = $Business->getList();
 		// 分配数据
 		$this->assign('cityList',$cityList);
-        $this->assign('businessList',$businessList);
 		$this->assign('crumbs','新增');
 		// 加载模板
 		return						$this->fetch(); 
@@ -138,7 +128,6 @@ class CouponRewardRule extends Auth{
 			$data['end_time']		= request('end_time','');
 			$data['start_time']		= $data['start_time'] ? strtotime($data['start_time']) : 0;
 			$data['end_time']		= $data['end_time'] ? strtotime($data['end_time']) : 0;
-            $data['business_id']	= request('business_id',0);
 			$cityIds				= request('city_ids',[]);
 			$data['city_ids']		= implode(',',$cityIds);
 			$removeCustom			= request('remove_custom','');
@@ -193,10 +182,8 @@ class CouponRewardRule extends Auth{
 		$oldData['city_ids']		= explode(',',$oldData['city_ids']);
 		// 获取列表
 		$cityList					= $City->getCityList();
-        $businessList 			    = $Business->getList();
 		// 分配数据
 		$this->assign('cityList',$cityList);
-        $this->assign('businessList',$businessList);
 		$this->assign('oldData',$oldData);
 		$this->assign('crumbs','修改');
 		// 加载模板

+ 0 - 4
app/Http/Controllers/Admin/Promo.php

@@ -129,10 +129,6 @@ class Promo extends Auth{
 				// 设置为0,避免数据异常
 				$data['rebate']     = 0;
 			}
-            $session                = session('userRule');
-            if ($session){
-                $data['company_id'] = $session['company_id'];
-            }
 			// 组合数据,写入订单表,子表
 			DB::beginTransaction();
 			try {

+ 0 - 3
app/Http/Controllers/Admin/PromoProduct.php

@@ -79,9 +79,6 @@ class PromoProduct extends Auth{
             //查询产品店铺是否与活动一致
             $productInfo            =   $Product->getOne($data['product_id']);
             $promoInfo              =   $Promo->getOne($data['promo_id']);
-            if ($productInfo['business_id'] !== $promoInfo['business_id']) {
-                return json_send(['code'=>'error','msg'=>'产品所属店铺不一致']);
-            }
 			// 写入数据表
 			$id						= $Model->add($data);
 			// 如果操作失败

+ 4 - 4
app/Http/Controllers/Admin/RegimentActive.php

@@ -95,7 +95,6 @@ class RegimentActive extends Auth{
             $data['quota']	                = request('quota','');
             $data['name']	                = request('name','');
             $data['number']	                = request('number',0);
-            $expiration_day	                = request('expiration_day',0);
             $expiration_hours	            = request('expiration_hours',0);
             //$data['expiration']	        = $expiration_day * 24 + $expiration_hours;
             $data['expiration']	            = $expiration_hours;
@@ -112,14 +111,15 @@ class RegimentActive extends Auth{
             $data['business_id']	        = request('business_id',0);
             $data['status']			        = 1;
             // 核对产品
-            $product_res                    = $Model::query()->where([['status','=', 1],['product_id','=', $data['product_id']],['end_time','>=', time()]])->first();
+            $product_res                    = $Model->query()->where([['status','=', 1],['product_id','=', $data['product_id']],['end_time','>=', time()]])->first();
             // 提示
             if ($product_res)               return json_send(['code'=>'error','msg'=>'该产品正在参加拼团活动']);
             // 核对产品
-            $product_res                    = $Product::query()->where([['business_id','=', $data['business_id']],['product_id','=', $data['product_id']]])->first();
+            $product_res                    = $Product->query()->where([['business_id','=', $data['business_id']],['id','=', $data['product_id']]])->first();
             if (!$product_res)               return json_send(['code'=>'error','msg'=>'该店铺产品不存在']);
             //核对产品价格
-            $productInfo                    =   $Product->getOne($data['product_id']);
+            $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

+ 2 - 0
resources/views/admin/banner/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/banner/add'))
 	<a href="{{url('admin/banner/add')}}" class="btn btn-primary">新增</a>
+	@endif
 </div>
 <form action="" method="get" class="form-horizontal form-line">
 	<div class="form-group col col-lg-2 col-md-4 col-sm-6 col-xs-12" style="margin-right: 2px;">

+ 5 - 5
resources/views/admin/business/index.blade.php

@@ -4,11 +4,11 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 @endsection
 @section('content')
 
-@if(check_auth('admin/business/add'))
-	<div class="page-header">
-		<a href="{{url('admin/business/add')}}" class="btn btn-primary">新增</a>
-	</div>
-@endif
+<div class="page-header">
+	@if(check_auth('admin/business/add'))
+	<a href="{{url('admin/business/add')}}" class="btn btn-primary">新增</a>
+	@endif
+</div>
 
 <form action="" method="get" class="form-horizontal form-line">
 	<div class="form-group col col-lg-2 col-md-4 col-sm-6 col-xs-12" style="margin-right: 2px;">

+ 0 - 8
resources/views/admin/coupon/add.blade.php

@@ -88,14 +88,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 			@endforeach
 		</select>
 	</div>
-	<div class="form-group col-sm-2">
-		<label class="control-label">商业公司</label>
-		<select name="business_id" class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="搜索商业公司" data-none-results-text="未搜索到 {0}" title="选择商业公司">
-			@foreach ($businessList as $value)
-				<option value="{{$value['id']}}" selected >{{$value['name']}}</option>
-			@endforeach
-		</select>
-	</div>
 	<div class="form-group col-sm-12">
 		@csrf
 		<input id="send" type="submit" value="提交" class="btn btn-primary btn-block" />

+ 0 - 8
resources/views/admin/coupon/edit.blade.php

@@ -88,14 +88,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 			@endforeach
 		</select>
 	</div>
-	<div class="form-group col-sm-2">
-		<label class="control-label">商业公司</label>
-		<select name="business_id" required class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="搜索商业公司" data-none-results-text="未搜索到 {0}" title="选择商业公司">
-			@foreach ($businessList as $value)
-				<option value="{{$value['id']}}" @if( $value['id'] == $oldData['business_id']) selected @endif >{{$value['name']}}</option>
-			@endforeach
-		</select>
-	</div>
 	<div class="form-group col-sm-12">
 		@csrf
 		<input type="hidden" name="id" value="{{$oldData['id']}}" />

+ 0 - 2
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>
@@ -96,7 +95,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 							@endif
 						</td>
 						<td> {{$a['gant_name']}} </td>
-						<td> {{$a['business_name']}} </td>
 						<td>
 							@if ($a['status'] == 0) 
 

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

@@ -85,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 - 1
resources/views/admin/coupon_reward_rule/index.blade.php

@@ -68,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 - 8
resources/views/admin/orders/index.blade.php

@@ -40,14 +40,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 	<div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-12" style="margin-right: 2px;">
 		<input type="text" class="form-control" name="contact_area" value="{{request('contact_area','')}}" placeholder="请输入区县查询" />
 	</div>
-	<div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-12" style="margin-right: 2px;">
-		<select name="business_id" class="form-control">
-			<option value="" >商业公司</option>
-			@foreach ($businessList as $business)
-				<option value="{{$business['id']}}" @if (request('business_id',0) == $business['id'] ) selected="selected" @endif >{{$business['name']}}</option>
-			@endforeach
-		</select>
-	</div>
 	<div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-12" style="margin-right: 2px;">
 		<select name="status" class="form-control">
 			<option value="" >订单状态</option>

+ 0 - 8
resources/views/admin/regiment_active/add.blade.php

@@ -79,14 +79,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 			<label class="radio-inline"><input type="radio" value="1" name="virtually" >关闭</label>
 		</div>
 	</div>
-	<div class="form-group col-sm-6">
-		<label class="control-label">商业公司</label>
-		<select name="business_id" class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="搜索商业公司" data-none-results-text="未搜索到 {0}" title="选择商业公司">
-			@foreach ($businessList as $value)
-				<option value="{{$value['id']}}" selected >{{$value['name']}}</option>
-			@endforeach
-		</select>
-	</div>
 	<div class="form-group col-sm-12">
 		@csrf
 		<input id="send" type="submit" value="提交" class="btn btn-primary btn-block" />

+ 0 - 8
resources/views/admin/regiment_active/edit.blade.php

@@ -79,14 +79,6 @@ style="margin: 0 auto;width: 96%;padding: 30px 0px;"
 				<label class="radio-inline"><input type="radio" value="1" name="virtually" @if($oldData['virtually'] == 1) checked @endif>关闭</label>
 			</div>
 		</div>
-		<div class="form-group col-sm-6">
-			<label class="control-label">商业公司</label>
-			<select name="business_id" required class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="搜索商业公司" data-none-results-text="未搜索到 {0}" title="选择商业公司">
-				@foreach ($businessList as $value)
-					<option value="{{$value['id']}}" @if( $value['id'] == $oldData['business_id']) selected @endif >{{$value['name']}}</option>
-				@endforeach
-			</select>
-		</div>
 		<div class="form-group col-sm-12">
 			@csrf
 			<input type="hidden" name="id" id="id" value="{{$oldData['id']}}" />