1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace Attr\Lib;
- use Dever;
- class Manage
- {
- /**
- * 更新属性信息
- *
- * @return mixed
- */
- public function update($id, $name, $data)
- {
- foreach ($data as $k => $v) {
- if (isset($data[$k . '_s']) && isset($data[$k . '_e'])) {
- $temp = explode(',', $v);
- if (isset($temp[0])) {
- $update[$k . '_s'] = $temp[0];
- }
- if (isset($temp[1])) {
- $update[$k . '_e'] = $temp[1];
- }
- }
- }
- if (isset($update)) {
- $update['where_id'] = $id;
- Dever::db($name)->update($update);
- }
- }
- /**
- * 更新属性信息
- *
- * @return mixed
- */
- public function infoUpdate($id, $name, $data)
- {
- $is_sell = Dever::param('is_sell', $data);
- if ($is_sell > 1) {
- $update['type'] = 11;
- }
- if (isset($update)) {
- $update['where_id'] = $id;
- Dever::db('attr/info')->update($update);
- }
- }
- }
|