1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\api\controller\user;
- use app\models\store\StoreServiceLog;
- use app\models\store\StoreService as StoreServiceModel;
- use app\Request;
- use crmeb\services\UtilService;
- class StoreService
- {
-
- public function lst(Request $request)
- {
- list($page, $limit) = UtilService::getMore([['page',0],['limit',0]], $request, true);
- $serviceInfoList = StoreServiceModel::lst($page, $limit);
- if(!count($serviceInfoList)) return app('json')->successful([]);
- return app('json')->successful($serviceInfoList->hidden(['notify', 'status', 'mer_id', 'add_time'])->toArray());
- }
-
- public function record(Request $request, $toUid)
- {
- list($page, $limit) = UtilService::getMore([['page',0],['limit',0]], $request, true);
- if(!$toUid) return app('json')->fail('参数错误');
- $uid = $request->uid();
- if(!$limit || !$page) return app('json')->successful([]);
- $serviceLogList = StoreServiceLog::lst($uid, $toUid, $page, $limit);
- if(!$serviceLogList) return app('json')->successful([]);
- $serviceLogList = $serviceLogList->hidden(['mer_id'])->toArray();
- $idArr = array_column($serviceLogList, 'id');
- array_multisort($idArr,SORT_ASC,$serviceLogList);
- return app('json')->successful($serviceLogList);
- }
- }
|