public static function setItem($params) { if (!self::isMaster()) { return; } $id = $params['id']; if ($id == 'null') { $id = self::getLastID('items'); } if (is_null($params['image'])) { $imagename = $id . '.' . $params['image_type']; $imageBase64 = $params['image_base64']; if ($imageBase64) { Funcs::uploadImage($imagename, $imageBase64); } else { $imagename = ''; } unset($params['image_type']); unset($params['image_base64']); $params['image'] = $imagename; } $lastID = self::setData('items', $params); if (isset($lastID)) { $enterprise = $params['enterprise']; $where = 'type = "normal"'; if ($enterprise != 'LITALICO') { $where .= ' AND (enterprise LIKE "%' . $enterprise . '%" OR enterprise = "LITALICO")'; } self::concatData('users', 'item_id_list', $lastID, $where); } }