| @@ -61,31 +61,5 @@ | ||
| 61 | 61 | */ |
| 62 | 62 | public function get_email_attribute( $customer ) { |
| 63 | 63 | return $customer->email ?? $customer->user_email; |
| 64 | 64 | } |
| 65 | - | |
| 66 | - /** | |
| 67 | - * total booking attribute | |
| 68 | - * | |
| 69 | - * @param $customer | |
| 70 | - * | |
| 71 | - * @return int | |
| 72 | - */ | |
| 73 | - public function get_total_booking_attribute( $customer ): int { | |
| 74 | - $db = new Booktics_Database(); | |
| 75 | - | |
| 76 | - return ( new Order_Model( $db ) )->count( [ 'customer_id' => $customer->id ] ); | |
| 77 | - } | |
| 78 | - | |
| 79 | - /** | |
| 80 | - * Get total amount of all orders for a customer | |
| 81 | - * | |
| 82 | - * @param object $customer Customer object | |
| 83 | - * | |
| 84 | - * @return float Total amount of customer orders | |
| 85 | - */ | |
| 86 | - public function get_total_amount_attribute( $customer ) { | |
| 87 | - $db = new Booktics_Database(); | |
| 88 | - | |
| 89 | - return ( new Order_Model( $db ) )->sum( 'total', [ 'customer_id' => $customer->id ] ); | |
| 90 | - } | |
| 91 | 65 | } |