123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace catchAdmin\api;
- use catcher\Utils;
- use think\facade\Db;
- class Directive
- {
-
- public static function Issued($type, $data, $order, $imei = '')
- {
- if ($type == 1) {
- $msetime = msectime();
- $cont = [
- 'Type' => 'directive',
- 'ContentType' => $order,
- 'Content' => json_encode($data),
- 'ContentId' => md5(time() . mt_rand(1, 1000000)),
- 'AddTime' => $msetime,
- 'Version' => $msetime,
- 'Status' => 2
- ];
- Db::name('publish')->save($cont);
- } else {
- $imei = is_array($imei) ? $imei : Utils::stringToArrayBy($imei);
- foreach ($imei as $item) {
- $msetime = msectime();
- $cont = [
- 'Type' => 'directive',
- 'ContentType' => $order,
- 'Content' => json_encode($data),
- 'ContentId' => md5(time() . mt_rand(1, 1000000)),
- 'AddTime' => $msetime,
- 'Version' => $msetime,
- 'Imei' => $item,
- 'Status' => 2
- ];
- Db::name('publish')->save($cont);
- }
- }
- }
- }
|