123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2020/6/19
- * Time: 上午11:52
- */
- namespace app\main\service;
- use app\main\constants\ApiConstants;
- class AutoreplyService extends BaseService
- {
- /**
- * @var AutoreplyService
- */
- protected static $self = null;
- /**
- * @return $this
- */
- public static function instance()
- {
- if (self::$self == null) {
- self::$self = new self();
- }
- return self::$self;
- }
- /**
- * 获取迁移后的数据
- * @param $ids
- * @return \app\main\model\object\ReturnObject
- */
- public function getMigrateData($ids)
- {
- $list = [];
- $data = ApiService::instance()->getCollectFromApi(ApiConstants::API_KEYWORDS, ['ids' => $ids])->data;
- foreach ($ids as $id) {
- $list[$id] = [
- 'uv' => 0,
- 'subscribe' => 0,
- 'money' => 0,
- ];
- }
- if ($data) {
- foreach ($data as $item) {
- $list[$item['aid']] = [
- 'uv' => $item['uv'],
- 'subscribe' => $item['subscribe'],
- 'money' => $item['money'],
- ];
- }
- }
- return $this->setData($list)->getReturn();
- }
- }
|