123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\admin\server\home;
- use app\admin\model\HomeOrder;
- class HomeOrderServer
- {
- /**
- * Notes:获取订单列表
- * @param string $keywords
- * @param int $page
- * @param int $limit
- * @return array
- * User: YCP
- * Date: 2022/11/2
- */
- public static function getOrderList(int $page, int $limit, string $keywords)
- {
- [$list, $count] = HomeOrder::getOrderList($page, $limit,$keywords);
- return compact('list', 'page', 'limit', 'count');
- }
- /**
- * Notes:获取订单详情
- * @param int $order_id
- * @return int
- * User: YCP
- * Date: 2022/11/2
- */
- public static function orderInfo(int $order_id)
- {
- HomeOrder::affairBegin();
- try {
- $where = [];
- $where['order_id'] = $order_id;
- $result = HomeOrder::with(['User','HomeGoods'])->where($where)->first();
- if (!empty($result)){
- HomeOrder::affairCommit();
- return $result;
- }else{
- return false;
- }
- }catch (\Exception $exception){
- HomeOrder::affairRollback();
- throw new \Exception($exception->getMessage(), 500);
- }
- }
-
- }
|