Example #1
0
 public function update()
 {
     $id = $_GET['id'];
     if (!$id) {
         echo '非法操作';
         exit;
     }
     $v = D('ProjectInfoView')->where(array('p.stage' => array('egt', 1), 'p.status' => 9, 'p.id' => $id))->find();
     if (!$v) {
         echo '指定项目不存在。';
         exit;
     }
     include_once APP_PATH . 'Admin/zczj/zczj.api.php';
     //===============初始化==================//
     $options = array('debug' => true, 'UserName' => 'jumuzhongchou', 'PassWord' => 'jumuzhongchou123', 'PlatId' => 2);
     $zczj = new \zczj($options);
     $var = get_cover($v['cover']);
     $filename = basename(APP_PATH . substr($var['path'], 1));
     //echo $filename;
     //echo getimagesize(substr($var['path'], 1)); die();
     //echo @file_get_contents(substr($var['path'], 1)); die();
     if ($v['stage'] == 1) {
         $state = 1;
     } else {
         if ($v['stage'] == 4) {
             $state = 2;
         } else {
             if ($v['stage'] >= 8) {
                 $state = 3;
             }
         }
     }
     $desc = str_replace('"/Uploads/', '"http://www.dreammove.cn/Uploads/', $v['description']);
     $pics = M('ProjectTemp')->where(array('project_id' => $id, 'temp_type' => 1))->order('sort')->limit(6)->select();
     foreach ($pics as $k1 => $v1) {
         $path = get_cover($v1['info_key'], 'path');
         $desc = $desc . '<p><img src="http://www.dreammove.cn' . $path . '"/></p>';
     }
     $projects = array('PlatProjectID' => $v['id'], 'projectName' => $v['project_name'], 'description' => $desc, 'currentAmount' => $v['has_fund'], 'targetAmount' => $v['need_fund'], 'endTime' => NULL, 'targetDay' => 30, 'projectSponsor' => get_membername($v['uid']), 'support' => $v['follow'], 'state' => $state, 'projectCategoryId' => 23673, 'fileBytes' => @file_get_contents(substr($var['path'], 1)), 'fileName' => $filename, 'url' => "http://www.dreammove.cn/Project/detail/id/" . $v['id'] . '.html');
     $ret = $zczj->projectsAdd($projects);
     //dump($ret); die();
     if ($ret->Result) {
         echo "处理成功.";
     } else {
         echo $ret->Message;
     }
 }
Example #2
0
<?php 
include_once "zczj.api.php";
//===============初始化==================//
$options = array('debug' => true, 'UserName' => '用户名', 'PassWord' => '密码', 'PlatId' => 2);
$zczj = new zczj($options);
//===============上传项目==================//
$projects = array('PlatProjectID' => "193", 'projectName' => "测试项目", 'description' => "测试项目,项目描述", 'currentAmount' => 100, 'targetAmount' => 10000, 'endTime' => "2014-01-13T00:00:00.000", 'targetDay' => 30, 'projectSponsor' => "文武", 'support' => 5, 'state' => 1, 'projectCategoryId' => 23673, 'fileBytes' => @file_get_contents("test.jpg"), 'fileName' => "test.jpg", 'url' => "http://www.dajiachou.com/view/191/-");
$zczj->projectsAdd($projects);
//===============上传平台数据==================//
$platdata = array('investmentNum' => 100, 'totalVolume' => 500, 'transactionCyde' => 30, 'valuation' => 580, 'transactionNum' => 30, 'completeRate' => 25);
$zczj->platDataAdd($platdata);
//===============上传投资人数据==================//
$investordata[0] = array('InvestorName' => 'a', 'Avatar' => 'http://static.cnblogs.com/images/logo_small.gif', 'Amount' => 30000, 'Type' => 1, 'PostDate' => "2014-12-23T00:00:00.000");
$zczj->projectInvestorsAdd('44128', $investordata);