Rev 15799 | Rev 15807 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?phpdeclare(strict_types=1);namespace LeadersLinked\Controller;use LeadersLinked\Model\User;use Laminas\View\Model\JsonModel;use Laminas\View\Model\ViewModel;use LeadersLinked\Mapper\UserMapper;use LeadersLinked\Mapper\QueryMapper;use LeadersLinked\Mapper\DiscoveryContactMapper;use LeadersLinked\Mapper\DiscoveryContactLogMapper;use Laminas\Mvc\Controller\AbstractActionController;use Laminas\Hydrator\ArraySerializableHydrator;use Laminas\Db\ResultSet\HydratingResultSet;use Laminas\Paginator\Adapter\DbSelect;use Laminas\Paginator\Paginator;use LeadersLinked\Mapper\CompanyMapper;// Create an action controller.class DiscoveryContactProgressController extends AbstractActionController{/**** @var AdapterInterface*/private $adapter;/**** @var AbstractAdapter*/private $cache;/**** @var LoggerInterface*/private $logger;/**** @var array*/private $config;/**** @param AdapterInterface $adapter* @param AbstractAdapter $cache* @param LoggerInterface $logger* @param array $config*/public function __construct($adapter, $cache, $logger, $config){$this->adapter = $adapter;$this->cache = $cache;$this->logger = $logger;$this->config = $config;}public function indexAction(){//Obtenemos los datos el usuario actualmente logueado$currentUserPlugin = $this->plugin('currentUserPlugin');$currentUser = $currentUserPlugin->getUser();$currentNetworkPlugin = $this->plugin('currentNetworkPlugin');$currentNetwork = $currentNetworkPlugin->getNetwork();$request = $this->getRequest();//if ($request->isGet()) {$headers = $request->getHeaders();$isJson = false;if ($headers->has('Accept')) {$accept = $headers->get('Accept');$prioritized = $accept->getPrioritized();foreach ($prioritized as $key => $value) {$raw = trim($value->getRaw());if (!$isJson) {$isJson = strpos($raw, 'json');}}}//if ($isJson) {$startDate = $this->params()->fromQuery('startDate');if (empty($startDate)) {$startDate = date('Y-m-d');}$endDate = $this->params()->fromQuery('endDate');if (empty($endDate)) {$endDate = date('Y-m-d');}$startDate = '2023-03-01';$endDate = '2023-03-19';$dtStartDate = \DateTime::createFromFormat('Y-n-d', $startDate);$dtEndDate = \DateTime::createFromFormat('Y-n-d', $endDate);return new JsonModel(['success' => true,'message' => $dtStartDate]);//}//}}}