staff_cld.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. class staff_cld extends DooModel {
  4. // 获得员工信息
  5. public function Get($id = 0) {
  6. $detail = $this->getOne ( array (
  7. 'where' => "sid= ? ",
  8. 'param' => array (
  9. $id
  10. ),
  11. 'asArray' => TRUE
  12. ) );
  13. // Doo::loadClass ( 'XDeode' );
  14. // $XDeode = new XDeode ( 9 );
  15. // $detail ['sid_cld']=$XDeode->encode($detail ['sid']);
  16. // $detail ['cid']=$XDeode->encode($detail ['cid']);
  17. // //
  18. // $detail ['cldAccessArray'] = array ();
  19. // if (! empty ( $detail ['cldAccess'] )) {
  20. // $detail ['cldAccessArray'] = json_decode ( $detail ['cldAccess'] );
  21. // }
  22. if(!empty($detail)){
  23. $detail=$this->makeStaffView($detail);
  24. }
  25. return $detail;
  26. }
  27. //办事处ID获得员工
  28. public function GetCategoryId($categoryId=0){
  29. $condition=array('where' => "username!='admin' and nature !=4 and (pendStatus!=3 or pendStatus!=4) ",'asArray' => TRUE);
  30. if($categoryId!=0){
  31. $condition=array (
  32. 'where' => "cid= ? and username!='admin' and nature !=4 and (pendStatus!=3 or pendStatus!=4) ",
  33. 'param' => array (
  34. $categoryId
  35. ),
  36. 'asArray' => TRUE
  37. );
  38. }
  39. $list = $this->find ( $condition );
  40. foreach ($list as $key=>$value){
  41. $list[$key]=$this->makeStaffView($value);
  42. }
  43. return $list;
  44. }
  45. public function GetName($name=""){
  46. $detail = $this->getOne ( array (
  47. 'where' => "username!='admin' and nature !=4 and (pendStatus!=3 or pendStatus!=4) and username= ? ",
  48. 'param' => array (
  49. $name
  50. ),
  51. 'asArray' => TRUE
  52. ) );
  53. if(!empty($detail)){
  54. $detail=$this->makeStaffView($detail);
  55. }
  56. return $detail;
  57. }
  58. private function makeStaffView($data=array()){
  59. Doo::loadClass ( 'XDeode' );
  60. $XDeode = new XDeode ( 9 );
  61. $data ['sid_cld']=$XDeode->encode($data ['sid']);
  62. $data ['cid']=$XDeode->encode($data ['cid']);
  63. $data ['cldAccessArray'] = array ();
  64. if (! empty ( $data ['cldAccess'] )) {
  65. $data ['cldAccessArray'] = json_decode ( $data ['cldAccess'] );
  66. }
  67. return $data;
  68. }
  69. private $sid;
  70. private $username;
  71. private $passwork;
  72. private $staffManage;
  73. private $isadmin;
  74. private $cid;
  75. private $othercid;
  76. private $category;
  77. private $othercategory;
  78. private $gender;
  79. private $qq;
  80. private $phone;
  81. private $telephone;
  82. private $email;
  83. private $birthday;
  84. private $position;
  85. private $avatar;
  86. private $appDate;
  87. private $hiredate;
  88. private $hireBiasDate;
  89. private $wxid;
  90. private $wecat;
  91. private $nature;
  92. private $remittanceName;
  93. private $bankName;
  94. private $bankNumber;
  95. private $coupletNumber;
  96. private $remittanceBankType;
  97. private $living;
  98. private $nativePlace;
  99. private $emergencyContacts;
  100. private $did;
  101. private $didName;
  102. private $jobNumber;
  103. private $baseWage;
  104. private $postWage;
  105. private $achievementBonus;
  106. private $pendingApprovals;
  107. private $processApprovals;
  108. private $processCC;
  109. private $InductionDate;
  110. private $pendStatus;
  111. private $updateDate;
  112. private $probationaryDate;
  113. private $regularsDate;
  114. private $qualifications;
  115. private $marriage;
  116. private $salaryCard;
  117. private $salaryBank;
  118. private $pendingApprovalsLeave;
  119. private $processApprovalsLeave;
  120. private $processLeaveCC;
  121. private $staffManageLeave;
  122. private $dimissionDate;
  123. private $dimissionReason;
  124. private $seniorityFormula;
  125. private $practiceDate;
  126. private $cldAccess;
  127. private $IDcards;
  128. private $IDcardsImgA;
  129. private $certificate;
  130. private $diploma;
  131. private $professionalTitle;
  132. private $IDcardsImgB;
  133. private $nation;
  134. private $graduateInstitutions;
  135. private $major;
  136. private $education;
  137. private $graduationTime;
  138. private $registeredResidence;
  139. private $householdRegistrationType;
  140. private $IDcardsValidity;
  141. private $positionId;
  142. private $appliedPromote;
  143. private $departmentID;
  144. private $applyLeaveDate;
  145. public $_table = 'CLD_staff';
  146. public $_primarykey = 'sid';
  147. public $_fields = array (
  148. 'nation',
  149. 'graduateInstitutions',
  150. 'major',
  151. 'education',
  152. 'graduationTime',
  153. 'registeredResidence',
  154. 'householdRegistrationType',
  155. 'IDcardsValidity',
  156. 'IDcards',
  157. 'IDcardsImgA',
  158. 'IDcardsImgB',
  159. 'certificate',
  160. 'diploma',
  161. 'professionalTitle',
  162. 'sid',
  163. 'username',
  164. 'staffManage',
  165. 'birthday',
  166. 'position',
  167. 'passwork',
  168. 'isadmin',
  169. 'cid',
  170. 'othercid',
  171. 'appDate',
  172. 'category',
  173. 'othercategory',
  174. 'gender',
  175. 'qq',
  176. 'phone',
  177. 'telephone',
  178. 'email',
  179. 'avatar',
  180. 'hiredate',
  181. 'hireBiasDate',
  182. 'wxid',
  183. 'nature',
  184. 'remittanceName',
  185. 'bankName',
  186. 'bankNumber',
  187. 'remittanceBankType',
  188. 'coupletNumber',
  189. 'did',
  190. 'jobNumber',
  191. 'baseWage',
  192. 'postWage',
  193. 'achievementBonus',
  194. 'pendingApprovals',
  195. 'processApprovals',
  196. 'processCC',
  197. 'pendingApprovalsLeave',
  198. 'processApprovalsLeave',
  199. 'processLeaveCC',
  200. 'staffManageLeave',
  201. 'InductionDate',
  202. 'pendStatus',
  203. 'wecat',
  204. 'updateDate',
  205. 'dimissionReason',
  206. 'salaryCard',
  207. 'salaryBank',
  208. 'qualifications',
  209. 'marriage',
  210. 'living',
  211. 'nativePlace',
  212. 'emergencyContacts',
  213. 'practiceDate',
  214. 'probationaryDate',
  215. 'regularsDate',
  216. 'dimissionDate',
  217. 'seniorityFormula',
  218. 'cldAccess',
  219. 'departmentID',
  220. 'didName',
  221. 'positionId',
  222. 'appliedPromote',
  223. 'applyLeaveDate'
  224. );
  225. }
  226. ?>