ReferralService.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: lytian
  5. * Date: 2019/6/12
  6. * Time: 17:13
  7. */
  8. namespace app\main\service;
  9. use app\admin\library\Auth;
  10. use app\admin\library\ShortUrl;
  11. use app\common\constants\AppConstants;
  12. use app\common\library\Redis;
  13. use app\common\library\WeChatObject;
  14. use app\common\model\object\ReferralObject;
  15. use app\common\model\Referral;
  16. use app\common\model\ReferralDayCollect;
  17. use app\common\service\ResourceService;
  18. use app\main\constants\AdminConstants;
  19. use app\main\constants\ApiConstants;
  20. use app\main\constants\CacheConstants;
  21. use app\main\constants\ErrorCodeConstants;
  22. use app\main\helper\ArrayHelper;
  23. use think\Config;
  24. use think\Log;
  25. use app\main\model\object\ReturnObject;
  26. class ReferralService extends BaseService
  27. {
  28. /**
  29. * 定义属性
  30. *
  31. * @var ReferralService
  32. */
  33. protected static $self = null;
  34. /**
  35. * 返回实例
  36. *
  37. * @return ReferralService
  38. */
  39. public static function instance()
  40. {
  41. if (self::$self == null) {
  42. self::$self = new self();
  43. }
  44. return self::$self;
  45. }
  46. /**
  47. * 返回推广链接每日统计model
  48. *
  49. * @return ReferralDayCollect
  50. */
  51. public function getReferralDayCollectModel()
  52. {
  53. return model('ReferralDayCollect');
  54. }
  55. /**
  56. * 返回推广链接model
  57. *
  58. * @return Referral
  59. */
  60. public function getReferralModel()
  61. {
  62. return model('Referral');
  63. }
  64. /**
  65. * 更新推广链接每日数据
  66. *
  67. * @param $referral_id
  68. * @param array $data
  69. * @return false|int
  70. */
  71. public function updateDayData($referral_id, $data = [], $time = 0)
  72. {
  73. $createDate = date("Ymd");
  74. if ($time) {
  75. $createDate = date("Ymd", $time);
  76. }
  77. $updateDataFields = [
  78. 'pv',
  79. 'uv',
  80. 'follow_num',
  81. 'unfollow_num',
  82. 'net_follow_num',
  83. 'incr_num',
  84. 'recharge_money',
  85. 'orders_num',
  86. 'all_recharge_money'
  87. ];
  88. $row = $this->getReferralDayCollectModel()
  89. ->where('referral_id', 'eq', $referral_id)
  90. ->where('createdate', 'eq', $createDate)
  91. ->find();
  92. if (empty($row)) {
  93. return $this->createDayData($referral_id, $data, $createDate);
  94. } else {
  95. //更新
  96. if ($row['all_recharge_money'] <= 0) {
  97. $allMoney = $this->getReferralModel()
  98. ->where('id', 'eq', $referral_id)->value('money');
  99. $data['all_recharge_money'] = $allMoney ?: 0;
  100. } else {
  101. $data['all_recharge_money'] = $data['recharge_money'];
  102. }
  103. foreach ($data as $key=>$val) {
  104. if (in_array($key, $updateDataFields)) {
  105. $row->$key = ['exp', "($key+$val)"];
  106. } else {
  107. if (in_array($val, $updateDataFields)) {
  108. $row->$val = ['exp', "($val+1)"];
  109. }
  110. }
  111. }
  112. return $row->save();
  113. }
  114. }
  115. /**
  116. * 创建日统计数据
  117. *
  118. * @param $referral_id
  119. * @param array $data
  120. * @return false|int
  121. */
  122. public function createDayData($referral_id, $data = [], $createDate = null)
  123. {
  124. $referral = $this->getReferralModel()
  125. ->where('id', 'eq', $referral_id)
  126. ->find();
  127. $allMoney = $referral['money'];
  128. if (empty($allMoney)) {
  129. Log::error("支付回调每日数据新增时money字段为null---{$referral_id}");
  130. }
  131. $saveData = [
  132. 'referral_id' => $referral_id,
  133. 'createdate' => $createDate ?: date("Ymd"),
  134. 'createtime' => time(),
  135. 'updatetime' => time(),
  136. 'all_recharge_money' => $allMoney ?: 0,
  137. ];
  138. $saveData = array_merge($saveData, $data);
  139. return $this->getReferralDayCollectModel()
  140. ->allowField(true)
  141. ->save($saveData);
  142. }
  143. public function getAdminReferralList($admin_id, $push = '0', $where = [], $sort = 'referral.money', $order = 'desc', $offset = 0, $limit = 10)
  144. {
  145. $condition = [
  146. 'push' => $push,
  147. ];
  148. $group = Auth::instance()->getGroups($admin_id);
  149. $timeBetween = (time() - 86400 * 7) . ',' . time();
  150. switch ($group[0]['group_id']) {
  151. case AdminConstants::ADMIN_GROUP_ID_ADMIN:
  152. $total = $this->getReferralModel()
  153. ->join('book', 'book.id=referral.book_id', "LEFT")
  154. ->join('admin_extend', 'admin_extend.admin_id=referral.admin_id', 'INNER')
  155. ->where('admin_extend.create_by', $admin_id)
  156. ->where($where)
  157. ->where($condition)
  158. ->whereBetween('referral.createtime',$timeBetween)
  159. ->count();
  160. $list = $this->getReferralModel()
  161. ->join('book', 'book.id=referral.book_id', "LEFT")
  162. ->join('admin_extend', 'admin_extend.admin_id=referral.admin_id', 'INNER')
  163. ->where('admin_extend.create_by', $admin_id)
  164. ->where($where)
  165. ->where($condition)
  166. ->whereBetween('referral.createtime',$timeBetween)
  167. // ->order('id', 'desc')
  168. ->order($sort, $order)
  169. ->limit($offset, $limit)
  170. ->field('referral.*,book.name as book_name')
  171. ->select();
  172. break;
  173. case AdminConstants::ADMIN_GROUP_ID_SUPER_ADMIN:
  174. case AdminConstants::ADMIN_GROUP_ID_TECHNICAL_SUPPORT:
  175. $total = $this->getReferralModel()
  176. ->join('book', 'book.id=referral.book_id', "LEFT")
  177. ->join('auth_group_access', 'auth_group_access.uid=referral.admin_id', 'INNER')
  178. ->where('auth_group_access.group_id', AdminConstants::ADMIN_GROUP_ID_CHANNEL)
  179. ->where($where)
  180. ->where($condition)
  181. ->whereBetween('referral.createtime',$timeBetween)
  182. ->count();
  183. $list = $this->getReferralModel()
  184. ->join('book', 'book.id=referral.book_id', "LEFT")
  185. ->join('auth_group_access', 'auth_group_access.uid=referral.admin_id', 'INNER')
  186. ->where('auth_group_access.group_id', AdminConstants::ADMIN_GROUP_ID_CHANNEL)
  187. ->where($where)
  188. ->where($condition)
  189. ->whereBetween('referral.createtime',$timeBetween)
  190. // ->order('id', 'desc')
  191. ->order($sort, $order)
  192. ->limit($offset, $limit)
  193. ->field('referral.*,book.name as book_name')
  194. ->select();
  195. break;
  196. default:
  197. $total = 0;
  198. $list = [];
  199. }
  200. $migrateCollectList = [];
  201. $migrate = VisitLimitService::instance()->checkMigratedV2();
  202. if ($migrate) {
  203. $referralIds = array_column($list, 'id');
  204. $migrateCollectList = ReferralService::instance()->getReferralCollectFromApi($referralIds)->data;
  205. }
  206. foreach ($list as $k => $v) {
  207. //获取当前书籍的默认关注章节
  208. if (empty($v['guide_chapter_idx']) && !empty($v['book_id'])) {
  209. $default_chapter_idx = model('Guide')->getGuideChapter($v['admin_id'], $v['book_id'], 0, $v['admin_id']);
  210. $list[$k]['guide_chapter_idx'] = $default_chapter_idx;
  211. }
  212. $adminConfig = model('adminConfig')->getAdminInfoAll($v['admin_id']);
  213. $url_referral = Config::get('site.scheme') . '://' . $adminConfig['appid'] . '.' . $adminConfig['ophost_host'];
  214. $list[$k]['url_referral'] = $url_referral . '/t/' . $v['id'];
  215. $list[$k]['skin_url'] = $this->getSkinUrl($v['id'], $v['source_url']);
  216. if ($migrate) {
  217. if (array_key_exists($v['id'], $migrateCollectList)) {
  218. $list[$k] = array_merge($list[$k]->getData(), $migrateCollectList[$v['id']]);
  219. }
  220. } else {
  221. $dayMTkey = "M-T:".$v['id'].":".date("d"); //今日充值金额key
  222. $list[$k]['dayuv'] = (int)Redis::instance()->get(CacheConstants::getReadOfReferralIdKey($v['id']));
  223. $list[$k]['dayut'] = (int)Redis::instance()->get(CacheConstants::getSubscribeOfReferralIdKey($v['id'])); //今日关注人数
  224. $list[$k]['daymt'] = (int)Redis::instance()->get($dayMTkey)? round(Redis::instance()->get($dayMTkey) / 100, 2) :0; //今日充值金额
  225. $list[$k]['dayjt'] = (int)Redis::instance()->get(CacheConstants::getSubscribeOfPureReferralIdKey($v['id'])); //今日净关注人数
  226. $list[$k]['dayqt'] = (int)Redis::instance()->get(CacheConstants::getUnsubscribeOfReferralIdKey($v['id'])); //今日取消关注人数
  227. $list[$k]['net_follow_num'] = (int)$list[$k]['net_follow_num'];
  228. $dayMTNkey = "M-T-N:".$v['id'].":".date("d"); //今日充值笔数key
  229. $list[$k]['order_nums'] = (int)$list[$k]['orders_num'];
  230. $list[$k]['day_order_nums'] = (int)Redis::instance()->get($dayMTNkey);
  231. }
  232. $list[$k]['book'] = [
  233. 'name' => isset($v['book_name'])?$v['book_name']:'',
  234. ];
  235. if (!empty($v['book_id'])) {
  236. $isLimited = model('BookLimit')->backendHasLimit(0, $v['admin_id'], $v['book_id']);
  237. if ($isLimited) {
  238. $list[$k]['limited'] = 1;
  239. } else {
  240. $list[$k]['limited'] = 0;
  241. }
  242. } else {
  243. $list[$k]['limited'] = 0;
  244. }
  245. $list[$k]['short_url'] = replaceShortDomain($list[$k]['url_referral'], $v['short_id']);
  246. }
  247. return $this->setData(["total" => $total, "rows" => $list])->getReturn();
  248. }
  249. public function getSkinUrl($referral_id, $default_url, $channel_id='')
  250. {
  251. //$channel_id = $this->getChannelIdByReferralId($referral_id);
  252. $domain = AppConstants::getRandomFrontDomain();
  253. Log::info('skinUrl:domain:'.$domain);
  254. $base_url = "";
  255. if(!$domain){
  256. $default_url = str_replace(["https://", "http://"], ["", ""], $default_url);
  257. $url = $base_url . $default_url;
  258. }else{
  259. //$url = $base_url . $domain . "/referral.html?t=" . $referral_id . "&type=code&channel_id=".$channel_id;
  260. $url = $base_url . $domain . "/referral.html?t=" . $referral_id . "&type=code";
  261. }
  262. Log::info('skinUrl:'.$url);
  263. return $url;
  264. }
  265. /**
  266. * 是否回源链接
  267. * @param $referral_id
  268. * @param bool $admin_id
  269. * @return int
  270. * @throws \think\exception\DbException
  271. */
  272. public function isAdReferral($referral_id, $admin_id = false)
  273. {
  274. $is = 0;
  275. $redisKey = 'CADH:'.$referral_id;
  276. $relationId = Redis::instance()->get($redisKey);
  277. if ($relationId !== false) {
  278. //延长时间
  279. Redis::instance()->expire($redisKey, 600);
  280. $is = $relationId;
  281. } else {
  282. //查库
  283. $id = 0;
  284. if (!$admin_id) {
  285. $referralRow = $this->getReferralModel()->get($referral_id);
  286. $admin_id = $referralRow['admin_id'];
  287. }
  288. $row = model("WechatAb")->field("id")->where('admin_id', 'eq', $admin_id)->where("find_in_set({$referral_id},referral_id)")->find();
  289. if ($row) {
  290. $id = $row['id'];
  291. $is = $id;
  292. }
  293. Redis::instance()->set($redisKey, $id, 600);
  294. }
  295. return (int)$is;
  296. }
  297. /**
  298. * 编辑缓存
  299. * @param $referral_id
  300. * @param $id
  301. * @param string $op
  302. * @return bool
  303. */
  304. public function modifyAdReferralCache($referral_id, $id, $op='add')
  305. {
  306. if (empty($referral_id)) return false;
  307. $redisKey = 'CADH:'.$referral_id;
  308. if ($op == 'add') {
  309. Redis::instance()->set($redisKey, $id, 600);
  310. } else {
  311. Redis::instance()->del($redisKey);
  312. }
  313. return true;
  314. }
  315. public function sendReferralAdData($referral_id, $data)
  316. {
  317. //是否需要回传
  318. if ($id = $this->isAdReferral($referral_id, $data['admin_id'])) {
  319. $row = model("WechatAb")->getInfo($id);
  320. if (empty($row)) {
  321. Log::error("WechatAb 记录不存在 referral_id: {$referral_id} id:{$id}");
  322. return false;
  323. }
  324. $adminInfo = AdminService::instance()->getAdminConfigModel()->getAdminInfoAll($data['admin_id']);
  325. if (isset($data['orders'])) {
  326. $postData['actions'][0] = [
  327. 'user_action_set_id' => $row['wx_ad_source_id'],
  328. 'action_type' => $data['action_type'],
  329. 'action_time' => time(),
  330. 'url' => $data['url'],
  331. 'user_id' => [
  332. 'wechat_app_id' => $adminInfo['appid'],
  333. 'wechat_openid' => $data['openid'],
  334. ],
  335. 'action_param' => [
  336. "product_name" => $data['orders']['productName'],
  337. "product_id" => $data['product_id'],
  338. "value" => intval($data['orders']['money'] * 100),
  339. "source" => "Biz",
  340. "wechat_app_id" => $adminInfo['appid'],
  341. 'claim_type' => 0
  342. ]
  343. ];
  344. }
  345. if (isset($data['sub'])) {
  346. $postData['actions'][0] = [
  347. 'user_action_set_id' => $row['wx_ad_source_id'],
  348. 'action_type' => 'REGISTER',
  349. 'action_time' => time(),
  350. 'url' => $data['url'],
  351. 'user_id' => [
  352. 'wechat_app_id' => $adminInfo['appid'],
  353. 'wechat_openid' => $data['openid'],
  354. ],
  355. 'action_param' => [
  356. "product_name" => $data['sub']['productName'],
  357. "source" => "Biz",
  358. "wechat_app_id" => $adminInfo['appid'],
  359. 'claim_type' => 0
  360. ]
  361. ];
  362. }
  363. try {
  364. $access_token = current((new WeChatObject(null))->getOfficialAccountByPlatform($row['platform_id'], $row['appid'], $row['refresh_token'])->access_token->getToken());
  365. $httpConfig = [
  366. 'base_uri' => 'https://api.weixin.qq.com/marketing/',
  367. 'connect_timeout' => 10,
  368. 'timeout' => 30,
  369. 'http_errors' => true, //抛出异常 true是 false否
  370. 'verify' => false, //不验证ssl证书
  371. ];
  372. $proxy = OpenPlatformService::instance()->getProxyconfigById($row['platform_id']);
  373. if ($proxy) {
  374. $httpConfig = array_merge($httpConfig, ['proxy' => $proxy]);
  375. }
  376. WeChatAdService::instance()->send($httpConfig,$access_token,$postData);
  377. } catch (\Exception $e) {
  378. Log::error("AbWeChatAd回源异常: data: ".json_encode($postData)." Error:".$e->getMessage());
  379. }
  380. }
  381. return true;
  382. }
  383. /**
  384. * 推广链接添加
  385. * @param $params
  386. * @param $admin_id
  387. * @param $group
  388. * @param $channel_id
  389. * @return ReturnObject
  390. */
  391. public function updateReferral($params, $admin_id, $group, $channel_id)
  392. {
  393. $params['type'] = 1;
  394. $params['wx_type'] = 1;
  395. $mReferral = $this->getReferralModel();
  396. $oReferral = (new ReferralObject())->bind($params);
  397. $oReferral->admin_id = $admin_id;
  398. $oReferral->createtime = time();
  399. //获取当前书籍的默认关注章节
  400. $default_chapter_idx = $oReferral->guide_chapter_idx ?? 0;
  401. if($oReferral->book_id){
  402. $bookInfo = BookService::instance()->getBookModel()->BookInfo($oReferral->book_id);
  403. if ($bookInfo['state'] == 0 || $bookInfo['cansee'] == 0) {
  404. return $this->setCode(ErrorCodeConstants::PARAMS_ERROR_INVALID)->setMsg('抱歉,本书已下架,无法生成推广链接~')->getReturn();
  405. }
  406. if (!$oReferral->guide_chapter_idx) {
  407. if (in_array($group, [AdminConstants::ADMIN_GROUP_ID_VIP, AdminConstants::ADMIN_GROUP_ID_VIP_OPERATOR])) {
  408. //vip和vip运营者
  409. return $this->setCode(ErrorCodeConstants::PARAMS_ERROR_INVALID)->setMsg('导粉章节数必填')->getReturn();
  410. } else {
  411. $default_chapter_idx = model('Guide')->getGuideChapter($admin_id,$params['book_id'],0,$channel_id);
  412. }
  413. }
  414. if($default_chapter_idx > $this->bookPayChapterIdex($oReferral->book_id)){
  415. return $this->setCode(ErrorCodeConstants::PARAMS_ERROR_INVALID)->setMsg('导粉章节数必须小于收费章节数')->getReturn();
  416. }
  417. }
  418. if(!$oReferral->push){
  419. $oReferral->push = 0;
  420. }
  421. $oReferral->share_image = ResourceService::instance()->getRandomImage()->data;
  422. $oReferral->share_title = ResourceService::instance()->getRandomTitle()->data;
  423. $return = [];
  424. if ($oReferral->id) {
  425. $update = $mReferral->mkParamsForUpdate($oReferral);
  426. $return['id'] = $oReferral->id;
  427. $mReferral->update($update, ['id'=>$oReferral->id]);
  428. } else {
  429. $insert = $mReferral->mkParamsForInsert($oReferral);
  430. $insertId = $mReferral->allowField(true)->insertGetId($insert);
  431. if($insertId === false){
  432. return $this->setData(ErrorCodeConstants::DB_ERROR_UPDATE)->setMsg($mReferral->getError())->getReturn();
  433. }
  434. $return['id'] = $insertId;
  435. $source_url = '';
  436. //首页
  437. if ($oReferral->type == 2) {
  438. $source_url .= '?referral_id='.$insertId;
  439. } else {
  440. $source_url .= '/index/book/chapter?book_id=' . $params['book_id'] . '&sid=' . $params['chapter_id'] . '&referral_id=' . $insertId;
  441. }
  442. if ($group == AdminConstants::ADMIN_GROUP_ID_AGENT) {
  443. $source_url .= '&agent_id='.$admin_id;
  444. }
  445. $update = [];
  446. $update['source_url'] =getCurrentDomain($channel_id,$source_url);
  447. //绑定域名短链ID及重置生成短链接的源地址,代理商使用渠道的短链域名池
  448. $short = model('ShortRelation')->getRandShort($channel_id);
  449. if($short){
  450. $update['short_id'] = $short->id;
  451. $short_source_url = replaceShortDomain($params['jmp_url'], $short->id);
  452. }else{
  453. $short_source_url = $update['source_url'];
  454. }
  455. $shoturl = new ShortUrl();
  456. //生成腾讯短链
  457. $update['short_url_qq'] = $shoturl->tencent($channel_id, $short_source_url);
  458. //生成sina短链
  459. $update['short_url_weibo'] = $shoturl->sina($short_source_url);
  460. $mReferral->update($update, ['id' => $insertId]);
  461. }
  462. $return['url'] = getCurrentDomain($channel_id,'/t/'.$return['id']);
  463. //删除Redis缓存
  464. Redis::instance()->del('RI:N:'.$return['id']);
  465. return $this->setData($return)->getReturn();
  466. }
  467. /**
  468. * 书收费章节
  469. * @param $book_id
  470. * @return ReturnObject
  471. */
  472. private function bookPayChapterIdex($book_id){
  473. //获取书籍信息
  474. $book = model('Book')->BookInfo($book_id);
  475. //全局免费章节数
  476. $free_chapter_idx = config('site.book_free_chapter_num');
  477. //如果本书籍设置了免费章节数,以本书籍的免费章节数为准
  478. if(intval($book['free_chapter_num'])>0){
  479. $free_chapter_idx = $book['free_chapter_num'];
  480. }
  481. return $this->setData($free_chapter_idx)->getReturn();
  482. }
  483. /**
  484. * 获取分流链接对应的渠道链接
  485. * @param $vid
  486. * @param $channel
  487. * @return ReturnObject
  488. */
  489. public function getChannelReferralFromVip($vid, $channel)
  490. {
  491. $referral_id = model('referral_slave')->where('library_id', $vid)
  492. ->where('channel_id', $channel)
  493. ->value('referral_id');
  494. return $this->setData($referral_id)->getReturn();
  495. }
  496. public function getReferralCollectFromApi($ids)
  497. {
  498. $return = [];
  499. $data = ApiService::instance()->getCollectFromApi(ApiConstants::API_REFERRAL, ['ids' => $ids])->data;
  500. foreach ($ids as $id) {
  501. $return[$id] = [
  502. 'uv' => 0,
  503. 'dayuv' => 0,
  504. 'follow' => 0,
  505. 'dayut' => 0,
  506. 'money' => 0,
  507. 'daymt' => 0,
  508. 'net_follow_num' => 0,
  509. 'dayjt' => 0,
  510. 'unfollow_num' => 0,
  511. 'dayqt' => 0,
  512. 'order_nums' => 0,
  513. 'day_order_nums' => 0,
  514. ];
  515. }
  516. foreach ($data as $index => $item) {
  517. $return[$item['referralId']] = [
  518. 'uv' => $item['uv'],
  519. 'dayuv' => $item['uvDay'],
  520. 'follow' => $item['follow'],
  521. 'dayut' => $item['followDay'],
  522. 'money' => $item['money'],
  523. 'daymt' => $item['moneyDay'],
  524. 'net_follow_num' => $item['netFollowNum'],
  525. 'dayjt' => $item['netFollowNumDay'],
  526. 'unfollow_num' => $item['unfollowNum'],
  527. 'dayqt' => $item['unfollowNumDay'],
  528. 'order_nums' => $item['ordersNum'],
  529. 'day_order_nums' => $item['ordersNumDay'],
  530. ];
  531. }
  532. return $this->setData($return)->getReturn();
  533. }
  534. public function getMigrateReferralDayCollect($id)
  535. {
  536. $list = [];
  537. $data = ApiService::instance()->getCollectFromApi(ApiConstants::API_REFERRAL_DAY, ['referralId'=>$id])->data;
  538. if ($data) {
  539. foreach ($data as $item) {
  540. $list[] = [
  541. 'follow' => $item['follow'],
  542. 'referral_id' => $item['referralId'],
  543. 'createdate' => $item['createdate'],
  544. 'recharge_money' => $item['rechargeMoney'],
  545. 'orders_num' => $item['ordersNum'],
  546. 'all_recharge_money' => $item['allRechargeMoney'],
  547. 'uv' => $item['uv'],
  548. ];
  549. }
  550. }
  551. return $this->setData($list)->getReturn();
  552. }
  553. }