|
@@ -149,8 +149,18 @@ class AppController extends Controller
|
|
|
* ]
|
|
|
* }
|
|
|
*/
|
|
|
- public function officialAccounts()
|
|
|
+ public function officialAccounts(Request $request)
|
|
|
{
|
|
|
+ $phone = $request->get('phone', '');
|
|
|
+ $is_enable = $request->get('is_enabled', '');
|
|
|
+ if(!empty($phone)) {
|
|
|
+ $channel = new ChannelService();
|
|
|
+ $distribution_channels = $channel->getChannelsByChannelUserIds([],$is_enable,$phone);
|
|
|
+ if(!$distribution_channels->isEmpty()){
|
|
|
+ $distribution_channels = $distribution_channels->toArray();
|
|
|
+ $this->channel_ids = array_column($distribution_channels,'id');
|
|
|
+ }
|
|
|
+ }
|
|
|
$service = new OfficialAccountService;
|
|
|
$result = collectionTransform(new OfficialAccountTransformer, $service->getOfficialAccountsByChannelIds($this->channel_ids));
|
|
|
return response()->success($result);
|