pull/1/head
wangmingchuan321@qq.com 10 months ago
parent b0f58984c3
commit f0e19a43f2
  1. 12
      app/api/controller/Order.php
  2. 14
      app/api/model/Order.php
  3. 2
      app/api/service/Goods.php
  4. 32
      app/common/model/Goods.php

@ -51,7 +51,17 @@ class Order extends Controller
if ($res) {
return $this->renderSuccess('删除成功');
}
return $this->renderSuccess('删除失败');
return $this->renderError('删除失败');
}
public function orderfast()
{
$model = new OrderModel;
$res = $model->orderfast();
if ($res) {
return $this->renderSuccess('催单成功');
}
return $this->renderError('催单失败');
}
/**

@ -135,6 +135,7 @@ class Order extends OrderModel
$info = $service->data()['storeInfo']->toArray();
//todo wmc
$info['phone'] = 13770778236;
foreach ($list['data'] as &$v) {
$v['storeInfo'] = $info;
}
@ -156,6 +157,11 @@ class Order extends OrderModel
return $res;
}
public function orderfast()
{//todo wmc
return 0;
}
/**
* 取消订单
* @return bool|mixed
@ -349,6 +355,14 @@ class Order extends OrderModel
// 查询订单记录
$order = static::detail($where, $with);
empty($order) && throwError('订单不存在');
//这边后面改成多商户的话需要根据storeid去获取信息
$service = new StoreService;
$info = $service->data()['storeInfo']->toArray();
//todo wmc
$info['phone'] = 13770778236;
$order->storeInfo = $info;
return $order;
}

@ -108,8 +108,6 @@ class Goods extends GoodsService
//大牌正品列表
public function brandList($storeid)
{
$page = (int)$_GET['page'];
$model = new GoodsModel;
$goodsList = $model->getList([

@ -184,6 +184,38 @@ class Goods extends BaseModel
$query->field(['(sales_initial + sales_actual) as goods_sales']);
// 排序条件
$sort = $this->setQuerySort($param);
$order = request()->get()['order'] ?? '';
if (!empty($order)) {
if ($order == 1) {
$sort['goods_price_min'] = 'asc';
}
if ($order == 2) {
$sort['goods_price_min'] = 'desc';
}
//todo wmc
if ($order == 3) {
$sort['goods_price_min'] = 'asc';
}
if ($order == 4) {
$sort['goods_price_min'] = 'desc';
}
if ($order == 5) {
$sort['goods_sales'] = 'asc';
}
if ($order == 6) {
$sort['goods_sales'] = 'desc';
}
//todo wmc
if ($order == 7) {
$sort['goods_sales'] = 'asc';
}
if ($order == 8) {
$sort['goods_sales'] = 'desc';
}
}
// 执行查询
$list = $query->with(['images.file'])
->alias($this->name)

Loading…
Cancel
Save