Created
April 24, 2016 15:02
-
-
Save rajithwijepura/813a8008952618bcf0764b3800679008 to your computer and use it in GitHub Desktop.
KC inactive users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show electricians which have not sent coupons for 2 year | |
* @return void | |
*/ | |
public function inactive() { | |
$time = new Time('2 years ago'); | |
$electricians = $this->Electricians->find('all', [ | |
'conditions' => [ | |
'Electricians.is_deleted' => 0, | |
'Electricians.is_blocked' => 0, | |
'Electricians.is_authorised' => 1, | |
'Electricians.last_coupon_update_date <' => $time->format('Y-m-d') | |
], | |
'contain' => ['UserTypes', 'ProductSalesAreas', 'AreaCodes', 'Districts'], | |
'order' => ['Electricians.electrician_id' => 'ASC'] | |
]); | |
$this->set(compact('electricians')); | |
$this->set('_serialize', ['electricians']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment