Ejemplo n.º 1
0
 /**
  * CUtil::isShopOwner()
  * added by manikandan_133at10
  *
  * @return boolean
  */
 public static function isShopOwner($user_id = null)
 {
     if (is_null($user_id)) {
         $user = \Config::get('webshoppack::logged_user_id');
         $logged_user_id = $user();
     } else {
         $logged_user_id = $user_id;
     }
     if ($logged_user_id > 0) {
         $details = UsersShopDetails::Select('is_shop_owner', 'paypal_id')->where('user_id', $logged_user_id)->first();
         if (count($details)) {
             $is_shop_owner = $details->is_shop_owner;
             $paypal_id = $details->paypal_id;
             if ($is_shop_owner == 'Yes' && $paypal_id != '') {
                 return true;
             }
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 public function checkIsShopOwner($user_id)
 {
     $user_shop_details = UsersShopDetails::Select('is_shop_owner')->whereRaw('user_id = ?', array($user_id))->first();
     if (count($user_shop_details) > 0) {
         if ($user_shop_details['is_shop_owner'] == 'Yes') {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 3
0
 public function updateUserTotalProducts($user_id)
 {
     $p_count = $this->getTotalProduct($user_id);
     UsersShopDetails::where('user_id', '=', $user_id)->update(array('total_products' => $p_count));
 }