|
@@ -111,11 +111,13 @@ class Codecreate extends Backend
|
|
*/
|
|
*/
|
|
public function download()
|
|
public function download()
|
|
{
|
|
{
|
|
|
|
+ $url = 'http://pig.viicb.com/index/index/code.html?code=';
|
|
$co_id = $params = $this->request->request("co_id");
|
|
$co_id = $params = $this->request->request("co_id");
|
|
if (!$co_id) {
|
|
if (!$co_id) {
|
|
$this->error('co_id为空!');
|
|
$this->error('co_id为空!');
|
|
}
|
|
}
|
|
- $list = $this->model->where('co_id', $co_id)->column('id')->select();
|
|
|
|
|
|
+ $model = new \app\admin\model\pig\Code;
|
|
|
|
+ $list = $model->where('co_id', $co_id)->column('id');
|
|
|
|
|
|
set_time_limit(0);
|
|
set_time_limit(0);
|
|
ini_set('memory_limit', '512M');
|
|
ini_set('memory_limit', '512M');
|
|
@@ -125,10 +127,10 @@ class Codecreate extends Backend
|
|
header("Content-Disposition:attachment;filename=" . $co_id ."-code-" . date("Y-m-d") . ".csv");
|
|
header("Content-Disposition:attachment;filename=" . $co_id ."-code-" . date("Y-m-d") . ".csv");
|
|
ob_end_clean();
|
|
ob_end_clean();
|
|
|
|
|
|
- echo 'ID,URL\n';
|
|
|
|
|
|
+ echo 'ID,URL'."\n";
|
|
|
|
|
|
foreach ($list as $k => $v) {
|
|
foreach ($list as $k => $v) {
|
|
- echo $k+1,','.encrypt($v).'\n';
|
|
|
|
|
|
+ echo $k+1,','.$url.encrypt(str_pad($v, 8, '0', STR_PAD_LEFT))."\n";
|
|
// code...
|
|
// code...
|
|
}
|
|
}
|
|
exit;
|
|
exit;
|