|
|
|
|
@ -27,8 +27,8 @@ class OrdersController extends CommonController
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/customer/get-product/{id}",
|
|
|
|
|
* summary="获取产品详情",
|
|
|
|
|
* path="/customer/get-product-by-project/{id}",
|
|
|
|
|
* summary="V2-获取产品详情",
|
|
|
|
|
* description="获取产品详情",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="id", in="path", @OA\Schema(type="integer"), required=true, description="id"),
|
|
|
|
|
@ -39,18 +39,19 @@ class OrdersController extends CommonController
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getProduct($id)
|
|
|
|
|
public function getProductByProject($id)
|
|
|
|
|
{
|
|
|
|
|
$product = (new Product())->with([
|
|
|
|
|
"defaultItem",
|
|
|
|
|
"productItems",
|
|
|
|
|
"project",
|
|
|
|
|
"productParamedicLevels" => function ($query) {
|
|
|
|
|
$query->with("paramedicLevel");
|
|
|
|
|
},
|
|
|
|
|
"factors" => function ($query) {
|
|
|
|
|
$query->with("factorItems");
|
|
|
|
|
}])->find($id);
|
|
|
|
|
$query->select("id", "name", "product_id")->orderBy("myindex")
|
|
|
|
|
->with(["factorItems" => function ($query) {
|
|
|
|
|
$query->select("id","name","factor_id")->orderBy("myindex");
|
|
|
|
|
}]);
|
|
|
|
|
}])
|
|
|
|
|
->where("project_id", $id)
|
|
|
|
|
->select("id", "name", "project_id")
|
|
|
|
|
->orderBy("myindex")
|
|
|
|
|
->first();
|
|
|
|
|
return response()->json($product->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -510,7 +511,7 @@ class OrdersController extends CommonController
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/customer/recharge",
|
|
|
|
|
* summary="获取充值接口信息",
|
|
|
|
|
* summary="V2-获取充值接口信息",
|
|
|
|
|
* description="获取充值接口信息",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="money", in="query", @OA\Schema(type="number"), required=true, description="充值金额"),
|
|
|
|
|
@ -589,7 +590,7 @@ class OrdersController extends CommonController
|
|
|
|
|
*/
|
|
|
|
|
public function getBalances()
|
|
|
|
|
{
|
|
|
|
|
$balances = (new Balance())->where("member_id",$this->customer->id)->with([
|
|
|
|
|
$balances = (new Balance())->where("member_id", $this->customer->id)->with([
|
|
|
|
|
"order" => function ($query) {
|
|
|
|
|
$query->select("id", "serial");
|
|
|
|
|
}
|
|
|
|
|
|