This commit is contained in:
wangjinlei
2022-11-10 18:47:33 +08:00
parent a078f6e753
commit 549b08c5a4

View File

@@ -445,6 +445,33 @@ class Datebase extends Controller
return jsonSuccess([]);
}
public function Mycreate(){
$data = $this->request->post();
$url = "http://ts.tmrjournals.com/api/dataApi/createTemplate";
$stage_info = $this->journal_stage_obj->where("journal_stage_id", $data['journal_stage_id'])->find();
$re['issue'] = $stage_info['issue_date'] . ", Volume " . $stage_info['stage_vol'] . " Issue " . $stage_info["stage_no"];
$adate = [];
$alist = $this->article_obj->where("journal_stage_id", $data['journal_stage_id'])->where("state", 0)->orderRaw("npp + 0")->select();
foreach ($alist as $k => $v) {
$cache["type"] = $v["type"];
$cache["no"] = $v["npp"];
$cache["title"] = $v["title"];
$cache["author"] = $this->getAuthor($v);
$adate[] = $cache;
}
$re["date_list"] = json_encode($adate);
$res = myPost($url, $re);
$r = object_to_array(json_decode($res));
$file = $r['data']["file"];//创建目录加压缩操作
$base_dir = ROOT_PATH . "public/dataFile/" . $stage_info["journal_stage_id"];
if (!is_dir($base_dir)) {
@mkdir($base_dir);
}
copy('http://ts.tmrjournals.com/upload/' . $file, $base_dir . '/' . $stage_info["journal_stage_id"] . ".docx");
echo 'success !';
}
private function createEmailFile($journal_stage_id)
{
$url = "http://ts.tmrjournals.com/api/dataApi/createTemplate";