1 <?php
2
3 namespace PLus\Orders\Repositories\Order;
4
5
6
7 8 9 10 11
12 class InvestmentRepository extends \PLus\Orders\Repositories\Repository {
13
14
15 16 17 18 19 20
21 public function findById($id) {
22 return $this->getTable()
23 ->select('investment.*')->wherePrimary($id)->fetch();
24 }
25
26 27 28 29 30 31
32 public function findByOrderId($order_id) {
33 return $this->getTable()
34 ->select('investment.*')->wherePrimary($order_id)->fetch();
35 }
36
37 38 39 40 41 42
43 public function getByOrderId($order_id) {
44 return $this->getTable()
45 ->select('investment.*, CONCAT_WS(\' \', user.firstname, user.lastname) AS uname, order.created')->where('order_id', $order_id)->fetch();
46 }
47
48 }
49