Пример #1
0
 /**
  *
  */
 public function actionUpdate()
 {
     $aApi = Api::find()->all();
     foreach ($aApi as $mApi) {
         UpdaterAccountApi::update($mApi);
     }
 }
 /**
  *
  */
 public function actionUpdate()
 {
     $aApi = Api::find()->all();
     foreach ($aApi as $mApi) {
         if ($mApi->characters) {
             foreach ($mApi->characters as $mCharacter) {
                 UpdaterCharacterMarketOrder::update($mApi->keyID, $mApi->vCode, $mCharacter->characterID);
             }
         }
     }
 }
Пример #3
0
 public function actionIndex()
 {
     $condition = [];
     $condition['status'] = 1;
     $query = Api::find()->where($condition);
     $query->orderBy('created_at DESC');
     $models = $query->all();
     $output = [];
     foreach ($models as $model) {
         $item = ['id' => $model->id, 'api_name' => $model->api_name, 'api_url' => $model->api_url, 'api_type' => $model->type, 'created_at' => $model->created_at ? date("Y-m-d H:i:s", $model->created_at) : ''];
         $output[] = $item;
     }
     return $this->render('index', ['list' => $output]);
 }
Пример #4
0
 /**
  * @return string
  */
 public function actionList()
 {
     $this->getView()->addBread('List');
     $apis = Api::find()->where(['userID' => \Yii::$app->user->id])->all();
     return $this->render('list', ['apis' => $apis]);
 }
 public function subscribe(Request $request)
 {
     $data = $request->all();
     $rules = ['growpage' => 'required|exists:relink_snips,id'];
     $this->validate($request, $rules);
     $growPage_item = ReLinkSnips::find($data['growpage']);
     $api = Api::find($growPage_item['api']);
     $service = UserService::where(['user_id' => $growPage_item['user_id'], 'api_id' => $growPage_item['api']])->first();
     $name = str_replace(' ', '', strtolower($api->name));
     $this->{$name}($service, $data['email']);
 }