文字修改:消费返利 修改为 推广佣金

This commit is contained in:
wuhui_zzw 2024-05-30 10:21:52 +08:00
parent d8b7d0604e
commit f01a4298b2
13 changed files with 21 additions and 21 deletions

View File

@ -590,7 +590,7 @@ class Privilege extends BaseModel
} }
/** /**
* Common: 消费返利商品判断 - 是否允许购买 * Common: 推广佣金商品判断 - 是否允许购买
* Author: wu-hui * Author: wu-hui
* Time: 2024/03/16 11:01 * Time: 2024/03/16 11:01
* @param $member * @param $member
@ -599,7 +599,7 @@ class Privilege extends BaseModel
* @throws AppException * @throws AppException
*/ */
public function validateRebate($member,$num){ public function validateRebate($member,$num){
// 判断:是否开启消费返利 // 判断:是否开启推广佣金
$goodsRebate = GoodsRebate::where('goods_id',$this->goods_id)->first(); $goodsRebate = GoodsRebate::where('goods_id',$this->goods_id)->first();
if($goodsRebate->is_open == 1){ if($goodsRebate->is_open == 1){
// 判断:当前返利记录是否存在 // 判断:当前返利记录是否存在

View File

@ -176,7 +176,7 @@ class PreOrderGoods extends OrderGoods
$this->legumes_exchange_price = $legumes_exchange_price; $this->legumes_exchange_price = $legumes_exchange_price;
$this->use_legumes_exchange = (float)ceil(sprintf("%.2f",$legumes_exchange_price / $current_fee)); $this->use_legumes_exchange = (float)ceil(sprintf("%.2f",$legumes_exchange_price / $current_fee));
} }
// 判断:是否开启消费返利 // 判断:是否开启推广佣金
$this->is_rebate = 0; $this->is_rebate = 0;
$goodsRebate = GoodsRebate::where('goods_id',$this->goods_id)->first(); $goodsRebate = GoodsRebate::where('goods_id',$this->goods_id)->first();
if($goodsRebate->is_open == 1){ if($goodsRebate->is_open == 1){

View File

@ -209,7 +209,7 @@ class IncomeService
const STORE_MANAGER = 200;// 经销商店长-店补 const STORE_MANAGER = 200;// 经销商店长-店补
const CULTURAL_SPACE_CONTRIBUTION_BONUS = 201;// 文创空间 - 贡献分享分红 const CULTURAL_SPACE_CONTRIBUTION_BONUS = 201;// 文创空间 - 贡献分享分红
const CULTURAL_SPACE_AREA_BONUS = 202;// 文创空间 - 市场津贴 const CULTURAL_SPACE_AREA_BONUS = 202;// 文创空间 - 市场津贴
const REBATE_MONEY = 203;// 消费返利 const REBATE_MONEY = 203;// 推广佣金
/** /**
@ -683,7 +683,7 @@ class IncomeService
self::STORE_MANAGER => '店补', self::STORE_MANAGER => '店补',
self::CULTURAL_SPACE_CONTRIBUTION_BONUS => '贡献分享分红', self::CULTURAL_SPACE_CONTRIBUTION_BONUS => '贡献分享分红',
self::CULTURAL_SPACE_AREA_BONUS => '市场津贴', self::CULTURAL_SPACE_AREA_BONUS => '市场津贴',
self::REBATE_MONEY => '消费返利' self::REBATE_MONEY => '推广佣金'
]; ];
if (empty($income_config_desc[$code])) { if (empty($income_config_desc[$code])) {
if ($func = app('ShopAsset')->getData('income')[$code]) { if ($func = app('ShopAsset')->getData('income')[$code]) {

View File

@ -106,7 +106,7 @@ abstract class BaseOrderGoodsPrice extends OrderGoodsPrice
// 商品销售价 - 等级优惠金额 // 商品销售价 - 等级优惠金额
$this->price = $this->getGoodsPrice(); $this->price = $this->getGoodsPrice();
$this->price = max($this->price, 0); $this->price = max($this->price, 0);
// 判断:是否开启消费返利 // 判断:是否开启推广佣金
$goodsRebate = GoodsRebate::uniacid()->where('goods_id',$this->orderGoods->goods_id)->first(); $goodsRebate = GoodsRebate::uniacid()->where('goods_id',$this->orderGoods->goods_id)->first();
if($goodsRebate->is_open == 1){ if($goodsRebate->is_open == 1){
// 判断:当前返利记录是否存在 // 判断:当前返利记录是否存在

View File

@ -1 +1 @@
## 消费返利 ## 推广佣金

View File

@ -2,8 +2,8 @@
"name": "rebate", "name": "rebate",
"terminal": "wechat|min|wap", "terminal": "wechat|min|wap",
"version": "1.0.1", "version": "1.0.1",
"title": "消费返利", "title": "推广佣金",
"description": "消费返利", "description": "推广佣金",
"author": "wuhui", "author": "wuhui",
"url": "", "url": "",
"namespace": "Yunshop\\Rebate", "namespace": "Yunshop\\Rebate",

View File

@ -9,7 +9,7 @@ class PluginApplication extends \app\common\services\PluginApplication{
protected function setMenuConfig(){ protected function setMenuConfig(){
\app\backend\modules\menu\Menu::current()->setPluginMenu('rebate', [ \app\backend\modules\menu\Menu::current()->setPluginMenu('rebate', [
'name' => '消费返利', 'name' => '推广佣金',
'type' => 'marketing', 'type' => 'marketing',
'url' => 'plugin.rebate.admin.index.index',// url 可以填写http 也可以直接写路由 'url' => 'plugin.rebate.admin.index.index',// url 可以填写http 也可以直接写路由
'url_params' => '',//如果是url填写的是路由则启用参数否则不启用 'url_params' => '',//如果是url填写的是路由则启用参数否则不启用
@ -75,11 +75,11 @@ class PluginApplication extends \app\common\services\PluginApplication{
{ {
return [ return [
'withdraw.rebate_commission' => [ 'withdraw.rebate_commission' => [
'title' => '消费返利提现', 'title' => '推广佣金提现',
'class' => 'Yunshop\Rebate\admin\widget\RebateWithdrawWidget' 'class' => 'Yunshop\Rebate\admin\widget\RebateWithdrawWidget'
], ],
'vue-goods.rebate' => [ 'vue-goods.rebate' => [
'title' => '消费返利', 'title' => '推广佣金',
'class' => \Yunshop\Rebate\admin\widget\RebateWidget::class, 'class' => \Yunshop\Rebate\admin\widget\RebateWidget::class,
], ],
]; ];
@ -115,12 +115,12 @@ class PluginApplication extends \app\common\services\PluginApplication{
public function cronConfig(){ public function cronConfig(){
\Event::listen('cron.collectJobs', function () { \Event::listen('cron.collectJobs', function () {
// 每5分钟 执行一次消费返利解冻判断 // 每5分钟 执行一次推广佣金解冻判断
\Cron::add('rebate-settlement', '*/5 * * * *', function () { \Cron::add('rebate-settlement', '*/5 * * * *', function () {
Rebate::rebateThaw(); Rebate::rebateThaw();
return; return;
}); });
// 每5分钟 执行一次消费返利失效判断 // 每5分钟 执行一次推广佣金失效判断
\Cron::add('rebate-lose-efficacy', '*/1 * * * *', function () { \Cron::add('rebate-lose-efficacy', '*/1 * * * *', function () {
Rebate::loseEfficacy(); Rebate::loseEfficacy();
return; return;

View File

@ -57,7 +57,7 @@ class IndexController extends ApiController{
$levelGive = TeamDividendModel::uniacid()->where('member_id',$uid)->where('type',1)->sum('dividend_amount'); $levelGive = TeamDividendModel::uniacid()->where('member_id',$uid)->where('type',1)->sum('dividend_amount');
// 下级总数 // 下级总数
$subCount = TeamDividendAgencyModel::where('parent_id', $uid)->count(); $subCount = TeamDividendAgencyModel::where('parent_id', $uid)->count();
// 复购商品 是否存在消费返利信息 存在继续下一个步骤 // 复购商品 是否存在推广佣金信息 存在继续下一个步骤
$goods = []; $goods = [];
$rebateGroupMax = Rebate::selectRaw('max(id) as max_id,max(reality_thaw_time) as max_reality_thaw_time,order_id,goods_id,max(status) as status') $rebateGroupMax = Rebate::selectRaw('max(id) as max_id,max(reality_thaw_time) as max_reality_thaw_time,order_id,goods_id,max(status) as status')
->where('uid',$uid) ->where('uid',$uid)

View File

@ -22,7 +22,7 @@ class OrderPaidListener{
$orderId = $model->id ?? 0; $orderId = $model->id ?? 0;
if($orderId > 0) Rebate::createRebateInit((int)$orderId,(int)$model->uid); if($orderId > 0) Rebate::createRebateInit((int)$orderId,(int)$model->uid);
}catch (\Exception $e){ }catch (\Exception $e){
\Log::debug('--- 消费返利 - 支付成功事件处理 - 失败 ---'.$e->getMessage()); \Log::debug('--- 推广佣金 - 支付成功事件处理 - 失败 ---'.$e->getMessage());
} }
} }
} }

View File

@ -25,7 +25,7 @@ class GoodsRebate extends BaseModel{
// 公共 // 公共
$info->uniacid = \YunShop::app()->uniacid; $info->uniacid = \YunShop::app()->uniacid;
$info->goods_id = $goodsId;// 商品ID $info->goods_id = $goodsId;// 商品ID
$info->is_open = $data['is_open'] ?? 0;// 当前商品是否参与消费返利0=未开启1=开启 $info->is_open = $data['is_open'] ?? 0;// 当前商品是否参与推广佣金0=未开启1=开启
$info->is_alone = $data['is_alone'] ?? 0;// 是否独立设置:0=不是1=是 $info->is_alone = $data['is_alone'] ?? 0;// 是否独立设置:0=不是1=是
$info->total_quarter = $data['total_quarter'] ?? 0;// 总多少季度 $info->total_quarter = $data['total_quarter'] ?? 0;// 总多少季度
$info->quarter_list = json_encode($data['quarter_list'] ?? []);// 每季度配置信息 $info->quarter_list = json_encode($data['quarter_list'] ?? []);// 每季度配置信息

View File

@ -215,7 +215,7 @@ class Rebate extends BaseModel{
* Time: 2024/03/15 9:50 * Time: 2024/03/15 9:50
*/ */
public static function rebateSettlement(){ public static function rebateSettlement(){
\Log::debug('--- 消费返利 - 结算到佣金 - 开始 ----'); \Log::debug('--- 推广佣金 - 结算到佣金 - 开始 ----');
// 获取可以结算但是未结算的数据 // 获取可以结算但是未结算的数据
$list = self::select(['id','uid','money','uniacid']) $list = self::select(['id','uid','money','uniacid'])
->where('status', 1) ->where('status', 1)
@ -304,7 +304,7 @@ class Rebate extends BaseModel{
DB::commit(); DB::commit();
}catch(\Exception $e){ }catch(\Exception $e){
\Log::debug('--- 消费返利 - 失效判断 - 错误:'.$e->getMessage()); \Log::debug('--- 推广佣金 - 失效判断 - 错误:'.$e->getMessage());
DB::rollBack(); DB::rollBack();
} }
} }

View File

@ -66,7 +66,7 @@
<div class="vue-main-title-content">返利设置</div> <div class="vue-main-title-content">返利设置</div>
</div> </div>
<div class="vue-main-form"> <div class="vue-main-form">
<el-form-item label="是否开启消费返利" prop="is_switch"> <el-form-item label="是否开启推广佣金" prop="is_switch">
<div style="line-height:40px"> <div style="line-height:40px">
<el-radio v-model.number="set.is_switch" :label="0">不开启</el-radio> <el-radio v-model.number="set.is_switch" :label="0">不开启</el-radio>
<el-radio v-model.number="set.is_switch" :label="1">开启</el-radio> <el-radio v-model.number="set.is_switch" :label="1">开启</el-radio>

View File

@ -4,7 +4,7 @@ define({
<div class="rebate"> <div class="rebate">
<el-form> <el-form>
<div style="margin:0 auto;width:80%;"> <div style="margin:0 auto;width:80%;">
<el-form-item label="是否参与消费返利" label-width="155px"> <el-form-item label="是否参与推广佣金" label-width="155px">
<el-radio v-model="json.is_open" :label="0">关闭</el-radio> <el-radio v-model="json.is_open" :label="0">关闭</el-radio>
<el-radio v-model="json.is_open" :label="1">开启</el-radio> <el-radio v-model="json.is_open" :label="1">开启</el-radio>
</el-form-item> </el-form-item>