创建版本

This commit is contained in:
2021-02-22 12:17:00 +08:00
commit af555f49c3
2332 changed files with 369202 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php namespace Gdoo\Index\Services;
class RetService
{
public $data = null;
public static function make($data = null)
{
$me = new static();
$me->data = collect();
$me->set($data);
return $me;
}
public function set($key, $value = null)
{
if (empty($key)) {
return;
}
if (empty($value)) {
$this->data = $this->data->merge($key);
} else {
$this->data[$key] = $value;
}
}
public function error($msg)
{
$this->data['msg'] = $msg;
$this->data['success'] = false;
return json_encode($this->data, JSON_UNESCAPED_UNICODE);
}
public function success($msg)
{
$this->data['msg'] = $msg;
$this->data['success'] = true;
return json_encode($this->data, JSON_UNESCAPED_UNICODE);
}
}