コード例 #1
0
ファイル: bannercat.php プロジェクト: lxthien/batdongsan
 function down_position()
 {
     $min = new bannercat();
     $min->select_min('position');
     $min->where('position >', $this->position);
     $min->get();
     $o = new bannercat();
     $o->where('position', $min->position);
     $o->get();
     if ($o->result_count() > 0) {
         $tg = $this->position;
         $this->position = $o->position;
         $o->position = $tg;
         $o->save();
         $this->save();
         return true;
     } else {
         return false;
     }
 }