diff --git a/app/api/logic/OrderLogic.php b/app/api/logic/OrderLogic.php index b27839f..80f220c 100644 --- a/app/api/logic/OrderLogic.php +++ b/app/api/logic/OrderLogic.php @@ -938,7 +938,7 @@ class OrderLogic extends LogicBase */ public static function getOrderDetail($order_id, $user_id) { - $order = Order::find(['del' => 0, 'id' => $order_id, 'user_id' => $user_id])->with('orderGoods'); + $order = Order::where(['del' => 0, 'id' => $order_id, 'user_id' => $user_id])->with('orderGoods')->find(); if (!$order){ return []; } diff --git a/app/common/model/SelffetchShop.php b/app/common/model/SelffetchShop.php new file mode 100644 index 0000000..8950394 --- /dev/null +++ b/app/common/model/SelffetchShop.php @@ -0,0 +1,102 @@ + '停用', + self::OPEN => '启用', + ]; + if ($status === true) { + return $desc; + } + return $desc[$status] ?? '未知'; + } + + /** + * @notes 门店状态获取器 + * @param $value + * @param $data + * @return string|string[] + * @author ljj + * @date 2021/8/14 5:24 下午 + */ + public function getStatusDescAttr($value,$data) + { + return self::getShopStatus($data['status']); + } + + /** + * @notes 创建时间获取器 + * @param $value + * @param $data + * @return false|string + * @author ljj + * @date 2021/8/14 5:28 下午 + */ + public function getCreateTimeAttr($value,$data) + { + return date('Y-m-d H:i:s',$value); + } + + /** + * @notes 门店地址获取器 + * @param $value + * @param $data + * @return string + * @author ljj + * @date 2021/8/14 5:29 下午 + */ + public function getShopAddressAttr($value,$data) + { + return implode('',DevRegion::where('id', 'in', $data['province'].','.$data['city'].','.$data['district'])->column('name')).$data['address']; + } + + /** + * @notes 图片获取器 + * @param $value + * @param $data + * @return string + * @author ljj + * @date 2021/8/16 11:39 上午 + */ + public function getImageAttr($value,$data) + { + return empty($value) ? '' : UrlServer::getFileUrl($value); + } +} \ No newline at end of file