<?php
class product_type extends base
{
  /**
   * [cids 主要获取下拉框内的分类]
   * @Author   huangxiaojian
   * @DateTime 2021-04-30T09:49:16+0800
   * @param    integer                  $pid      [上级ID]
   * @param    integer                  $model_id [模型ID]
   * @return   [type]                             [description]
   */
  public function cids($pid = 0, $status = 0)
  {
    if ($status > 0)
      $where = "status=$status";
    else
      $where = "1=1";
    $data = db()->select_all("product_type", "id, title, pid", $where . ' order by sort asc, id desc');
    $res = reSort($data, $pid, 0, TRUE);
    $arr = [];
    foreach ($res as $key => $value) {
      $arr[$value['id']] = $value['title'];
    }
    return $arr;
  }
  function list($list)
  {
    foreach ($list as $key => $value) {
      // $list[$key]['rfile'] = $value['img'] ? showrfile($value['img']) : "";
    }
    return $list;
  }
}
