From 97a97aa4888e58d32ae53aca336e7e833641d6e8 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Thu, 31 Mar 2022 14:42:56 +0800 Subject: [PATCH] setter --- app/common.php | 2 +- app/controller/api/Business.php | 6 +- app/controller/api/Consumer.php | 2 +- app/controller/api/Coupon.php | 92 +++++++++---------- app/controller/api/User.php | 2 +- app/controller/manager/Agency.php | 2 +- app/controller/manager/Business.php | 16 ++-- app/controller/manager/Consumer.php | 14 +-- app/controller/manager/Coupon.php | 26 +++--- app/controller/manager/CouponType.php | 4 +- app/controller/manager/Statistical.php | 2 +- app/model/Coupon.php | 2 +- app/model/CouponBill.php | 2 +- app/model/CouponMain.php | 2 +- app/model/CouponType.php | 2 +- app/model/Redpack.php | 2 +- app/model/Score.php | 2 +- app/model/UsingRule.php | 2 +- app/repository/BusinessRepository.php | 6 +- app/repository/CouponRepository.php | 12 +-- app/repository/DictionaryRepository.php | 12 +-- app/subscribe/Coupon.php | 4 +- app/traits/CouponBillTrait.php | 2 +- app/traits/CouponMainTrait.php | 30 +++--- app/traits/CouponTrait.php | 14 +-- app/validate/CouponRelease.php | 8 +- public/static/manager/js/bill.js | 4 +- public/static/manager/js/bill_deduction.js | 4 +- public/static/manager/js/business/business.js | 8 +- .../js/business/business_deduction_list.js | 2 +- public/static/manager/js/channel.js | 2 +- public/static/manager/js/consumer/index.js | 6 +- public/static/manager/js/consumer/info.js | 4 +- route/api.php | 6 +- view/manager/bill/deduction.html | 2 +- view/manager/bill/index.html | 2 +- .../business/business_coupon_list.html | 2 +- view/manager/business/business_detail.html | 2 +- view/manager/business/index.html | 2 +- view/manager/config/wechat.html | 10 +- view/manager/consumer/info.html | 6 +- view/manager/coupon/add.html | 2 +- view/manager/coupon/edit.html | 2 +- view/manager/coupon/index.html | 4 +- view/manager/coupon/info.html | 6 +- view/manager/index/dashboard.html | 4 +- view/manager/slide/add.html | 2 +- view/manager/slide/edit.html | 2 +- 48 files changed, 177 insertions(+), 177 deletions(-) diff --git a/app/common.php b/app/common.php index a6e78bc..c5a5254 100644 --- a/app/common.php +++ b/app/common.php @@ -846,7 +846,7 @@ if (!function_exists('get_distance')) { } /** - * 格式化优惠券的使用周期 + * 格式化签到券的使用周期 * */ if (!function_exists('encodeCouponCycle')) { function encodeCouponCycle(array $week) diff --git a/app/controller/api/Business.php b/app/controller/api/Business.php index f43bb1a..6b3048c 100644 --- a/app/controller/api/Business.php +++ b/app/controller/api/Business.php @@ -345,7 +345,7 @@ class Business extends Base } /** - * 商家优惠券详情 + * 商家签到券详情 * */ public function couponDetail() { @@ -357,10 +357,10 @@ class Business extends Base $couponMainId = input("id/d"); $couponMain = CouponMain::findOne(["id"=>$couponMainId]); if(empty($couponMain)){ - return $this->json(4001,"优惠券不存在"); + return $this->json(4001,"签到券不存在"); } if(!$business = BusinessRepository::getInstance()->findOneByWhere(["code"=>$couponMain["business_code"]])){ - return $this->json(4001,"优惠券商家信息不存在"); + return $this->json(4001,"签到券商家信息不存在"); } $list = $business->toArray(); diff --git a/app/controller/api/Consumer.php b/app/controller/api/Consumer.php index f9f5645..dfe90fc 100644 --- a/app/controller/api/Consumer.php +++ b/app/controller/api/Consumer.php @@ -123,7 +123,7 @@ class Consumer extends Base $item->distance_text = $distance . "m"; } - //是否收藏了该优惠券的商家 + //是否收藏了该签到券的商家 $item->isFlow = in_array($item->business_code,$flowArray); $item->couponId = $item->id; diff --git a/app/controller/api/Coupon.php b/app/controller/api/Coupon.php index b6d5610..edf0efc 100644 --- a/app/controller/api/Coupon.php +++ b/app/controller/api/Coupon.php @@ -71,7 +71,7 @@ class Coupon extends Base // switch ($type) { // case 'all': -// // 全部持有优惠券 +// // 全部持有签到券 // $sortOrder = ['sort_weight' => 'desc', 'end_time' => 'asc']; // break; // case 'notUsed': @@ -135,7 +135,7 @@ class Coupon extends Base $time = time(); $res['list'] ->each(function ($item) use($time){ - //重置优惠券名称 + //重置签到券名称 if(isset($item->couponMain) && $item->couponMain){ $item->couponName = $item->couponMain->name; $item->image_url = $this->request->domain() . $item->couponMain->image_url; @@ -265,7 +265,7 @@ class Coupon extends Base $item->status = $status; - //重置优惠券名称 + //重置签到券名称 if(isset($item->couponMain) && $item->couponMain){ $item->couponName = $item->couponMain->name; $item->image_url = $this->request->domain() . $item->couponMain->image_url; @@ -283,7 +283,7 @@ class Coupon extends Base } /** - * 领取优惠券 + * 领取签到券 * */ public function receiveCoupon() { @@ -308,7 +308,7 @@ class Coupon extends Base return $q->with("business")->lock(true); }); if(!isset($couponMain->business)||empty($couponMain->business)){ - return $this->json(4001, "优惠券所属商家不存在"); + return $this->json(4001, "签到券所属商家不存在"); } if($couponMain->business->enable != BusinessModel::COMMON_OFF){ @@ -316,7 +316,7 @@ class Coupon extends Base } try { - //检查优惠券状态 + //检查签到券状态 CouponRepository::getInstance()->checkCouponMainReceiveStatus($couponMain); }catch (RepositoryException $e){ return $this->json(4001,$e->getMessage()); @@ -355,10 +355,10 @@ class Coupon extends Base ]; //如果商家指派了渠道商 分销人重新定义为空 if ($couponMain->business->is_assign == BusinessModel::COMMON_ON){ - $data["is_distribution_coupon"] = couponMain::COMMON_OFF;//是否是分销优惠券 + $data["is_distribution_coupon"] = couponMain::COMMON_OFF;//是否是分销签到券 $data["distribution_user_code"] = '';//分销人user_code }else{ - $data["is_distribution_coupon"] = couponMain::COMMON_ON;//是否是分销优惠券 + $data["is_distribution_coupon"] = couponMain::COMMON_ON;//是否是分销签到券 $data["distribution_user_code"] = $distributionUserCode;//分销人user_code } @@ -371,11 +371,11 @@ class Coupon extends Base Db::commit(); return $this->json(); }catch (RepositoryException $e){ - Log::error("优惠券领取失败RepositoryException:".$e->getMessage()); + Log::error("签到券领取失败RepositoryException:".$e->getMessage()); Db::rollback(); return $this->json(5001,"领取失败"); }catch (Exception $e){ - Log::error("优惠券领取失败:".$e->getMessage()); + Log::error("签到券领取失败:".$e->getMessage()); Db::rollback(); return $this->json(5001,"领取失败"); } @@ -383,7 +383,7 @@ class Coupon extends Base } /** - * 核验优惠券 程序----核心操作---- + * 核验签到券 程序----核心操作---- * */ public function verification() { @@ -409,31 +409,31 @@ class Coupon extends Base }); if(empty($coupon)){ - return $this->json(4001, "优惠券不存在"); + return $this->json(4001, "签到券不存在"); } if($coupon->consumer_code != $account->user_code ){ return $this->json(4001, "参数错误"); } if($coupon->is_verificated != CouponModel::is_verificated_off){ - return $this->json(4001, "优惠券已验证"); + return $this->json(4001, "签到券已验证"); } if($coupon->status != CouponMain::status_on){ - return $this->json(4001, "优惠券已停用"); + return $this->json(4001, "签到券已停用"); } if($coupon->on_shelf != CouponMain::on_shelf_on){ - return $this->json(4001, "优惠券下架"); + return $this->json(4001, "签到券下架"); } if(!isset($coupon->couponMain) || empty($coupon->couponMain)){ - return $this->json(4001, "商家优惠券信息错误"); + return $this->json(4001, "商家签到券信息错误"); } if(strtotime($coupon->couponMain->end_time) < $time){ - return $this->json(4001, "优惠券已过期"); + return $this->json(4001, "签到券已过期"); } //$usingRule = UsingRule::findOne(["coupon_id"=>$coupon->couponMain->id]); //if(empty($usingRule)){ - // return $this->json(4001, "商家优惠券使用规则信息错误"); + // return $this->json(4001, "商家签到券使用规则信息错误"); //} //一天的开始时间 @@ -494,7 +494,7 @@ class Coupon extends Base } $businessModel = $business["model"]; - // 指定时间段内发布的优惠券个数 + // 指定时间段内发布的签到券个数 $TimeListModeReleaseCount = BusinessRepository::getInstance() ->getTimeListModeReleaseCount($business["code"],$business["time_limit_start"],$business["time_limit_end"]); @@ -582,7 +582,7 @@ class Coupon extends Base //开始数据操作 Db::startTrans(); try { - // 1. 修改优惠券状态 + // 1. 修改签到券状态 $coupon->save([ "is_verificated" => CouponModel::is_verificated_on, "used_time" => date("Y-m-d H:i:s" ,$time), @@ -597,7 +597,7 @@ class Coupon extends Base // $couponBill = CouponBill::getUserOne($account->user_code,$coupon->couponMain->id,$coupon->id); // if(empty($couponBill)){ - //2. 写入优惠券流水 + //2. 写入签到券流水 $couponBillData = [ "coupon_main_id" => $coupon->couponMain->id, "coupon_id" => $coupon->id, @@ -639,7 +639,7 @@ class Coupon extends Base "business_code" => $business->code, "business_name" => $business->business_name, "balance" => $business->balance - $deductionMoney, - "reason" => sprintf("[%s]验证优惠券[%s]扣除[%s]",$account->nick_name, $coupon->couponMain->name,$deductionMoney), + "reason" => sprintf("[%s]验证签到券[%s]扣除[%s]",$account->nick_name, $coupon->couponMain->name,$deductionMoney), "coupon_main_id" => $coupon->couponMain->id, "coupon_id" => $coupon->id, "bill_id" => $couponBill->id, @@ -680,7 +680,7 @@ class Coupon extends Base 'openid' => $agencyRedpackUser->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 'amount' => $agencyPayAmount , //单位为分,不小于300 - 'desc' => '用户核销优惠券,渠道商奖励', + 'desc' => '用户核销签到券,渠道商奖励', ]; // 写入红包 @@ -731,7 +731,7 @@ class Coupon extends Base 'openid' => $consumerRedpackUser->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 'amount' => $consumerAmount, //单位为分,不小于300 - 'desc' => '验证优惠券签到奖励', + 'desc' => '验证签到券签到奖励', ]; // 写入红包 @@ -781,7 +781,7 @@ class Coupon extends Base 'openid' => $distributionRedpackUser->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 'amount' => $confirmDistributionMoney * 100, //单位为分,不小于300 - 'desc' => '优惠券分销奖励', + 'desc' => '签到券分销奖励', ]; // 写入红包 @@ -831,7 +831,7 @@ class Coupon extends Base Db::commit(); return $this->json( 0, - "优惠券签到使用成功,您获得{$returnConsumerMoney}元红包,已存入您的零钱", + "签到券签到使用成功,您获得{$returnConsumerMoney}元红包,已存入您的零钱", [ "redpack" =>$returnConsumerMoney, "user_coupon_id" =>$couponId, @@ -841,13 +841,13 @@ class Coupon extends Base Db::rollback(); return $this->json(5001, "Repository服务器错误"); }catch (\Exception $e){ - Log::error('核销优惠券失败:'.$e->getMessage()); + Log::error('核销签到券失败:'.$e->getMessage()); Db::rollback(); return $this->json(5002, "服务器错误"); } } /** - * 发布优惠券 + * 发布签到券 * */ public function add() { @@ -889,11 +889,11 @@ class Coupon extends Base if ($hasCouponMax > 0) { $hasCouponCount = CouponRepository::getInstance()->getBusinessOnShelfOnCount($account->business->code); if ($hasCouponCount > $hasCouponMax) { - return $this->json(4001, "商家持有优惠券不能超过{$hasCouponMax}"); + return $this->json(4001, "商家持有签到券不能超过{$hasCouponMax}"); } } - //验证通过 不管是商家还是工作人员 都可以发布优惠券 + //验证通过 不管是商家还是工作人员 都可以发布签到券 $couponMain = [ "name" => $data['name'] ?? '', "business_code" => $account->business->code, @@ -931,7 +931,7 @@ class Coupon extends Base //$usingRule = input("using_rule/a"); $businessModel = $account->business["model"]; - // 指定时间段内发布的优惠券个数 + // 指定时间段内发布的签到券个数 $TimeListModeReleaseCount = BusinessRepository::getInstance() ->getTimeListModeReleaseCount($account->business["code"],$account->business["time_limit_start"],$account->business["time_limit_end"]); @@ -959,7 +959,7 @@ class Coupon extends Base //检查类型 if(CouponTypeModel::checkType($couponMain['type']) !== true){ - return $this->json(4001, '优惠券类型不存在'); + return $this->json(4001, '签到券类型不存在'); } $type = CouponRepository::getInstance()->getCouponTypeAll(); $type = array_column($type->toArray(), null, "id"); @@ -1021,7 +1021,7 @@ class Coupon extends Base //} - //未领取的优惠券 + //未领取的签到券 $NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($account->business["code"]); // if( // $account->business["model"] == BusinessModel::model_ordinary @@ -1073,7 +1073,7 @@ class Coupon extends Base } /** - * 修改优惠券 + * 修改签到券 * */ public function edit() { @@ -1097,14 +1097,14 @@ class Coupon extends Base $couponMain = CouponMain::findById($couponMainId,[]); if (empty($couponMain)) { - return $this->json(4001, "优惠券不存在"); + return $this->json(4001, "签到券不存在"); } //if (!isset($couponMain->usingRule)||empty($couponMain->usingRule)) { - // return $this->json(4001, "优惠券信息错误"); + // return $this->json(4001, "签到券信息错误"); //} $data = input(); - //验证通过 不管是商家还是工作人员 都可以修改优惠券 只能修改指定字段 + //验证通过 不管是商家还是工作人员 都可以修改签到券 只能修改指定字段 $couponMainData = [ "name" => $data['name'] ?? '', "type" => $data['type'] ?? 0, @@ -1132,7 +1132,7 @@ class Coupon extends Base //检查类型 if(CouponTypeModel::checkType($couponMainData['type']) !== true){ - return $this->json(4001, '优惠券类型不存在'); + return $this->json(4001, '签到券类型不存在'); } $type = CouponRepository::getInstance()->getCouponTypeAll(); $type = array_column($type->toArray(), null, "id"); @@ -1156,7 +1156,7 @@ class Coupon extends Base } /** - * 商家管理优惠券 + * 商家管理签到券 * */ public function getPageList() { @@ -1212,7 +1212,7 @@ class Coupon extends Base } /** - * 优惠券的领取 使用记录列表 + * 签到券的领取 使用记录列表 * */ public function getShopCouponList() { @@ -1237,10 +1237,10 @@ class Coupon extends Base $couponMain = CouponMain::findById($couponMainId); if(empty($couponMain)){ - return $this->json(4001, "优惠券不存在"); + return $this->json(4001, "签到券不存在"); } if($couponMain->business_code != $account->business->code){ - return $this->json(4001, "优惠券参数信息错误"); + return $this->json(4001, "签到券参数信息错误"); } $page = $this->request->param('page/d', 1); @@ -1257,7 +1257,7 @@ class Coupon extends Base } switch ($type) { case 'all': - // 全部持有优惠券 + // 全部持有签到券 $sortOrder = [ 'end_time' => 'asc']; break; case 'notUsed': @@ -1296,7 +1296,7 @@ class Coupon extends Base } /** - * 获取优惠券详情 + * 获取签到券详情 * */ public function getCouponMainInfo() { @@ -1307,14 +1307,14 @@ class Coupon extends Base }]); }); if(empty($couponMain)){ - return $this->json(4001,"优惠券不存在"); + return $this->json(4001,"签到券不存在"); } return $this->json(0,"success",$couponMain->toArray()); } /** - * 已使用优惠券 评分 + * 已使用签到券 评分 * */ public function score() { diff --git a/app/controller/api/User.php b/app/controller/api/User.php index 684a4d7..c9e31b3 100644 --- a/app/controller/api/User.php +++ b/app/controller/api/User.php @@ -168,7 +168,7 @@ class User extends Base throw new ValidateException('用户无效!没有相关的商户信息记录'); } - // 指定时间段内发布的优惠券个数 + // 指定时间段内发布的签到券个数 $TimeListModeReleaseCount = BusinessRepository::getInstance() ->getTimeListModeReleaseCount($account->business["code"],$account->business["time_limit_start"],$account->business["time_limit_end"]); diff --git a/app/controller/manager/Agency.php b/app/controller/manager/Agency.php index 62ee95e..73cb84f 100644 --- a/app/controller/manager/Agency.php +++ b/app/controller/manager/Agency.php @@ -306,7 +306,7 @@ class Agency extends Base $list["list"]->each(function ($item) { //管理的商家数 $item->business_count = BusinessRepository::getInstance()->agencyHasBusinessCount($item['business_code']); - //管理的商家的优惠券数 + //管理的商家的签到券数 $item->coupon_count = BusinessRepository::getInstance()->agencyHasCouponCount($item['business_code']); }); return $this->json(0, 'success', $list); diff --git a/app/controller/manager/Business.php b/app/controller/manager/Business.php index b0ea82a..d7f2d66 100644 --- a/app/controller/manager/Business.php +++ b/app/controller/manager/Business.php @@ -60,12 +60,12 @@ class Business extends Base } $list = $repo->businessList($whereMap, $page, $size, $orders); $list["list"]->each(function ($item) { - //得到当前商家的所有优惠券 + //得到当前商家的所有签到券 $date = date("Y-m-d H:i:s"); - //优惠券总数 + //签到券总数 $item->coupon_total_count = CouponMain::where(["business_code" => $item->business_code])->sum("count"); - //进行中优惠券总数 + //进行中签到券总数 $item->coupon_doing_count = CouponMain::where(["business_code" => $item->business_code]) ->whereTime("start_time", "<", $date) ->whereTime("end_time", ">", $date) @@ -73,16 +73,16 @@ class Business extends Base ->where("on_shelf", CouponMain::on_shelf_on) ->sum("count"); - //进行中优惠券总数 + //进行中签到券总数 $item->coupon_receive_count = CouponMain::where(["business_code" => $item->business_code])->sum("received_count"); - //过期未使用优惠券总数 + //过期未使用签到券总数 $item->coupon_be_overdue_count = Coupon::where(["business_code" => $item->business_code]) ->where("is_verificated", "=", Coupon::is_verificated_off) ->whereTime("end_time", "<", $date) ->count(); - //已使用优惠券总数 + //已使用签到券总数 $item->coupon_used_count = Coupon::where(["business_code" => $item->business_code]) ->where("is_verificated", "=", Coupon::is_verificated_on) ->count(); @@ -107,7 +107,7 @@ class Business extends Base /** - * 商家优惠券列表 + * 商家签到券列表 * * @return Json|View * @throws Exception @@ -236,7 +236,7 @@ class Business extends Base 'time_limit_start|时限商家模式【开始时间】' => 'requireIf:model,'.BusinessModel::model_time_limit.'|date', 'time_limit_end|时限商家模式【结束时间】' => 'requireIf:model,'.BusinessModel::model_time_limit.'|date|after:'.date("Y-m-d",strtotime("+1 day")), - 'time_limit_release_count|时限商家模式可发布优惠券个数' => 'requireIf:model,'.BusinessModel::model_time_limit.'|>:0', + 'time_limit_release_count|时限商家模式可发布签到券个数' => 'requireIf:model,'.BusinessModel::model_time_limit.'|>:0', ]); if ($validate !== true) { diff --git a/app/controller/manager/Consumer.php b/app/controller/manager/Consumer.php index 6b06e71..b7bfcc7 100644 --- a/app/controller/manager/Consumer.php +++ b/app/controller/manager/Consumer.php @@ -39,11 +39,11 @@ class Consumer extends Base } $list = $repo->findList($whereMap, [], $page, $size, null, $orders); $list["list"]->each(function ($item) { - //优惠券领取总数 + //签到券领取总数 $item->coupon_total_count = Coupon::where(["consumer_code" => $item->user_code])->count("id"); - //优惠券使用总数 + //签到券使用总数 $item->coupon_used_count = Coupon::where(["consumer_code" => $item->user_code])->where("is_verificated", Coupon::is_verificated_on)->count("id"); - //优惠券未使用总数 + //签到券未使用总数 $item->coupon_not_use_count = Coupon::where(["consumer_code" => $item->user_code])->where("is_verificated", Coupon::is_verificated_off)->count("id"); //优惠红包总金额 @@ -70,7 +70,7 @@ class Consumer extends Base $consumer = Account::findOne(["id" => $id], [], function ($q) { return $q->with("tag"); }); - //只查询优惠券持有 + //只查询签到券持有 if ($this->request->isPost()) { $repo = AccountRepository::getInstance(); $page = $this->request->param('page/d', 1); @@ -101,12 +101,12 @@ class Consumer extends Base //评论总数数 $this->data["totalTheMonthComment"] = $rep->consumerTheMonthTotalComment($consumer["user_code"]); - //优惠券领取总数 + //签到券领取总数 $this->data["couponTotalCount"] = $rep->consumerTotalCoupon($consumer["user_code"]); - //优惠券使用总数 + //签到券使用总数 $this->data["couponUsedTotalCount"] = $rep->consumerUsedTotalCoupon($consumer["user_code"]); - //优惠券未使用总数 + //签到券未使用总数 $this->data["couponNotUsedTotalCount"] = $rep->consumerNotUsedTotalCoupon($consumer["user_code"]); $this->data["consumer"] = $consumer->toArray(); diff --git a/app/controller/manager/Coupon.php b/app/controller/manager/Coupon.php index e3a64ee..56cec18 100644 --- a/app/controller/manager/Coupon.php +++ b/app/controller/manager/Coupon.php @@ -25,7 +25,7 @@ use think\response\View; use think\facade\Config as CConfig; /** - * 优惠券相关 + * 签到券相关 **/ class Coupon extends Base { @@ -111,7 +111,7 @@ class Coupon extends Base $coupon = $repo->findById($id); if (empty($coupon)) { - return $this->json(4001, "优惠券不存在"); + return $this->json(4001, "签到券不存在"); } if (!in_array($on_shelf, [CouponMain::COMMON_OFF, CouponMain::COMMON_ON])) { @@ -158,14 +158,14 @@ class Coupon extends Base ->with('category'); }, "couponType"])->where("id", $id)->find(); if (empty($coupon)) { - return $this->error("优惠券不存在"); + return $this->error("签到券不存在"); } $this->data["coupon"] = $coupon; return $this->view(); } /** - * 发布优惠券 + * 发布签到券 * * @return Json|View * @throws Exception @@ -187,7 +187,7 @@ class Coupon extends Base return $this->json(4001, "商家已禁用"); } - // 指定时间段内发布的优惠券个数 + // 指定时间段内发布的签到券个数 $TimeListModeReleaseCount = BusinessRepository::getInstance() ->getTimeListModeReleaseCount($business["code"],$business["time_limit_start"],$business["time_limit_end"]); @@ -218,13 +218,13 @@ class Coupon extends Base if ($hasCouponMax > 0) { $hasCouponCount = CouponRepository::getInstance()->getBusinessOnShelfOnCount($business->code); if ($hasCouponCount > $hasCouponMax) { - return $this->json(4001, "商家持有商家优惠券不能超过{$hasCouponMax}"); + return $this->json(4001, "商家持有商家签到券不能超过{$hasCouponMax}"); } } //检查类型 if(CouponTypeModel::checkType($data['type']) !== true){ - return $this->json(4001, '优惠券类型不存在'); + return $this->json(4001, '签到券类型不存在'); } $type = CouponRepository::getInstance()->getCouponTypeAll(); @@ -324,7 +324,7 @@ class Coupon extends Base $totalMoney = $data['deduction_money'] * $data['count']; - //未领取的优惠券 + //未领取的签到券 $NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($business["code"]); // if( // $business["model"] == BusinessModel::model_ordinary @@ -400,10 +400,10 @@ class Coupon extends Base $data = input("item/a", []); //$usingRule = input("using_rule/a", []); if (empty($couponMain)) { - return $this->json(4001, "优惠券不存在"); + return $this->json(4001, "签到券不存在"); } if (!isset($couponMain->business) || empty($couponMain->business)) { - return $this->json(4001, "优惠券所属商家不存在"); + return $this->json(4001, "签到券所属商家不存在"); } $validate = new CouponRelease(); if (!$validate->scene("edit")->check($data)) { @@ -422,7 +422,7 @@ class Coupon extends Base //检查类型 if(CouponTypeModel::checkType($data['type']) !== true){ - return $this->json(4001, '优惠券类型不存在'); + return $this->json(4001, '签到券类型不存在'); } $type = CouponRepository::getInstance()->getCouponTypeAll(); $type = array_column($type->toArray(), null, "id"); @@ -535,7 +535,7 @@ class Coupon extends Base } if (empty($couponMain)) { - return $this->error("优惠券不存在"); + return $this->error("签到券不存在"); } $this->data['business'] = BusinessRepository::getInstance()->getBusinessAll(); $this->data['type'] = CouponRepository::getInstance()->getCouponTypeAll(); @@ -553,7 +553,7 @@ class Coupon extends Base $id = input("id/d"); $couponMain = CouponMain::findById($id); if(empty($couponMain)){ - return $this->json(4001,"优惠券不存在"); + return $this->json(4001,"签到券不存在"); } $qrData = $this->request->domain() . "/coupon_info?id={$id}&business_code={$couponMain['business_code']}" ; diff --git a/app/controller/manager/CouponType.php b/app/controller/manager/CouponType.php index 7e86e62..f37d672 100644 --- a/app/controller/manager/CouponType.php +++ b/app/controller/manager/CouponType.php @@ -17,7 +17,7 @@ use think\response\Json; use think\response\View; /** - * 优惠券类型 + * 签到券类型 * * Class CouponType * @package app\controller\manager @@ -110,7 +110,7 @@ class CouponType extends Base $couponMain = CouponMain::findOne([["type","in",$ids]]); if(!empty($couponMain)){ - return $this->json(4001,"该优惠券绑定了该类型,不能删除"); + return $this->json(4001,"该签到券绑定了该类型,不能删除"); } CouponTypeModel::destroy($ids); diff --git a/app/controller/manager/Statistical.php b/app/controller/manager/Statistical.php index e425deb..0c62d8d 100644 --- a/app/controller/manager/Statistical.php +++ b/app/controller/manager/Statistical.php @@ -99,7 +99,7 @@ class Statistical extends Base } /** - * 领取优惠券位置 + * 领取签到券位置 * */ public function receive(){ if($this->request->isPost()){ diff --git a/app/model/Coupon.php b/app/model/Coupon.php index 66165da..36d0a6a 100644 --- a/app/model/Coupon.php +++ b/app/model/Coupon.php @@ -8,7 +8,7 @@ use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; /** - * 优惠券 + * 签到券 * Class Coupon * @package app\model */ diff --git a/app/model/CouponBill.php b/app/model/CouponBill.php index bfea99c..2ca71b7 100644 --- a/app/model/CouponBill.php +++ b/app/model/CouponBill.php @@ -8,7 +8,7 @@ use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; /** - * 优惠券验证记录 各个角色的提成 + * 签到券验证记录 各个角色的提成 * Class Coupon * @package app\model */ diff --git a/app/model/CouponMain.php b/app/model/CouponMain.php index 26ba621..55e5afd 100644 --- a/app/model/CouponMain.php +++ b/app/model/CouponMain.php @@ -9,7 +9,7 @@ use think\db\exception\ModelNotFoundException; use think\Model; /** - * 优惠券主表 + * 签到券主表 * Class CouponMain * @package app\model */ diff --git a/app/model/CouponType.php b/app/model/CouponType.php index 85d3db6..9a02aac 100644 --- a/app/model/CouponType.php +++ b/app/model/CouponType.php @@ -9,7 +9,7 @@ use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; /** - * 优惠券类型 + * 签到券类型 * Class CouponType * @package app\model */ diff --git a/app/model/Redpack.php b/app/model/Redpack.php index e21747b..7ba8c49 100644 --- a/app/model/Redpack.php +++ b/app/model/Redpack.php @@ -12,7 +12,7 @@ class Redpack extends Base * 获取分销红包记录 * @param string $userType 红包获取人的角色 * @param string $distributionUserCode 分销人/渠道商/被分销者 user_code - * @param mixed $couponMainId 分销的couponMain 优惠券id + * @param mixed $couponMainId 分销的couponMain 签到券id * 以上三个参数就可以确定 分销数据的唯一性 * */ public static function getDistributionRedpack($userType,$distributionUserCode,$couponMainId) diff --git a/app/model/Score.php b/app/model/Score.php index 7c7ad23..c8792ac 100644 --- a/app/model/Score.php +++ b/app/model/Score.php @@ -2,7 +2,7 @@ namespace app\model; /** - * 优惠券使用后商家打分 + * 签到券使用后商家打分 * Class Score * @package app\model */ diff --git a/app/model/UsingRule.php b/app/model/UsingRule.php index b56b7ff..b598518 100644 --- a/app/model/UsingRule.php +++ b/app/model/UsingRule.php @@ -1,7 +1,7 @@ id; //UsingRule::create($usingRule); //Business::where("code", $data["business_code"])->dec("balance", $totalMoney)->update(); @@ -102,7 +102,7 @@ class CouponRepository extends Repository } /** - * 写入一个领取优惠券 + * 写入一个领取签到券 * @param array $data * @return Coupon|Model */ diff --git a/app/repository/DictionaryRepository.php b/app/repository/DictionaryRepository.php index 58bc4d7..f51b414 100644 --- a/app/repository/DictionaryRepository.php +++ b/app/repository/DictionaryRepository.php @@ -159,7 +159,7 @@ class DictionaryRepository extends Repository } /** - * 获取一个优惠券的使用规则 + * 获取一个签到券的使用规则 * @param int $couponMainId * @return string * @throws \think\db\exception\DataNotFoundException @@ -172,10 +172,10 @@ class DictionaryRepository extends Repository if(empty($usingRule)){ return ''; } - return "