|
|
|
@ -37,7 +37,6 @@ class AutoPackController extends Think
|
|
|
|
|
|
|
|
|
|
public function package()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$find_web_stie = M('config')
|
|
|
|
|
-> field('value')
|
|
|
|
|
-> where(['name' => 'WEB_SITE'])
|
|
|
|
@ -49,18 +48,10 @@ class AutoPackController extends Think
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->checkPackageStatus();
|
|
|
|
|
|
|
|
|
|
$this->app_package();//app渠道自动打包
|
|
|
|
|
|
|
|
|
|
$this->channel();
|
|
|
|
|
|
|
|
|
|
$this->launch_package(false);
|
|
|
|
|
|
|
|
|
|
$this->leak_detection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -311,7 +302,6 @@ class AutoPackController extends Think
|
|
|
|
|
* @throws \think\exception\DbException
|
|
|
|
|
*/
|
|
|
|
|
private function channel() {
|
|
|
|
|
|
|
|
|
|
$zip = new \ZipArchive();
|
|
|
|
|
|
|
|
|
|
$map['status'] = 1;
|
|
|
|
@ -346,13 +336,11 @@ class AutoPackController extends Think
|
|
|
|
|
$launchCount = $launchModel->where(['apply_id'=>$value['id']])->count();
|
|
|
|
|
|
|
|
|
|
if($launchCount>0) {
|
|
|
|
|
|
|
|
|
|
$applyModel->where(['id' => $value['id']]) -> setField('enable_status', 3);
|
|
|
|
|
|
|
|
|
|
$launchModel->where(['apply_id'=>$value['id'], 'launch_packge'=>['in',[0,2,3]]])->save(['launch_packge'=>2,'launch_down_url'=>'','launch_plist_url'=>'']);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$applyModel -> where(['id' => $value['id']]) -> setField('enable_status', 3);
|
|
|
|
|
|
|
|
|
|
if ($value['sdk_version'] == 1) {
|
|
|
|
@ -377,6 +365,7 @@ class AutoPackController extends Think
|
|
|
|
|
}
|
|
|
|
|
$new_name = "game_package" . $value['game_id'] . "-" . $value['promote_id'] . $str_ver;
|
|
|
|
|
$to = "./Uploads/" . $file_name . "/" . $new_name;
|
|
|
|
|
$localPath = ROOTTT . ltrim($to, './');
|
|
|
|
|
copy(get_game_source_file_url($value['game_id']), ROOTTT . ltrim($to, './'));
|
|
|
|
|
$zip_res = $zip -> open(ROOTTT . ltrim($to, './'), \ZipArchive::CREATE);
|
|
|
|
|
if ($zip_res == true) {
|
|
|
|
@ -408,9 +397,14 @@ class AutoPackController extends Think
|
|
|
|
|
$new_to = ROOTTT . "Uploads/" . $file_name . "/" . $newname;
|
|
|
|
|
$updata['savename'] = $newname;
|
|
|
|
|
$updata['path'] = $new_to;
|
|
|
|
|
$this -> upload_game_pak_oss($updata);
|
|
|
|
|
$result = $this -> upload_game_pak_oss($updata);
|
|
|
|
|
@unlink($new_to);
|
|
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
|
if (file_exists($localPath)) {
|
|
|
|
|
unlink($localPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} elseif (get_tool_status("qiniu_storage") == 1) {
|
|
|
|
|
|
|
|
|
|
$this -> dleteQiNiuFile($newname);
|
|
|
|
|