Example #1
0
 /**
  * 是否显示的状态
  * @param $cat_id
  * @param int $status
  * @return bool|int
  */
 public function is_show($cat_id, $status = 1)
 {
     if (!in_array($status, [0, 1])) {
         return false;
     }
     return Category::updateAll(['is_show' => $status], 'cat_id = :cat_id', [':cat_id' => $cat_id]);
 }