123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?php
- Doo::loadCore ( 'db/DooModel' );
- class longle extends DooModel {
-
- public $lid;
- public $year;
- public $cid;
- public $category;
- public $status;
- public $statuslog;
- public $statusT;
- public $key_num;
- public $product;
- public $alloted_time;
- public $product_id;
- public $make_day;
- public $version;
- public $responsible;
- public $client;
- public $clientid;
- public $licences;
- public $SerialNumber;
-
- public $AuthorizeStr;
- public $AuthorizeFile;
- public $UpdateStr;
- public $UpdateFile;
-
-
-
- public $_table = 'CLD_longle';
- public $_primarykey = 'lid';
- public $_fields = array ('lid', 'year', 'cid','category','product_id', 'status','statuslog','statusT', 'key_num','SerialNumber','product','alloted_time', 'make_day','version', 'responsible','client','clientid'
- ,'licences' ,'AuthorizeStr','AuthorizeFile','UpdateStr','UpdateFile'
- );
-
- public function getLongleByStatus($year=0,$cid=0,$staff=0,$status=0,$search="",$productW=""){
-
- if(empty($search)){
- $str="( status=".$status." or statuslog like '%".$status."%' )";
- $str2=" and make_day like '%".$year."%'";
- $str3=" and cid =".$cid."";
- $str4=" and product like '%".$productW."%'";
- $str5=' and responsible="'.$staff.'"';
- if(empty($productW))
- $str4="";
-
- if($cid==0)
- $str3="";
-
- if($year==0)
- $str2="";
- if(empty($staff))
- $str5="";
- if($status==0)
- $str=" 1 ";
-
- //echo $str.$str2.$str3.$str4;
-
- // 'select * form CLD_longle as a left join CLD_client as b on (a.clientid =b.cid) where ( status=3 or statuslog like "%3%" ) and make_day like "%2015%" and cid =10';
- return $this->find ( array ('where' => $str.$str2.$str3.$str4.$str5, 'desc'=>'make_day', 'asArray' => TRUE ) );
- }else{
- return $this->find ( array ('where' => " key_num like '%".$search."%'",'desc'=>'make_day', 'asArray' => TRUE ) );
- }
- }
-
- public function getLongleReceive($cid,$status,$othercid=""){
-
- $str="";
- if(!empty($othercid))
- $str= " cid in (".$cid.",".$othercid." )";
- else
- $str= " cid in (".$cid." )";
-
- return $this->find ( array ('where' => $str." and (status=".$status." or responsible='') and make_day>='2019-01-01' ", 'asArray' => TRUE ) );
- }
-
- public function getLongleBykeynum($keynum){
- return $this->find ( array ('where' => " key_num = '".$keynum."'", 'asArray' => TRUE ) );
- }
-
- public function getLongleBykeynum2($keynum){
- return $this->find ( array ('where' => " key_num like '%".$keynum."%'",'limit'=>'10', 'asArray' => TRUE ) );
- }
-
- public function getLongleByKeyNumDetail($keynum,$SerialNumber=''){
- return $this->getOne ( array ('where' => " key_num = '".$keynum."' and SerialNumber like '".$SerialNumber."'", 'asArray' => TRUE ) );
- }
-
- public function getLongleByLid($lid){
- return $this->find ( array ('where' => " lid =".$lid, 'asArray' => TRUE ) );
- }
-
- public function getLongleByClient($clientname){
- return $this->find ( array ('where' => " client like '".$clientname."'", 'asArray' => TRUE ) );
- }
-
- public function getLongleBySerialNumber($SerialNumber){
- return $this->getOne ( array ('where' => " SerialNumber like '".$SerialNumber."'", 'asArray' => TRUE ) );
- }
-
- public function getLongleBySerialNumberList($SerialNumber){
- return $this->find ( array ('where' => " SerialNumber like '".$SerialNumber."'", 'asArray' => TRUE ) );
- }
-
- public function getLongleByClientid($client){
- return $this->find ( array ('where' => " clientid = '".$client."'", 'asArray' => TRUE ) );
- }
-
- // public function getLongleByRe($cid,$status=1){
- //
- // }
-
- public function getUser() {
- return $this->find ( array ('asc' => 'uid', 'asArray' => TRUE ) );
- }
- public function getUserByIdList($puid){
- return $this->find ( array ('where' => "uid= '".$puid."'", 'asArray' => TRUE ) );
- }
-
- }
- ?>
|