FEATURE_SET_EXPIRED_CUSTOMERS

This commit is contained in:
Srinivas-Saravanan 2024-11-18 16:37:59 +05:30
parent c7ae0adc3f
commit 3b7fd97f3e
2 changed files with 15 additions and 2 deletions

View File

@ -4,6 +4,7 @@ namespace App\Controllers;
use App\Helpers\NotificationHelper;
use App\Models\NotificationModel;
use App\Models\SubscriptionModel;
class Notifications extends BaseController
{
@ -570,6 +571,7 @@ class Notifications extends BaseController
################################################################
public function getExpCustomerDetail($window_time = null)
{
$this->update_expired_members();
echo "Hi, ";
# Step 1: add the days to retrive the data//
$providedDate = date('Y-m-d');
@ -799,13 +801,24 @@ class Notifications extends BaseController
# EXPIRAY_NOTIFY_TEMPLATE_WHATSAPP Closed
}
else{
$this->logger->error("statsu is draft");
$this->logger->error("status is draft");
}
# Loop Closed
echo "Process Completed <br>";
}
}
public function update_expired_members()
{
$model = new SubscriptionModel();
$currentDate = date('Y-m-d');
$model->where('to_subscription <', $currentDate)
->set(['status' => 0])
->update();
log_message('info','inside the update function');
}
# getExpCustomerDetail fns Closed
################################################################

View File

@ -7,7 +7,7 @@ class SubscriptionModel extends Model
{
protected $table = 'subscription';
protected $primaryKey = 'sub_id';
protected $allowedFields = ['sub_id','scheme_id','customer_id','to_subscription','from_subscription','mode','created_on','created_by','updated_by','updated_on','business_id'];
protected $allowedFields = ['sub_id','scheme_id','customer_id','to_subscription','from_subscription','mode','created_on','created_by','updated_by','updated_on','business_id','status'];