• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP models\Activity类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app\models\Activity的典型用法代码示例。如果您正苦于以下问题:PHP Activity类的具体用法?PHP Activity怎么用?PHP Activity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Activity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $attendance_application = ['user_id' => rand(1, 8), 'activity_type' => 'request', 'source_id' => rand(1, 4), 'source_type' => 'conference application', 'profile_id' => rand(1, 8)];
     $attendance_application_update = ['user_id' => rand(1, 8), 'activity_type' => 'update', 'source_id' => rand(1, 4), 'source_type' => 'conference application', 'profile_id' => rand(1, 8)];
     $attendance_application_approved = ['user_id' => rand(1, 8), 'activity_type' => 'approved', 'source_id' => rand(1, 4), 'source_type' => 'conference application', 'profile_id' => rand(1, 8)];
     $conference_denied = ['user_id' => rand(1, 8), 'activity_type' => 'denied', 'source_id' => rand(1, 4), 'source_type' => 'conference'];
     $attendance_application_deleted = ['user_id' => rand(1, 8), 'activity_type' => 'deleted', 'source_id' => rand(1, 4), 'source_type' => 'conference application', 'profile_id' => rand(1, 8)];
     $ev_attendance_application = ['user_id' => rand(1, 8), 'activity_type' => 'request', 'source_id' => rand(1, 6), 'source_type' => 'event application', 'profile_id' => rand(1, 8)];
     $event_update = ['user_id' => rand(1, 8), 'activity_type' => 'update', 'source_id' => rand(1, 6), 'source_type' => 'event'];
     $ev_attendance_application_approved = ['user_id' => rand(1, 8), 'activity_type' => 'approved', 'source_id' => rand(1, 6), 'source_type' => 'event application', 'profile_id' => rand(1, 8)];
     $ev_attendance_application_denied = ['user_id' => rand(1, 8), 'activity_type' => 'denied', 'source_id' => rand(1, 6), 'source_type' => 'event application', 'profile_id' => rand(1, 8)];
     $ev_deleted = ['user_id' => rand(1, 8), 'activity_type' => 'deleted', 'source_id' => rand(1, 6), 'source_type' => 'event'];
     $attendance_application = new Activity($attendance_application);
     $attendance_application->save();
     $attendance_application_deleted = new Activity($attendance_application_deleted);
     $attendance_application_deleted->save();
     $attendance_application_approved = new Activity($attendance_application_approved);
     $attendance_application_approved->save();
     $attendance_application_update = new Activity($attendance_application_update);
     $attendance_application_update->save();
     $conference_denied = new Activity($conference_denied);
     $conference_denied->save();
     $ev_deleted = new Activity($ev_deleted);
     $ev_deleted->save();
     $event_update = new Activity($event_update);
     $event_update->save();
     $ev_attendance_application = new Activity($ev_attendance_application);
     $ev_attendance_application->save();
     $ev_attendance_application_denied = new Activity($ev_attendance_application_denied);
     $ev_attendance_application_denied->save();
     $ev_attendance_application_approved = new Activity($ev_attendance_application_approved);
     $ev_attendance_application_approved->save();
 }
开发者ID:vinlore,项目名称:huddle,代码行数:38,代码来源:ActivitySeeder.php


示例2: log

 public static function log($text = null, $params = null, $user_id = null, $contact_id = null)
 {
     $params = isset($params) ? $params : Request::all();
     $browser = "";
     foreach ($params as $key => &$param) {
         foreach (self::$hides as $hide) {
             if (strpos($key, $hide) !== false) {
                 $param = "***";
             }
         }
     }
     $activity = new Activity();
     $activity->user_id = isset($user_id) ? $user_id : Auth::user()->id;
     $activity->contact_id = isset($contact_id) ? $contact_id : Auth::user()->active_contact->id;
     $activity->method = Request::method();
     $activity->path = Request::path();
     $activity->request = json_encode($params);
     $activity->ip_address = Request::ip();
     $activity->route = Request::route() ? Request::route()->getName() : NULL;
     $activity->text = $text;
     $browser = new Browser();
     $activity->browser = $browser->getBrowser();
     $activity->browser_version = $browser->getVersion();
     $activity->os = $browser->getPlatform();
     $activity->save();
 }
开发者ID:pinkynrg,项目名称:convergence2.0,代码行数:26,代码来源:ActivitiesManager.php


示例3: handle

 /**
  * Handle the event.
  *
  * @param  PermissionChecked $event
  * @return void
  */
 public function handle(PermissionChecked $event)
 {
     $activity = new Activity();
     $activity->activity_type = get_class($event->permission);
     $activity->activity_id = $event->permission->id;
     $activity->user_id = $event->user->id;
     $activity->save();
 }
开发者ID:reportingsjr,项目名称:makerspace-manager,代码行数:14,代码来源:LogActivity.php


示例4: actionCreate

 public function actionCreate()
 {
     $model = new Activity();
     if ($model->load(Yii::$app->request->post())) {
         $model->save();
         //var_dump($model->getErrors()); die;
     }
     return $this->render('create', array('model' => $model));
 }
开发者ID:rahaldr,项目名称:hello-world,代码行数:9,代码来源:ActivityController.php


示例5: index

 public function index()
 {
     // total_income, billed_clients, invoice_sent and active_clients
     $select = DB::raw('COUNT(DISTINCT CASE WHEN invoices.id IS NOT NULL THEN clients.id ELSE null END) billed_clients,
                     SUM(CASE WHEN invoices.invoice_status_id >= ' . INVOICE_STATUS_SENT . ' THEN 1 ELSE 0 END) invoices_sent,
                     COUNT(DISTINCT clients.id) active_clients');
     $metrics = DB::table('accounts')->select($select)->leftJoin('clients', 'accounts.id', '=', 'clients.account_id')->leftJoin('invoices', 'clients.id', '=', 'invoices.client_id')->where('accounts.id', '=', Auth::user()->account_id)->where('clients.is_deleted', '=', false)->where('invoices.is_deleted', '=', false)->where('invoices.is_recurring', '=', false)->where('invoices.is_quote', '=', false)->groupBy('accounts.id')->first();
     $select = DB::raw('SUM(clients.paid_to_date) as value, clients.currency_id as currency_id');
     $paidToDate = DB::table('accounts')->select($select)->leftJoin('clients', 'accounts.id', '=', 'clients.account_id')->where('accounts.id', '=', Auth::user()->account_id)->where('clients.is_deleted', '=', false)->groupBy('accounts.id')->groupBy(DB::raw('CASE WHEN clients.currency_id IS NULL THEN CASE WHEN accounts.currency_id IS NULL THEN 1 ELSE accounts.currency_id END ELSE clients.currency_id END'))->get();
     $select = DB::raw('AVG(invoices.amount) as invoice_avg, clients.currency_id as currency_id');
     $averageInvoice = DB::table('accounts')->select($select)->leftJoin('clients', 'accounts.id', '=', 'clients.account_id')->leftJoin('invoices', 'clients.id', '=', 'invoices.client_id')->where('accounts.id', '=', Auth::user()->account_id)->where('clients.is_deleted', '=', false)->where('invoices.is_deleted', '=', false)->where('invoices.is_quote', '=', false)->where('invoices.is_recurring', '=', false)->groupBy('accounts.id')->groupBy(DB::raw('CASE WHEN clients.currency_id IS NULL THEN CASE WHEN accounts.currency_id IS NULL THEN 1 ELSE accounts.currency_id END ELSE clients.currency_id END'))->get();
     $select = DB::raw('SUM(clients.balance) as value, clients.currency_id as currency_id');
     $balances = DB::table('accounts')->select($select)->leftJoin('clients', 'accounts.id', '=', 'clients.account_id')->where('accounts.id', '=', Auth::user()->account_id)->where('clients.is_deleted', '=', false)->groupBy('accounts.id')->groupBy(DB::raw('CASE WHEN clients.currency_id IS NULL THEN CASE WHEN accounts.currency_id IS NULL THEN 1 ELSE accounts.currency_id END ELSE clients.currency_id END'))->get();
     $activities = Activity::where('activities.account_id', '=', Auth::user()->account_id)->where('activity_type_id', '>', 0)->orderBy('created_at', 'desc')->take(50)->get();
     $pastDue = DB::table('invoices')->leftJoin('clients', 'clients.id', '=', 'invoices.client_id')->leftJoin('contacts', 'contacts.client_id', '=', 'clients.id')->where('invoices.account_id', '=', Auth::user()->account_id)->where('clients.deleted_at', '=', null)->where('contacts.deleted_at', '=', null)->where('invoices.is_recurring', '=', false)->where('invoices.balance', '>', 0)->where('invoices.is_deleted', '=', false)->where('invoices.deleted_at', '=', null)->where('contacts.is_primary', '=', true)->where('invoices.due_date', '<', date('Y-m-d'))->select(['invoices.due_date', 'invoices.balance', 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id', 'is_quote'])->orderBy('invoices.due_date', 'asc')->take(50)->get();
     $upcoming = DB::table('invoices')->leftJoin('clients', 'clients.id', '=', 'invoices.client_id')->leftJoin('contacts', 'contacts.client_id', '=', 'clients.id')->where('invoices.account_id', '=', Auth::user()->account_id)->where('clients.deleted_at', '=', null)->where('contacts.deleted_at', '=', null)->where('invoices.deleted_at', '=', null)->where('invoices.is_recurring', '=', false)->where('invoices.balance', '>', 0)->where('invoices.is_deleted', '=', false)->where('contacts.is_primary', '=', true)->where('invoices.due_date', '>=', date('Y-m-d'))->orderBy('invoices.due_date', 'asc')->take(50)->select(['invoices.due_date', 'invoices.balance', 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id', 'is_quote'])->get();
     $payments = DB::table('payments')->leftJoin('clients', 'clients.id', '=', 'payments.client_id')->leftJoin('contacts', 'contacts.client_id', '=', 'clients.id')->leftJoin('invoices', 'invoices.id', '=', 'payments.invoice_id')->where('payments.account_id', '=', Auth::user()->account_id)->where('clients.deleted_at', '=', null)->where('contacts.deleted_at', '=', null)->where('contacts.is_primary', '=', true)->select(['payments.payment_date', 'payments.amount', 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id'])->orderBy('payments.id', 'desc')->take(50)->get();
     $hasQuotes = false;
     foreach ([$upcoming, $pastDue] as $data) {
         foreach ($data as $invoice) {
             if ($invoice->is_quote) {
                 $hasQuotes = true;
             }
         }
     }
     $data = ['account' => Auth::user()->account, 'paidToDate' => $paidToDate, 'balances' => $balances, 'averageInvoice' => $averageInvoice, 'invoicesSent' => $metrics ? $metrics->invoices_sent : 0, 'activeClients' => $metrics ? $metrics->active_clients : 0, 'activities' => $activities, 'pastDue' => $pastDue, 'upcoming' => $upcoming, 'payments' => $payments, 'title' => trans('texts.dashboard'), 'hasQuotes' => $hasQuotes];
     return View::make('dashboard', $data);
 }
开发者ID:nafrente,项目名称:invoice-ninja,代码行数:28,代码来源:DashboardController.php


示例6: actionList

 public function actionList()
 {
     $query = Activity::find();
     $pagination = new Pagination(['defaultPageSize' => 10, 'totalCount' => $query->count()]);
     $models = $query->orderby("id DESC")->offset($pagination->offset)->limit($pagination->limit)->all();
     return $this->render("list", ['models' => $models, 'pagination' => $pagination]);
 }
开发者ID:JeremiahW,项目名称:membermgt,代码行数:7,代码来源:ActivityController.php


示例7: sendInvitation

 private function sendInvitation($invitation, $invoice, $body, $subject, $pdfString)
 {
     $client = $invoice->client;
     $account = $invoice->account;
     if (Auth::check()) {
         $user = Auth::user();
     } else {
         $user = $invitation->user;
         if ($invitation->user->trashed()) {
             $user = $account->users()->orderBy('id')->first();
         }
     }
     if (!$user->email || !$user->confirmed) {
         return false;
     }
     if (!$invitation->contact->email || $invitation->contact->trashed()) {
         return false;
     }
     $variables = ['account' => $account, 'client' => $client, 'invitation' => $invitation, 'amount' => $invoice->getRequestedAmount()];
     $data = ['body' => $this->processVariables($body, $variables), 'link' => $invitation->getLink(), 'entityType' => $invoice->getEntityType(), 'invoiceId' => $invoice->id, 'invitation' => $invitation];
     if ($account->attatchPDF()) {
         $data['pdfString'] = $pdfString;
         $data['pdfFileName'] = $invoice->getFileName();
     }
     $subject = $this->processVariables($subject, $variables);
     $fromEmail = $user->email;
     $response = $this->sendTo($invitation->contact->email, $fromEmail, $account->getDisplayName(), $subject, ENTITY_INVOICE, $data);
     if ($response === true) {
         Activity::emailInvoice($invitation);
         return true;
     } else {
         return false;
     }
 }
开发者ID:nafrente,项目名称:invoice-ninja,代码行数:34,代码来源:ContactMailer.php


示例8: loadHistory

 public static function loadHistory($users)
 {
     $userIds = [];
     if (is_array($users)) {
         foreach ($users as $user) {
             $userIds[] = $user->user_id;
         }
     } else {
         $userIds[] = $users;
     }
     $activityTypes = [ACTIVITY_TYPE_CREATE_CLIENT, ACTIVITY_TYPE_CREATE_TASK, ACTIVITY_TYPE_UPDATE_TASK, ACTIVITY_TYPE_CREATE_INVOICE, ACTIVITY_TYPE_UPDATE_INVOICE, ACTIVITY_TYPE_EMAIL_INVOICE, ACTIVITY_TYPE_CREATE_QUOTE, ACTIVITY_TYPE_UPDATE_QUOTE, ACTIVITY_TYPE_EMAIL_QUOTE, ACTIVITY_TYPE_VIEW_INVOICE, ACTIVITY_TYPE_VIEW_QUOTE];
     $activities = Activity::scope()->with(['client.contacts', 'invoice', 'task'])->whereIn('user_id', $userIds)->whereIn('activity_type_id', $activityTypes)->orderBy('id', 'asc')->limit(100)->get();
     foreach ($activities as $activity) {
         if ($activity->activity_type_id == ACTIVITY_TYPE_CREATE_CLIENT) {
             $entity = $activity->client;
         } else {
             if ($activity->activity_type_id == ACTIVITY_TYPE_CREATE_TASK || $activity->activity_type_id == ACTIVITY_TYPE_UPDATE_TASK) {
                 $entity = $activity->task;
                 $entity->setRelation('client', $activity->client);
             } else {
                 $entity = $activity->invoice;
                 $entity->setRelation('client', $activity->client);
             }
         }
         static::trackViewed($entity);
     }
 }
开发者ID:rafaelsisweb,项目名称:invoice-ninja,代码行数:27,代码来源:HistoryUtils.php


示例9: sendInvoice

 public function sendInvoice(Invoice $invoice)
 {
     $invoice->load('invitations', 'client', 'account');
     $entityType = $invoice->getEntityType();
     $view = 'invoice';
     $subject = trans("texts.{$entityType}_subject", ['invoice' => $invoice->invoice_number, 'account' => $invoice->account->getDisplayName()]);
     $accountName = $invoice->account->getDisplayName();
     $emailTemplate = $invoice->account->getEmailTemplate($entityType);
     $invoiceAmount = Utils::formatMoney($invoice->getRequestedAmount(), $invoice->client->currency_id);
     foreach ($invoice->invitations as $invitation) {
         if (!$invitation->user || !$invitation->user->email) {
             return false;
         }
         if (!$invitation->contact || !$invitation->contact->email) {
             return false;
         }
         $invitation->sent_date = \Carbon::now()->toDateTimeString();
         $invitation->save();
         $variables = ['$footer' => $invoice->account->getEmailFooter(), '$link' => $invitation->getLink(), '$client' => $invoice->client->getDisplayName(), '$account' => $accountName, '$contact' => $invitation->contact->getDisplayName(), '$amount' => $invoiceAmount];
         $data['body'] = str_replace(array_keys($variables), array_values($variables), $emailTemplate);
         $data['link'] = $invitation->getLink();
         $data['entityType'] = $entityType;
         $data['invoice_id'] = $invoice->id;
         $fromEmail = $invitation->user->email;
         $this->sendTo($invitation->contact->email, $fromEmail, $accountName, $subject, $view, $data);
         Activity::emailInvoice($invitation);
     }
     if (!$invoice->isSent()) {
         $invoice->invoice_status_id = INVOICE_STATUS_SENT;
         $invoice->save();
     }
     Event::fire(new InvoiceSent($invoice));
 }
开发者ID:biggtfish,项目名称:invoiceNinja-1,代码行数:33,代码来源:ContactMailer.php


示例10: sendInvoice

 public function sendInvoice(Invoice $invoice, $reminder = false)
 {
     $invoice->load('invitations', 'client.language', 'account');
     $entityType = $invoice->getEntityType();
     $client = $invoice->client;
     $account = $invoice->account;
     if ($invoice->trashed() || $client->trashed()) {
         return false;
     }
     $account->loadLocalizationSettings($client);
     if ($account->pdf_email_attachment) {
         $invoice->updateCachedPDF();
     }
     $view = 'invoice';
     $accountName = $invoice->account->getDisplayName();
     $emailTemplate = $invoice->account->getEmailTemplate($reminder ?: $entityType);
     $emailSubject = $invoice->account->getEmailSubject($reminder ?: $entityType);
     $this->initClosure($invoice);
     $response = false;
     $sent = false;
     foreach ($invoice->invitations as $invitation) {
         if (Auth::check()) {
             $user = Auth::user();
         } else {
             $user = $invitation->user;
             if ($invitation->user->trashed()) {
                 $user = $account->users()->orderBy('id')->first();
             }
         }
         if (!$user->email || !$user->confirmed) {
             continue;
         }
         if (!$invitation->contact->email || $invitation->contact->trashed()) {
             continue;
         }
         $invitation->sent_date = \Carbon::now()->toDateTimeString();
         $invitation->save();
         $variables = ['account' => $account, 'client' => $client, 'invitation' => $invitation, 'amount' => $invoice->getRequestedAmount()];
         $data['body'] = $this->processVariables($emailTemplate, $variables);
         $data['link'] = $invitation->getLink();
         $data['entityType'] = $entityType;
         $data['invoice_id'] = $invoice->id;
         $subject = $this->processVariables($emailSubject, $variables);
         $fromEmail = $user->email;
         $response = $this->sendTo($invitation->contact->email, $fromEmail, $accountName, $subject, $view, $data);
         if ($response === true) {
             $sent = true;
             Activity::emailInvoice($invitation);
         }
     }
     if ($sent === true) {
         if (!$invoice->isSent()) {
             $invoice->invoice_status_id = INVOICE_STATUS_SENT;
             $invoice->save();
         }
         $account->loadLocalizationSettings();
         Event::fire(new InvoiceSent($invoice));
     }
     return $response ?: trans('texts.email_error');
 }
开发者ID:juanmanavarro,项目名称:invoice-ninja,代码行数:60,代码来源:ContactMailer.php


示例11: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $act = Models\Activity::find($id);
     //活动列表
     $activities = Models\Activity::select('id', 'title')->get();
     return view('home.activity.show', compact('act', 'activities'));
 }
开发者ID:honxin,项目名称:studentclub,代码行数:13,代码来源:ActivityController.php


示例12: index

 public function index()
 {
     $classroomIds = Auth::user()->joinedClassrooms;
     $activities = Activity::whereIn('classroom_id', $classroomIds)->orderBy('created_at', 'DESC')->paginate(10);
     $discussions = Discussion::where('parent_id', '')->whereIn('classroom_id', $classroomIds)->orderBy('created_at', 'DESC')->paginate(10);
     return view('user.global.feeds', compact('activities', 'discussions'));
 }
开发者ID:alfrcr,项目名称:ilearn,代码行数:7,代码来源:HomeController.php


示例13: index

 /**
  * Retrieve all Activities.
  *
  * @param  Request  $request
  * @return Collection|Response
  */
 function index(Request $request)
 {
     try {
         return Activity::all();
     } catch (Exception $e) {
         return response()->error();
     }
 }
开发者ID:vinlore,项目名称:huddle,代码行数:14,代码来源:ActivityController.php


示例14: findModel

 /**
  * Finds the Activity model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Activity the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Activity::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
开发者ID:hoangngk,项目名称:adminpanel,代码行数:15,代码来源:ActivitiesController.php


示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //社团列表
     $associates = Models\Associate::select('id', 'name', 'poly_id')->take(5)->orderBy('id', 'desc')->get();
     //活动列表
     $activities = Models\Activity::select('id', 'title')->take(5)->orderBy('id', 'desc')->get();
     //->orderBy('name', 'desc')->take(10)->get();
     return view('home.index', compact('activities', 'associates'));
 }
开发者ID:honxin,项目名称:studentclub,代码行数:14,代码来源:IndexController.php


示例16: attachTo

 public function attachTo(Request $request)
 {
     $this->validate($request, ['classroom_id' => 'required|exists:classrooms,id', 'quiz_id' => 'required|exists:quizzes,id'], ['required' => 'Kolom :attribute diperlukan']);
     $quiz = Quiz::findOrFail($request->quiz_id);
     Activity::create(['teacher_id' => $request->user()->id, 'classroom_id' => $request->classroom_id, 'action' => 'Membagikan quiz ke ', 'route' => 'classrooms.quizdetail', 'detail' => $quiz->id]);
     $quiz->classrooms()->sync([$request->classroom_id], false);
     \Flash::success('Quiz berhasil dibagikan.');
     return redirect()->back();
 }
开发者ID:alfrcr,项目名称:ilearn,代码行数:9,代码来源:QuizController.php


示例17: autoBillInvoice

 /**
  * @param Invoice $invoice
  * @return bool
  */
 public function autoBillInvoice(Invoice $invoice)
 {
     /** @var \App\Models\Client $client */
     $client = $invoice->client;
     /** @var \App\Models\Account $account */
     $account = $client->account;
     /** @var \App\Models\Invitation $invitation */
     $invitation = $invoice->invitations->first();
     if (!$invitation) {
         return false;
     }
     if ($credits = $client->credits->sum('balance')) {
         $balance = $invoice->balance;
         $amount = min($credits, $balance);
         $data = ['payment_type_id' => PAYMENT_TYPE_CREDIT, 'invoice_id' => $invoice->id, 'client_id' => $client->id, 'amount' => $amount];
         $payment = $this->paymentRepo->save($data);
         if ($amount == $balance) {
             return $payment;
         }
     }
     $paymentDriver = $account->paymentDriver($invitation, GATEWAY_TYPE_TOKEN);
     if (!$paymentDriver) {
         return false;
     }
     $customer = $paymentDriver->customer();
     if (!$customer) {
         return false;
     }
     $paymentMethod = $customer->default_payment_method;
     if ($paymentMethod->requiresDelayedAutoBill()) {
         $invoiceDate = \DateTime::createFromFormat('Y-m-d', $invoice->invoice_date);
         $minDueDate = clone $invoiceDate;
         $minDueDate->modify('+10 days');
         if (date_create() < $minDueDate) {
             // Can't auto bill now
             return false;
         }
         if ($invoice->partial > 0) {
             // The amount would be different than the amount in the email
             return false;
         }
         $firstUpdate = Activity::where('invoice_id', '=', $invoice->id)->where('activity_type_id', '=', ACTIVITY_TYPE_UPDATE_INVOICE)->first();
         if ($firstUpdate) {
             $backup = json_decode($firstUpdate->json_backup);
             if ($backup->balance != $invoice->balance || $backup->due_date != $invoice->due_date) {
                 // It's changed since we sent the email can't bill now
                 return false;
             }
         }
         if ($invoice->payments->count()) {
             // ACH requirements are strict; don't auto bill this
             return false;
         }
     }
     return $paymentDriver->completeOnsitePurchase(false, $paymentMethod);
 }
开发者ID:rafaelsisweb,项目名称:invoice-ninja,代码行数:60,代码来源:PaymentService.php


示例18: run

 public function run()
 {
     $disViewMore = false;
     $activities = Activity::find()->where(['belong_to' => $this->belong_to])->orderBy('id DESC')->limit(5)->offset(0)->all();
     $allActivities = Activity::find()->where(['belong_to' => $this->belong_to])->orderBy('id DESC')->all();
     if (count($allActivities) <= 5) {
         $disViewMore = true;
     }
     return $this->render('activities/index', ['activities' => $activities, 'belong_to' => $this->belong_to, 'disViewMore' => $disViewMore]);
 }
开发者ID:hoangngk,项目名称:adminpanel,代码行数:10,代码来源:ActivitiesWidget.php


示例19: updateAssign

 public function updateAssign($id, $requestData)
 {
     $lead = Leads::findOrFail($id);
     $input = $requestData->get('fk_user_id_assign');
     $input = array_replace($requestData->all());
     $lead->fill($input)->save();
     $insertedName = $lead->assignee->name;
     $activityinput = array_merge(['text' => auth()->user()->name . ' assigned lead to ' . $insertedName, 'user_id' => Auth()->id(), 'type' => 'lead', 'type_id' => $id]);
     Activity::create($activityinput);
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:10,代码来源:LeadRepository.php


示例20: search

 public function search($params)
 {
     $query = Activity::find()->where(['user_id' => Yii::$app->user->getId()]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 30], 'sort' => ['defaultOrder' => ['start' => SORT_DESC]]]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'date' => $this->calories, 'val' => $this->peak_heartrate]);
     return $dataProvider;
 }
开发者ID:nikolasg22,项目名称:curso_yii,代码行数:10,代码来源:CalendarSearch.php



注:本文中的app\models\Activity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP models\Article类代码示例发布时间:2022-05-23
下一篇:
PHP models\Account类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap