All non-invoice list and view calls.
このコミットが含まれているのは:
コミット
c48b67170e
|
@ -10,15 +10,35 @@ class InvoiceController extends Controller {
|
|||
// Clients
|
||||
public function getClients() { // /api/rpc/invoice/clients/getclients
|
||||
return DB::table('inv_clients')
|
||||
->select('*')
|
||||
->get();
|
||||
->join('inv_contacts', 'inv_contacts.id', 'inv_clients.contact_id')
|
||||
->get(array(
|
||||
'inv_clients.id as id',
|
||||
'inv_contacts.id as cid',
|
||||
'inv_contacts.name',
|
||||
'inv_contacts.address',
|
||||
'inv_contacts.postcode',
|
||||
'inv_contacts.town',
|
||||
'inv_contacts.country',
|
||||
'inv_contacts.phone',
|
||||
'inv_contacts.email'
|
||||
));
|
||||
}
|
||||
|
||||
public function getClient($id) { // /api/rpc/invoice/clients/getclient/id
|
||||
return DB::table('inv_clients')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
->join('inv_contacts', 'inv_contacts.id', 'inv_clients.contact_id')
|
||||
->where('inv_clients.id', $id)
|
||||
->get(array(
|
||||
'inv_clients.id as id',
|
||||
'inv_contacts.id as cid',
|
||||
'inv_contacts.name',
|
||||
'inv_contacts.address',
|
||||
'inv_contacts.postcode',
|
||||
'inv_contacts.town',
|
||||
'inv_contacts.country',
|
||||
'inv_contacts.phone',
|
||||
'inv_contacts.email'
|
||||
));
|
||||
}
|
||||
|
||||
public function newClient(Request $request) { // /api/rpc/invoice/clients/new
|
||||
|
@ -83,15 +103,35 @@ class InvoiceController extends Controller {
|
|||
// Employers
|
||||
public function getEmployers() { // /api/rpc/invoice/employees/getemployers
|
||||
return DB::table('inv_employers')
|
||||
->select('*')
|
||||
->get();
|
||||
->join('inv_contacts', 'inv_employers.contact_id', 'inv_contacts.id')
|
||||
->get(array(
|
||||
'inv_employers.id as id',
|
||||
'inv_contacts.id as cid',
|
||||
'inv_contacts.name',
|
||||
'inv_contacts.address',
|
||||
'inv_contacts.postcode',
|
||||
'inv_contacts.town',
|
||||
'inv_contacts.country',
|
||||
'inv_contacts.phone',
|
||||
'inv_contacts.email'
|
||||
));
|
||||
}
|
||||
|
||||
public function getEmployer($id) { // /api/rpc/invoice/employees/getemployer/id
|
||||
return DB::table('inv_employers')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
->join('inv_contacts', 'inv_employers.contact_id', 'inv_contacts.id')
|
||||
->where('inv_employers.id', $id)
|
||||
->get(array(
|
||||
'inv_employers.id as id',
|
||||
'inv_contacts.id as cid',
|
||||
'inv_contacts.name',
|
||||
'inv_contacts.address',
|
||||
'inv_contacts.postcode',
|
||||
'inv_contacts.town',
|
||||
'inv_contacts.country',
|
||||
'inv_contacts.phone',
|
||||
'inv_contacts.email'
|
||||
));
|
||||
}
|
||||
|
||||
public function newEmployer(Request $request) { // /api/rpc/invoice/employers/new
|
||||
|
|
新しいイシューから参照