- Create migration for global settings table and add google_ads_customer_id and google_ads_start_date columns to clients table. - Add migration to include product_url column in products_data table. - Insert demo data for campaigns, products, and their history for client 'pomysloweprezenty.pl'. - Implement client management interface with modals for adding and editing clients, including Google Ads Customer ID and data retrieval start date.
37 lines
696 B
PHP
37 lines
696 B
PHP
<?php
|
|
namespace factory;
|
|
|
|
class Clients
|
|
{
|
|
static public function get_all()
|
|
{
|
|
global $mdb;
|
|
return $mdb -> select( 'clients', '*', [ 'ORDER' => [ 'name' => 'ASC' ] ] );
|
|
}
|
|
|
|
static public function get( $id )
|
|
{
|
|
global $mdb;
|
|
return $mdb -> get( 'clients', '*', [ 'id' => $id ] );
|
|
}
|
|
|
|
static public function create( $data )
|
|
{
|
|
global $mdb;
|
|
$mdb -> insert( 'clients', $data );
|
|
return $mdb -> id();
|
|
}
|
|
|
|
static public function update( $id, $data )
|
|
{
|
|
global $mdb;
|
|
return $mdb -> update( 'clients', $data, [ 'id' => $id ] );
|
|
}
|
|
|
|
static public function delete( $id )
|
|
{
|
|
global $mdb;
|
|
return $mdb -> delete( 'clients', [ 'id' => $id ] );
|
|
}
|
|
}
|