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

This commit is contained in:
liaofei 2023-02-17 16:36:24 +08:00
commit 5bcf3523ce
14 changed files with 76 additions and 111 deletions

View File

@ -110,7 +110,8 @@ class ExportExcel extends AuthController
$where = $this->request->getMore([
['store_name', ''],
['cate_id', ''],
['type', 1]
['type', 1],
['ids', []]
]);
return app('json')->success($this->service->exportProductList($where));
}

View File

@ -9,35 +9,3 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
/**
* 设置浏览信息
* @param $uid
* @param int $product_id
* @param int $cate
* @param string $type
* @param string $content
* @param int $min
*/
function set_view($uid, $product_id = 0, $cate = 0, $type = '', $content = '', $min = 20)
{
//TODO 待优化
$Db = new \app\models\store\StoreVisit;
$view = $Db->where('uid', $uid)->where('product_id', $product_id)->field('count,add_time,id')->find();
if ($view && $type != 'search') {
$time = time();
if (($view['add_time'] + $min) < $time) {
$Db->where(['id' => $view['id']])->update(['count' => $view['count'] + 1, 'add_time' => time()]);
}
} else {
$cate = explode(',', $cate)[0];
$Db->insert([
'add_time' => time(),
'count' => 1,
'product_id' => $product_id,
'cate_id' => $cate,
'type' => $type,
'uid' => $uid,
'content' => $content
]);
}
}

View File

@ -409,6 +409,7 @@ class StoreOrderController
$uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid;
$orderInfo->pay_uid = $uid;
$orderInfo->save();
$orderInfo = $orderInfo->toArray();
$order = $this->services->get(['order_id' => $uni]);
if (!$order)
return app('json')->fail(410173);
@ -455,7 +456,7 @@ class StoreOrderController
$success = app()->make(StoreOrderSuccessServices::class);
$payPriceStatus = $success->zeroYuanPayment($orderInfo, $uid, $paytype);
if ($payPriceStatus)//0元支付成功
return app('json')->status('success', 410195, ['order_id' => $orderInfo['order_id'], 'key' => $orderInfo['unique ']]);
return app('json')->status('success', 410195, ['order_id' => $orderInfo['order_id'], 'key' => $orderInfo['unique']]);
else
return app('json')->status('pay_error');
}

View File

@ -17,8 +17,6 @@ return [
'HttpEnd' => [],
'LogLevel' => [],
'LogWrite' => [],
'UserLogin'=>[
// \crmeb\listeners\user\UserLogin::class
]
'UserLogin'=> []
]
];

View File

@ -19,7 +19,6 @@ class SystemTimer implements ListenerInterface
{
public function handle($event): void
{
new Crontab('*/6 * * * * *', function () {
file_put_contents(runtime_path() . '.timer', time());
});
@ -30,13 +29,9 @@ class SystemTimer implements ListenerInterface
foreach ($list as &$item) {
//获取定时任务时间字符串
$timeStr = $this->getTimerStr($item);
// Log::error('mark:'.$item['mark']);
// Log::error($timeStr);
//未支付自动取消订单
if ($item['mark'] == 'order_cancel') {
new Crontab($timeStr, function () {
// Log::error('每隔30秒执行一次自动取消订单 '.date('Y-m-d H:i:s'));
//未支付自动取消订单
try {
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
@ -46,11 +41,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//拼团到期订单处理
if ($item['mark'] == 'pink_expiration') {
new Crontab($timeStr, function () {
// Log::error('每隔1分钟执行一次拼团到期订单处理 '.date('Y-m-d H:i:s'));
//拼团到期订单处理
try {
/** @var StorePinkServices $storePinkServices */
$storePinkServices = app()->make(StorePinkServices::class);
@ -60,11 +53,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//自动解绑上级绑定
if ($item['mark'] == 'agent_unbind') {
new Crontab($timeStr, function () {
// Log::error('每隔1分钟执行一次自动解除上级绑定 '.date('Y-m-d H:i:s'));
//自动解绑上级绑定
try {
/** @var AgentManageServices $agentManage */
$agentManage = app()->make(AgentManageServices::class);
@ -74,11 +65,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//更新直播商品状态
if ($item['mark'] == 'live_product_status') {
new Crontab($timeStr, function () {
// Log::error('每隔3分钟执行一次更新直播商品状态 '.date('Y-m-d H:i:s'));
//更新直播商品状态
try {
/** @var LiveGoodsServices $liveGoods */
$liveGoods = app()->make(LiveGoodsServices::class);
@ -88,11 +77,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//更新直播间状态
if ($item['mark'] == 'live_room_status') {
new Crontab($timeStr, function () {
// Log::error('每隔3分钟执行一次更新直播间状态 '.date('Y-m-d H:i:s'));
//更新直播间状态
try {
/** @var LiveRoomServices $liveRoom */
$liveRoom = app()->make(LiveRoomServices::class);
@ -102,11 +89,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//自动收货
if ($item['mark'] == 'take_delivery') {
new Crontab($timeStr, function () {
// Log::error('每隔5分钟执行一次自动收货 '.date('Y-m-d H:i:s'));
//自动收货
try {
/** @var StoreOrderTakeServices $services */
$services = app()->make(StoreOrderTakeServices::class);
@ -116,11 +101,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//查询预售到期商品自动下架
if ($item['mark'] == 'advance_off') {
new Crontab($timeStr, function () {
// Log::error('每隔5分钟执行一次查询预售到期商品自动下架 '.date('Y-m-d H:i:s'));
//查询预售到期商品自动下架
try {
/** @var StoreProductServices $product */
$product = app()->make(StoreProductServices::class);
@ -130,11 +113,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//自动好评
if ($item['mark'] == 'product_replay') {
new Crontab($timeStr, function () {
// Log::error('每隔5分钟执行一次自动好评 '.date('Y-m-d H:i:s'));
//自动好评
try {
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
@ -144,11 +125,9 @@ class SystemTimer implements ListenerInterface
}
});
}
//清除昨日海报
if ($item['mark'] == 'clear_poster') {
new Crontab($timeStr, function () {
// Log::error('每天0时30分0秒执行一次清除昨日海报 '.date('Y-m-d H:i:s'));
//清除昨日海报
try {
/** @var SystemAttachmentServices $attach */
$attach = app()->make(SystemAttachmentServices::class);
@ -160,33 +139,47 @@ class SystemTimer implements ListenerInterface
}
}
}
/**
* 0 1 2 3 4 5
| | | | | |
| | | | | +------ day of week (0 - 6) (Sunday=0)
| | | | +------ month (1 - 12)
| | | +-------- day of month (1 - 31)
| | +---------- hour (0 - 23)
| +------------ min (0 - 59)
+-------------- sec (0-59)[可省略,如果没有0位,则最小时间粒度是分钟]
*/
/**
* 获取定时任务时间表达式
* @param $data
* @return string
*/
public function getTimerStr($data): string
{
$timeStr = '';
switch ($data['type']) {
case 1:
case 1:// 每隔几秒
$timeStr = '*/' . $data['second'] . ' * * * * *';
break;
case 2:
case 2:// 每隔几分
$timeStr = '0 */' . $data['minute'] . ' * * * *';
break;
case 3:
$timeStr = '0 0 */' . $data['hour'] . ' * * *';
case 3:// 每隔几时第几分钟执行
$timeStr = '0 ' . $data['minute'] . ' */' . $data['hour'] . ' * * *';
break;
case 4:
$timeStr = '0 0 0 */' . $data['day'] . ' * *';
case 4:// 每隔几日第几小时第几分钟执行
$timeStr = '0 ' . $data['minute'] . ' ' . $data['hour'] . ' */' . $data['day'] . ' * *';
break;
case 5:
case 5:// 每日几时几分几秒
$timeStr = $data['second'] . ' ' . $data['minute'] . ' ' . $data['hour'] . ' * * *';
break;
case 6:
case 6:// 每周周几几时几分几秒
$timeStr = $data['second'] . ' ' . $data['minute'] . ' ' . $data['hour'] . ' * * ' . ($data['week'] == 7 ? 0 : $data['week']);
break;
case 7:
case 7:// 每月几日几时几分几秒
$timeStr = $data['second'] . ' ' . $data['minute'] . ' ' . $data['hour'] . ' ' . $data['day'] . ' * *';
break;
}
return $timeStr;
}
}
}

View File

@ -338,6 +338,16 @@ class StoreProduct extends BaseModel
}
}
/**
* 不在当前id中查询
* @param $query
* @param $value
*/
public function searchIdsAttr($query, $value)
{
if ($value != '') $query->whereIn('id', $value);
}
/**
* 不在当前id中查询
* @param $query

View File

@ -998,8 +998,6 @@ class StoreOrderRefundServices extends BaseServices
$res4 = $res4 && $storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['refund_num' => (($cartInfo[$cart['cart_id']]['refund_num'] ?? 0) + $cart['cart_num'])]);
}
} else {
//修改原订单状态
$res2 = false !== $orderServices->update(['id' => $order['id']], ['refund_status' => 1]);
foreach ($cartInfos as $cart) {
$res4 = $res4 && $storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['refund_num' => $cart['cart_num']]);
}

View File

@ -93,8 +93,14 @@ class StoreProductServices extends BaseServices
/**
* 获取列表
* @param $where
* @param array $where
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 吴汐
* @email 442384644@qq.com
* @date 2023/02/17
*/
public function getList(array $where)
{

View File

@ -70,7 +70,7 @@ class UserAuthServices extends BaseServices
throw new AuthException(110003);
}
$user = $this->dao->get(['uid' => $id, 'is_del' => 0]);
$user = $this->dao->get(['uid' => $id, 'is_del' => 0, 'status' => 1]);
if (!$user || $user->uid != $tokenData['uid']) {
if (!request()->isCli()) CacheService::delete($md5Token);

View File

@ -561,6 +561,7 @@ export default {
let excelData = JSON.parse(JSON.stringify(this.artFrom));
excelData.page = 1;
excelData.limit = 50;
excelData.ids = this.ids;
for (let i = 0; i < excelData.page + 1; i++) {
let lebData = await this.getExcelData(excelData);
if (!fileName) fileName = lebData.filename;

View File

@ -291,6 +291,12 @@ export default {
cancel() {
this.$refs['formItem'].resetFields();
},
refreshFrame() {
this.imgUrl = '';
setTimeout((e) => {
this.imgUrl = `${location.origin}/pages/index/index?type=iframeWindow`;
}, 200);
},
getChildData(e) {
this.loadingExist = e;
},
@ -454,26 +460,10 @@ export default {
type: 1,
})
.then((res) => {
this.refreshFrame();
this.$Message.success(res.msg);
this.$Modal.remove();
this.getList();
// if (res.data.status) {
// this.$Message.success(res.data.msg);
// this.$Modal.remove();
// this.getList();
// } else {
// setTimeout((e) => {
// this.$Modal.confirm({
// title: "提示",
// content: "<p>尚未安装模板,请购买安装后再试!</p>",
// loading: false,
// okText: "点击购买",
// onOk: () => {
// window.open("http://s.crmeb.com/goods_cate", `_blank`);
// },
// });
// }, 200);
// }
})
.catch((res) => {
this.$Modal.remove();

View File

@ -40,13 +40,13 @@
<span class="suffix">日</span>
</div>
</Col>
<Col v-if="[3, 5, 6, 7].includes(formValidate.type)" span="4">
<Col v-if="[3, 4, 5, 6, 7].includes(formValidate.type)" span="4">
<div class="input-number-wrapper">
<InputNumber v-model="formValidate.hour" :max="23" :min="0"></InputNumber>
<span class="suffix">时</span>
</div>
</Col>
<Col span="4" v-if="[2, 5, 6, 7].includes(formValidate.type)">
<Col span="4" v-if="[2, 3, 4, 5, 6, 7].includes(formValidate.type)">
<div class="input-number-wrapper">
<InputNumber
v-model="formValidate.minute"
@ -170,10 +170,10 @@ export default {
this.trip = `每隔${nVal.minute}分钟执行一次`;
break;
case 3:
this.trip = `每隔${nVal.hour}小时执行一次`;
this.trip = `每隔${nVal.hour}小时的${nVal.minute}分执行一次`;
break;
case 4:
this.trip = `每隔${nVal.day}天执行一次`;
this.trip = `每隔${nVal.day}天的${nVal.hour}时${nVal.minute}分执行一次`;
break;
case 5:
this.trip = `每天${nVal.hour}时${nVal.minute}分${nVal.second}秒执行一次`;
@ -306,10 +306,10 @@ export default {
line-height: 33px;
color: #333333;
}
}
.trip{
padding-left 15px
color #aaa
}
.trip {
padding-left: 15px;
color: #aaa;
}
</style>

View File

@ -660,9 +660,8 @@
.then(res => {
that.$util.Tips({
title: res.msg
}, {
tab: 3
});
this.getCombinationPink()
})
.catch(res => {
that.$util.Tips({

View File

@ -49,7 +49,7 @@
</div>
<div class="chart">
<div class="chart-title">
{{$t(`单位`)}}({{where.type == 1?$t(`元.`):$t(`分.`)}})
{{$t(`单位`)}}({{where.type == 1?$t(`元.`):$t(`份`)}})
</div>
<canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" disable-scroll=true @touchstart="touchLineA"
@touchmove="moveLineA" @touchend="touchEndLineA">