Example #1
0
 public function updatemusicAction()
 {
     $id = reqnum('id', 0);
     $ispost = reqnum('ispost', 0);
     $model = new Psys_ResModel();
     if ($ispost == 1) {
         $albumid = reqstr('albumid');
         $musicid = reqstr('musicid');
         $mname = reqstr('mname');
         $singer = reqstr('singer');
         $sortid = reqstr('sortid');
         $flag = reqnum('flag', 0);
         $hits = reqstr('hits');
         $price = reqstr('price');
         $mpath = reqstr('mpath');
         $data = array('albumid' => $albumid, 'musicid' => $musicid, 'mname' => $mname, 'singer' => $singer, 'sortid' => $sortid, 'flag' => $flag, 'hits' => $hits, 'price' => $price, 'mpath' => $mpath);
         $result = array('result' => 'ERROR');
         if ($id == 0) {
             if ($mname == '') {
                 MsgInfoConst::GetMsg(1051, $result);
                 return $result;
             }
         } else {
             if ($mname == '') {
                 MsgInfoConst::GetMsg(1051, $result);
                 return $result;
             }
         }
         if ($id == 0) {
             $data['ctime'] = time();
             $model->addMusic($data);
             //$id = $model->AddOne($data,'rhi_albummusic');
             //$model->Record($data,$id,'db-rht_sync','albummusic','rhs_downsync');
             //start 写操作日志
             $log = array('logtype' => 71, 'guid' => $_SESSION['Cur_X_User']['id'], 'ctime' => time(), 'cip' => real_ip());
             $log['logdetail'] = $_SESSION['Cur_X_User']['username'] . "于" . date("Y-m-d H:i:s") . "[添加]音乐" . $mname;
             $model->admin_syslog($log);
             //end 日志
             $result['result'] = 'SUCCESS';
         } else {
             $w = array('id' => $id);
             $model->updateMusic($data, $w);
             //$res = $model->UpdateOne($data,$w,'rhi_albummusic');
             //$model->Record($data,$res,'db-rht_sync','albummusic','rhs_downsync');
             //start 写操作日志
             $log = array('logtype' => 71, 'guid' => $_SESSION['Cur_X_User']['id'], 'ctime' => time(), 'cip' => real_ip());
             $log['logdetail'] = $_SESSION['Cur_X_User']['username'] . "于" . date("Y-m-d H:i:s") . "[编辑]音乐" . $mname;
             $model->admin_syslog($log);
             //end 日志
             $result['result'] = 'SUCCESS';
         }
         return $result;
     }
 }