|
@@ -8,22 +8,28 @@
|
|
|
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
|
|
|
|
+use App\Models\Nurse;
|
|
use App\Models\Order;
|
|
use App\Models\Order;
|
|
|
|
+use App\Models\OrderNurse;
|
|
|
|
+use App\Models\OrderPack;
|
|
use App\Models\OrderPatient;
|
|
use App\Models\OrderPatient;
|
|
|
|
+use App\Models\OrderVaccine;
|
|
use App\Models\Patient;
|
|
use App\Models\Patient;
|
|
use App\Models\Payment;
|
|
use App\Models\Payment;
|
|
|
|
+use App\Models\ServicePack;
|
|
use App\Models\TimePeriod;
|
|
use App\Models\TimePeriod;
|
|
use App\Models\UserCoupon;
|
|
use App\Models\UserCoupon;
|
|
|
|
+use App\Models\Vaccine;
|
|
use EasyWeChat\Factory;
|
|
use EasyWeChat\Factory;
|
|
use DB;
|
|
use DB;
|
|
|
|
|
|
class OrderController extends AuthController
|
|
class OrderController extends AuthController
|
|
{
|
|
{
|
|
- public function placeOrder()
|
|
|
|
|
|
+ public function consultPlaceOrder()
|
|
{
|
|
{
|
|
$req = request()->post();
|
|
$req = request()->post();
|
|
$this->validate(request(), [
|
|
$this->validate(request(), [
|
|
- 'product_type' => 'required|in:1,2,3',
|
|
|
|
|
|
+ 'product_type' => 'required|in:1,2',
|
|
'docter_id' => 'required|integer',
|
|
'docter_id' => 'required|integer',
|
|
'patient_id' => 'required|integer',
|
|
'patient_id' => 'required|integer',
|
|
'total_amount' => 'required|integer',
|
|
'total_amount' => 'required|integer',
|
|
@@ -32,9 +38,6 @@ class OrderController extends AuthController
|
|
'phone_minutes' => 'required_if:product_type,1|integer',
|
|
'phone_minutes' => 'required_if:product_type,1|integer',
|
|
'symptoms' => 'required_if:product_type,2|max:2000',
|
|
'symptoms' => 'required_if:product_type,2|max:2000',
|
|
'medical_imgs' => 'required_if:product_type,2|json|max:3000',
|
|
'medical_imgs' => 'required_if:product_type,2|json|max:3000',
|
|
- 'schedule_date' => 'required_if:product_type,3|date',
|
|
|
|
- 'time_period_id' => 'required_if:product_type,3|integer',
|
|
|
|
- 'organization_id' => 'required_if:product_type,3|integer'
|
|
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
@@ -44,7 +47,16 @@ class OrderController extends AuthController
|
|
$discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], $req['product_type']);
|
|
$discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], $req['product_type']);
|
|
}
|
|
}
|
|
$payment_amount = $req['total_amount'] - $discount_amount;
|
|
$payment_amount = $req['total_amount'] - $discount_amount;
|
|
|
|
+ $payment_amount = $payment_amount < 0 ? 0 : $payment_amount;
|
|
|
|
|
|
|
|
+ $order_status = $payment_status = 1;
|
|
|
|
+ $payment_time = 0;
|
|
|
|
+ if ($payment_amount == 0) {
|
|
|
|
+ $order_status = $payment_status = 2;
|
|
|
|
+ $payment_time = time();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $config = null;
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
try {
|
|
try {
|
|
//保存订单数据
|
|
//保存订单数据
|
|
@@ -56,6 +68,9 @@ class OrderController extends AuthController
|
|
'payment_amount' => $payment_amount,
|
|
'payment_amount' => $payment_amount,
|
|
'discount_amount' => $discount_amount,
|
|
'discount_amount' => $discount_amount,
|
|
'patient_id' => $req['patient_id'],
|
|
'patient_id' => $req['patient_id'],
|
|
|
|
+ 'order_status' => $order_status,
|
|
|
|
+ 'payment_status' => $payment_status,
|
|
|
|
+ 'payment_time' => $payment_time,
|
|
]);
|
|
]);
|
|
$order_sn = build_sn($order['id']);
|
|
$order_sn = build_sn($order['id']);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
@@ -71,40 +86,261 @@ class OrderController extends AuthController
|
|
$addPatient['symptoms'] = $req['symptoms'];
|
|
$addPatient['symptoms'] = $req['symptoms'];
|
|
$addPatient['medical_imgs'] = $req['medical_imgs'];
|
|
$addPatient['medical_imgs'] = $req['medical_imgs'];
|
|
}
|
|
}
|
|
- elseif ($req['product_type'] == 3) {
|
|
|
|
- $addPatient['organization_id'] = $req['organization_id'];
|
|
|
|
- $addPatient['time_period_id'] = $req['time_period_id'];
|
|
|
|
- $timePeriod = TimePeriod::where('id', $req['time_period_id'])->first();
|
|
|
|
- $addPatient['appoint_start_time'] = strtotime($req['schedule_date'].' '.$timePeriod['start_time_period'].':00');
|
|
|
|
- $addPatient['appoint_end_time'] = strtotime($req['schedule_date'].' '.$timePeriod['end_time_period'].':00');
|
|
|
|
- }
|
|
|
|
OrderPatient::create($addPatient);
|
|
OrderPatient::create($addPatient);
|
|
//生成支付交易单
|
|
//生成支付交易单
|
|
- $trade_sn = build_sn($order['id'], 3, 'T');
|
|
|
|
- $payBody = '超级宝妈-'.config('config.product_type_map')[$req['product_type']];
|
|
|
|
- Payment::create([
|
|
|
|
|
|
+ if ($payment_amount > 0) {
|
|
|
|
+ $trade_sn = build_sn($order['id'], 3, 'T');
|
|
|
|
+ $payBody = '超级宝妈-'.config('config.product_type_map')[$req['product_type']];
|
|
|
|
+ Payment::create([
|
|
|
|
+ 'user_id' => $user['id'],
|
|
|
|
+ 'order_id' => $order['id'],
|
|
|
|
+ 'trade_sn' => $trade_sn,
|
|
|
|
+ 'amount' => $payment_amount,
|
|
|
|
+ 'remark' => $payBody,
|
|
|
|
+ ]);
|
|
|
|
+ //请求支付
|
|
|
|
+ $payment = Factory::payment(config('config.wechat_pay'));
|
|
|
|
+ $result = $payment->order->unify([
|
|
|
|
+ 'body' => $payBody,
|
|
|
|
+ 'out_trade_no' => $trade_sn,
|
|
|
|
+ 'total_fee' => $payment_amount,
|
|
|
|
+ 'trade_type' => 'JSAPI',
|
|
|
|
+ 'openid' => $user['openid'],
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if (empty($result['prepay_id'])) {
|
|
|
|
+ $errorMsg = !empty($result['err_code_des']) ? $result['err_code_des'] : $result['return_msg'];
|
|
|
|
+ return out(null, 702, $errorMsg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $config = $payment->jssdk->bridgeConfig($result['prepay_id'], false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DB::commit();
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+ DB::rollBack();
|
|
|
|
+ return out(null, 500, '下单失败,请稍后重试', $e->getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return out($config);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function appointPlaceOrder()
|
|
|
|
+ {
|
|
|
|
+ $req = request()->post();
|
|
|
|
+ $this->validate(request(), [
|
|
|
|
+ 'product_type' => 'required|in:3,4,5',
|
|
|
|
+ 'patient_id' => 'required|integer',
|
|
|
|
+ 'organization_id' => 'required|integer',
|
|
|
|
+ 'schedule_date' => 'required|date',
|
|
|
|
+ 'time_period_id' => 'required|integer',
|
|
|
|
+ 'total_amount' => 'required|integer',
|
|
|
|
+ 'user_coupon_id' => 'integer',
|
|
|
|
+ 'docter_id' => 'required_if:product_type,3|integer',
|
|
|
|
+ 'vaccine_id' => 'required_if:product_type,4|integer',
|
|
|
|
+ 'nurse_ids' => 'required_if:product_type,5|json',
|
|
|
|
+ ]);
|
|
|
|
+ $user = $this->user;
|
|
|
|
+
|
|
|
|
+ $product_type = $req['product_type'];
|
|
|
|
+
|
|
|
|
+ if ($req['product_type'] == 4) {
|
|
|
|
+ $vaccine = Vaccine::select(['type'])->where('id', $req['vaccine_id'])->first();
|
|
|
|
+ if ($vaccine['type'] == 2) {
|
|
|
|
+ if (empty($req['total_amount'])) {
|
|
|
|
+ return out(null, 10001, '总价不能为0');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $discount_amount = 0;
|
|
|
|
+ if (!empty($req['user_coupon_id'])) {
|
|
|
|
+ //计算优惠金额
|
|
|
|
+ $discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], $product_type);
|
|
|
|
+ }
|
|
|
|
+ $payment_amount = $req['total_amount'] - $discount_amount;
|
|
|
|
+ $payment_amount = $payment_amount < 0 ? 0 : $payment_amount;
|
|
|
|
+
|
|
|
|
+ $order_status = $payment_status = 1;
|
|
|
|
+ $payment_time = 0;
|
|
|
|
+ if ($payment_amount == 0) {
|
|
|
|
+ $order_status = $payment_status = 2;
|
|
|
|
+ $payment_time = time();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $config = null;
|
|
|
|
+ DB::beginTransaction();
|
|
|
|
+ try {
|
|
|
|
+ //保存订单数据
|
|
|
|
+ $order = Order::create([
|
|
'user_id' => $user['id'],
|
|
'user_id' => $user['id'],
|
|
- 'order_id' => $order['id'],
|
|
|
|
- 'trade_sn' => $trade_sn,
|
|
|
|
- 'amount' => $payment_amount,
|
|
|
|
- 'remark' => $payBody,
|
|
|
|
- ]);
|
|
|
|
- //请求支付
|
|
|
|
- $payment = Factory::payment(config('config.wechat_pay'));
|
|
|
|
- $result = $payment->order->unify([
|
|
|
|
- 'body' => $payBody,
|
|
|
|
- 'out_trade_no' => $trade_sn,
|
|
|
|
- 'total_fee' => $payment_amount,
|
|
|
|
- 'trade_type' => 'JSAPI',
|
|
|
|
- 'openid' => $user['openid'],
|
|
|
|
|
|
+ 'docter_id' => $req['docter_id'] ?? 0,
|
|
|
|
+ 'patient_id' => $req['patient_id'],
|
|
|
|
+ 'organization_id' => $req['organization_id'],
|
|
|
|
+ 'product_type' => $product_type,
|
|
|
|
+ 'order_status' => $order_status,
|
|
|
|
+ 'payment_status' => $payment_status,
|
|
|
|
+ 'total_amount' => $req['total_amount'],
|
|
|
|
+ 'payment_amount' => $payment_amount,
|
|
|
|
+ 'discount_amount' => $discount_amount,
|
|
|
|
+ 'payment_time' => $payment_time,
|
|
]);
|
|
]);
|
|
|
|
+ $order_sn = build_sn($order['id']);
|
|
|
|
+ Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
|
|
+ //保存订单患者信息
|
|
|
|
+ $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->toArray();
|
|
|
|
+ $addPatient['order_id'] = $order['id'];
|
|
|
|
+ $addPatient['patient_id'] = $req['patient_id'];
|
|
|
|
+ $addPatient['organization_id'] = $req['organization_id'];
|
|
|
|
+ $addPatient['time_period_id'] = $req['time_period_id'];
|
|
|
|
+ $timePeriod = TimePeriod::where('id', $req['time_period_id'])->first();
|
|
|
|
+ $addPatient['appoint_start_time'] = strtotime($req['schedule_date'].' '.$timePeriod['start_time_period'].':00');
|
|
|
|
+ $addPatient['appoint_end_time'] = strtotime($req['schedule_date'].' '.$timePeriod['end_time_period'].':00');
|
|
|
|
+ $orderPatient = OrderPatient::create($addPatient);
|
|
|
|
+ //保存订单疫苗信息
|
|
|
|
+ if ($req['product_type'] == 4) {
|
|
|
|
+ $addVaccine = Vaccine::select(['id vaccine_id', 'type vaccine_type', 'price vaccine_price', 'name vaccine_name', 'remark vaccine_remark', 'supplier vaccine_supplier'])->where('id', $req['vaccine_id'])->first()->toArray();
|
|
|
|
+ $addVaccine['order_id'] = $order['id'];
|
|
|
|
+ $addVaccine['order_patient_id'] = $orderPatient['id'];
|
|
|
|
+ OrderVaccine::create($addVaccine);
|
|
|
|
+ }
|
|
|
|
+ //保存儿保订单信息
|
|
|
|
+ if ($req['product_type'] == 5) {
|
|
|
|
+ $nurse_ids = json_decode($req['nurse_ids'], true);
|
|
|
|
+ foreach ($nurse_ids as $k => $v) {
|
|
|
|
+ $addNurse = Nurse::select(['id nurse_id', 'price nurse_price', 'name nurse_name', 'remark nurse_remark'])->where('id', $v)->first()->toArray();
|
|
|
|
+ $addNurse['order_id'] = $order['id'];
|
|
|
|
+ $addNurse['order_patient_id'] = $orderPatient['id'];
|
|
|
|
+ OrderNurse::create($addNurse);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //生成支付交易单
|
|
|
|
+ if ($payment_amount > 0) {
|
|
|
|
+ $trade_sn = build_sn($order['id'], 3, 'T');
|
|
|
|
+ $payBody = '超级宝妈-'.config('config.product_type_map')[$product_type];
|
|
|
|
+ Payment::create([
|
|
|
|
+ 'user_id' => $user['id'],
|
|
|
|
+ 'order_id' => $order['id'],
|
|
|
|
+ 'trade_sn' => $trade_sn,
|
|
|
|
+ 'amount' => $payment_amount,
|
|
|
|
+ 'remark' => $payBody,
|
|
|
|
+ ]);
|
|
|
|
+ //请求支付
|
|
|
|
+ $payment = Factory::payment(config('config.wechat_pay'));
|
|
|
|
+ $result = $payment->order->unify([
|
|
|
|
+ 'body' => $payBody,
|
|
|
|
+ 'out_trade_no' => $trade_sn,
|
|
|
|
+ 'total_fee' => $payment_amount,
|
|
|
|
+ 'trade_type' => 'JSAPI',
|
|
|
|
+ 'openid' => $user['openid'],
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if (empty($result['prepay_id'])) {
|
|
|
|
+ $errorMsg = !empty($result['err_code_des']) ? $result['err_code_des'] : $result['return_msg'];
|
|
|
|
+ return out(null, 702, $errorMsg);
|
|
|
|
+ }
|
|
|
|
|
|
- if (empty($result['prepay_id'])) {
|
|
|
|
- $errorMsg = !empty($result['err_code_des']) ? $result['err_code_des'] : $result['return_msg'];
|
|
|
|
- return out(null, 702, $errorMsg);
|
|
|
|
|
|
+ $config = $payment->jssdk->bridgeConfig($result['prepay_id'], false);
|
|
}
|
|
}
|
|
|
|
|
|
- $config = $payment->jssdk->bridgeConfig($result['prepay_id'], false);
|
|
|
|
|
|
+ DB::commit();
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+ DB::rollBack();
|
|
|
|
+ return out(null, 500, '下单失败,请稍后重试', $e->getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return out($config);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function packPlaceOrder()
|
|
|
|
+ {
|
|
|
|
+ $req = request()->post();
|
|
|
|
+ $this->validate(request(), [
|
|
|
|
+ 'patient_id' => 'required|integer',
|
|
|
|
+ 'total_amount' => 'required|integer',
|
|
|
|
+ 'user_coupon_id' => 'integer',
|
|
|
|
+ 'service_pack_id' => 'required|integer',
|
|
|
|
+ 'is_security' => 'required|in:0,1',
|
|
|
|
+ 'guardian_name' => 'required|max:50',
|
|
|
|
+ 'relationship_type' => 'required|integer',
|
|
|
|
+ ]);
|
|
|
|
+ $user = $this->user;
|
|
|
|
+
|
|
|
|
+ $discount_amount = 0;
|
|
|
|
+ if (!empty($req['user_coupon_id'])) {
|
|
|
|
+ //计算优惠金额
|
|
|
|
+ $discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], 6);
|
|
|
|
+ }
|
|
|
|
+ $payment_amount = $req['total_amount'] - $discount_amount;
|
|
|
|
+ $payment_amount = $payment_amount < 0 ? 0 : $payment_amount;
|
|
|
|
+
|
|
|
|
+ $order_status = $payment_status = 1;
|
|
|
|
+ $payment_time = 0;
|
|
|
|
+ if ($payment_amount == 0) {
|
|
|
|
+ $order_status = $payment_status = 2;
|
|
|
|
+ $payment_time = time();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $config = null;
|
|
|
|
+ DB::beginTransaction();
|
|
|
|
+ try {
|
|
|
|
+ //保存订单数据
|
|
|
|
+ $order = Order::create([
|
|
|
|
+ 'user_id' => $user['id'],
|
|
|
|
+ 'patient_id' => $req['patient_id'],
|
|
|
|
+ 'product_type' => 6,
|
|
|
|
+ 'docter_id' => $req['docter_id'],
|
|
|
|
+ 'total_amount' => $req['total_amount'],
|
|
|
|
+ 'payment_amount' => $payment_amount,
|
|
|
|
+ 'discount_amount' => $discount_amount,
|
|
|
|
+ 'order_status' => $order_status,
|
|
|
|
+ 'payment_status' => $payment_status,
|
|
|
|
+ 'payment_time' => $payment_time,
|
|
|
|
+ ]);
|
|
|
|
+ $order_sn = build_sn($order['id']);
|
|
|
|
+ Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
|
|
+ //保存订单患者信息
|
|
|
|
+ $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->toArray();
|
|
|
|
+ $addPatient['order_id'] = $order['id'];
|
|
|
|
+ $addPatient['patient_id'] = $req['patient_id'];
|
|
|
|
+ OrderPatient::create($addPatient);
|
|
|
|
+ //保存订单服务包表
|
|
|
|
+ $addPack = ServicePack::select(['id service_pack_id', 'name pack_name', 'intro pack_intro', 'price pack_price', 'team_id', 'phone_minutes', 'chat_num', 'appoint_num', 'vaccine_limit_amount', 'nurses_limit_amount', 'effective_days'])->where('id', $req['service_pack_id'])->first()->toArray();
|
|
|
|
+ $addPack['order_id'] = $order['id'];
|
|
|
|
+ $addPack['is_security'] = $req['is_security'];
|
|
|
|
+ $addPack['guardian_name'] = $req['guardian_name'];
|
|
|
|
+ $addPack['relationship_type'] = $req['relationship_type'];
|
|
|
|
+ $addPack['start_time'] = time();
|
|
|
|
+ $addPack['end_time'] = time() + $addPack['effective_days']*24*3600;
|
|
|
|
+ OrderPack::create($addPack);
|
|
|
|
+ //生成支付交易单
|
|
|
|
+ if ($payment_amount > 0) {
|
|
|
|
+ $trade_sn = build_sn($order['id'], 3, 'T');
|
|
|
|
+ $payBody = '超级宝妈-'.config('config.product_type_map')[6];
|
|
|
|
+ Payment::create([
|
|
|
|
+ 'user_id' => $user['id'],
|
|
|
|
+ 'order_id' => $order['id'],
|
|
|
|
+ 'trade_sn' => $trade_sn,
|
|
|
|
+ 'amount' => $payment_amount,
|
|
|
|
+ 'remark' => $payBody,
|
|
|
|
+ ]);
|
|
|
|
+ //请求支付
|
|
|
|
+ $payment = Factory::payment(config('config.wechat_pay'));
|
|
|
|
+ $result = $payment->order->unify([
|
|
|
|
+ 'body' => $payBody,
|
|
|
|
+ 'out_trade_no' => $trade_sn,
|
|
|
|
+ 'total_fee' => $payment_amount,
|
|
|
|
+ 'trade_type' => 'JSAPI',
|
|
|
|
+ 'openid' => $user['openid'],
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if (empty($result['prepay_id'])) {
|
|
|
|
+ $errorMsg = !empty($result['err_code_des']) ? $result['err_code_des'] : $result['return_msg'];
|
|
|
|
+ return out(null, 702, $errorMsg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $config = $payment->jssdk->bridgeConfig($result['prepay_id'], false);
|
|
|
|
+ }
|
|
|
|
|
|
DB::commit();
|
|
DB::commit();
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
@@ -126,7 +362,7 @@ class OrderController extends AuthController
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
- $builder = Order::with(['docter' => ['office', 'qualification'], 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine'])->where('user_id', $user['id']);
|
|
|
|
|
|
+ $builder = Order::with(['docter.office', 'docter.qualification', 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine'])->where('user_id', $user['id']);
|
|
if (!empty($req['product_type'])) {
|
|
if (!empty($req['product_type'])) {
|
|
$builder->where('product_type', $req['product_type']);
|
|
$builder->where('product_type', $req['product_type']);
|
|
}
|
|
}
|
|
@@ -164,7 +400,7 @@ class OrderController extends AuthController
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
- $data = Order::with(['docter' => ['office', 'qualification'], 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine'])->where('id', $req['order_id'])->where('user_id', $user['id'])->first();
|
|
|
|
|
|
+ $data = Order::with(['docter.office', 'docter.qualification', 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine'])->where('id', $req['order_id'])->where('user_id', $user['id'])->first();
|
|
|
|
|
|
return out($data);
|
|
return out($data);
|
|
}
|
|
}
|