search

Home  >  Q&A  >  body text

thinkphp联表查询这样写为什么没有结果?

$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);


橱窗的光橱窗的光2919 days ago850

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:51:13

    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.

    reply
    0
  • 迷茫

    迷茫2017-03-14 09:31:00

    $hr_punch_record = M() -> query("$sql");

    换成

    $hr_punch_record = M() -> query($sql);

    reply
    0
  • Cancelreply