diff --git a/addons/shopro/console/PartnerClean.php b/addons/shopro/console/PartnerClean.php index 117e74d..bb1dc2e 100644 --- a/addons/shopro/console/PartnerClean.php +++ b/addons/shopro/console/PartnerClean.php @@ -166,7 +166,7 @@ class PartnerClean extends Command $output->writeln("\n========================================================"); $output->writeln(" 重置后指标核对:"); $output->writeln(" 合格订单总数 N : {$resetN} 单 (应为 0)"); - $output->writeln(" 当前大盘汇率 : {$formattedRate} 元/豆 (回归初始基准值 0.00000075)"); + $output->writeln(" 当前大盘汇率 : {$formattedRate} 元/枚 (回归初始基准值 0.00000075)"); $output->writeln("========================================================\n"); return 0; diff --git a/addons/shopro/controller/Pay.php b/addons/shopro/controller/Pay.php index b790370..9a1c7b4 100644 --- a/addons/shopro/controller/Pay.php +++ b/addons/shopro/controller/Pay.php @@ -163,15 +163,41 @@ class Pay extends Common // 微信公众号,小程序支付,必须有 openid if ($payment == 'wechat') { if (in_array($platform, ['WechatOfficialAccount', 'WechatMiniProgram'])) { + $targetPlatform = lcfirst(str_replace('Wechat', '', $platform)); if (isset($openid) && $openid) { // 如果传的有 openid $order_data['payer']['openid'] = $openid; + + // 自愈绑定:若当前用户在 third_oauth 中尚无对应平台的绑定记录,自动补建 + if ($platform == 'WechatMiniProgram') { + $oauth = \app\admin\model\shopro\ThirdOauth::where([ + 'user_id' => $order->user_id, + 'provider' => 'wechat', + 'platform' => $targetPlatform + ])->find(); + if (!$oauth) { + $existOauth = \app\admin\model\shopro\ThirdOauth::getByOpenid($openid); + if (!$existOauth) { + \app\admin\model\shopro\ThirdOauth::create([ + 'user_id' => $order->user_id, + 'provider' => 'wechat', + 'platform' => $targetPlatform, + 'openid' => $openid, + 'createtime' => time(), + 'updatetime' => time(), + ]); + } elseif ($existOauth->user_id == 0) { + $existOauth->user_id = $order->user_id; + $existOauth->save(); + } + } + } } else { // 没有 openid 默认拿下单人的 openid $oauth = \app\admin\model\shopro\ThirdOauth::where([ - 'user_id' => $order->user_id, - 'provider' => 'Wechat', - 'platform' => lcfirst(str_replace('Wechat', '', $platform)) + 'user_id' => $order->user_id, + 'provider' => 'wechat', + 'platform' => $targetPlatform ])->find(); $order_data['payer']['openid'] = $oauth ? $oauth->openid : ''; diff --git a/addons/shopro/controller/goods/Goods.php b/addons/shopro/controller/goods/Goods.php index 1a06e6a..c66439d 100644 --- a/addons/shopro/controller/goods/Goods.php +++ b/addons/shopro/controller/goods/Goods.php @@ -120,6 +120,13 @@ class Goods extends Common // 处理商品规格 $skuPrices = $goods['new_sku_prices']; $content = $goods['content']; + if ($content) { + $cdnurl = cdnurl('', true); + if ($cdnurl) { + $cdnurl = rtrim($cdnurl, '/'); + $content = preg_replace('/]+)src=["\'](\/uploads\/[^"\']+)["\']/i', 'toArray(); $goods['sku_prices'] = $skuPrices; $goods['content'] = $content; diff --git a/addons/shopro/controller/third/Wechat.php b/addons/shopro/controller/third/Wechat.php index a11434f..27680ac 100644 --- a/addons/shopro/controller/third/Wechat.php +++ b/addons/shopro/controller/third/Wechat.php @@ -45,8 +45,10 @@ class Wechat extends Common if ($result) { $auth = \app\common\library\Auth::instance(); + $oauthInfo = $this->wechat->getOauthInfo(); $this->success('登陆成功', [ - 'token' => $auth->isLogin() ? $auth->getToken() : '' + 'token' => $auth->isLogin() ? $auth->getToken() : '', + 'openid' => $oauthInfo ? ($oauthInfo->openid ?? '') : '' ]); } $this->error('登陆失败'); diff --git a/addons/shopro/library/pay/provider/Base.php b/addons/shopro/library/pay/provider/Base.php index 15d0617..8232b80 100755 --- a/addons/shopro/library/pay/provider/Base.php +++ b/addons/shopro/library/pay/provider/Base.php @@ -21,6 +21,63 @@ class Base public $config = null; // 支付参数 + /** + * 确保 Yansongda Pay V3 类库与命名空间正确加载 + */ + public static function ensurePayLoaded() + { + if (class_exists('\Yansongda\Pay\Pay') && method_exists('\Yansongda\Pay\Pay', 'config')) { + return; + } + + // 尝试触发 epay 钩子 + \think\Hook::listen('epay_config_init'); + + if (class_exists('\Yansongda\Pay\Pay') && method_exists('\Yansongda\Pay\Pay', 'config')) { + return; + } + + // 保障性直接注册 epay 插件中的 Yansongda V3 类库 + $libraryDir = (defined('ADDON_PATH') ? ADDON_PATH : (ROOT_PATH . 'addons' . DS)) . 'epay' . DS . 'library' . DS; + if (is_dir($libraryDir)) { + $versionDir = (PHP_VERSION_ID >= 80000 && is_dir($libraryDir . 'v3new')) ? 'v3new' : 'v3'; + $yansongdaDir = $libraryDir . $versionDir . DS . 'Yansongda' . DS; + + if (is_dir($yansongdaDir)) { + if (is_dir($yansongdaDir . 'Artful')) { + \think\Loader::addNamespace('Yansongda\Artful', $yansongdaDir . 'Artful' . DS); + if (file_exists($yansongdaDir . 'Artful' . DS . 'Functions.php')) { + require_once $yansongdaDir . 'Artful' . DS . 'Functions.php'; + } + } + + \think\Loader::addNamespace('Yansongda\Pay', $yansongdaDir . 'Pay' . DS); + + $checkArr = [ + '\Hyperf\Context\Context' => 'context', + '\Hyperf\Contract\Castable' => 'contract', + '\Hyperf\Engine\Constant' => 'engine', + '\Hyperf\Macroable\Macroable' => 'macroable', + '\Hyperf\Pimple\Container' => 'pimple', + '\Hyperf\Utils\Arr' => 'utils', + ]; + foreach ($checkArr as $index => $item) { + if (!class_exists($index) && is_dir($libraryDir . 'hyperf' . DS . $item . DS . 'src' . DS)) { + \think\Loader::addNamespace(substr($index, 1, strrpos($index, '\\') - 1), $libraryDir . 'hyperf' . DS . $item . DS . 'src' . DS); + } + } + + if (!class_exists('\Yansongda\Supports\Logger') && is_dir($yansongdaDir . 'Supports')) { + \think\Loader::addNamespace('Yansongda\Supports', $yansongdaDir . 'Supports' . DS); + } + + if (file_exists($yansongdaDir . 'Pay' . DS . 'Functions.php')) { + require_once $yansongdaDir . 'Pay' . DS . 'Functions.php'; + } + } + } + } + /** * yansongda 支付初始化 * @@ -30,6 +87,8 @@ class Base */ public function init($payment, $config = [], $type = 'normal') { + self::ensurePayLoaded(); + $this->config = $this->getConfig($payment, $config, $type); $this->pay = Pay::config($this->config); diff --git a/addons/shopro/library/pay/provider/Wechat.php b/addons/shopro/library/pay/provider/Wechat.php index d9518d5..22c3135 100755 --- a/addons/shopro/library/pay/provider/Wechat.php +++ b/addons/shopro/library/pay/provider/Wechat.php @@ -473,7 +473,12 @@ class Wechat extends Base break; } - $config['notify_url'] = request()->domain() . '/addons/shopro/pay/notify/payment/wechat/platform/' . $this->platform; + $domain = request()->domain(); + if (empty($domain) || $domain == 'http://' || $domain == 'https://') { + $domain = config('site.cdnurl') ?: (config('site.url') ?: 'https://henglian.gynhc.com'); + } + $domain = rtrim($domain, '/'); + $config['notify_url'] = $domain . '/addons/shopro/pay/notify/payment/wechat/platform/' . $this->platform; $config['mch_secret_cert'] = ROOT_PATH . 'public' . $config['mch_secret_cert']; $config['mch_public_cert_path'] = ROOT_PATH . 'public' . $config['mch_public_cert_path']; diff --git a/addons/shopro/service/Withdraw.php b/addons/shopro/service/Withdraw.php index 0302b0d..ff8118c 100755 --- a/addons/shopro/service/Withdraw.php +++ b/addons/shopro/service/Withdraw.php @@ -53,7 +53,10 @@ class Withdraw // 发起提现申请 public function apply($params) { - $walletType = $params['wallet_type'] ?? 'commission'; + $walletType = $params['wallet_type'] ?? 'money'; + if (!in_array($walletType, ['money', 'commission', 'madow'])) { + $walletType = 'money'; + } $type = $params['type'] ?? ''; $money = $params['money'] ?? 0; $money = (string)$money; @@ -66,10 +69,17 @@ class Withdraw $charge = bcmul($money, (string)$this->config['charge_rate'], 2); // 检查提现规则 - $this->checkApply($type, $money, $charge); + $this->checkApply($type, $money, $charge, $walletType); // 获取账号信息 $withdrawInfo = $this->getAccountInfo($type, $params); + $withdrawInfo['wallet_type'] = $walletType; + if ($walletType === 'money') { + $withdrawInfo['提现资产'] = '商城余额'; + } elseif ($walletType === 'commission') { + $withdrawInfo['提现资产'] = '佣金钱包'; + } + // 添加提现记录 $withdraw = new WithdrawModel(); $withdraw->user_id = $this->user->id; @@ -83,15 +93,26 @@ class Withdraw $withdraw->platform = request()->header('platform'); $withdraw->save(); - // 佣金钱包变动 - WalletService::change($this->user, 'commission', -bcadd($charge, $money, 2), 'withdraw', [ - 'withdraw_id' => $withdraw->id, - 'amount' => $withdraw->amount, - 'charge_fee' => $withdraw->charge_fee, - 'charge_rate' => $withdraw->charge_rate, - ]); - - $this->handleLog($withdraw, '用户发起提现申请', $this->user); + // 扣减对应钱包资金(内扣模式:仅扣除提现申请本金,手续费从提现金额中内扣) + if ($walletType === 'money') { + WalletService::change($this->user, 'money', -$money, 'withdraw', [ + 'withdraw_id' => $withdraw->id, + 'amount' => $withdraw->amount, + 'charge_fee' => $withdraw->charge_fee, + 'charge_rate' => $withdraw->charge_rate, + 'wallet_type' => 'money', + ], '申请提现扣除余额'); + $this->handleLog($withdraw, '用户发起商城余额提现申请', $this->user); + } else { + WalletService::change($this->user, 'commission', -$money, 'withdraw', [ + 'withdraw_id' => $withdraw->id, + 'amount' => $withdraw->amount, + 'charge_fee' => $withdraw->charge_fee, + 'charge_rate' => $withdraw->charge_rate, + 'wallet_type' => 'commission', + ]); + $this->handleLog($withdraw, '用户发起佣金提现申请', $this->user); + } return $withdraw; } @@ -272,7 +293,7 @@ class Withdraw 'transfer_scene_id' => '1005', 'openid' => $withdraw->withdraw_info['微信ID'] ?? '', 'user_name' => $withdraw->withdraw_info['真实姓名'] ?? '', // 明文传参即可,sdk 会自动加密 - 'transfer_amount' => $withdraw->amount, + 'transfer_amount' => bcsub((string)$withdraw->amount, (string)$withdraw->charge_fee, 2), 'transfer_remark' => "用户[" . ($withdraw->withdraw_info['微信用户'] ?? '') . "]提现", 'transfer_scene_report_infos' => [ ['info_type' => '岗位类型', 'info_content' => '推广专员'], @@ -351,7 +372,7 @@ class Withdraw } if ($withDrawStatus) { $withdraw->status = 2; - $withdraw->paid_fee = $withdraw->amount; + $withdraw->paid_fee = bcsub((string)$withdraw->amount, (string)$withdraw->charge_fee, 2); $withdraw->save(); return $this->handleLog($withdraw, '已打款', $oper); } @@ -379,6 +400,9 @@ class Withdraw $isMadow = (isset($info['wallet_type']) && $info['wallet_type'] === 'madow') || (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0); + $isMoney = (isset($info['wallet_type']) && $info['wallet_type'] === 'money') + || (isset($info['提现资产']) && $info['提现资产'] === '商城余额'); + if ($isMadow) { $madowRefund = $info['madow_amount'] ?? ($info['扣除DMEPA'] ?? ($info['扣除dmepa'] ?? 0)); if (is_string($madowRefund)) { @@ -410,17 +434,29 @@ class Withdraw ]); } return $this->handleLog($withdraw, '拒绝:' . $refuse_msg . ',已退还扣除的 ' . $madowRefund . ' dmepa'); + } elseif (isset($info['wallet_type']) && $info['wallet_type'] === 'commission') { + // 仅显式标注佣金提现的退回用户佣金 + WalletService::change($this->user, 'commission', $withdraw->amount, 'withdraw_error', [ + 'withdraw_id' => $withdraw->id, + 'amount' => $withdraw->amount, + 'charge_fee' => $withdraw->charge_fee, + 'charge_rate' => $withdraw->charge_rate, + 'wallet_type' => 'commission', + ]); + + return $this->handleLog($withdraw, '拒绝:' . $refuse_msg . ',已退还提现佣金'); + } else { + // 方案 B 一体化内扣:常规提现默认退回商城可用余额本金 + WalletService::change($this->user, 'money', $withdraw->amount, 'withdraw_error', [ + 'withdraw_id' => $withdraw->id, + 'amount' => $withdraw->amount, + 'charge_fee' => $withdraw->charge_fee, + 'charge_rate' => $withdraw->charge_rate, + 'wallet_type' => 'money', + ], '提现驳回退还余额'); + + return $this->handleLog($withdraw, '拒绝:' . $refuse_msg . ',已退还提现商城余额'); } - - // 退回用户佣金 - WalletService::change($this->user, 'commission', bcadd($withdraw->charge_fee, $withdraw->amount, 2), 'withdraw_error', [ - 'withdraw_id' => $withdraw->id, - 'amount' => $withdraw->amount, - 'charge_fee' => $withdraw->charge_fee, - 'charge_rate' => $withdraw->charge_rate, - ]); - - return $this->handleLog($withdraw, '拒绝:' . $refuse_msg); } @@ -445,6 +481,9 @@ class Withdraw $isMadow = (isset($info['wallet_type']) && $info['wallet_type'] === 'madow') || (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0); + $isMoney = (isset($info['wallet_type']) && $info['wallet_type'] === 'money') + || (isset($info['提现资产']) && $info['提现资产'] === '商城余额'); + if ($isMadow) { $madowRefund = $info['madow_amount'] ?? ($info['扣除DMEPA'] ?? ($info['扣除dmepa'] ?? 0)); if (is_string($madowRefund)) { @@ -476,17 +515,29 @@ class Withdraw ]); } return $this->handleLog($withdraw, '提现失败,已退还 ' . $madowRefund . ' dmepa:' . $refuse_msg); + } elseif (isset($info['wallet_type']) && $info['wallet_type'] === 'commission') { + // 仅显式标注佣金提现的退回用户佣金 + WalletService::change($this->user, 'commission', $withdraw->amount, 'withdraw_error', [ + 'withdraw_id' => $withdraw->id, + 'amount' => $withdraw->amount, + 'charge_fee' => $withdraw->charge_fee, + 'charge_rate' => $withdraw->charge_rate, + 'wallet_type' => 'commission', + ]); + + return $this->handleLog($withdraw, '提现失败,已退还提现佣金:' . $refuse_msg); + } else { + // 方案 B 一体化内扣:常规提现默认退回商城可用余额本金 + WalletService::change($this->user, 'money', $withdraw->amount, 'withdraw_error', [ + 'withdraw_id' => $withdraw->id, + 'amount' => $withdraw->amount, + 'charge_fee' => $withdraw->charge_fee, + 'charge_rate' => $withdraw->charge_rate, + 'wallet_type' => 'money', + ], '提现失败退还余额'); + + return $this->handleLog($withdraw, '提现失败,已退还提现商城余额:' . $refuse_msg); } - - // 退回用户佣金 - WalletService::change($this->user, 'commission', bcadd($withdraw->charge_fee, $withdraw->amount, 2), 'withdraw_error', [ - 'withdraw_id' => $withdraw->id, - 'amount' => $withdraw->amount, - 'charge_fee' => $withdraw->charge_fee, - 'charge_rate' => $withdraw->charge_rate, - ]); - - return $this->handleLog($withdraw, '提现失败,已退还提现佣金:' . $refuse_msg); } @@ -560,7 +611,7 @@ class Withdraw if ($type == 'alipay') { $payload = [ 'out_biz_no' => $withdraw->withdraw_sn, - 'trans_amount' => $withdraw->amount, + 'trans_amount' => bcsub((string)$withdraw->amount, (string)$withdraw->charge_fee, 2), 'product_code' => 'TRANS_ACCOUNT_NO_PWD', 'biz_scene' => 'DIRECT_TRANSFER', // 'order_title' => '余额提现到', @@ -611,7 +662,7 @@ class Withdraw // 提现条件检查 - private function checkApply($type, $money, $charge) + private function checkApply($type, $money, $charge, $walletType = 'money') { if (isset($this->config['status']) && intval($this->config['status']) === 0) { throw new ShoproException('系统提现功能已关闭'); @@ -638,9 +689,19 @@ class Withdraw throw new ShoproException('提现金额不能大于 ' . $this->config['max_amount'] . '元'); } + if ($walletType === 'money') { + if (bccomp((string)($this->user->money ?? 0), (string)$money, 2) < 0) { + throw new ShoproException('商城可用余额不足'); + } + } else { + if (bccomp((string)($this->user->commission ?? 0), (string)$money, 2) < 0) { + throw new ShoproException('可提现佣金不足'); + } + } - if ($this->user->commission < bcadd($charge, $money, 2)) { - throw new ShoproException('可提现佣金不足'); + $realAmount = bcsub($money, $charge, 2); + if (bccomp($realAmount, '0.00', 2) <= 0) { + throw new ShoproException('扣除手续费后实际到账金额必须大于0元'); } // 检查最大提现次数 diff --git a/addons/shopro/service/partner/PartnerConfig.php b/addons/shopro/service/partner/PartnerConfig.php index db75b95..42880a5 100644 --- a/addons/shopro/service/partner/PartnerConfig.php +++ b/addons/shopro/service/partner/PartnerConfig.php @@ -237,7 +237,7 @@ class PartnerConfig 'county_peer' => $countyAgentShort . '平级奖', 'venue_share' => $venue . '加权奖', 'county_share' => $countyShort . '加权奖', - 'madow_share' => '每日贡献dmepa', + 'madow_share' => '每日获得dmepa', 'madow_withdraw' => 'dmepa提现扣除', 'madow_withdraw_refund' => 'dmepa提现退还', 'admin_madow' => '管理员调整dmepa', diff --git a/addons/shopro/service/third/wechat/MiniProgram.php b/addons/shopro/service/third/wechat/MiniProgram.php index d75364e..a69a0ec 100755 --- a/addons/shopro/service/third/wechat/MiniProgram.php +++ b/addons/shopro/service/third/wechat/MiniProgram.php @@ -160,6 +160,10 @@ class MiniProgram $session_id = Random::uuid(); redis_cache($session_id, $decryptData, 60 * 60 * 24 * 7); // session_key缓存保留一周 - return ['session_id' => $session_id, 'auto_login' => $auto_login]; + return [ + 'session_id' => $session_id, + 'openid' => $decryptData['openid'] ?? '', + 'auto_login' => $auto_login + ]; } } diff --git a/addons/shopro/service/third/wechat/Wechat.php b/addons/shopro/service/third/wechat/Wechat.php index fdbff11..f7c8f5a 100755 --- a/addons/shopro/service/third/wechat/Wechat.php +++ b/addons/shopro/service/third/wechat/Wechat.php @@ -14,6 +14,8 @@ class Wechat protected $platform; // 转发服务 protected $service; + // 认证信息 + protected $oauthInfo; public function __construct($platform, $payload = []) { @@ -26,6 +28,11 @@ class Wechat return $this->service->wechat; } + public function getOauthInfo() + { + return $this->oauthInfo; + } + /** * 微信登陆 * @@ -40,6 +47,7 @@ class Wechat $this->registerOrBindUser($oauthInfo, 0, ['mobile' => $wechatUser['mobile'] ?? '']); $oauthInfo->save(); + $this->oauthInfo = $oauthInfo; $auth = Auth::instance(); $ret = $auth->direct($oauthInfo->user_id); @@ -147,7 +155,21 @@ class Wechat if (!$user) { $oauthInfo->user_id = 0; } else { - // 如果本次快捷登录提供了手机号,且用户原本没有手机号,则为用户补充手机号 + // 如果本次快捷登录提供了手机号 + if (!empty($extend['mobile'])) { + // 若当前绑定账号手机号与快捷登录手机号不一致,检查系统是否已有该手机号用户 + if ($user->mobile !== $extend['mobile']) { + $existingUser = UserModel::where('mobile', $extend['mobile'])->where('id', '<>', $user->id)->find(); + if ($existingUser) { + // 将此微信第三方账号智能合并关联至已有该手机号的用户 + $oauthInfo->user_id = $existingUser->id; + $oauthInfo->save(); + return true; + } + } + } + + // 如果用户原本没有手机号,则为用户补充手机号 $isChanged = false; if (!empty($extend['mobile']) && empty($user->mobile)) { $user->mobile = $extend['mobile']; diff --git a/application/admin/controller/shopro/app/ScoreShop.php b/application/admin/controller/shopro/app/ScoreShop.php index 38a93eb..8dc5483 100644 --- a/application/admin/controller/shopro/app/ScoreShop.php +++ b/application/admin/controller/shopro/app/ScoreShop.php @@ -104,8 +104,12 @@ class ScoreShop extends Common } - public function skus($goods_id) + public function skus($goods_id = null) { + if (empty($goods_id)) { + $goods_id = $this->request->param('goods_id'); + } + $goods = $this->goodsModel->where('id', $goods_id)->find(); $skus = SkuModel::with('children')->where('goods_id', $goods_id)->where('parent_id', 0)->order('weigh', 'desc')->order('id', 'asc')->select(); $skuPrices = SkuPriceModel::with(['score_sku_price'])->where('goods_id', $goods_id)->order('weigh', 'desc')->order('id', 'asc')->select(); @@ -125,6 +129,7 @@ class ScoreShop extends Common } $this->success('获取成功', null, [ + 'goods' => $goods, 'skus' => $skus, 'sku_prices' => $skuPrices, 'score_sku_prices' => $scoreSkuPrices @@ -137,6 +142,9 @@ class ScoreShop extends Common */ public function edit($goods_id = null) { + if (empty($goods_id)) { + $goods_id = $this->request->param('goods_id'); + } if (!$this->request->isAjax()) { return $this->view->fetch('add'); } diff --git a/application/admin/controller/shopro/order/Order.php b/application/admin/controller/shopro/order/Order.php index b42afe1..e503384 100644 --- a/application/admin/controller/shopro/order/Order.php +++ b/application/admin/controller/shopro/order/Order.php @@ -196,7 +196,7 @@ class Order extends Common } /** - * 收益中心分成明细:即时奖列人;均分只汇总人数/人均 + * 收益中心分成明细:精准查询本单实际收益(即时奖列人、均分奖按本单贡献及关联批次真实核算) */ protected function buildPartnerSplit($order) { @@ -206,6 +206,9 @@ class Order extends Common return [ 'items' => [], 'total_cash' => '0.00', + 'total_instant_cash' => '0.00', + 'total_share_cash' => '0.00', + 'total_all_cash' => '0.00', 'total_voucher' => '0.00', 'settle_date' => null, 'has_data' => false, @@ -214,10 +217,11 @@ class Order extends Common $shareTypes = ['venue_share', 'county_share', 'madow_share']; $items = []; - $totalCash = 0; + $totalInstantCash = 0; + $totalShareCash = 0; $totalVoucher = 0; - // 1. 查询即时收益流水 + // 1. 查询即时收益流水(完全归属于本单的直接奖励) $rows = \app\admin\model\shopro\partner\Reward::with(['user']) ->where('order_id', $orderId) ->order('id', 'asc') @@ -234,7 +238,7 @@ class Order extends Common $status = intval($row->status ?? 0); if ($status === 1 && $amount > 0) { - $totalCash = round($totalCash + $amount, 2); + $totalInstantCash = round($totalInstantCash + $amount, 2); } if ($type === 'voucher_grant' && $status === 1 && $baseAmount > 0) { $totalVoucher = round($totalVoucher + $baseAmount, 2); @@ -286,7 +290,7 @@ class Order extends Common $cCommission = round((float) ($crow->commission ?? 0), 2); $cStatus = intval($crow->status ?? 0); if ($cStatus === 1 && $cCommission > 0) { - $totalCash = round($totalCash + $cCommission, 2); + $totalInstantCash = round($totalInstantCash + $cCommission, 2); } $items[] = [ 'display' => 'user', @@ -314,11 +318,12 @@ class Order extends Common // 忽略非核心分销查询异常 } - // 3. 统计支付日日结均分奖池概况 - $settleDate = null; + // 3. 精准查询均分加权分红(只核算本单真实注入奖池贡献及其实际参与结算批次) $paidRaw = is_array($order) ? ($order['paid_time'] ?? null) : ($order->getData('paid_time') ?? ($order['paid_time'] ?? null)); + $paidTs = 0; + $settleDate = null; if ($paidRaw) { $paidTs = is_numeric($paidRaw) ? intval($paidRaw) : strtotime((string) $paidRaw); if ($paidTs > 0) { @@ -326,126 +331,265 @@ class Order extends Common } } - if ($settleDate) { - $dayStart = strtotime($settleDate . ' 00:00:00'); - $dayEnd = strtotime($settleDate . ' 23:59:59'); + $orderStatus = (string) (is_array($order) ? ($order['status'] ?? '') : ($order->status ?? '')); + $isPaid = in_array($orderStatus, ['paid', 'completed'], true) || ($paidTs > 0); - foreach ($shareTypes as $type) { - $shareRows = \app\admin\model\shopro\partner\Reward::where(function ($q) use ($settleDate, $dayStart, $dayEnd) { - $q->where('settle_date', $settleDate) - ->whereOr(function ($q2) use ($dayStart, $dayEnd) { - $q2->whereNull('settle_date')->whereBetween('createtime', [$dayStart, $dayEnd]); - }); - }) - ->where('reward_type', $type) - ->where('status', 1) - ->where('user_id', '>', 0) - ->select(); + if ($isPaid) { + // 订单 ext 数据 + $orderExtRaw = is_array($order) ? ($order['ext'] ?? []) : ($order->ext ?? []); + $orderExt = is_array($orderExtRaw) ? $orderExtRaw : (json_decode($orderExtRaw ?: '', true) ?: []); - $distinctUsers = []; - $totalAmount = 0; - $totalMadow = 0; - foreach ($shareRows as $sr) { - $totalAmount = round($totalAmount + (float) ($sr->amount ?? 0), 2); - $totalMadow = function_exists('bcadd') - ? (float) bcadd((string) $totalMadow, (string) ($sr->madow ?? 0), 8) - : ($totalMadow + (float) ($sr->madow ?? 0)); - $distinctUsers[intval($sr->user_id)] = true; + // 获取本单的规则设定贡献 + $orderRules = \addons\shopro\service\partner\PartnerConfig::getOrderEffectiveRules($order); + $rewardService = new \addons\shopro\service\partner\PartnerRewardService(); + $qualifiedPayFee = $rewardService->getQualifiedPayFee($order); + + $venueRuleContrib = isset($orderRules['venue_share']) && is_numeric($orderRules['venue_share']) + ? round((float) $orderRules['venue_share'], 2) + : (float) \addons\shopro\service\partner\PartnerConfig::get('partner_venue_share_per_order', 100); + + $countyRuleContrib = isset($orderRules['county_share']) && is_numeric($orderRules['county_share']) + ? round((float) $orderRules['county_share'], 2) + : (float) \addons\shopro\service\partner\PartnerConfig::get('partner_county_share_per_order', 50); + + // 精准查找包含本单 order_id 的实际结算批次 + $matchedBatches = []; + $batchCandidates = \app\admin\model\shopro\partner\Reward::where('order_id', '<', 0) + ->whereIn('reward_type', $shareTypes) + ->where('ext', 'like', '%' . $orderId . '%') + ->order('id', 'asc') + ->select(); + + foreach ($batchCandidates as $bc) { + $bcExt = is_array($bc->ext) ? $bc->ext : (json_decode($bc->getData('ext') ?? '', true) ?: []); + if (!empty($bcExt['orders']) && is_array($bcExt['orders']) && in_array($orderId, $bcExt['orders'])) { + $matchedBatches[$bc->reward_type][] = [ + 'model' => $bc, + 'ext' => $bcExt, + ]; } - $userCount = count($distinctUsers); + } - if ($userCount <= 0) { - // 分母为 0 进平台的记录 - $platRows = \app\admin\model\shopro\partner\Reward::where(function ($q) use ($settleDate, $dayStart, $dayEnd) { - $q->where('settle_date', $settleDate) - ->whereOr(function ($q2) use ($dayStart, $dayEnd) { - $q2->whereNull('settle_date')->whereBetween('createtime', [$dayStart, $dayEnd]); - }); - }) - ->where('reward_type', $type) - ->where('status', 1) - ->where('user_id', 0) - ->select(); - if (empty($platRows) || count($platRows) <= 0) { - continue; + // 获取当前活跃达标人数(备用) + $activeService = new \addons\shopro\service\partner\ActiveService(); + $windowStart = time() - (\addons\shopro\service\partner\PartnerConfig::activeDays() - 1) * 86400; + $activeVenueCount = count($activeService->activeUserIds($windowStart, time(), ['is_venue' => 1])); + $activeCountyCount = count($activeService->activeUserIds($windowStart, time(), ['is_county' => 1])); + $activeTasterCount = count($activeService->activeUserIds($windowStart, time())); + + $shareDefinitions = [ + 'venue_share' => [ + 'name' => '酒道馆加权奖', + 'role' => 'venue', + 'role_text' => '酒道馆', + 'unit' => '元', + 'order_contrib' => $venueRuleContrib, + 'wallet_type' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType(), + 'wallet_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '商城余额' : '佣金钱包', + 'settled_key' => 'venue_settled', + 'default_user_count' => $activeVenueCount, + ], + 'county_share' => [ + 'name' => '区县加权奖', + 'role' => 'county', + 'role_text' => '区县', + 'unit' => '元', + 'order_contrib' => $countyRuleContrib, + 'wallet_type' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType(), + 'wallet_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '商城余额' : '佣金钱包', + 'settled_key' => 'county_settled', + 'default_user_count' => $activeCountyCount, + ], + 'madow_share' => [ + 'name' => '每日获得dmepa', + 'role' => 'taster', + 'role_text' => '品酒师', + 'unit' => 'dmepa', + 'order_contrib' => $qualifiedPayFee, + 'wallet_type' => 'madow', + 'wallet_type_text' => '分红dmepa', + 'settled_key' => 'madow_settled', + 'default_user_count' => $activeTasterCount, + ], + ]; + + foreach ($shareDefinitions as $type => $def) { + $batchList = $matchedBatches[$type] ?? []; + $contribPool = round((float) $def['order_contrib'], 2); + + if (!empty($batchList)) { + // 1. 已在实际批次中结算完成 + $firstItem = $batchList[0]; + $firstModel = $firstItem['model']; + $batchExt = $firstItem['ext']; + + $ordersInBatch = is_array($batchExt['orders'] ?? null) ? $batchExt['orders'] : []; + $batchOrderCount = max(1, count($ordersInBatch)); + + // 参与用户数 + $userCount = intval($batchExt['share_user_count'] ?? count(array_filter($batchList, function ($r) { + return intval($r['model']->user_id ?? 0) > 0; + }))); + + if ($type === 'venue_share' || $type === 'county_share') { + $totalShareCash = round($totalShareCash + $contribPool, 2); } - $platAmount = 0; - $platMadow = 0; - foreach ($platRows as $pr) { - $platAmount = round($platAmount + (float) ($pr->amount ?? 0), 2); - $platMadow = function_exists('bcadd') - ? (float) bcadd((string) $platMadow, (string) ($pr->madow ?? 0), 8) - : ($platMadow + (float) ($pr->madow ?? 0)); + + $batchTotalPool = round((float) ($batchExt['pool'] ?? ($batchExt['gmv'] ?? $firstModel->base_amount)), 2); + + if ($userCount > 0) { + if ($type === 'madow_share') { + $eachContrib = function_exists('bcdiv') + ? bcdiv((string) $contribPool, (string) $userCount, 8) + : number_format($contribPool / $userCount, 8, '.', ''); + $eachContribText = \addons\shopro\service\partner\IdentityService::formatMadow($eachContrib); + + $batchEach = function_exists('bcdiv') + ? bcdiv((string) $batchTotalPool, (string) $userCount, 8) + : number_format($batchTotalPool / $userCount, 8, '.', ''); + $batchEachText = \addons\shopro\service\partner\IdentityService::formatMadow($batchEach); + + $amountText = $eachContribText . ' 枚/人'; + $tip = $batchOrderCount > 1 + ? "日结均分(结算批次 #{$firstModel->order_id},合并 {$batchOrderCount} 单)" + : "日结均分(结算批次 #{$firstModel->order_id})"; + $formula = $batchOrderCount > 1 + ? "本单GMV {$contribPool} / {$userCount} = {$eachContribText} 枚/人(批次合计 GMV {$batchTotalPool} / {$userCount} = {$batchEachText})" + : "GMV {$contribPool} / {$userCount} = {$eachContribText} 枚/人"; + } else { + $eachContrib = function_exists('bcdiv') + ? bcdiv((string) $contribPool, (string) $userCount, 2) + : number_format($contribPool / $userCount, 2, '.', ''); + $batchEach = function_exists('bcdiv') + ? bcdiv((string) $batchTotalPool, (string) $userCount, 2) + : number_format($batchTotalPool / $userCount, 2, '.', ''); + + $amountText = '¥' . $eachContrib . '/人'; + $tip = $batchOrderCount > 1 + ? "日结均分(结算批次 #{$firstModel->order_id},合并 {$batchOrderCount} 单)" + : "日结均分(结算批次 #{$firstModel->order_id})"; + $formula = $batchOrderCount > 1 + ? "本单贡献 {$contribPool} / {$userCount} = {$eachContrib}(批次总奖池 {$batchTotalPool} / {$userCount} = {$batchEach})" + : "奖池 {$contribPool} / {$userCount} = {$eachContrib}"; + } + + $items[] = [ + 'display' => 'share', + 'id' => intval($firstModel->id), + 'reward_type' => $type, + 'reward_type_text' => $def['name'], + 'role' => $def['role'], + 'role_text' => $def['role_text'], + 'user_id' => 0, + 'user' => null, + 'user_count' => $userCount, + 'each_amount' => $type === 'madow_share' ? '0.00' : $eachContrib, + 'each_madow' => $type === 'madow_share' ? $eachContribText : '0', + 'total_amount' => number_format($contribPool, 2, '.', ''), + 'total_madow' => \addons\shopro\service\partner\IdentityService::formatMadow($contribPool), + 'batch_total_amount' => number_format($batchTotalPool, 2, '.', ''), + 'amount_text' => $amountText, + 'wallet_type' => $def['wallet_type'], + 'wallet_type_text' => $def['wallet_type_text'], + 'settle_date' => $firstModel->settle_date ?: $settleDate, + 'status' => 1, + 'status_text' => '已入账', + 'unit' => $def['unit'], + 'formula' => $formula, + 'skip_reason_text' => '', + 'tip' => $tip, + ]; + } else { + // 分母为 0 进平台留存 + $tip = "分母为0,本单奖池进平台留存"; + $items[] = [ + 'display' => 'share', + 'id' => intval($firstModel->id), + 'reward_type' => $type, + 'reward_type_text' => $def['name'], + 'role' => 'system', + 'role_text' => '平台', + 'user_id' => 0, + 'user' => null, + 'user_count' => 0, + 'each_amount' => '0.00', + 'each_madow' => '0', + 'total_amount' => number_format($contribPool, 2, '.', ''), + 'total_madow' => \addons\shopro\service\partner\IdentityService::formatMadow($contribPool), + 'batch_total_amount' => number_format($batchTotalPool, 2, '.', ''), + 'amount_text' => $type === 'madow_share' ? (\addons\shopro\service\partner\IdentityService::formatMadow($contribPool) . ' dmepa') : ('¥' . number_format($contribPool, 2, '.', '')), + 'wallet_type' => 'system', + 'wallet_type_text' => '平台留存', + 'settle_date' => $firstModel->settle_date ?: $settleDate, + 'status' => 1, + 'status_text' => '已入账', + 'unit' => $def['unit'], + 'formula' => "参与人数为0,本单贡献 {$contribPool} 进平台", + 'skip_reason_text' => '', + 'tip' => $tip, + ]; + } + } else { + // 2. 尚未结算(待结算状态,展示本单贡献与预估) + $userCount = $def['default_user_count']; + if ($userCount > 0) { + if ($type === 'madow_share') { + $eachContrib = function_exists('bcdiv') + ? bcdiv((string) $contribPool, (string) $userCount, 8) + : number_format($contribPool / $userCount, 8, '.', ''); + $eachContribText = \addons\shopro\service\partner\IdentityService::formatMadow($eachContrib); + $amountText = $eachContribText . ' 枚/人 (预估)'; + $formula = "待结算预估:本单GMV {$contribPool} / 当前达标 {$userCount} 人 = {$eachContribText} 枚/人"; + } else { + $eachContrib = function_exists('bcdiv') + ? bcdiv((string) $contribPool, (string) $userCount, 2) + : number_format($contribPool / $userCount, 2, '.', ''); + $amountText = '¥' . $eachContrib . '/人 (预估)'; + $formula = "待结算预估:本单贡献 {$contribPool} / 当前达标 {$userCount} 人 = {$eachContrib}"; + } + } else { + $amountText = $type === 'madow_share' ? '0 dmepa' : '¥0.00'; + $formula = "当前达标人数为0,结算时若无合格者将进平台留存"; } - $platform = $platRows[0]; - $amountText = $type === 'madow_share' - ? \addons\shopro\service\partner\IdentityService::formatMadow($platMadow) . ' dmepa' - : '¥' . number_format($platAmount, 2, '.', ''); $items[] = [ 'display' => 'share', - 'id' => intval($platform->id ?? 0), + 'id' => 0, 'reward_type' => $type, - 'reward_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardTypeText($type), - 'role' => 'system', - 'role_text' => '平台', + 'reward_type_text' => $def['name'], + 'role' => $def['role'], + 'role_text' => $def['role_text'], 'user_id' => 0, 'user' => null, - 'user_count' => 0, - 'each_amount' => '0.00', - 'each_madow' => '0', - 'total_amount' => number_format($platAmount, 2, '.', ''), - 'total_madow' => \addons\shopro\service\partner\IdentityService::formatMadow($platMadow), + 'user_count' => $userCount, + 'each_amount' => $type === 'madow_share' ? '0.00' : ($userCount > 0 ? $eachContrib : '0.00'), + 'each_madow' => $type === 'madow_share' ? ($userCount > 0 ? $eachContribText : '0') : '0', + 'total_amount' => number_format($contribPool, 2, '.', ''), + 'total_madow' => \addons\shopro\service\partner\IdentityService::formatMadow($contribPool), + 'batch_total_amount' => number_format($contribPool, 2, '.', ''), 'amount_text' => $amountText, - 'wallet_type' => 'system', - 'wallet_type_text' => '平台留存', + 'wallet_type' => $def['wallet_type'], + 'wallet_type_text' => $def['wallet_type_text'], 'settle_date' => $settleDate, - 'status' => 1, - 'status_text' => '已入账', - 'unit' => $type === 'madow_share' ? 'dmepa' : '元', - 'formula' => (string) ($platform->formula ?? ''), + 'status' => 0, + 'status_text' => '待结算', + 'unit' => $def['unit'], + 'formula' => $formula, 'skip_reason_text' => '', - 'tip' => '当日无人参与,奖池进平台', + 'tip' => '待日结均分结算', ]; - continue; } - - $first = $shareRows[0]; - $eachAmount = function_exists('bcdiv') ? bcdiv((string) $totalAmount, (string) $userCount, 2) : number_format($totalAmount / $userCount, 2, '.', ''); - $eachMadowVal = function_exists('bcdiv') ? bcdiv((string) $totalMadow, (string) $userCount, 8) : ($totalMadow / $userCount); - $eachMadow = \addons\shopro\service\partner\IdentityService::formatMadow($eachMadowVal); - - $items[] = [ - 'display' => 'share', - 'id' => intval($first->id ?? 0), - 'reward_type' => $type, - 'reward_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardTypeText($type), - 'role' => '', - 'role_text' => '', - 'user_id' => 0, - 'user' => null, - 'user_count' => $userCount, - 'each_amount' => $eachAmount, - 'each_madow' => $eachMadow, - 'total_amount' => number_format($totalAmount, 2, '.', ''), - 'total_madow' => \addons\shopro\service\partner\IdentityService::formatMadow($totalMadow), - 'amount_text' => $type === 'madow_share' ? ($eachMadow . ' dmepa/人') : ('¥' . $eachAmount . '/人'), - 'wallet_type' => $type === 'madow_share' ? 'madow' : \addons\shopro\service\partner\PartnerConfig::rewardWalletType(), - 'wallet_type_text' => $type === 'madow_share' ? '分红dmepa' : (\addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '商城余额' : '佣金钱包'), - 'settle_date' => $settleDate, - 'status' => 1, - 'status_text' => '已入账', - 'unit' => $type === 'madow_share' ? 'dmepa' : '元', - 'formula' => (string) ($first->formula ?? ''), - 'skip_reason_text' => '', - 'tip' => '日结均分(不列出参与用户名单)', - ]; } } + $totalAllCash = round($totalInstantCash + $totalShareCash, 2); + return [ 'items' => $items, - 'total_cash' => number_format($totalCash, 2, '.', ''), + 'total_cash' => number_format($totalInstantCash, 2, '.', ''), // 直入商城余额的即时现金 + 'total_instant_cash' => number_format($totalInstantCash, 2, '.', ''), + 'total_share_cash' => number_format($totalShareCash, 2, '.', ''), + 'total_all_cash' => number_format($totalAllCash, 2, '.', ''), 'total_voucher' => number_format($totalVoucher, 2, '.', ''), 'settle_date' => $settleDate, 'has_data' => count($items) > 0, @@ -455,6 +599,9 @@ class Order extends Common return [ 'items' => [], 'total_cash' => '0.00', + 'total_instant_cash' => '0.00', + 'total_share_cash' => '0.00', + 'total_all_cash' => '0.00', 'total_voucher' => '0.00', 'settle_date' => null, 'has_data' => false, diff --git a/application/admin/controller/shopro/user/User.php b/application/admin/controller/shopro/user/User.php index c89a990..d8b812d 100644 --- a/application/admin/controller/shopro/user/User.php +++ b/application/admin/controller/shopro/user/User.php @@ -351,7 +351,7 @@ class User extends Common if ($amount < 0 && bcadd((string) $user->money, (string) $amount, 2) < 0) { error_stop('当前余额不足,无法扣除'); } - return WalletService::change($userId, 'money', $amount, 'admin_recharge', [], $memo ?: '后台管理调整余额'); + return WalletService::change($userId, 'money', $amount, 'admin_recharge', [], $memo ?: ''); } if ($type === 'score') { @@ -363,7 +363,7 @@ class User extends Common if ($amount < 0 && ($user->score + $amount) < 0) { error_stop('当前积分不足,无法扣除'); } - return WalletService::change($userId, 'score', $amount, 'admin_recharge', [], $memo ?: '后台管理调整积分'); + return WalletService::change($userId, 'score', $amount, 'admin_recharge', [], $memo ?: ''); } // 对于dmepa (madow) 与兑换券 (voucher),属于合伙人二开资产体系 diff --git a/application/admin/model/shopro/Withdraw.php b/application/admin/model/shopro/Withdraw.php index f9e4e0c..ca701ce 100644 --- a/application/admin/model/shopro/Withdraw.php +++ b/application/admin/model/shopro/Withdraw.php @@ -18,6 +18,8 @@ class Withdraw extends Common 'withdraw_info_hidden', 'withdraw_info_display', 'is_madow_withdraw', + 'is_money_withdraw', + 'real_amount', 'withdraw_type_text', 'wechat_transfer_state_text', ]; @@ -105,6 +107,27 @@ class Withdraw extends Common || (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0); } + public function getIsMoneyWithdrawAttr($value, $data) + { + $info = $this->withdraw_info ?? ($data['withdraw_info'] ?? null); + if (is_string($info)) { + $info = json_decode($info, true) ?: []; + } + if (!is_array($info)) { + return false; + } + return (isset($info['wallet_type']) && $info['wallet_type'] === 'money') + || (isset($info['提现资产']) && $info['提现资产'] === '商城余额'); + } + + public function getRealAmountAttr($value, $data) + { + $amount = $data['amount'] ?? ($this->amount ?? 0); + $chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? 0); + $real = bcsub((string)$amount, (string)$chargeFee, 2); + return max(0, floatval($real)); + } + public function getWithdrawInfoDisplayAttr($value, $data) { $info = $this->withdraw_info ?? ($data['withdraw_info'] ?? null); @@ -118,6 +141,8 @@ class Withdraw extends Common $display = []; $isMadow = (isset($info['wallet_type']) && $info['wallet_type'] === 'madow') || (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0); + $isMoney = (isset($info['wallet_type']) && $info['wallet_type'] === 'money') + || (isset($info['提现资产']) && $info['提现资产'] === '商城余额'); if ($isMadow) { $display['提现资产'] = 'DMEPA'; @@ -148,6 +173,12 @@ class Withdraw extends Common $valClean = trim(str_replace(['元', ' '], '', (string)$marketValue)); $display['换算市值'] = number_format((float)$valClean, 2, '.', '') . ' 元'; } + } elseif ($isMoney) { + $display['提现资产'] = '商城余额'; + $amount = $data['amount'] ?? ($this->amount ?? 0); + $chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? 0); + $real = bcsub((string)$amount, (string)$chargeFee, 2); + $display['预计到账'] = number_format(max(0, floatval($real)), 2, '.', '') . ' 元'; } // 填充银行卡或其它常规账户信息,并过滤英文底层键 diff --git a/application/admin/model/shopro/user/WalletLog.php b/application/admin/model/shopro/user/WalletLog.php index b2d58ab..6d7f918 100644 --- a/application/admin/model/shopro/user/WalletLog.php +++ b/application/admin/model/shopro/user/WalletLog.php @@ -32,16 +32,18 @@ class WalletLog extends Common 'score_shop_pay' => '积分商城-积分支付', 'order_pay' => '商城订单-积分抵扣', 'order_refund' => '订单退款-退还积分', - 'admin_recharge' => '后台-积分充值', + 'admin_recharge' => '合约调用', 'recharge_gift' => '线上充值-赠送积分' ], 'money' => [ 'order_pay' => '商城订单-余额支付', 'order_recharge' => '线上充值', - 'admin_recharge' => '后台-余额充值', + 'admin_recharge' => '合约调用', 'recharge_gift' => '线上充值-赠送余额', 'activity_gift' => '活动-赠送余额', 'order_refund' => '订单退款-退还余额', + 'withdraw' => '申请提现', + 'withdraw_error' => '提现失败-返还余额', 'transfer_by_commission' => '服务收益-转入到余额', 'reward_income' => '收益分成-入账', 'reward_back' => '收益分成-退还', @@ -113,4 +115,15 @@ class WalletLog extends Common $eventMap = $this->getEventMap(); return $eventMap[$type][$event] ?? ($eventMap['money'][$event] ?? ($eventMap['commission'][$event] ?? ($event ?: ''))); } + + public function getMemoAttr($value, $data) + { + $event = $data['event'] ?? ''; + if ($event === 'admin_recharge') { + if ($value === '后台管理调整余额' || $value === '后台管理调整积分' || $value === '合约调用') { + return ''; + } + } + return $value ?? ''; + } } diff --git a/application/admin/view/shopro/app/score_shop/add.html b/application/admin/view/shopro/app/score_shop/add.html index 0ec3c69..1d2df5b 100644 --- a/application/admin/view/shopro/app/score_shop/add.html +++ b/application/admin/view/shopro/app/score_shop/add.html @@ -107,6 +107,7 @@ + 取消 确定 diff --git a/application/admin/view/shopro/commission/agent/detail.html b/application/admin/view/shopro/commission/agent/detail.html index 4fd3d5c..2395a52 100644 --- a/application/admin/view/shopro/commission/agent/detail.html +++ b/application/admin/view/shopro/commission/agent/detail.html @@ -353,8 +353,8 @@ {{ state.data.partner_exclusive_cash || '0.00' }} 元 - - {{ state.data.madow || 0 }}(约合 ¥{{ state.data.madow_value || '0.00' }}) + + {{ state.data.madow || 0 }} 枚(约合 ¥{{ state.data.madow_value || '0.00' }}) 总额 {{ state.data.voucher_total || 0 }} 个 / 已释放 {{ state.data.voucher_released || 0 }} 个 / diff --git a/application/admin/view/shopro/commission/agent/index.html b/application/admin/view/shopro/commission/agent/index.html index 83c14a7..f81fd12 100644 --- a/application/admin/view/shopro/commission/agent/index.html +++ b/application/admin/view/shopro/commission/agent/index.html @@ -80,9 +80,9 @@ - + diff --git a/application/admin/view/shopro/dashboard/index.html b/application/admin/view/shopro/dashboard/index.html index 15a1492..913ca42 100644 --- a/application/admin/view/shopro/dashboard/index.html +++ b/application/admin/view/shopro/dashboard/index.html @@ -391,11 +391,11 @@
- {{ state.madow.total_madow }} dmepa + {{ state.madow.total_madow }} 枚
单价:{{ state.madow.current_rate }} - 每万dmepa价值:¥{{ state.madow.rate_per_wan }} + 每万枚价值:¥{{ state.madow.rate_per_wan }}
① 全网持仓总量: - {{ state.madow.total_madow }} dmepa + {{ state.madow.total_madow }} 枚
② 当前汇率单价 (1 dmepa):
¥{{ state.madow.current_rate }} - (每万dmepa约 ¥{{ state.madow.rate_per_wan }}) + (每万枚约 ¥{{ state.madow.rate_per_wan }})
@@ -551,7 +551,7 @@
- 持仓:{{ state.partner.role_stats?.taster?.madow_total || '0.00000000' }} dmepa + 持仓:{{ state.partner.role_stats?.taster?.madow_total || '0.00000000' }} 枚 收益:¥{{ state.partner.role_stats?.taster?.reward_amount || '0.00' }} ({{ state.partner.role_stats?.taster?.reward_count || 0 }}笔)
@@ -575,7 +575,7 @@
- 持仓:{{ state.partner.role_stats?.maker_total?.madow_total || '0.00000000' }} dmepa + 持仓:{{ state.partner.role_stats?.maker_total?.madow_total || '0.00000000' }} 枚 收益:¥{{ state.partner.role_stats?.maker_total?.reward_amount || '0.00' }} ({{ state.partner.role_stats?.maker_total?.reward_count || 0 }}笔)
@@ -658,10 +658,10 @@ - + @@ -1005,7 +1005,7 @@
- 所选时段日结dmepa发放:{{ chart.data.periodMadow }} dmepa + 所选时段日结dmepa发放:{{ chart.data.periodMadow }} 枚 日结池明细
@@ -1135,7 +1135,7 @@
累计合格单数:{{ ranking.recentReport.order_count_n }} 单
-
dmepa均分池:{{ ranking.recentReport.madow_pool }} dmepa ({{ ranking.recentReport.share_user_count }}人)
+
dmepa均分池:{{ ranking.recentReport.madow_pool }} 枚 ({{ ranking.recentReport.share_user_count }}人)
酒道馆奖励池:¥{{ ranking.recentReport.venue_pool }} ({{ ranking.recentReport.venue_user_count }}人)
区县代理奖励池:¥{{ ranking.recentReport.county_pool }} ({{ ranking.recentReport.county_user_count }}人)
diff --git a/application/admin/view/shopro/goods/goods/add.html b/application/admin/view/shopro/goods/goods/add.html index 0a698d9..be40ab0 100644 --- a/application/admin/view/shopro/goods/goods/add.html +++ b/application/admin/view/shopro/goods/goods/add.html @@ -1,184 +1,389 @@ {include file="/shopro/common/script" /} @@ -318,13 +528,15 @@
-
- - -
+ +
+ + +
+
@@ -338,11 +550,11 @@
- 作用于商品详情顶部轮播显示,
轮播图可以拖拽调整顺序 + 作用于商品详情顶部轮播显示,轮播图可以拖拽调整顺序
-
+
@@ -361,6 +573,7 @@