select ifnull(sum(pay_price),0) as num from wm_order where pay_status=1 and pay_time between 1543766400 and 1543852800;

 

使用判断

public function  getGold($table,$querry,$start,$end,$status,$field)
    {
       $gold = Db::table($table)->where("$querry BETWEEN $start AND $end AND $status")->sum($field);
       if ($gold == null){
           $gold =0;
       }
       return $gold;
    }

 

相关文章:

  • 2021-11-06
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-09-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
相关资源
相似解决方案