$sql = "select p.*,u.key_name from record p left join sys_user u on p.create_entity=u.id where u.key_name='admin' and p.punch_time between '2017-03-01' and '2017-03-08'";
$hr_punch_record = M() -> query("$sql");
var_dump($hr_punch_record);
thinkphp joint table query written like this why there is no result? -PHP Chinese website Q&A-thinkphp joint table query written like this why there is no result? -PHP Chinese website Q&A
thinkphp joint table query written like this why there is no result? -PHP Chinese website Q&A-thinkphp joint table query written like this why there is no result? -PHP Chinese website Q&A
Let’s take a look and learn.
$hr_punch_record = M() -> query("$sql");
换成
$hr_punch_record = M() -> query($sql);