我的金币
@param int $id
@return string
11551
public function actionIndex($id)
    {
        $model = $this->findModel($id);
        $dataProvider = new ActiveDataProvider([
            'query' => Coin::find()->where(['user_id' => $model->id])->orderBy(['created_at' => SORT_DESC]),
        ]);
        return $this->render('index', [
            'model' => $model,
            'dataProvider' => $dataProvider
        ]);
    }
670250
public function hasFollow($id=0)
    {
        //检查临时存放
        $server_val = $this->searchServeVal('follow_state');
        count($server_val) ? $not_follow_list = explode('|', $server_val) : $not_follow_list = $this->getWechatUsersNotFollow();

        if ($id === 0) $id = Session::get('id');

        $work_id = Member::find($id)->work_id;

        return array_search($work_id, $not_follow_list) === false ? true : false;

    }
591608
public function loginById($id)
    {
        /** @var User $user */
        $user = wei()->user()->findById($id);
        if (!$user) {
            return ['code' => -1, 'message' => '用户不存在'];
        } else {
            return $this->loginByRecord($user);
        }
    }
549910
public function actionAppendReward($id)
    {
        /** @var Question $model */
        $model = $this->findModel($id);
        if ($model->isAuthor()) {
            $coins = Yii::$app->request->post('coins', 0);
            //此处开始扣钱
            $transaction = Question::getDb()->beginTransaction();
            try {
                if (function_exists('credit')) {
                    credit($model->user_id, 'answer_adopted', -$coins, $model->id, $model->title);
                }

                $model->updateCounters(['price' => $coins]);
                $model->save();
                if (function_exists('doing')) {
                    doing($model->user_id, 'append_reward', get_class($model), $model->id, $model->title, "追加了 " . $coins . " 个积分");
                }
                Yii::$app->session->setFlash('success', 'question Submitted');
                $transaction->commit();
            } catch (\Exception $e) {
                $transaction->rollBack();
                Yii::$app->session->setFlash('error', 'question Submitted');
            }
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            Yii::$app->session->setFlash('danger', Yii::t('yii', 'You are not allowed to perform this action.'));
            return $this->redirect(['/question/question/view', 'id' => $model->id]);
        }
    }
1096507
function card($id) {
		$id=preg_replace('/[^\d]/','',$id);
		if ($this->mod10($id)) {
			if (preg_match('/^3[47][0-9]{13}$/',$id))
				return 'American Express';
			if (preg_match('/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/',$id))
				return 'Diners Club';
			if (preg_match('/^6(?:011|5[0-9][0-9])[0-9]{12}$/',$id))
				return 'Discover';
			if (preg_match('/^(?:2131|1800|35\d{3})\d{11}$/',$id))
				return 'JCB';
			if (preg_match('/^5[1-5][0-9]{14}$|'.
				'^(222[1-9]|2[3-6]\d{2}|27[0-1]\d|2720)\d{12}$/',$id))
				return 'MasterCard';
			if (preg_match('/^4[0-9]{12}(?:[0-9]{3})?$/',$id))
				return 'Visa';
		}
		return FALSE;
	}
178630
public function actionDelete($id)
    {
        $subCount = Menu::find()->where('`pid`=:id',[':id'=>$id])->count();
        if($subCount == 0) { //不包含子菜单时 方可删除
            $this->findModel($id)->delete();
        }
        return $this->redirect(['index']);
    }
1309117
public function getCharacter4Id($id)
    {
        /** @var \GameBackend\Entity\CrossFire\Repository\Character $repository */
        $repository = $this->getAccountEntityManager()->getRepository($this->getGameOptions()->getEntityCharacterClass());
        return $repository->getCharacter4Id($id);
    }
26163
public function actionView($id)
    {
        /** @var Question $model */
        $model = $this->findModel($id);

        /*问题查看数+1*/
        if (!$model->isAuthor()) $model->updateCounters(['views' => 1]);

        /*已解决问题*/
        $bestAnswer = null;
        if ($model->status === Question::STATUS_END) {
            $bestAnswer = $model->getAnswers()->where(['>', 'adopted_at', '0'])->one();
        }
        /** @var Answer $query 回答列表 */
        $query = $model->getAnswers()->with('user');

        $answerOrder = $query->applyOrder(Yii::$app->request->get('answers', 'supports'));

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        return $this->render('view', [
            'model' => $model,
            'answerOrder' => $answerOrder,
            'bestAnswer' => $bestAnswer,
            'dataProvider' => $dataProvider
        ]);
    }
691083
public function read($id) : string
    {
        if ($session = $this->walk('read', null, [$id])) {
            self::$session = $session;
            return self::$session['data'];
        }
        return '';
    }
1322430
public static function id($id, $options = []) {
		if (is_array($id)) {
			$result = [];
			foreach ($id as $v) {
				$result[] = self::numberToFromNativeLanguage($v . '', $options);
			}
			return implode(self::$symbol_comma . ' ', $result);
		} else {
			return self::numberToFromNativeLanguage($id . '', $options);
		}
	}
1027593
protected function getValue($id)
    {
        $file = $this->getFile($id);
        if (!file_exists($file)) {
            return null;
        }
        if (filemtime($file) < time()) { // filemtime : 文件最后修改时间
            @unlink($file);
            return null;
        }
        return file_get_contents($file);
    }
936538
public function show($id): Model
    {
        $result = $this->repo->with(['parentCate'])->find($id);

        if (is_null($result)) {
            throw new CommodityCateException("没有找到对应的商品分类", ExceptionCode::NOT_FIND_RESOURCE);
        }

        return $result;
    }
805320
public static function convertId($id)
    {
        if (strlen($id) === 17) {
            $converted = substr($id, 3) - 61197960265728;
        } else {
            $converted = '765' . ($id + 61197960265728);
        }
        return (string)$converted;
    }
668747
protected function getFileName($id)
    {
        $directory = $this->getDirectory($id);
        $hash      = sha1($id, false);
        $file      = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';
        return $file;
    }
284631
public function MangaMoreInfo(int $id): ?string
    {
        return $this->myanimelist->getMangaMoreInfo(
            new Request\Manga\MangaMoreInfoRequest($id)
        );
    }
1195051
public function fetchIssue($id)
    {
        $this->connect();

        return $this->soapClient->getIssue($this->token, $id);
    }
1224539
protected function getCacheHash($id)
    {
        if (is_array($id)) {
            $id = Util::filterScalarValues($id);
            $id = array_map(
                function ($child) {
                    return (string)$child; //Converts ids from integer to string => Parameters for transform and reverse functions must be identicals
                },
                $id
            );
            sort($id);
        } else {
            $id = (string) $id;
        }

        return md5(
            json_encode(
                array(
                    spl_object_hash($this->queryBuilder),
                    $this->identifier,
                    $id,
                )
            )
        );
    }