Browse Source

Show who added review/plan in wizards

Vijayakrishnan 3 years ago
parent
commit
84a66855f1

+ 2 - 2
app/Helpers/helpers.php

@@ -333,8 +333,8 @@ if(!function_exists('relative_friendly_date')) {
             $result = date_diff(date_create($value), date_create('now'))->days;
             $result = date_diff(date_create($value), date_create('now'))->days;
             if ($result > 30) $result = date('F, Y', strtotime($value));
             if ($result > 30) $result = date('F, Y', strtotime($value));
             else if ($result > 1) $result .= ' days ago';
             else if ($result > 1) $result .= ' days ago';
-            else if ($result === 1) $result = 'yesterday';
-            else if ($result === 0) $result = 'today';
+            else if ($result === 1) $result = 'Yesterday';
+            else if ($result === 0) $result = 'Today';
             return $result;
             return $result;
         }
         }
         catch (Exception $e) {
         catch (Exception $e) {

+ 5 - 0
app/Models/Point.php

@@ -8,6 +8,11 @@ class Point extends Model
 {
 {
     protected $table = 'point';
     protected $table = 'point';
 
 
+    public function creatorPro()
+    {
+        return $this->hasOne(Pro::class, 'id', 'created_by_pro_id');
+    }
+
     public function childReviews()
     public function childReviews()
     {
     {
         return $this->hasMany(Point::class, 'parent_point_id', 'id')
         return $this->hasMany(Point::class, 'parent_point_id', 'id')

+ 4 - 1
resources/views/app/patient/segment-templates/_child_plan/last-plan.php

@@ -12,7 +12,10 @@
             <?php else: ?>
             <?php else: ?>
                 <div class="d-inline position-relative on-click-menu">
                 <div class="d-inline position-relative on-click-menu">
                     <span class="text-sm text-primary c-pointer">
                     <span class="text-sm text-primary c-pointer">
-                        Updated <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
+                        <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
+                        <?php if($point->lastChildPlan->creatorPro): ?>
+                            by <?= $point->lastChildPlan->creatorPro->displayName() ?>
+                        <?php endif; ?>
                     </span>
                     </span>
                     <div menu right class="bg-white border">
                     <div menu right class="bg-white border">
                         <a native target="_blank"
                         <a native target="_blank"

+ 4 - 1
resources/views/app/patient/segment-templates/_child_review/last-review.php

@@ -11,7 +11,10 @@
             <?php else: ?>
             <?php else: ?>
                 <div class="d-inline position-relative on-click-menu">
                 <div class="d-inline position-relative on-click-menu">
                     <span class="text-sm text-primary c-pointer">
                     <span class="text-sm text-primary c-pointer">
-                        Updated <?= relative_friendly_date($point->last_child_review_effective_date) ?>
+                        <?= relative_friendly_date($point->last_child_review_effective_date) ?>
+                        <?php if($point->lastChildReview->creatorPro): ?>
+                        by <?= $point->lastChildReview->creatorPro->displayName() ?>
+                        <?php endif; ?>
                     </span>
                     </span>
                     <div menu right class="bg-white border">
                     <div menu right class="bg-white border">
                         <a native target="_blank"
                         <a native target="_blank"