SHARE
TWEET

User

a guest Jun 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace Sts\CmsCommon\BO;
  4. use Sts\PleafCore\DefaultBusinessFunction;
  5. use Sts\PleafCore\BusinessFunction;
  6. use Sts\PleafCore\QueryBuilder;
  7. use Sts\PleafCore\CreateNativeQuery;
  8. use Sts\CmsCommon\Helpers\ConditionExpression;
  9. use Sts\CmsCommon\Model\user;
  10.  
  11.  
  12.  
  13. /**
  14.  * @author Sulfano Agus Fikri, 30/08/2018
  15.  * @in
  16.  * - userId
  17.  * - orderId
  18.  * @out
  19.  * orderDetail
  20.  */
  21.  
  22. class GetUserListAdvance implements BusinessFunction {
  23.  
  24.     public function getDescription(){
  25.         return "Get User List Advance";
  26.     }
  27.  
  28.     public function execute($dto){
  29.         \log::debug('GetUserListAdvance');
  30.  
  31.         $dateTime = $dto["dateTime"];
  32.         $userId   = $dto["userid"];
  33.         $username = $dto["username"];
  34.         $email    = $dto["email"];
  35.         $fullname = $dto["fullname"];
  36.         $cabang   = $dto["cabang"];
  37.         $role     = $dto["role"];
  38.         $active   = $dto["active"];
  39.  
  40.  
  41.         $queryBuilder = new QueryBuilder();
  42.  
  43.  
  44.         $queryBuilder
  45.         ->add("SELECT")
  46.         ->add("A.username, A.email, A.fullname, B.ou_name, C.role_name,")
  47.         ->add("A.active, A.user_id, A.tenant_id, A.password, A.phone,")
  48.         ->add("A.role_default_id, A.private_key, A.create_datetime, A.create_user_id, A.update_datetime,")
  49.         ->add("A.update_user_id, A.version, A.active_datetime, A.non_active_datetime, A.ou_default_id,
  50.             A.policy_default_id")
  51.         ->add("FROM")->add(User::getTableName())->add(" A ")
  52.         ->add("INNER JOIN")->add(User::getTableName())->add(" B ON A.ou_default_id = B.ou_id ")
  53.         ->add("INNER JOIN")->add(User::getTableName())->add(" C ON A.role_default_id = C.role_id ")
  54.         ->add("ORDER BY fullname, username ASC");
  55.  
  56.  
  57.         $query = new CreateNativeQuery($queryBuilder->toString())
  58.         $result = $query->getResultList();
  59.  
  60.         return [
  61.             "get_user_list_advance" => $result
  62.         ];
  63.     }
  64. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top