コード例 #1
0
ファイル: Face.php プロジェクト: Crocodile26/php-1
 public function _face($uid, $data)
 {
     $uid = intval($uid);
     $info = Face::findFirst("uid={$uid}");
     if (!$info) {
         $info = new Face();
         $info->addtime = time();
     }
     $info->uptime = time();
     $info->uid = $uid;
     foreach ($data as $field => $value) {
         $info->{$field} = $value;
     }
     $result = $info->save();
     if (!$result) {
         $this->outputErrors($info);
     }
     return true;
 }
コード例 #2
0
ファイル: Loan.php プロジェクト: Crocodile26/php-1
 public static function advise($uid, $foid, $adviseType, $reason, $loan = false)
 {
     $isLoanSketch = false;
     switch ($adviseType) {
         case 'loansketch':
             $status = \App\LoanStatus::getStatusSketch();
             $oid = User::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
         case 'visit':
             $status = \App\LoanStatus::getStatusCarAssess();
             $oid = Visit::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
         case 'car':
             $status = \App\LoanStatus::getStatusVisit();
             $oid = Car::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
         case 'face':
             $status = \App\LoanStatus::getStatusChecked();
             $oid = Face::findFirst("uid={$uid}")->oid;
             $isLoanSketch = true;
             break;
     }
     if (empty($oid)) {
         return false;
     }
     if ($isLoanSketch) {
         $model = LoanSketch::findFirst("uid={$uid}");
         $model->status = $status;
         $model->update();
     }
     Advise::add($uid, $oid, $foid, $adviseType, $reason);
     return true;
 }