40 lines
937 B
PHP
40 lines
937 B
PHP
<?php
|
|
|
|
namespace app\modules\api\controllers;
|
|
|
|
use app\models\Report;
|
|
use app\modules\api\models\ReportForm;
|
|
|
|
class ReportStartController extends \app\controllers\Controller
|
|
{
|
|
/**
|
|
* @return array|mixed|null
|
|
*/
|
|
public function actionStart()
|
|
{
|
|
$storeId = \Yii::$app->request->get('store_id', 3);
|
|
|
|
$reportForm = new ReportForm();
|
|
|
|
$data = $reportForm->getStartByStoreId($storeId);
|
|
|
|
return $this->responseHandler(['code' => 0, 'msg' => '请求成功', 'data' => $data]);
|
|
}
|
|
|
|
/**
|
|
* @return array|mixed|null
|
|
*/
|
|
public function actionUpload()
|
|
{
|
|
$leftImg = \Yii::$app->request->get('left');
|
|
$rightImg = \Yii::$app->request->get('right');
|
|
$id = \Yii::$app->request->get('id');
|
|
|
|
$reportForm = new ReportForm();
|
|
|
|
$data = $reportForm->uploadModule($id, $leftImg, $rightImg);
|
|
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
} |