82 lines
2.1 KiB
PHP
82 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace app\modules\api\controllers;
|
|
|
|
use app\models\DeviceUniqueConfig;
|
|
use app\models\DeviceUniqueData;
|
|
use function AlibabaCloud\Client\value;
|
|
use app\models\Banner;
|
|
use app\models\Store;
|
|
use app\modules\api\models\CoachForm;
|
|
use app\modules\api\models\DeviceUniqueDataForm;
|
|
use app\modules\api\models\StoreForm;
|
|
use app\modules\api\models\StoreCityForm;
|
|
use app\modules\api\models\UserBasicInfoForm;
|
|
use Yii;
|
|
use yii\web\NotFoundHttpException;
|
|
use yii\filters\VerbFilter;
|
|
use app\modules\api\behaviors\LoginBehavior;
|
|
|
|
/**
|
|
*教练
|
|
*/
|
|
class CoachController extends Controller
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function behaviors()
|
|
{
|
|
return array_merge(parent::behaviors(), [
|
|
'verbs' => [
|
|
'class' => VerbFilter::className(),
|
|
'actions' => [
|
|
'delete' => ['POST'],
|
|
],
|
|
],
|
|
'login' => [
|
|
'class' => LoginBehavior::className(),
|
|
'ignore' => [
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* 学员列表
|
|
*/
|
|
public function actionIndex()
|
|
{
|
|
$request = Yii::$app->request;
|
|
$get = $request->get();
|
|
$coachForm = new CoachForm();
|
|
$coachForm->cx_mch_id = $this->cx_mch_id;
|
|
$coachForm->user_id = \Yii::$app->user->identity->id;
|
|
$coachForm->user_type = \Yii::$app->user->identity->type;
|
|
|
|
$coachForm->page = $get['page'];
|
|
$coachForm->limit = $get['limit'];
|
|
$coachForm->name = $get['name'];
|
|
$data = $coachForm->search();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
|
|
/**
|
|
*学员数据
|
|
*/
|
|
public function actionStudent()
|
|
{
|
|
$form = new DeviceUniqueDataForm();
|
|
$request = Yii::$app->request;
|
|
$get = $request->get();
|
|
$form->attributes = Yii::$app->request->get();
|
|
$form->user_id = $request->get('user_id');
|
|
$form->page = $get['page'];
|
|
$form->limit = $get['limit'];
|
|
$data = $form->historicalData();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
}
|