<?php
namespace App\Models;

use CodeIgniter\Model;

class myfitHx extends baseModel
{

    public function __construct()
    {
        parent::__construct();
    }

    public function readLoginHx($in)
    {
        // $in['member_id'] = 16;
        $member_id2 =
            isset($in['member_id']) &&
            $in['member_id'] > 0 &&
            is_int($in['member_id'])
                ? $in['member_id']
                : 0;
        $member_id =  isset($in["member_id"]) ? (int) $in["member_id"]: 0 ;

        $member_id = 13;
        $sqlQ =
            'SELECT * FROM members_login_hx WHERE member_id=' .
            $member_id .
            ' ORDER BY id DESC LIMIT 15';
            log_message('critical', "readLoginHx=>".$sqlQ );
        $query = $this->db->query($sqlQ);
        $data['loginhx_data'] = $query->getResultArray();
        return $inx = [
            'loginhx' => $data['loginhx_data'],
            'status' => 1,
            'raw_data' => $in,
        ];
    }
}
