Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

This commit is contained in:
From-wh 2023-03-02 15:12:06 +08:00
commit f7ab5a681d
10 changed files with 66 additions and 48 deletions

View File

@ -57,7 +57,13 @@ class RefundOrder extends AuthController
/**
* 订单详情
* @param $uni
* @return mixed
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 吴汐
* @email 442384644@qq.com
* @date 2023/03/02
*/
public function getRefundInfo($uni)
{
@ -163,12 +169,12 @@ class RefundOrder extends AuthController
return app('json')->fail(400147);
}
$refund_price = $data['refund_price'];
}
$data['refunded_price'] = bcadd($data['refund_price'], $orderRefund['refunded_price'], 2);
$bj = bccomp((string)$orderRefund['refund_price'], (string)$data['refunded_price'], 2);
if ($bj < 0) {
return app('json')->fail(400148);
}
$data['refunded_price'] = bcadd($data['refund_price'], $orderRefund['refunded_price'], 2);
$bj = bccomp((string)$orderRefund['refund_price'], (string)$data['refunded_price'], 2);
if ($bj < 0) {
return app('json')->fail(400148);
}
unset($data['type']);

View File

@ -36,7 +36,8 @@ class SystemCrontabListener implements ListenerInterface
}
/**
* 0 1 2 3 4 5
* 获取定时任务时间表达式
* 0 1 2 3 4 5
* | | | | | |
* | | | | | +------ day of week (0 - 6) (Sunday=0)
* | | | | +------ month (1 - 12)
@ -44,9 +45,6 @@ class SystemCrontabListener implements ListenerInterface
* | | +---------- hour (0 - 23)
* | +------------ min (0 - 59)
* +-------------- sec (0-59)[可省略,如果没有0位,则最小时间粒度是分钟]
*/
/**
* 获取定时任务时间表达式
* @param $data
* @return string
*/

View File

@ -488,10 +488,8 @@ class StoreOrderCreateServices extends BaseServices
$cart['coupon_price'] = 0.00;
}
try {
[$cartInfo, $spread_ids] = $this->computeOrderProductBrokerage($uid, $cartInfo, $orderInfo);
$cartInfo = $this->computeOrderProductCoupon($cartInfo, $priceData);
$cartInfo = $this->computeOrderProductIntegral($cartInfo, $priceData);
// $cartInfo = $this->computeOrderProductPostage($cartInfo, $priceData, $addressId);
} catch (\Throwable $e) {
Log::error('订单商品结算失败,File:' . $e->getFile() . ',Line:' . $e->getLine() . ',Message:' . $e->getMessage());
throw new ApiException(410248);
@ -513,6 +511,12 @@ class StoreOrderCreateServices extends BaseServices
$cart['truePrice'] = $cart['truePrice'] > $uni_integral_price ? bcsub((string)$cart['truePrice'], $uni_integral_price, 2) : 0;
}
}
try {
[$cartInfo, $spread_ids] = $this->computeOrderProductBrokerage($uid, $cartInfo, $orderInfo);
} catch (\Throwable $e) {
Log::error('订单商品结算失败,File:' . $e->getFile() . ',Line:' . $e->getLine() . ',Message:' . $e->getMessage());
throw new ApiException(410248);
}
return [$cartInfo, $spread_ids];
}
@ -794,12 +798,19 @@ class StoreOrderCreateServices extends BaseServices
$productInfo = $cart['productInfo'];
//计算商品金额
if (isset($productInfo['attrInfo'])) {
$price = bcmul((string)($productInfo['attrInfo']['price'] ?? '0'), $cartNum, 4);
if (sys_config('user_brokerage_type') == 1) {
//按照实际支付价格返佣
$price = bcmul((string)$cart['truePrice'], $cartNum, 4);
} else {
$price = bcmul((string)($productInfo['price'] ?? '0'), $cartNum, 4);
//按照商品价格返佣
if (isset($productInfo['attrInfo'])) {
$price = bcmul((string)($productInfo['attrInfo']['price'] ?? '0'), $cartNum, 4);
} else {
$price = bcmul((string)($productInfo['price'] ?? '0'), $cartNum, 4);
}
}
$staffBrokerage = bcmul((string)$price, (string)bcdiv($staffPercent, 100, 4), 2);
$agentBrokerage = bcmul((string)$price, (string)bcdiv($agentPercent, 100, 4), 2);
$divisionBrokerage = bcmul((string)$price, (string)bcdiv($divisionPercent, 100, 4), 2);

View File

@ -20,6 +20,22 @@ use think\facade\Log;
*/
class CrontabRunServices
{
/**
* 定时任务类型 每一个定义的类型会对应CrontabRunServices类中的一个方法
* @var string[]
*/
public $markList = [
'orderCancel' => '未支付自动取消订单',
'pinkExpiration' => '拼团到期订单处理',
'agentUnbind' => '到期自动解绑上级',
'liveProductStatus' => '自动更新直播商品状态',
'liveRoomStatus' => '自动更新直播间状态',
'takeDelivery' => '订单自动收货',
'advanceOff' => '预售商品到期自动下架',
'productReplay' => '订单商品自动好评',
'clearPoster' => '清除昨日海报',
];
/**
* 调用不存在的方法
* @param $name

View File

@ -18,22 +18,6 @@ use think\helper\Str;
class SystemCrontabServices extends BaseServices
{
/**
* 定时任务类型 每一个定义的类型会对应CrontabRunServices类中的一个方法
* @var string[]
*/
private $markList = [
'order_cancel' => '未支付自动取消订单',
'pink_expiration' => '拼团到期订单处理',
'agent_unbind' => '到期自动解绑上级',
'live_product_status' => '自动更新直播商品状态',
'live_room_status' => '自动更新直播间状态',
'take_delivery' => '订单自动收货',
'advance_off' => '预售商品到期自动下架',
'product_replay' => '订单商品自动好评',
'clear_poster' => '清除昨日海报',
];
public function __construct(SystemCrontabDao $dao)
{
$this->dao = $dao;
@ -80,7 +64,7 @@ class SystemCrontabServices extends BaseServices
*/
public function getMarkList(): array
{
return $this->markList;
return app()->make(CrontabRunServices::class)->markList;
}
/**
@ -93,7 +77,7 @@ class SystemCrontabServices extends BaseServices
if (!$data['id'] && $this->dao->getCount(['mark' => $data['mark'], 'is_del' => 0])) {
throw new AdminException('该定时任务已存在,请勿重复添加');
}
$data['name'] = $this->markList[$data['mark']];
$data['name'] = $this->getMarkList()[$data['mark']];
$data['add_time'] = time();
if (!$data['id']) {
unset($data['id']);

View File

@ -212,7 +212,7 @@ class PayClient extends BaseClient
$totalFee = '0';
$amount = bcadd($amount, '0', 2);
foreach ($transferDetailList as &$item) {
if ($item['transfer_amount'] >= 2000 && !empty($item['user_name'])) {
if ($item['transfer_amount'] >= 2000 && empty($item['user_name'])) {
throw new PayException('明细金额大于等于2000时,收款人姓名必须填写');
}
$totalFee = bcadd($totalFee, $item['transfer_amount'], 2);

View File

@ -34875,15 +34875,15 @@ CREATE TABLE IF NOT EXISTS `eb_system_timer` (
--
INSERT INTO `eb_system_timer` (`id`, `name`, `mark`, `content`, `type`, `week`, `day`, `hour`, `minute`, `second`, `last_execution_time`, `next_execution_time`, `add_time`, `is_del`, `is_open`) VALUES
(1, '未支付自动取消订单', 'order_cancel', '每隔30秒执行自动取消到期未支付的订单', 1, 1, 1, 1, 30, 30, 0, 1670642407, 1670642377, 0, 1),
(2, '拼团到期订单处理', 'pink_expiration', '每隔1分钟拼团到期之后的操作', 2, 1, 1, 1, 1, 0, 0, 1670642487, 1670642427, 0, 1),
(3, '到期自动解绑上级', 'agent_unbind', '每隔1分钟执行到期的绑定关系的解除', 2, 1, 1, 1, 1, 0, 0, 1670642534, 1670642474, 0, 1),
(4, '自动更新直播商品状态', 'live_product_status', '每隔3分钟执行更新直播商品状态', 2, 1, 1, 1, 3, 0, 0, 1670642694, 1670642514, 0, 1),
(5, '自动更新直播间状态', 'live_room_status', '每隔3分钟执行更新直播间状态', 2, 1, 1, 1, 3, 0, 0, 1670642709, 1670642529, 0, 1),
(6, '订单自动收货', 'take_delivery', '每隔5分钟执行订单到期自动收货', 2, 1, 1, 1, 5, 0, 0, 1670642891, 1670642591, 0, 1),
(7, '预售商品到期自动下架', 'advance_off', '每隔5分钟执行预售商品到期下架', 2, 1, 1, 1, 5, 0, 0, 1670642913, 1670642613, 0, 1),
(8, '订单商品自动好评', 'product_replay', '每隔5分钟执行订单到期商品好评', 2, 1, 1, 1, 5, 0, 0, 1670642933, 1670642633, 0, 1),
(9, '清除昨日海报', 'clear_poster', '每天0时30分0秒执行一次清除昨日海报', 5, 1, 1, 0, 30, 0, 0, 1670862600, 1670815378, 0, 1);
(1, '未支付自动取消订单', 'orderCancel', '每隔30秒执行自动取消到期未支付的订单', 1, 1, 1, 1, 30, 30, 0, 1670642407, 1670642377, 0, 1),
(2, '拼团到期订单处理', 'pinkExpiration', '每隔1分钟拼团到期之后的操作', 2, 1, 1, 1, 1, 0, 0, 1670642487, 1670642427, 0, 1),
(3, '到期自动解绑上级', 'agentUnbind', '每隔1分钟执行到期的绑定关系的解除', 2, 1, 1, 1, 1, 0, 0, 1670642534, 1670642474, 0, 1),
(4, '自动更新直播商品状态', 'liveProductStatus', '每隔3分钟执行更新直播商品状态', 2, 1, 1, 1, 3, 0, 0, 1670642694, 1670642514, 0, 1),
(5, '自动更新直播间状态', 'liveRoomStatus', '每隔3分钟执行更新直播间状态', 2, 1, 1, 1, 3, 0, 0, 1670642709, 1670642529, 0, 1),
(6, '订单自动收货', 'takeDelivery', '每隔5分钟执行订单到期自动收货', 2, 1, 1, 1, 5, 0, 0, 1670642891, 1670642591, 0, 1),
(7, '预售商品到期自动下架', 'advanceOff', '每隔5分钟执行预售商品到期下架', 2, 1, 1, 1, 5, 0, 0, 1670642913, 1670642613, 0, 1),
(8, '订单商品自动好评', 'productReplay', '每隔5分钟执行订单到期商品好评', 2, 1, 1, 1, 5, 0, 0, 1670642933, 1670642633, 0, 1),
(9, '清除昨日海报', 'clearPoster', '每天0时30分0秒执行一次清除昨日海报', 5, 1, 1, 0, 30, 0, 0, 1670862600, 1670815378, 0, 1);
-- --------------------------------------------------------

View File

@ -20,7 +20,8 @@
<Radio :label="item.val" v-for="(item, i) in fromList.fromTxt" :key="i">{{ item.text }}</Radio>
</RadioGroup>
<DatePicker
:editable="false"
:editable="true"
:clearable="true"
@on-change="onchangeTime"
:value="timeVal"
format="yyyy/MM/dd"

View File

@ -46,7 +46,7 @@
:data="classList"
row-id="id"
>
<vxe-table-column field="id" title="ID" tooltip min-width="60"></vxe-table-column>
<vxe-table-column field="id" title="ID" tooltip width="60"></vxe-table-column>
<vxe-table-column field="title" tree-node title="分类名称" min-width="150"></vxe-table-column>
<vxe-table-column field="eng_title" title="分类字段" min-width="150"></vxe-table-column>
<vxe-table-column field="statuss" title="状态" min-width="150">

View File

@ -21,8 +21,8 @@
</div>
<div class="bottom acea-row row-between-wrapper">
<div class="purple" v-if="item.status === 1">{{$t(`活动进行中`)}}</div>
<div class="success" v-else-if="item.status === 3">{{$t(`砍价成功`)}}</div>
<div class="end" v-else>{{$t(`活动已结束`)}}</div>
<div class="success" v-if="item.status === 3">{{$t(`砍价成功`)}}</div>
<div class="end" v-if="item.status === 2">{{$t(`活动已结束`)}}</div>
<div class="acea-row row-middle row-right">
<div class="bnt cancel" v-if="item.status === 1"
@click="getBargainUserCancel(item.bargain_id)">
@ -31,7 +31,9 @@
<div class="bnt bg-color-red" v-if="item.status === 1" @click="goDetail(item.bargain_id)">
{{$t(`继续砍价`)}}
</div>
<!-- <div class="bnt bg-color-red" v-else @click="goList">重开一个</div> -->
</div>
<div class="acea-row row-middle row-right success" v-if="item.status === 3">
{{item.success_time}}
</div>
</div>
</div>