Fixes : ps
This commit is contained in:
parent
52e744b5bc
commit
dbc9e7a397
@ -99,6 +99,7 @@ class Customer extends BaseController
|
|||||||
'mobile_no' => $this->request->getPost('cmobile'),
|
'mobile_no' => $this->request->getPost('cmobile'),
|
||||||
'email' => $this->request->getPost('cmail'),
|
'email' => $this->request->getPost('cmail'),
|
||||||
'date_of_birth' => $dob,
|
'date_of_birth' => $dob,
|
||||||
|
'type' => "customer",
|
||||||
'mode' => "Offline",
|
'mode' => "Offline",
|
||||||
'business_id' => $this->request->getPost('business_id')
|
'business_id' => $this->request->getPost('business_id')
|
||||||
];
|
];
|
||||||
@ -354,6 +355,7 @@ class Customer extends BaseController
|
|||||||
$result = $model->where($where)->findAll();
|
$result = $model->where($where)->findAll();
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
$sql = (string)$result[0]['group_query'];
|
$sql = (string)$result[0]['group_query'];
|
||||||
|
// print_r($sql);die;
|
||||||
if($sql){
|
if($sql){
|
||||||
$query = $db->query($sql);
|
$query = $db->query($sql);
|
||||||
$results = $query->getResultArray();
|
$results = $query->getResultArray();
|
||||||
@ -490,7 +492,8 @@ class Customer extends BaseController
|
|||||||
LEFT JOIN invoice I on I.customer_id = C.customer_id and I.isactive = 1
|
LEFT JOIN invoice I on I.customer_id = C.customer_id and I.isactive = 1
|
||||||
LEFT JOIN customer_addresses CA on CA.customer_id = C.customer_id and CA.address_type = 1 and CA.isactive = 1
|
LEFT JOIN customer_addresses CA on CA.customer_id = C.customer_id and CA.address_type = 1 and CA.isactive = 1
|
||||||
LEFT JOIN subscription S on S.customer_id = C.customer_id
|
LEFT JOIN subscription S on S.customer_id = C.customer_id
|
||||||
LEFT JOIN category CM on CM.id = S.scheme_id
|
LEFT JOIN book_categories BC on BC.book_id = S.scheme_id
|
||||||
|
LEFT JOIN category CM on CM.id = BC.category_id
|
||||||
WHERE C.isactive = 1 AND ".$whereCondition." GROUP BY C.customer_id";
|
WHERE C.isactive = 1 AND ".$whereCondition." GROUP BY C.customer_id";
|
||||||
$this->logger->info("Customer Group: SQL = ".$sql);
|
$this->logger->info("Customer Group: SQL = ".$sql);
|
||||||
// Execute the query
|
// Execute the query
|
||||||
|
|||||||
@ -71,11 +71,12 @@ public function add_subscription() {
|
|||||||
|
|
||||||
$SubscriptionModel = new SubscriptionModel();
|
$SubscriptionModel = new SubscriptionModel();
|
||||||
$data = [
|
$data = [
|
||||||
|
|
||||||
'scheme_id' =>$this->request->getPost('scheme'),
|
'scheme_id' =>$this->request->getPost('scheme'),
|
||||||
'customer_id' =>$this->request->getPost('customer'),
|
'customer_id' =>$this->request->getPost('customer'),
|
||||||
'from_subscription' => $this->request->getPost('from_date'),
|
'from_subscription' => $this->request->getPost('from_date'),
|
||||||
'to_subscription' => $this->request->getPost('to_date'),
|
'to_subscription' => $this->request->getPost('to_date'),
|
||||||
|
// 'type' => "subscribed customer",
|
||||||
|
'type' => "customer",
|
||||||
'mode' => $this->request->getPost('mode'),
|
'mode' => $this->request->getPost('mode'),
|
||||||
'business_id'=>$session_bid
|
'business_id'=>$session_bid
|
||||||
];
|
];
|
||||||
|
|||||||
@ -65,11 +65,12 @@ class HomeModel extends Model
|
|||||||
->join('books as BK', 'BK.book_id = S.scheme_id', 'left')
|
->join('books as BK', 'BK.book_id = S.scheme_id', 'left')
|
||||||
->join('book_categories as BC', 'BC.book_id = S.scheme_id', 'left')
|
->join('book_categories as BC', 'BC.book_id = S.scheme_id', 'left')
|
||||||
->join('category as CM', 'CM.id = BC.category_id', 'left')
|
->join('category as CM', 'CM.id = BC.category_id', 'left')
|
||||||
->select('CM.name, CONCAT(C.first_name, " ", C.last_name) as customer_name, C.email as customer_email, C.mobile_no as customer_mobile, S.sub_id, S.scheme_id, S.customer_id, S.business_id, S.to_subscription, S.from_subscription, BK.title, BK.book_id,DATEDIFF(S.to_subscription, CURDATE()) as countdays')
|
->select('CM.name, CONCAT(C.first_name, " ", C.last_name) as customer_name, C.email as customer_email, C.mobile_no as customer_mobile, S.sub_id, S.scheme_id, S.customer_id, S.business_id, S.to_subscription, S.from_subscription, BK.title, BK.book_id,DATEDIFF(S.to_subscription, CURDATE()) as countdays,DATE_FORMAT(S.to_subscription, "%d-%m-%Y") as to_subscription_date_format')
|
||||||
->where('S.to_subscription >=', $now)
|
->where('S.to_subscription >=', $now)
|
||||||
->where('S.to_subscription <=', $last30days)
|
->where('S.to_subscription <=', $last30days)
|
||||||
// ->where('BC.category_id', 5)
|
// ->where('BC.category_id', 5)
|
||||||
->where('LOWER(CM.name)', strtolower("Membership"))
|
->where('LOWER(CM.name)', strtolower("Membership"))
|
||||||
|
->orderBy('S.to_subscription', 'ASC')
|
||||||
->groupBy('S.sub_id')
|
->groupBy('S.sub_id')
|
||||||
->get()
|
->get()
|
||||||
->getResultArray();
|
->getResultArray();
|
||||||
@ -86,6 +87,7 @@ class HomeModel extends Model
|
|||||||
->where('B.created_on >=', $oneMonthAgo)
|
->where('B.created_on >=', $oneMonthAgo)
|
||||||
->where('B.created_on <=', $now)
|
->where('B.created_on <=', $now)
|
||||||
->where('B.isactive', 1)
|
->where('B.isactive', 1)
|
||||||
|
->orderBy('B.publication_date', 'DESC')
|
||||||
->groupBy('B.book_id')
|
->groupBy('B.book_id')
|
||||||
->get()
|
->get()
|
||||||
->getResultArray();
|
->getResultArray();
|
||||||
|
|||||||
@ -222,15 +222,20 @@
|
|||||||
// print "<pre>";
|
// print "<pre>";
|
||||||
// print_r($expiring_membership);
|
// print_r($expiring_membership);
|
||||||
// print "</pre>";
|
// print "</pre>";
|
||||||
foreach ($expiring_membership as $e) : ?>
|
$tempinx = 0;
|
||||||
|
foreach ($expiring_membership as $e) :
|
||||||
|
$daysincount = (int)$e['countdays'] ;
|
||||||
|
$daysincountstring = ($daysincount == 0 ? 'Today' : ($daysincount == 1 ? 'Tomorrow' : $daysincount.' days'));
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $e['sub_id']; ?></td>
|
<!-- <td><?= $e['sub_id']; ?></td> -->
|
||||||
|
<td><?= ++$tempinx; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<h5 class="mt-0 mb-1"><?= $e['customer_name']; ?></h5>
|
<h5 class="mt-0 mb-1"><?= $e['customer_name']; ?></h5>
|
||||||
<span class="font-13"><?= $e['customer_mobile']; ?></span>
|
<span class="font-13"><?= $e['customer_mobile']; ?></span>
|
||||||
</td>
|
</td>
|
||||||
<td><?= $e['title']; ?></td>
|
<td><?= $e['title']; ?></td>
|
||||||
<td><span class="badge badge-success badge-pill"><span data-plugin="counterup"><?= $e['countdays']; ?></span> days</span></td>
|
<td><span class="badge badge-success badge-pill"><?= $daysincountstring; ?></span> <span class="font-13"><br><?= $e['to_subscription_date_format']; ?></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<!-- <tr>
|
<!-- <tr>
|
||||||
@ -274,15 +279,21 @@
|
|||||||
<?php foreach ($book_published as $b) :?>
|
<?php foreach ($book_published as $b) :?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $b['title']; ?>
|
<td><?= $b['title']; ?>
|
||||||
<p class="text-muted mb-0">
|
<?php if (!empty($b['author'])) { ?>
|
||||||
|
<p class="text-muted mb-0" title="Author : <?= $b['author']; ?>">
|
||||||
<i class="mdi mdi-account mr-1"></i><?= $b['author']; ?>
|
<i class="mdi mdi-account mr-1"></i><?= $b['author']; ?>
|
||||||
</p>
|
</p>
|
||||||
<p class="text-muted mb-0">
|
<?php } ?>
|
||||||
|
<?php if (!empty($b['publisher'])) { ?>
|
||||||
|
<p class="text-muted mb-0" title="Publisher : <?= $b['publisher']; ?>">
|
||||||
<i class="mdi mdi-book-open-variant mr-1"></i><?= $b['publisher']; ?>
|
<i class="mdi mdi-book-open-variant mr-1"></i><?= $b['publisher']; ?>
|
||||||
</p>
|
</p>
|
||||||
<p class="text-muted mb-0">
|
<?php } ?>
|
||||||
|
<?php if (!empty($b['publication_date_format'])) { ?>
|
||||||
|
<p class="text-muted mb-0" title="Publication Date : <?= $b['publication_date_format']; ?>">
|
||||||
<i class="mdi mdi-update mr-1"></i><?= $b['publication_date_format']; ?>
|
<i class="mdi mdi-update mr-1"></i><?= $b['publication_date_format']; ?>
|
||||||
</p>
|
</p>
|
||||||
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php // echo $b['categories'];
|
<?php // echo $b['categories'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user