diff --git a/app/common/dao/user/UserDao.php b/app/common/dao/user/UserDao.php index fbbcaf23..de90b069 100644 --- a/app/common/dao/user/UserDao.php +++ b/app/common/dao/user/UserDao.php @@ -312,7 +312,7 @@ class UserDao extends BaseDao public function userOrderDetail($uid) { $info = User::getDB()->alias('A')->with(['group','spread','memberIcon']) - ->join('StoreOrder B', 'A.uid = B.uid and B.paid = 1 and B.pay_time between \'' . date('Y/m/d', strtotime('first day of')) . ' 00:00:00\' and \'' . date('Y/m/d H:i:s') . '\'') + ->leftJoin('StoreOrder B', 'A.uid = B.uid and B.paid = 1 and B.pay_time between \'' . date('Y/m/d', strtotime('first day of')) . ' 00:00:00\' and \'' . date('Y/m/d H:i:s') . '\'') ->join('PresellOrder C', 'C.order_id = B.order_id and C.paid = 1', 'LEFT') ->field('A.*, sum(B.pay_price + IFNULL(C.pay_price,0)) as total_pay_price, count(B.order_id) as total_pay_count,is_svip,svip_endtime,svip_save_money') ->where('A.uid', $uid)