123 lines
2.9 KiB
PHP
123 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace app\modules\api\controllers;
|
|
|
|
use app\components\SiteHelper;
|
|
use app\modules\api\models\SigningForm;
|
|
|
|
class SigningController extends Controller
|
|
{
|
|
|
|
/**
|
|
* showdoc
|
|
* @catalog 签约订单
|
|
* @title 业务类型
|
|
* @description 本接口用于签约订单
|
|
* @method get
|
|
* @url /api/signing/signing-type
|
|
* @return {"code":0,"msg":"ok","data":[]}
|
|
|
|
* @remark
|
|
*/
|
|
public function actionSigningType()
|
|
{
|
|
$type = SiteHelper::getCustomiseOptionByKey("siteSigningType", "hump");
|
|
|
|
return $this->responseHandler(['data' => explode('|', $type)]);
|
|
}
|
|
|
|
/**
|
|
* showdoc
|
|
* @catalog 签约订单
|
|
* @title 签约协议
|
|
* @description 本接口用于签约订单
|
|
* @method get
|
|
* @url /api/signing/signing
|
|
* @return {"code":0,"msg":"ok","data":[]}
|
|
|
|
* @remark
|
|
*/
|
|
public function actionSigning()
|
|
{
|
|
$type = SiteHelper::getCustomiseOptionByKey("siteSigning", "hump");
|
|
|
|
return $this->responseHandler(['data' => $type]);
|
|
}
|
|
|
|
/**
|
|
* showdoc
|
|
* @catalog 签约订单
|
|
* @title 签约
|
|
* @description 本接口用于签约订单
|
|
* @method post
|
|
* @url /api/signing/signing-add
|
|
* @param goods_hub_id 必选 int 签约商品id
|
|
* @param company_name 必选 string 公司名称
|
|
* @param brand_name 必选 string 品牌名称
|
|
* @param product 必选 string 主营产品
|
|
* @param type 必选 int 业务类型
|
|
* @param number 必选 int 签约年限
|
|
* @param remark 必选 int 备注
|
|
* @return {"code":0,"msg":"ok","data":[]}
|
|
|
|
* @remark
|
|
*/
|
|
public function actionSigningAdd()
|
|
{
|
|
if (!\Yii::$app->request->isPost) {
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
$signingForm = new SigningForm();
|
|
|
|
$signingForm->attributes = \Yii::$app->request->post();
|
|
|
|
return $signingForm->add();
|
|
|
|
}
|
|
|
|
/**
|
|
* showdoc
|
|
* @catalog 签约订单
|
|
* @title 签约
|
|
* @description 本接口用于签约订单
|
|
* @method get
|
|
* @url /api/signing/signing-detail
|
|
* @param order_no 必选 int 订单号
|
|
* @return {"code":0,"msg":"ok","data":[]}
|
|
|
|
* @remark
|
|
*/
|
|
|
|
public function actionSigningDetail()
|
|
{
|
|
$orderNo = \Yii::$app->request->get('order_no');
|
|
|
|
$signingForm = new SigningForm();
|
|
|
|
return $signingForm->orderDetail($orderNo);
|
|
}
|
|
|
|
/**
|
|
* showdoc
|
|
* @catalog 签约订单
|
|
* @title 签约列表
|
|
* @description 本接口用于签约订单
|
|
* @method get
|
|
* @url /api/signing/signing-list
|
|
* @param status 可选 int 订单状态
|
|
* @return {"code":0,"msg":"ok","data":[]}
|
|
|
|
* @remark
|
|
*/
|
|
public function actionSigningList()
|
|
{
|
|
$signingForm = new SigningForm();
|
|
|
|
$status = \Yii::$app->request->get('status');
|
|
|
|
return $signingForm->orderList($status);
|
|
}
|
|
|
|
} |