first commit
This commit is contained in:
226
金壶/ydyd_service/application/api/controller/ServiceController.php
Normal file
226
金壶/ydyd_service/application/api/controller/ServiceController.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\service\OrderService;
|
||||
use app\common\service\PayService;
|
||||
use think\Db;
|
||||
use think\Exception;
|
||||
|
||||
class ServiceController extends ApiController
|
||||
{
|
||||
protected $noAuth = [];
|
||||
|
||||
/**
|
||||
* @apiDefine Service 售后管理
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiVersion 1.0.0
|
||||
* @api {post} /service/add 1.申请售后(朱晓伟)
|
||||
* @apiGroup Service
|
||||
* @apiHeader {String} authentication 验证
|
||||
* @apiParam {int} order_id 订单id
|
||||
* @apiParam {int} order_goods_id 订单商品id
|
||||
* @apiParam {int} order_goods_id 订单商品id
|
||||
* @apiParam {int} type 售后类型
|
||||
* @apiParam {String} reason 售后原因
|
||||
* @apiParam {String} refund_price 退款金额
|
||||
* @apiParam {String} refund_content 退款说明
|
||||
* @apiParam {Json} img 图片证明
|
||||
* @apiSuccessExample Success-Response:
|
||||
*{
|
||||
"code": 200,
|
||||
"message": "成功",
|
||||
"data": {
|
||||
"service_id": 1
|
||||
}
|
||||
}
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
try{
|
||||
$parames = input('');
|
||||
$parames['user_id'] = $this->uid;
|
||||
$data = model(OrderService::class)->addService($parames);
|
||||
return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'), $data);
|
||||
} catch (Exception $e) {
|
||||
return self::returnMsg($e->getCode(), $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @apiVersion 1.0.0
|
||||
* @api {post} /service/getList 2.售后列表(朱晓伟)
|
||||
* @apiGroup Service
|
||||
* @apiHeader {String} authentication 验证
|
||||
* @apiSuccessExample Success-Response:
|
||||
*{
|
||||
"code": 200,
|
||||
"message": "成功",
|
||||
"data": {
|
||||
"total": 2,
|
||||
"per_page": 20,
|
||||
"current_page": 1,
|
||||
"last_page": 1,
|
||||
"data": [{
|
||||
"order_sn": "19011917229620248565",
|
||||
"name": "复方陈香胃片",
|
||||
"app_thumb": "http:\/\/",
|
||||
"pc_thumb": null,
|
||||
"spec_desc": "0.56g*48s",
|
||||
"extend_data": "{\"name\": \"复方陈香胃片\", \"unit\": \"盒\", \"price\": \"5.30\", \"sketch\": \"复方陈香胃片\", \"gallery\": [\"http:\/\/hyey.cn\/uploadpic\/400\/a0021\/7387035\/7387035_0.jpg\", \"http:\/\/hyey.cn\/uploadpic\/400\/a0021\/7387035\/7387035_1.jpg\"], \"can_show\": 1, \"drug_form\": \"片剂\", \"spec_desc\": \"0.56g*48s\", \"stock_num\": \"99999+\", \"pc_content\": \"\", \"retail_num\": \"10\", \"show_price\": \"31.70\", \"retail_flag\": 0, \"batch_number\": \"18010701\", \"country_code\": \"Z36021569\", \"entirety_num\": \"200\", \"term_validity\": \"2019-12\", \"show_price_int\": 31, \"extend_goods_id\": \"b8a00217387035180107011\", \"show_price_float\": 69, \"manufacturer_name\": \"江西天施康中药股份有限公司\"}",
|
||||
"goods_number": 10,
|
||||
"unit_price": "5.30",
|
||||
"retail_flag": "整",
|
||||
"manufacturer_name": "江西天施康中药股份有限公司",
|
||||
"id": 2,
|
||||
"order_id": 124,
|
||||
"order_goods_id": 102,
|
||||
"user_id": 298,
|
||||
"status": 1,
|
||||
"type": 0,
|
||||
"reason": null,
|
||||
"refund_price": null,
|
||||
"refund_content": null,
|
||||
"img": null,
|
||||
"admin_user_id": 0,
|
||||
"express": 0,
|
||||
"express_sn": null,
|
||||
"express_remarks": null,
|
||||
"create_time": "1970-01-01",
|
||||
"update_time": "1970-01-01",
|
||||
"delete_time": null,
|
||||
"total_price": 53,
|
||||
"status_text": "订单信息",
|
||||
"type_text": ""
|
||||
}, {
|
||||
"order_sn": "19011917229620248565",
|
||||
"name": "柴黄颗粒",
|
||||
"app_thumb": "http:\/\/ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com\/pc_shop_thumb_url_1542080800757.jpg",
|
||||
"pc_thumb": "ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com\/pc_shop_thumb_url_1542080800757.jpg",
|
||||
"spec_desc": "4g*12袋",
|
||||
"extend_data": null,
|
||||
"goods_number": 200,
|
||||
"unit_price": "10.50",
|
||||
"retail_flag": "零",
|
||||
"manufacturer_name": "江西京通美联药业有限公司",
|
||||
"id": 1,
|
||||
"order_id": 124,
|
||||
"order_goods_id": 1279,
|
||||
"user_id": 298,
|
||||
"status": 1,
|
||||
"type": 0,
|
||||
"reason": null,
|
||||
"refund_price": null,
|
||||
"refund_content": null,
|
||||
"img": null,
|
||||
"admin_user_id": 0,
|
||||
"express": 0,
|
||||
"express_sn": null,
|
||||
"express_remarks": null,
|
||||
"create_time": "1970-01-01",
|
||||
"update_time": "1970-01-01",
|
||||
"delete_time": null,
|
||||
"total_price": 2100,
|
||||
"status_text": "订单信息",
|
||||
"type_text": ""
|
||||
}]
|
||||
}
|
||||
}
|
||||
*/
|
||||
public function getList()
|
||||
{
|
||||
try{
|
||||
$parames = input('');
|
||||
$parames['user_id'] = $this->uid;
|
||||
$data = model(OrderService::class)->getServiceList($parames);
|
||||
return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'), $data);
|
||||
} catch (Exception $e) {
|
||||
return self::returnMsg($e->getCode(), $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @apiVersion 1.0.0
|
||||
* @api {post} /service/getInfo 3.售后详情(朱晓伟)
|
||||
* @apiGroup Service
|
||||
* @apiHeader {String} authentication 验证
|
||||
* @apiParam {int} id 服务id
|
||||
* @apiSuccessExample Success-Response:
|
||||
*{
|
||||
"code": 200,
|
||||
"message": "成功",
|
||||
"data": {
|
||||
"service_id": 1
|
||||
}
|
||||
}
|
||||
*/
|
||||
public function getInfo()
|
||||
{
|
||||
try{
|
||||
$parames = input('');
|
||||
$parames['user_id'] = $this->uid;
|
||||
$data = model(OrderService::class)->getServiceInfo($parames);
|
||||
return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'), $data);
|
||||
} catch (Exception $e) {
|
||||
return self::returnMsg($e->getCode(), $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @apiVersion 1.0.0
|
||||
* @api {post} /service/express 4.提交物流(朱晓伟)
|
||||
* @apiGroup Service
|
||||
* @apiHeader {String} authentication 验证
|
||||
* @apiParam {int} id 服务id
|
||||
* @apiParam {String} express 物流公司
|
||||
* @apiParam {String} express_sn 物流单号
|
||||
* apiParam {String} [express_remarks] 物流备注
|
||||
* @apiSuccessExample Success-Response:
|
||||
*{
|
||||
"code": 200,
|
||||
"message": "成功",
|
||||
"data": {
|
||||
"service_id": 1
|
||||
}
|
||||
}
|
||||
*/
|
||||
public function express()
|
||||
{
|
||||
try{
|
||||
$parames = input('');
|
||||
$parames['user_id'] = $this->uid;
|
||||
$data = model(OrderService::class)->submitService($parames);
|
||||
return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'), $data);
|
||||
} catch (Exception $e) {
|
||||
return self::returnMsg($e->getCode(), $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @apiVersion 1.0.0
|
||||
* @api {post} /service/cancel 5.撤销售后(朱晓伟)
|
||||
* @apiGroup Service
|
||||
* @apiHeader {String} authentication 验证
|
||||
* @apiParam {int} id 服务id
|
||||
* @apiSuccessExample Success-Response:
|
||||
*{
|
||||
"code": 200,
|
||||
"message": "成功",
|
||||
"data": {
|
||||
"service_id": 1
|
||||
}
|
||||
}
|
||||
*/
|
||||
public function cancel()
|
||||
{
|
||||
try{
|
||||
$parames = input('');
|
||||
$parames['user_id'] = $this->uid;
|
||||
$data = model(OrderService::class)->cancelService($parames);
|
||||
return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'), $data);
|
||||
} catch (Exception $e) {
|
||||
return self::returnMsg($e->getCode(), $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user