wanghousheng 10 months ago
parent cdc3f533f8
commit c83342af68
  1. 22
      app/api/controller/Shop.php
  2. 9
      app/timer/service/Order.php

@ -55,11 +55,8 @@ class Shop extends Controller
return $this->renderError('缺少必要参数'); return $this->renderError('缺少必要参数');
} }
$detail = ShopModel::detail($shopId); $detail = ShopModel::detail($shopId);
// var_dump($detail['shop_hours']);
// exit;
if (!empty($detail['shop_hours'])) { if (!empty($detail['shop_hours'])) {
$shop_hours = explode(' ', $detail['shop_hours']); $shop_hours = explode('-', $detail['shop_hours'] ?? "00:00");
$shop_hours = explode('-', $shop_hours[1] ?? "00:00");
if (count($shop_hours) == 2) { if (count($shop_hours) == 2) {
$array = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; $array = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
for ($i = 0; $i < 3; $i++) { for ($i = 0; $i < 3; $i++) {
@ -95,16 +92,17 @@ class Shop extends Controller
{ {
$param = $this->request->param(); $param = $this->request->param();
$upData = [ $upData = [
'shop_name' => $param['shop_name']??"", 'shop_name' => $param['shop_name'] ?? "",
'address' => $param['address']??"", 'address' => $param['address'] ?? "",
'phone' => $param['phone']??"", 'phone' => $param['phone'] ?? "",
'wechat_img_id' => $param['wechat_img_id']??"", 'wechat_img_id' => $param['wechat_img_id'] ?? "",
]; ];
ShopModel::where('shop_id',$param['shop_id'])->update($upData); ShopModel::where('shop_id', $param['shop_id'])->update($upData);
return $this->renderSuccess('ok'); return $this->renderSuccess('ok');
} }
public function getShopInfo(){ public function getShopInfo()
{
$banner_imgs = []; $banner_imgs = [];
$share_imgs = []; $share_imgs = [];
$activity_imgs = []; $activity_imgs = [];
@ -117,8 +115,4 @@ class Shop extends Controller
} }
} }

@ -12,13 +12,13 @@ declare (strict_types=1);
namespace app\timer\service; namespace app\timer\service;
use app\timer\model\Order as OrderModel; use app\common\enum\order\OrderStatus as OrderStatusEnum;
use app\common\library\helper;
use app\common\service\BaseService; use app\common\service\BaseService;
use app\common\service\Order as OrderService; use app\common\service\Order as OrderService;
use app\common\service\order\Complete as OrderCompleteService; use app\common\service\order\Complete as OrderCompleteService;
use app\common\enum\order\OrderStatus as OrderStatusEnum;
use app\common\library\helper;
use app\timer\library\Tools; use app\timer\library\Tools;
use app\timer\model\Order as OrderModel;
/** /**
* 服务类:订单模块 * 服务类:订单模块
@ -38,7 +38,8 @@ class Order extends BaseService
public function closeEvent(int $storeId, int $closeHours) public function closeEvent(int $storeId, int $closeHours)
{ {
// 截止时间 // 截止时间
$deadlineTime = time() - ((int)$closeHours * 60 * 60); //$deadlineTime = time() - ((int)$closeHours * 60 * 60);//按小时计算
$deadlineTime = time() - ($closeHours * 60);//按分钟计算
// 查询截止时间未支付的订单 // 查询截止时间未支付的订单
$model = new OrderModel; $model = new OrderModel;
$list = $model->getListByClose($storeId, $deadlineTime); $list = $model->getListByClose($storeId, $deadlineTime);

Loading…
Cancel
Save