当前位置: 首页>>代码示例>>PHP>>正文


PHP Employee::monthlyDirectSales方法代码示例

本文整理汇总了PHP中app\Employee::monthlyDirectSales方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::monthlyDirectSales方法的具体用法?PHP Employee::monthlyDirectSales怎么用?PHP Employee::monthlyDirectSales使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Employee的用法示例。


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

示例1: single

 public function single($mr, $currentMonth)
 {
     $actualVisits = [];
     $MonthlyCustomerProducts = [];
     $MRLine = [];
     $doctors = Customer::where('mr_id', $mr)->get();
     foreach ($doctors as $singleDoctor) {
         $actualVisits[$singleDoctor->id] = Report::where('mr_id', $mr)->where('month', $currentMonth)->where('doctor_id', $singleDoctor->id)->count();
         $MonthlyCustomerProducts[$singleDoctor->id] = Customer::monthlyProductsBought([$singleDoctor->id])->toArray();
     }
     $products = Product::where('line_id', Employee::findOrFail($mr)->line_id)->get();
     $coverageStats = Employee::coverageStats($mr, $currentMonth);
     $allManagers = Employee::yourManagers($mr);
     $totalProducts = Employee::monthlyDirectSales($mr, $currentMonth);
     $totalSoldProductsSales = $totalProducts['totalSoldProductsSales'];
     $totalSoldProductsSalesPrice = $totalProducts['totalSoldProductsSalesPrice'];
     $currentMonth = \Carbon\Carbon::parse($currentMonth);
     $lines = MrLines::select('line_id', 'from', 'to')->where('mr_id', $mr)->get();
     foreach ($lines as $line) {
         $lineFrom = \Carbon\Carbon::parse($line->from);
         $lineTo = \Carbon\Carbon::parse($line->to);
         if (!$currentMonth->lte($lineTo) && $currentMonth->gte($lineFrom)) {
             $MRLine = MrLines::where('mr_id', $mr)->where('line_id', $line->line_id)->get();
         }
     }
     $dataView = ['doctors' => $doctors, 'MonthlyCustomerProducts' => $MonthlyCustomerProducts, 'actualVisits' => $actualVisits, 'products' => $products, 'totalVisitsCount' => $coverageStats['totalVisitsCount'], 'actualVisitsCount' => $coverageStats['actualVisitsCount'], 'totalMonthlyCoverage' => $coverageStats['totalMonthlyCoverage'], 'allManagers' => $allManagers, 'totalSoldProductsSales' => $totalSoldProductsSales, 'totalSoldProductsSalesPrice' => $totalSoldProductsSalesPrice, 'MRLines' => $MRLine];
     return view('am.line.single', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:28,代码来源:LineController.php

示例2: function

    Route::get('services-requests', ['as' => 'amServicesRequests', 'uses' => 'AM\\ReportController@listAllServicesRequests']);
    Route::get('add-service-request', ['as' => 'amAddServiceRequest', 'uses' => 'AM\\ReportController@createServiceRequest']);
    Route::post('add-service-request', ['as' => 'amDoAddServiceRequest', 'uses' => 'AM\\ReportController@doCreateServiceRequest']);
    Route::get('pending-services-requests', ['as' => 'amPendingServicesRequests', 'uses' => 'AM\\ReportController@listAllPendingServicesRequests']);
    Route::get('approve-service-request/{id}', ['as' => 'amApprovePendingServiceRequest', 'uses' => 'AM\\ReportController@approvePendingServiceRequest']);
    Route::get('decline-service-request/{id}', ['as' => 'amDeclinePendingServiceRequest', 'uses' => 'AM\\ReportController@declinePendingServiceRequest']);
});
// Medical Rep. Section
Route::group(['prefix' => 'mr', 'middleware' => 'mr'], function () {
    // Medical Rep. Dashboard
    Route::get('test-coverage/{id}', ['as' => 'specialtyCoverageStats', 'uses' => 'MR\\LineController@specialtyCoverageStats']);
    Route::get('test-sales/{id}/{month}', ['as' => 'monthlyDirectSales', 'uses' => 'MR\\LineController@monthlyDirectSales']);
    Route::get('test-target', ['uses' => 'MR\\LineController@target']);
    Route::get('dashboard', ['as' => 'mr', function () {
        $coverageStats = Employee::coverageStats(\Auth::user()->id, date('M-Y'));
        $totalProducts = Employee::monthlyDirectSales(\Auth::user()->id, date('M-Y'));
        $reports = Report::where('mr_id', \Auth::user()->id)->where('month', date('M-Y'));
        $monthlyReports = $reports->get();
        $monthlyFollowsUp = $reports->whereNotNull('follow_up')->get();
        $doctors = Customer::where('mr_id', \Auth::user()->id)->get();
        $announcements = Announcement::where('level_id', 7)->where('start', '>=', date('Y-m-d'))->where('end', '<=', date('Y-m-d', strtotime('+1 week')))->get();
        $dataView = ['doctors' => count($doctors), 'totalVisitsCount' => $coverageStats['totalVisitsCount'], 'actualVisitsCount' => $coverageStats['actualVisitsCount'], 'totalMonthlyCoverage' => $coverageStats['totalMonthlyCoverage'], 'totalSoldProductsSalesPrice' => $totalProducts['totalSoldProductsSalesPrice'], 'monthlyReports' => $monthlyReports, 'monthlyFollowsUp' => $monthlyFollowsUp, 'announcements' => $announcements];
        return view('mr.index', $dataView);
    }]);
    //Profile
    Route::get('profile', ['as' => 'mrProfile', 'uses' => 'AuthController@editMRProfile']);
    Route::post('profile', ['as' => 'postMRProfile', 'uses' => 'AuthController@postEditMRProfile']);
    // Message
    Route::get('all-messages', ['as' => 'mrInbox', 'uses' => 'MR\\InboxController@all']);
    Route::get('sent-messages', ['as' => 'mrSentMessages', 'uses' => 'MR\\InboxController@sent']);
    Route::get('create-message', ['as' => 'mrCreateMessage', 'uses' => 'MR\\InboxController@create']);
开发者ID:m-gamal,项目名称:crm,代码行数:31,代码来源:routes.php


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