本文整理汇总了PHP中EmailTemplate::where方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::where方法的具体用法?PHP EmailTemplate::where怎么用?PHP EmailTemplate::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertPoolingSchedule
public function insertPoolingSchedule($contact_id, $member_id, $template_id)
{
$contactTarget = Contact::find($contact_id);
$memberTarget = User::find($member_id);
$templateTarget = EmailTemplate::where('sequence', $template_id)->first();
// return $templateTarget->id;
if (!$contactTarget || !$memberTarget || !$templateTarget) {
return null;
}
$stag = new EmailSchedullerPool();
$stag->contact_id = $contact_id;
$stag->member_id = $member_id;
$stag->template_id = $template_id;
// $configurationMember = MemberConfiguration::where('member_id',$member_id)->where('param_code',MemberConfiguration::FOLLOW_UP_SEQUENCE)->first();
// if(!$configurationMember){
// return null ;
// }
// $followUpSequence = $configurationMember->param_value;
$followUpSequence = Sysparam::getValue('conf_follow_up_date');
$stag->execution_date = date('Y-m-d H:i:s', strtotime("+" . $followUpSequence . " day"));
$emailSchedullerPool = EmailSchedullerPool::where('member_id', $member_id)->where('contact_id', $contact_id)->where('template_id', $template_id)->first();
if ($emailSchedullerPool) {
//save history
$this->saveHistory("canceled", $emailSchedullerPool->member_id, $emailSchedullerPool->template_id);
//delete pool
$emailSchedullerPool->delete();
}
//add entry
if ($contactTarget->active && $memberTarget->active) {
$stag->save();
return $stag->toJson();
} else {
return null;
}
}
示例2: sharedTemplates
/**
* sharedTemplates()
* Returns a query object of all the shared templates by default excluding the shared templates authored by the current user.
* @param bool $showall
* @return mixed
*/
public static function sharedTemplates($showall = FALSE)
{
if ($showall) {
$query = EmailTemplate::where('public', '=', '1')->orderBy('name', 'ASC')->get();
} else {
$query = EmailTemplate::where('public', '=', '1')->where('author', '!=', Auth::consoleuser()->get()->cid)->orderBy('name', 'ASC')->get();
}
return $query;
}
示例3: post_emailtemplatedelete
public function post_emailtemplatedelete()
{
//Get our id
$id = Input::get('id');
//Verify that the id is valid and the template is owned by the member trying to delete it or they are level 1 access
if (Auth::consoleuser()->get()->access > 0) {
$query = EmailTemplate::where('id', '=', $id)->count();
} else {
$query = EmailTemplate::where('id', '=', $id)->where('author', '=', Auth::consoleuser()->get()->cid)->count();
}
if ($query > 0) {
//Count is greater than 0 let's delete the record;
EmailTemplate::where('id', '=', $id)->delete();
}
}